diff --git a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle11.jsx b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle11.jsx index bd0e9c8..895e519 100644 --- a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle11.jsx +++ b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle11.jsx @@ -4,7 +4,18 @@ import { useDispatch, useSelector } from "react-redux"; import { GlobalPritdummyData, changeReprintDataFound, - GlobalprinttermsAndConditions + GlobalprinttermsAndConditions, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, + GlobalSelectedNetAmountColor, + GlobalSelectedNetAmountFontColor, } from '../../../Features/ThemeChange/ThemeChange'; import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.scss"; import { extractLastNumber } from "../../../Services/Others"; @@ -29,11 +40,26 @@ const PurPrintStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, totalQua const Rate = FieldDetails?.["Rate"]; const Amount = FieldDetails?.["Amount"]; const HsnCode = FieldDetails?.["HsnCode"]; + let printColors = printDatas?.PrintColors; + const headerColor = printColors?.find(obj => obj.headerColor)?.headerColor; + const tableHeaderColor = printColors?.find(obj => obj.tableHeaderColor)?.tableHeaderColor; + 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 GlobaldummyData = useSelector(GlobalPritdummyData); + const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); - + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); + const SelectedHeaderFontColor = useSelector(GlobalSelectedPrintHeaderFontColor); + const SelectedTableHeaderColor = useSelector(GlobalSelectedTableHeaderColor); + const SelectedTableHeaderFontColor = useSelector(GlobalSelectedTableHeaderFontColor); + const SelectedTableBodyColor = useSelector(GlobalSelectedTableBodyColor); + const SelectedTableBodyFontColor = useSelector(GlobalSelectedTableBodyFontColor); + const SelectedRowType = useSelector(GlobalRowType); + const SelectedTableFooterColor = useSelector(GlobalSelectedFooterColor); + const SelectedTableFooterFontColor = useSelector(GlobalSelectedFooterFontColor); + const SelectedNetAmountColor = useSelector(GlobalSelectedNetAmountColor); + const SelectedNetAmountFontColor = useSelector(GlobalSelectedNetAmountFontColor); let TermsAndConditions = printDatas?.TermsandConditions let SignatureImg = printDatas?.Signature @@ -70,39 +96,85 @@ const PurPrintStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, totalQua } const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == "A5" ? 5 : 10); + const headerStyle = { + backgroundColor: GlobaldummyData + ? SelectedHeaderColor + : headerColor?.background, + color: GlobaldummyData + ? SelectedHeaderFontColor + : headerColor?.font, + } + const tableHeaderStyle = { + backgroundColor: GlobaldummyData + ? SelectedTableHeaderColor + : tableHeaderColor?.background, + + color: GlobaldummyData + ? SelectedTableHeaderFontColor + : tableHeaderColor?.font, + } + const tableBodyStyle = { + backgroundColor: GlobaldummyData + ? SelectedTableBodyColor + : tableBodyColor?.background, + color: GlobaldummyData + ? SelectedTableBodyFontColor + : tableBodyColor?.font, + } + const rowtypeStyle = GlobaldummyData ? SelectedRowType : tableBodyColor?.rowType; + const footerColorStyle = { + backgroundColor: GlobaldummyData + ? SelectedTableFooterColor + : footerColor?.background, + + color: GlobaldummyData + ? SelectedTableFooterFontColor + : footerColor?.font, + } + const netAmountStyle = { + backgroundColor: GlobaldummyData + ? SelectedNetAmountColor + : netAmtColor?.background, + + color: GlobaldummyData + ? SelectedNetAmountFontColor + : netAmtColor?.font, + } return ( <> {FormatTheme ?
| S.N | } - {Item &&Item | } - {Quantity &&Qty | } - { HsnCode &&HSN | } - { MRP &&MRP | } - { Discount &&Dis | } - { Rate &&Rate | } - { Amount &&Amt | } + {SLNO &&S.N | } + {Item &&Item | } + {Quantity &&Qty | } + {HsnCode &&HSN | } + {MRP &&MRP | } + {Discount &&Dis | } + {Rate &&Rate | } + {Amount &&Amt | }
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {chunkIndex * chunkSize + index + 1} | } +|||||||||||||||
| {chunkIndex * chunkSize + index + 1} | } {Item &&
{item?.ProdName}
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"}){item?.BrandName !== null ? item?.BrandName : ""}
@@ -149,8 +232,8 @@ const PurPrintStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, totalQua
{HsnCode && {item?.HSN} | }
{MRP && {item?.SinglePc === 'Y' ? item?.Price : item?.MRP} | }
{Discount && {item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} | }
- { Rate && {item?.Price} | }
- { Amount && {item?.NetAmt?.toFixed(2)} | }
+ {Rate && {item?.Price} | }
+ {Amount && {item?.NetAmt?.toFixed(2)} | }
|
Signature
| S.N | } - {Item &&Item | } - {Quantity &&Qty | } - { HsnCode &&HSN | } - { MRP &&MRP | } - { Discount &&Dis | } - { Rate &&Rate | } - { Amount &&Amt | } + {SLNO &&S.N | } + {Item &&Item | } + {Quantity &&Qty | } + {HsnCode &&HSN | } + {MRP &&MRP | } + {Discount &&Dis | } + {Rate &&Rate | } + {Amount &&Amt | }
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {index + 1} | } +|||||||||||||||
| {index + 1} | } {Item &&
{item?.ProdName}
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"}){item?.BrandName !== null ? item?.BrandName : ""}
@@ -722,10 +818,10 @@ const PurPrintStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, totalQua
| }
{Quantity && {item?.Qty} | } {HsnCode &&{item?.HSN} | } - { MRP &&{item?.SinglePc === 'Y' ? item?.Price : item?.MRP} | } - { Discount &&{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} | } - { Rate &&{item?.Price} | } - { Amount &&{item?.NetAmt?.toFixed(2)} | } + {MRP &&{item?.SinglePc === 'Y' ? item?.Price : item?.MRP} | } + {Discount &&{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} | } + {Rate &&{item?.Price} | } + {Amount &&{item?.NetAmt?.toFixed(2)} | }