diff --git a/src/Pages/DeliveryChallanToInvoice/PrintTemplates/PrintStyleDCToInvoice9.jsx b/src/Pages/DeliveryChallanToInvoice/PrintTemplates/PrintStyleDCToInvoice9.jsx index dc77824..5b51526 100644 --- a/src/Pages/DeliveryChallanToInvoice/PrintTemplates/PrintStyleDCToInvoice9.jsx +++ b/src/Pages/DeliveryChallanToInvoice/PrintTemplates/PrintStyleDCToInvoice9.jsx @@ -1,6 +1,6 @@ import { useMemo } from "react"; import { useSelector } from "react-redux"; -import { GloabalFieldDetails } from "../../../Features/ThemeChange/ThemeChange"; // Fix typo if needed +import { GloabalDCtoInvoiceFieldDetails, GloabalFieldDetails } from "../../../Features/ThemeChange/ThemeChange"; // Fix typo if needed import { dateFormatChange1 } from "../../../Services/Others"; const PrintStyleDCToInvoice9 = ({ invoiceData, preference, printDatas }) => { @@ -18,7 +18,7 @@ const PrintStyleDCToInvoice9 = ({ invoiceData, preference, printDatas }) => { VehicleNo } = invoiceData; - const fieldDetails = useSelector(GloabalFieldDetails); + const fieldDetails = useSelector(GloabalDCtoInvoiceFieldDetails); const signature = fieldDetails?.["signature"]; const termsAndConditions = fieldDetails?.["terms&conditions"]; const termsAndConditionsData = printDatas?.TermsandConditions; @@ -52,9 +52,36 @@ const PrintStyleDCToInvoice9 = ({ invoiceData, preference, printDatas }) => { height: pageSize === "A5" ? "170mm" : "98vh", maxHeight: "98vh" }); + 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 headerStyle = { + backgroundColor: headerColor?.background, + color: headerColor?.font, + } + const tableHeaderStyle = { + backgroundColor: tableHeaderColor?.background, + color: tableHeaderColor?.font, + } + const tableBodyStyle = { + backgroundColor: tableBodyColor?.background, + color: tableBodyColor?.font, + } + const rowtypeStyle = tableBodyColor?.rowType; + const footerColorStyle = { + backgroundColor: footerColor?.background, + color: footerColor?.font, + } + const netAmountStyle = { + backgroundColor: netAmtColor?.background, + color: netAmtColor?.font, + } const renderFooter = () => ( -
{notesText}
} @@ -101,6 +128,7 @@ const PrintStyleDCToInvoice9 = ({ invoiceData, preference, printDatas }) => { DCNo={DCNo} InvoiceDate={InvoiceDate} VehicleNo={VehicleNo} + headerStyle={headerStyle} /> ); @@ -119,13 +147,14 @@ const PrintStyleDCToInvoice9 = ({ invoiceData, preference, printDatas }) => { >| {col.label} | ))} @@ -208,7 +238,18 @@ const ProductTable = ({ data }) => {||
|---|---|---|
| {index + 1} | {prod.ProdName} | {prod.ProdVariantName} | @@ -223,8 +264,8 @@ const ProductTable = ({ data }) => { ); }; -const Summary = ({ TotalAmount, TaxAmount, GrandTotal }) => ( -