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:
commit
b41d6d79f1
|
|
@ -70,13 +70,15 @@ export const postStockAdjustment = createAsyncThunk(
|
||||||
export const getPurchaseSupplierAndWareHouseData = createAsyncThunk(
|
export const getPurchaseSupplierAndWareHouseData = createAsyncThunk(
|
||||||
'PurchaseOrder/getPurchaseSupplierAndWareHouseData',
|
'PurchaseOrder/getPurchaseSupplierAndWareHouseData',
|
||||||
async (ProdData, { rejectWithValue }) => {
|
async (ProdData, { rejectWithValue }) => {
|
||||||
const { AppId, CompId, BranchId } = ProdData;
|
const { AppId, CompId, BranchId, Type } = ProdData;
|
||||||
|
|
||||||
if (AppId && CompId && BranchId) {
|
if (AppId && CompId && BranchId) {
|
||||||
try {
|
try {
|
||||||
const response = await axiosRetailInstanceData.get(
|
let url = `/Supplier/AllSupplierBranchDropdown?appId=${AppId}&compId=${CompId}&branchId=${BranchId}`;
|
||||||
`/Supplier/AllSupplierBranchDropdown?appId=${AppId}&compId=${CompId}&branchId=${BranchId}`
|
if (Type) {
|
||||||
);
|
url += `&Type=${Type}`;
|
||||||
|
}
|
||||||
|
const response = await axiosRetailInstanceData.get(url);
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return rejectWithValue(error.response?.data || error.message);
|
return rejectWithValue(error.response?.data || error.message);
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,7 @@ const TaxInvoice = ({
|
||||||
paginatedChunks.push(chunk);
|
paginatedChunks.push(chunk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(paginatedChunks, "paginatedChunks")
|
||||||
|
|
||||||
const lastChunkRows =
|
const lastChunkRows =
|
||||||
paginatedChunks.length > 0
|
paginatedChunks.length > 0
|
||||||
|
|
@ -878,7 +879,7 @@ const TaxInvoice = ({
|
||||||
>
|
>
|
||||||
{Number(
|
{Number(
|
||||||
table2Data?.OrderType !== 'E'
|
table2Data?.OrderType !== 'E'
|
||||||
? item.Rate - item.ProdTaxAmt
|
? item.Rate - (item?.SinglePc === 'Y' ? (item?.TaxAmt / item?.SalesQty) : item.ProdTaxAmt)
|
||||||
: item.Rate || 0
|
: item.Rate || 0
|
||||||
).toLocaleString('en-IN', {
|
).toLocaleString('en-IN', {
|
||||||
minimumFractionDigits: 2,
|
minimumFractionDigits: 2,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import {
|
||||||
EditFilled,
|
EditFilled,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { Messages } from '../../Components/Notifications/Messages';
|
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 { IoWarningOutline } from 'react-icons/io5';
|
||||||
import {
|
import {
|
||||||
getSession,
|
getSession,
|
||||||
|
|
@ -134,6 +134,7 @@ const PurchaseOrder = () => {
|
||||||
const [itemsPerPage] = useState(20);
|
const [itemsPerPage] = useState(20);
|
||||||
const [searchTerm, setSearchTerm] = useState('');
|
const [searchTerm, setSearchTerm] = useState('');
|
||||||
const [minQty, setMinQty] = useState('');
|
const [minQty, setMinQty] = useState('');
|
||||||
|
const [showAllSuppliers, setShowAllSuppliers] = useState(false);
|
||||||
|
|
||||||
// const filteredData = currentData.filter((item) => {
|
// const filteredData = currentData.filter((item) => {
|
||||||
// const matchesSearch =
|
// const matchesSearch =
|
||||||
|
|
@ -153,7 +154,7 @@ const PurchaseOrder = () => {
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'Purchase Order',
|
name: 'Purchase Order',
|
||||||
link: `${subDirectory}setting/purchase-order/new`,
|
link: `${subDirectory}setting/purchase-order`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New',
|
name: 'New',
|
||||||
|
|
@ -223,7 +224,7 @@ const PurchaseOrder = () => {
|
||||||
console.error('Error fetching stock details:', err);
|
console.error('Error fetching stock details:', err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
console.log('hi');
|
console.log('hi');
|
||||||
|
|
||||||
const debouncedFetchStock = useMemo(() => debounce(ProductStockFun, 600), []);
|
const debouncedFetchStock = useMemo(() => debounce(ProductStockFun, 600), []);
|
||||||
const handleMinQtyChange = (e) => {
|
const handleMinQtyChange = (e) => {
|
||||||
|
|
@ -301,20 +302,21 @@ console.log('hi');
|
||||||
let SelectSupDetails = Supplierdata?.filter(
|
let SelectSupDetails = Supplierdata?.filter(
|
||||||
(item) => item.SuppName?.toLowerCase() === 'self'
|
(item) => item.SuppName?.toLowerCase() === 'self'
|
||||||
); //naresh
|
); //naresh
|
||||||
|
setselecSuppDetails(SelectSupDetails?.[0]);
|
||||||
setselecPurSupplierDetails(SelectSupDetails);
|
setselecPurSupplierDetails(SelectSupDetails);
|
||||||
formRef.current?.setFieldsValue({ SuppId: SupplierId });
|
formRef.current?.setFieldsValue({ SuppId: SupplierId });
|
||||||
setselecPurSupplier(SupplierId);
|
setselecPurSupplier(SupplierId);
|
||||||
getProductDatas(SupplierId);
|
getProductDatas(SupplierId);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSupplierData = async () => {
|
const getSupplierData = async (Type = null) => {
|
||||||
try {
|
try {
|
||||||
let Supplier = await dispatch(
|
let Supplier = await dispatch(
|
||||||
getPurchaseSupplierAndWareHouseData({
|
getPurchaseSupplierAndWareHouseData({
|
||||||
CompId,
|
CompId,
|
||||||
AppId,
|
AppId,
|
||||||
BranchId,
|
BranchId,
|
||||||
|
Type,
|
||||||
})
|
})
|
||||||
).unwrap();
|
).unwrap();
|
||||||
if (Supplier?.statusCode == 1) {
|
if (Supplier?.statusCode == 1) {
|
||||||
|
|
@ -1322,6 +1324,7 @@ console.log('hi');
|
||||||
style={{ paddingTop: '0px', rowGap: '0px' }}
|
style={{ paddingTop: '0px', rowGap: '0px' }}
|
||||||
>
|
>
|
||||||
<div className="inputForm">
|
<div className="inputForm">
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="SuppId"
|
name="SuppId"
|
||||||
rules={[
|
rules={[
|
||||||
|
|
@ -1379,10 +1382,29 @@ console.log('hi');
|
||||||
<PlusCircleOutlined onClick={addPurSupplier} />
|
<PlusCircleOutlined onClick={addPurSupplier} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Form.Item>
|
</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 = [];
|
const fields = [];
|
||||||
if (selecSuppDetails?.SuppName) {
|
if (selecSuppDetails?.SuppName) {
|
||||||
fields.push(
|
fields.push(
|
||||||
|
|
@ -1456,7 +1478,8 @@ console.log('hi');
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})()}
|
})()}
|
||||||
</div>
|
</div>)
|
||||||
|
}
|
||||||
<div
|
<div
|
||||||
className="lowStock-button"
|
className="lowStock-button"
|
||||||
onClick={() => setisLowStockModel(true)}
|
onClick={() => setisLowStockModel(true)}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import {
|
||||||
PlusCircleOutlined,
|
PlusCircleOutlined,
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { Form, Tooltip, Table, Input, AutoComplete, Switch } from 'antd';
|
import { Form, Tooltip, Table, Input, AutoComplete, Switch, Checkbox } from 'antd';
|
||||||
import { IoAddCircleSharp } from 'react-icons/io5';
|
import { IoAddCircleSharp } from 'react-icons/io5';
|
||||||
import { InputField } from '../../Components/Forms/InputField.jsx';
|
import { InputField } from '../../Components/Forms/InputField.jsx';
|
||||||
import Buttons from '../../Components/Forms/Buttons.jsx';
|
import Buttons from '../../Components/Forms/Buttons.jsx';
|
||||||
|
|
@ -268,6 +268,7 @@ const StockForm = ({ formType }) => {
|
||||||
// const [filteredPurchaseData, setFilteredPurchaseData] = useState([]);
|
// const [filteredPurchaseData, setFilteredPurchaseData] = useState([]);
|
||||||
const [searchValue, setSearchValue] = useState('');
|
const [searchValue, setSearchValue] = useState('');
|
||||||
const isSearching = Boolean(searchValue?.trim());
|
const isSearching = Boolean(searchValue?.trim());
|
||||||
|
const [showAllSuppliers, setShowAllSuppliers] = useState(false);
|
||||||
|
|
||||||
const SelInvoiceAmount = useMemo(() => {
|
const SelInvoiceAmount = useMemo(() => {
|
||||||
const total = PurchaseData?.reduce(
|
const total = PurchaseData?.reduce(
|
||||||
|
|
@ -324,7 +325,7 @@ const StockForm = ({ formType }) => {
|
||||||
deliveryPerformance();
|
deliveryPerformance();
|
||||||
discountLevel();
|
discountLevel();
|
||||||
qualityofSupp();
|
qualityofSupp();
|
||||||
getSuplaierApi({});
|
getSuplaierApi({ Type: null });
|
||||||
|
|
||||||
if (formType == 'add') {
|
if (formType == 'add') {
|
||||||
formRef.current?.setFieldsValue({ SuppInvoiceDate: new Date().toJSON() });
|
formRef.current?.setFieldsValue({ SuppInvoiceDate: new Date().toJSON() });
|
||||||
|
|
@ -416,9 +417,9 @@ const StockForm = ({ formType }) => {
|
||||||
: setSelectedSupplierName(true);
|
: setSelectedSupplierName(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSuplaierApi = async ({ dataReturn = false }) => {
|
const getSuplaierApi = async ({ dataReturn = false, Type = null }) => {
|
||||||
const response = await dispatch(
|
const response = await dispatch(
|
||||||
getPurchaseSupplierAndWareHouseData({ CompId, AppId, BranchId })
|
getPurchaseSupplierAndWareHouseData({ CompId, AppId, BranchId, Type })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
if (response?.statusCode === 1) {
|
if (response?.statusCode === 1) {
|
||||||
|
|
@ -3381,6 +3382,8 @@ const StockForm = ({ formType }) => {
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<div className={`${orderType ? 'div-flex' : ''}`}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="CustSuppId"
|
name="CustSuppId"
|
||||||
rules={[
|
rules={[
|
||||||
|
|
@ -3430,8 +3433,32 @@ const StockForm = ({ formType }) => {
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
{orderType && <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);
|
||||||
|
setInitialLoad(true);
|
||||||
|
getSuplaierApi({ Type: checked ? 'Y' : null });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
All
|
||||||
|
</Checkbox>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
{!selectedSupplierName && (
|
{!selectedSupplierName && (
|
||||||
<RadioGrpButton
|
<RadioGrpButton
|
||||||
|
|
||||||
content={[
|
content={[
|
||||||
{ value: 'own', label: 'Own' },
|
{ value: 'own', label: 'Own' },
|
||||||
{ value: 'paid', label: 'With paid' },
|
{ value: 'paid', label: 'With paid' },
|
||||||
|
|
@ -3443,6 +3470,7 @@ const StockForm = ({ formType }) => {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
<div className="pe-inward-date">
|
<div className="pe-inward-date">
|
||||||
<label className="required">Inward Date</label>
|
<label className="required">Inward Date</label>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
width: 180px !important;
|
width: 180px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
> div:nth-child(2) {
|
>div:nth-child(2) {
|
||||||
p {
|
p {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
max-width: 130px !important;
|
max-width: 130px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
> td:nth-child(3) {
|
>td:nth-child(3) {
|
||||||
.ant-input {
|
.ant-input {
|
||||||
width: max-content !important;
|
width: max-content !important;
|
||||||
max-width: 70px !important;
|
max-width: 70px !important;
|
||||||
|
|
@ -153,7 +153,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> td:nth-child(5) {
|
>td:nth-child(5) {
|
||||||
.ant-input {
|
.ant-input {
|
||||||
width: max-content !important;
|
width: max-content !important;
|
||||||
max-width: 100px !important;
|
max-width: 100px !important;
|
||||||
|
|
@ -324,12 +324,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.purchase-status {
|
.purchase-status {
|
||||||
> div:nth-child(1) {
|
>div:nth-child(1) {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|
||||||
> p {
|
>p {
|
||||||
padding-bottom: 0 !important;
|
padding-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -447,7 +447,7 @@
|
||||||
|
|
||||||
.invoice-date {
|
.invoice-date {
|
||||||
.ant-form-item-control-input-content {
|
.ant-form-item-control-input-content {
|
||||||
> label {
|
>label {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
@ -473,7 +473,7 @@
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
> button {
|
>button {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
background-color: #ef4444;
|
background-color: #ef4444;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
@ -481,8 +481,8 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.ant-btn-icon {
|
.ant-btn-icon {
|
||||||
> span {
|
>span {
|
||||||
> svg {
|
>svg {
|
||||||
width: 13px;
|
width: 13px;
|
||||||
height: 13px;
|
height: 13px;
|
||||||
}
|
}
|
||||||
|
|
@ -833,9 +833,36 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 500px) {
|
||||||
|
|
||||||
.tdProductrecipt,
|
.tdProductrecipt,
|
||||||
.proReceiptTD {
|
.proReceiptTD {
|
||||||
font-size: 12px !important;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue