diff --git a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle9.jsx b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle9.jsx index c45b747..36dd142 100644 --- a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle9.jsx +++ b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle9.jsx @@ -2,9 +2,20 @@ import React from "react"; import { useDispatch, useSelector } from "react-redux"; import { - GlobalPritdummyData, - changeReprintDataFound, - GlobalprinttermsAndConditions + GlobalPritdummyData, + changeReprintDataFound, + GlobalprinttermsAndConditions, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, + GlobalSelectedNetAmountColor, + GlobalSelectedNetAmountFontColor, } from '../../../Features/ThemeChange/ThemeChange'; import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.scss'; import { extractLastNumber } from "../../../Services/Others"; @@ -28,11 +39,26 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C 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 @@ -54,7 +80,7 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C console.log(TakeawayData, "TakeawayData", table2Data) - + let TotalOfferAmount = 0; @@ -71,7 +97,51 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C } 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 ? @@ -80,9 +150,9 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
| S.No | } - { Item &&Item | } - { Quantity &&Qty | } - { HsnCode &&HSN | } - { MRP &&MRP | } - { Discount &&Dis | } - { Rate &&Rate | } - { Amount &&Amt | } + {SLNO &&S.No | } + {Item &&Item | } + {Quantity &&Qty | } + {HsnCode &&HSN | } + {MRP &&MRP | } + {Discount &&Dis | } + {Rate &&Rate | } + {Amount &&Amt | }
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {chunkIndex * chunkSize + index + 1} | } - { Item &&+ | ||||||||||||||
| {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 : ""}
{item?.ProductIdentifierDtls?.length > 0 ? (item?.ProductIdentifierDtls?.filter((items) => !(items.SerialNumber == "" || items.SerialNumber == null))
@@ -141,12 +221,12 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
}
) : ""}
| }
- { 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)} | } + {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)} | }
Customer : {table2Data?.CustSuppName}
@@ -344,14 +424,14 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C - +{Notestext}
+{Notestext}
-Customer : {table2Data?.CustSuppName}
@@ -617,6 +698,7 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C pageBreakBefore: "avoid", pageBreakInside: "avoid", minHeight: "auto", + ...footerColorStyle }} > { @@ -641,7 +723,7 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, CSignature
| S.No | } - { Item &&Item | } - { Quantity &&Qty | } - { HsnCode &&HSN | } - { MRP &&MRP | } - { Discount &&Dis | } - { Rate &&Rate | } - { Amount &&Amt | } + {SLNO &&S.No | } + {Item &&Item | } + {Quantity &&Qty | } + {HsnCode &&HSN | } + {MRP &&MRP | } + {Discount &&Dis | } + {Rate &&Rate | } + {Amount &&Amt | }
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {index + 1} | } - { Item &&+ | ||||||||||||||
| {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 : ""}
{item?.ProductIdentifierDtls?.length > 0 ? (item?.ProductIdentifierDtls?.filter((items) => !(items.SerialNumber == "" || items.SerialNumber == null))
@@ -732,10 +825,10 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
Customer : {table2Data?.CustSuppName}
@@ -936,6 +1029,7 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C pageBreakBefore: "avoid", pageBreakInside: "avoid", minHeight: "auto", + ...footerColorStyle }} > { @@ -969,8 +1063,8 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C