diff --git a/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx b/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx index b6f36dd..8bddde9 100644 --- a/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx +++ b/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx @@ -561,7 +561,7 @@ const SelectionComponent = forwardRef((props, ref) => { PrintType: item.PrintType, PrintHdrName: item.PrintHdrName, PrintDocLabel: item.PrintDocLabel, - PrintTotalLabel:item.PrintTotalLabel, + PrintTotalLabel: item.PrintTotalLabel, // legacy fields are filled from the array so older code still works PrintHdrColor: item.PrintHdrColor || @@ -726,7 +726,7 @@ const SelectionComponent = forwardRef((props, ref) => { dispatch(changeBillName(PrintHdrName)); dispatch(changeBillNolabel(PrintDocLabel)); dispatch(changetotallabel(PrintTotalLabel)); - + // derive color objects; prefer the legacy fields but fall back to the PrintColors array const hdr = getColor(PrintColors, 'headerColor'); const tblHdr = getColor(PrintColors, 'tableHeaderColor'); @@ -1059,7 +1059,7 @@ const SelectionComponent = forwardRef((props, ref) => { PageSize: PageSize, PrintHdrName: BillName, PrintDocLabel: BillNolabel, - PrintTotalLabel:totalLabel, + PrintTotalLabel: totalLabel, PrintType: PrintType ? 'S' : 'C', PrintTypeId: segmentValue, // Header color (background) and font @@ -1140,7 +1140,7 @@ const SelectionComponent = forwardRef((props, ref) => { }; const onfinish = async (values) => { - + if (!templateEdit && sizeOptionData?.length == 0) { setMessageType('error'); setMessageData('Please Setup the Screen'); @@ -1207,7 +1207,7 @@ const SelectionComponent = forwardRef((props, ref) => { ...(item?.PrintHdrName ? { PrintHdrName: item.PrintHdrName } : {}), ...(item?.PrintDocLabel ? { PrintDocLabel: item.PrintDocLabel } : {}), ...(item?.PrintTotalLabel ? { PrintTotalLabel: item.PrintTotalLabel } : {}), - + ...(item?.Signature ? { Signature: item?.Signature } : {}), PrintType: item?.PrintType, }) @@ -1661,6 +1661,7 @@ const SelectionComponent = forwardRef((props, ref) => { '' )} + { > {sizeCheckList - ?.filter((item) => item.ConfigName) + ?.filter((item) => { + if (item.ConfigName?.toLowerCase?.() === 'rate with tax') { + const rateConfigId = sizeCheckList?.find( + (opt) => opt.ConfigName?.toLowerCase?.() === 'rate' + )?.ConfigId; + return selectedSizeCheckedValues?.includes(rateConfigId); + } + return Boolean(item.ConfigName); + }) ?.map((value, key) => ( { }} /> - )} -
- - BillName - - Bill Name} - value={BillName} - onChange={(e) => { - setBillName(e.target.value); - dispatch(changeBillName(e.target.value)); - }} - /> -
- + )} +
+ + BillName + + Bill Name} + value={BillName} + onChange={(e) => { + setBillName(e.target.value); + dispatch(changeBillName(e.target.value)); + }} + /> +
+ {isbillnoLabel &&
diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx index 7c90d68..038e5c5 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx @@ -72,8 +72,9 @@ const TaxInvoice = ({ const footerColor = printColors?.find(obj => obj.footerColor)?.footerColor; const netAmtColor = printColors?.find(obj => obj.netAmtColor)?.netAmtColor; const FieldDetails = useSelector(GloabalFieldDetails); - console.log(FieldDetails,"FieldDetails") + console.log(FieldDetails, "FieldDetails") const Discount = FieldDetails?.['Discount']; + const rate_with_tax = FieldDetails?.['Rate with Tax']; console.log(Discount, "Discount") // Function to convert number to words const numberToWords = (num) => { @@ -984,7 +985,7 @@ const TaxInvoice = ({ > {Number( table2Data?.OrderType !== 'E' - ? item.Rate - (item?.SinglePc === 'Y' ? (item?.TaxAmt / item?.SalesQty) : item.ProdTaxAmt) + ? rate_with_tax ? item.Rate : item.Rate - (item?.SinglePc === 'Y' ? (item?.TaxAmt / item?.SalesQty) : item.ProdTaxAmt) : item.Rate || 0 ).toLocaleString('en-IN', { minimumFractionDigits: 2,