Merge pull request 'fixed taxInvoice print and added All list in supplier dropdown product receipt' (#122) from temp/sales-bill-edit-fix into main

Reviewed-on: Pozomind/pozo-retail-app#122
This commit is contained in:
karthikalakshmi 2026-02-10 13:50:16 +05:30
commit b41d6d79f1
5 changed files with 660 additions and 579 deletions

View File

@ -70,13 +70,15 @@ export const postStockAdjustment = createAsyncThunk(
export const getPurchaseSupplierAndWareHouseData = createAsyncThunk(
'PurchaseOrder/getPurchaseSupplierAndWareHouseData',
async (ProdData, { rejectWithValue }) => {
const { AppId, CompId, BranchId } = ProdData;
const { AppId, CompId, BranchId, Type } = ProdData;
if (AppId && CompId && BranchId) {
try {
const response = await axiosRetailInstanceData.get(
`/Supplier/AllSupplierBranchDropdown?appId=${AppId}&compId=${CompId}&branchId=${BranchId}`
);
let url = `/Supplier/AllSupplierBranchDropdown?appId=${AppId}&compId=${CompId}&branchId=${BranchId}`;
if (Type) {
url += `&Type=${Type}`;
}
const response = await axiosRetailInstanceData.get(url);
return response.data;
} catch (error) {
return rejectWithValue(error.response?.data || error.message);

View File

@ -282,6 +282,7 @@ const TaxInvoice = ({
paginatedChunks.push(chunk);
}
}
console.log(paginatedChunks, "paginatedChunks")
const lastChunkRows =
paginatedChunks.length > 0
@ -878,7 +879,7 @@ const TaxInvoice = ({
>
{Number(
table2Data?.OrderType !== 'E'
? item.Rate - item.ProdTaxAmt
? item.Rate - (item?.SinglePc === 'Y' ? (item?.TaxAmt / item?.SalesQty) : item.ProdTaxAmt)
: item.Rate || 0
).toLocaleString('en-IN', {
minimumFractionDigits: 2,

View File

@ -8,7 +8,7 @@ import {
EditFilled,
} from '@ant-design/icons';
import { Messages } from '../../Components/Notifications/Messages';
import { Form, Tooltip, Space, Input, Button, AutoComplete } from 'antd';
import { Form, Tooltip, Space, Input, Button, AutoComplete, Checkbox } from 'antd';
import { IoWarningOutline } from 'react-icons/io5';
import {
getSession,
@ -134,6 +134,7 @@ const PurchaseOrder = () => {
const [itemsPerPage] = useState(20);
const [searchTerm, setSearchTerm] = useState('');
const [minQty, setMinQty] = useState('');
const [showAllSuppliers, setShowAllSuppliers] = useState(false);
// const filteredData = currentData.filter((item) => {
// const matchesSearch =
@ -153,7 +154,7 @@ const PurchaseOrder = () => {
{
name: 'Purchase Order',
link: `${subDirectory}setting/purchase-order/new`,
link: `${subDirectory}setting/purchase-order`,
},
{
name: 'New',
@ -223,7 +224,7 @@ const PurchaseOrder = () => {
console.error('Error fetching stock details:', err);
}
};
console.log('hi');
console.log('hi');
const debouncedFetchStock = useMemo(() => debounce(ProductStockFun, 600), []);
const handleMinQtyChange = (e) => {
@ -301,20 +302,21 @@ console.log('hi');
let SelectSupDetails = Supplierdata?.filter(
(item) => item.SuppName?.toLowerCase() === 'self'
); //naresh
setselecSuppDetails(SelectSupDetails?.[0]);
setselecPurSupplierDetails(SelectSupDetails);
formRef.current?.setFieldsValue({ SuppId: SupplierId });
setselecPurSupplier(SupplierId);
getProductDatas(SupplierId);
};
const getSupplierData = async () => {
const getSupplierData = async (Type = null) => {
try {
let Supplier = await dispatch(
getPurchaseSupplierAndWareHouseData({
CompId,
AppId,
BranchId,
Type,
})
).unwrap();
if (Supplier?.statusCode == 1) {
@ -1322,6 +1324,7 @@ console.log('hi');
style={{ paddingTop: '0px', rowGap: '0px' }}
>
<div className="inputForm">
<Form.Item
name="SuppId"
rules={[
@ -1379,10 +1382,29 @@ console.log('hi');
<PlusCircleOutlined onClick={addPurSupplier} />
</Tooltip>
</Form.Item>
<Form.Item
name="showAll"
valuePropName="checked"
>
<Tooltip title="Show all branches and warehouses" placement="top">
<span>
<Checkbox
checked={showAllSuppliers}
onChange={(e) => {
const checked = e.target.checked;
setShowAllSuppliers(checked);
getSupplierData(checked ? 'Y' : null);
}}
>
All
</Checkbox>
</span>
</Tooltip>
</Form.Item>
<div className='deliveryaddress'>
{selecSuppDetails !== null &&
(() => {
{selecSuppDetails !== null &&
(<div className='deliveryaddress'>
{(() => {
const fields = [];
if (selecSuppDetails?.SuppName) {
fields.push(
@ -1456,7 +1478,8 @@ console.log('hi');
</div>
);
})()}
</div>
</div>)
}
<div
className="lowStock-button"
onClick={() => setisLowStockModel(true)}

File diff suppressed because it is too large Load Diff

View File

@ -87,7 +87,7 @@
width: 180px !important;
}
> div:nth-child(2) {
>div:nth-child(2) {
p {
display: none !important;
}
@ -145,7 +145,7 @@
max-width: 130px !important;
}
> td:nth-child(3) {
>td:nth-child(3) {
.ant-input {
width: max-content !important;
max-width: 70px !important;
@ -153,7 +153,7 @@
}
}
> td:nth-child(5) {
>td:nth-child(5) {
.ant-input {
width: max-content !important;
max-width: 100px !important;
@ -324,12 +324,12 @@
}
.purchase-status {
> div:nth-child(1) {
>div:nth-child(1) {
display: flex;
align-items: center;
gap: 10px;
> p {
>p {
padding-bottom: 0 !important;
}
}
@ -447,7 +447,7 @@
.invoice-date {
.ant-form-item-control-input-content {
> label {
>label {
font-family: 'Poppins';
font-weight: 500;
}
@ -473,7 +473,7 @@
gap: 1rem;
margin-bottom: 10px;
> button {
>button {
font-family: 'Poppins';
background-color: #ef4444;
color: #fff;
@ -481,8 +481,8 @@
align-items: center;
.ant-btn-icon {
> span {
> svg {
>span {
>svg {
width: 13px;
height: 13px;
}
@ -833,9 +833,36 @@
}
@media (max-width: 500px) {
.tdProductrecipt,
.proReceiptTD {
font-size: 12px !important;
}
.div-flex{
padding-bottom: 18px !important;
}
}
.div-flex {
display: flex;
align-items: center;
gap: 10px;
background-color: rgb(218, 218, 218);
border-radius: 4px;
padding: 4px 4px 8px 4px;
.ant-form-item {
margin-bottom: 0 !important;
}
}
@media (max-width: 400px) {
.div-flex {
flex-direction: column;
align-items: flex-start;
padding-bottom: 8px !important;
}
}