diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx index 93cf4e6..e91957c 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx @@ -3180,13 +3180,13 @@ const BSBillingEditQuantity = (props) => { ...( !offerApply && itemDiscountPrice > 0 ? { - DiscountAmt: safeRound(itemDiscountPrice), + DiscountAmt: safeRound(itemDiscountPrice*fixedQty ), DiscountType: itemDiscountPercentageSelection === 'Fixed' ? 'F' : 'P', DiscountValue: itemDiscountPercentageSelection === 'Fixed' - ? itemDiscountPrice + ? itemDiscountPrice*fixedQty : ( - (itemDiscountPrice / + (itemDiscountPrice*fixedQty / (newPrice > 0 ? newPrice : editedProduct?.OrderRate)) * 100 ) } @@ -3301,7 +3301,7 @@ const BSBillingEditQuantity = (props) => { const { OfferType = null, OfferPrice = 0 } = product; let totalAmount = qty * rate; - totalAmount = totalAmount - (itemDiscountPrice || 0); + totalAmount = totalAmount - (itemDiscountPrice*qty|| 0); const taxAmount = ( (totalAmount * taxPercentage) / (100 + taxPercentage) diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx index e12d50b..3fe85e2 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx @@ -13,6 +13,7 @@ import { GlobalSelectedFooterFontColor, GlobalSelectedNetAmountColor, GlobalSelectedNetAmountFontColor, + GloabalFieldDetails, } from '../../../../Features/ThemeChange/ThemeChange'; import { isMobile } from 'react-device-detect'; import { extractLastNumberOrderId } from '../../../../Services/Others'; @@ -70,6 +71,10 @@ const TaxInvoice = ({ const tableBodyColor = printColors?.find(obj => obj.tableBodyColor)?.tableBodyColor; const footerColor = printColors?.find(obj => obj.footerColor)?.footerColor; const netAmtColor = printColors?.find(obj => obj.netAmtColor)?.netAmtColor; + const FieldDetails = useSelector(GloabalFieldDetails); + console.log(FieldDetails,"FieldDetails") + const Discount = FieldDetails?.['Discount']; + console.log(Discount, "Discount") // Function to convert number to words const numberToWords = (num) => { const a = [ @@ -802,7 +807,8 @@ const TaxInvoice = ({
Rate
+ {Discount &&
+ Disc +
} {/*
per
*/}
Amount @@ -869,7 +884,7 @@ const TaxInvoice = ({ key={index} style={{ display: 'grid', - gridTemplateColumns: '5% 40% 12% 11% 16% 16%', + gridTemplateColumns: Discount ? '5% 40% 12% 11% 8% 8% 16%' : '5% 40% 12% 11% 16% 16%', // borderRight: '1px solid #000', ...(index % 2 === 0 && rowtypeStyle === "even" ? tableBodyStyle @@ -976,6 +991,21 @@ const TaxInvoice = ({ maximumFractionDigits: 2, })}
+ {Discount &&
+ {Number( + + (item.DiscountAmt / item.SalesQty) || 0 + ).toLocaleString('en-IN', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} +
} {/*
{item.UomName || 'NOS'}
*/}
+ {Discount &&
}
@@ -1048,7 +1079,7 @@ const TaxInvoice = ({
CGST
+ {Discount &&
}
@@ -1100,7 +1134,7 @@ const TaxInvoice = ({
SGST
+ {Discount &&
}
@@ -1155,7 +1192,7 @@ const TaxInvoice = ({
IGST
+ {Discount &&
}
@@ -1211,7 +1251,7 @@ const TaxInvoice = ({
ROUNDING OFF
+ + {Discount &&
}
@@ -1248,7 +1292,7 @@ const TaxInvoice = ({ key={`empty-${idx}`} style={{ display: 'grid', - gridTemplateColumns: '5% 40% 12% 11% 16% 16%', + gridTemplateColumns: Discount ? '5% 40% 12% 11% 8% 8% 16%' : '5% 40% 12% 11% 16% 16%', // borderRight: '1px solid #000', minHeight: '32px', // Adjust height as needed for your design @@ -1272,6 +1316,15 @@ const TaxInvoice = ({ >   + {Discount &&
+   +
}
+ {Discount &&
}
{/*
*/}
No items to display
+ {Discount &&
+ - +
}