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
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : "257mm" : "", }} key={chunkIndex}> -
-
-
{ table2Data?.[0]?.BrName}
+
+
+
{table2Data?.[0]?.BrName}
{GlobaldummyData ? @@ -94,42 +164,52 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
{BillName}
{/* -
- {table2Data?.BrGSTIN &&
GST NO :{table2Data?.BrGSTIN}, CIN :u00045hhsgbubufsdug
} -
PH : +91 {table2Data?.[0]?.BrMobile}
-
} */} -
-
BILL NO :{table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}
-
{Date1}
-
+
+ {table2Data?.BrGSTIN &&
GST NO :{table2Data?.BrGSTIN}, CIN :u00045hhsgbubufsdug
} +
PH : +91 {table2Data?.[0]?.BrMobile}
+
} */} +
+
+
BILL NO :{table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}
+
{Date1}
-
- {(TakeawayData?.length > 0 ) && + {(TakeawayData?.length > 0) && <> - { SLNO && } - { Item && } - { Quantity && } - { HsnCode && } - { MRP && } - { Discount && } - { Rate && } - { Amount && } + {SLNO && } + {Item && } + {Quantity && } + {HsnCode && } + {MRP && } + {Discount && } + {Rate && } + {Amount && } {dataChunk?.map((item, index) => { return ( - - { SLNO && } - { Item && + {SLNO && } + {Item && } - { Quantity && } - { HsnCode && } - { MRP && } - { Discount && } - { Rate && } - { Amount && } + {Quantity && } + {HsnCode && } + {MRP && } + {Discount && } + {Rate && } + {Amount && } ) })} @@ -154,14 +234,14 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
S.NoItemQtyHSNMRPDis RateAmtS.NoItemQtyHSNMRPDis RateAmt
{chunkIndex * chunkSize + index + 1} +
{chunkIndex * chunkSize + index + 1}
{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 } ) : ""}
{item?.Qty}{item?.HSN}{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Price}{item?.NetAmt?.toFixed(2)}{item?.Qty}{item?.HSN}{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Price}{item?.NetAmt?.toFixed(2)}
} - +
{((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && <> -
- - +
+ + {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
Off : @@ -328,12 +408,12 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
- +
- - - + + + {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&

Customer : {table2Data?.CustSuppName}

@@ -344,14 +424,14 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C - +
- +
{Notestext && (
-

{Notestext}

+

{Notestext}

-
-
) +
+
) } @@ -393,8 +474,8 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
- - + + } @@ -422,9 +503,9 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C > <> -
- - +
+ + {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
Off : @@ -582,7 +663,7 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C }
- + } @@ -591,13 +672,13 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
- +
- - - - + + + + {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&

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, C
) } - { Signature == true && (
+ {Signature == true && (

Signature

)} @@ -649,7 +731,7 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
- +
@@ -659,7 +741,7 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C :
-
+
{GlobaldummyData ? 'XYZ Shop' : table2Data?.[0]?.BrName}
@@ -676,12 +758,12 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C {table2Data?.BrGSTIN &&
GST NO :{table2Data?.BrGSTIN}, CIN :u00045hhsgbubufsdug
}
PH : +91 {table2Data?.[0]?.BrMobile}
} */} -
-
BILL NO :{table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}
-
{ Date1}
-
-
+
+
+
BILL NO :{table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}
+
{Date1}
+
@@ -692,22 +774,33 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C - { SLNO && } - { Item && } - { Quantity && } - { HsnCode && } - { MRP && } - { Discount && } - { Rate && } - { Amount && } + {SLNO && } + {Item && } + {Quantity && } + {HsnCode && } + {MRP && } + {Discount && } + {Rate && } + {Amount && } {(TakeawayData)?.map((item, index) => { return ( - - { SLNO && } - { Item && + {SLNO && } + {Item &&
S.NoItemQtyHSNMRPDis RateAmtS.NoItemQtyHSNMRPDis RateAmt
{index + 1} +
{index + 1}
{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
} - -
- - + +
+ + {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
Off : @@ -772,10 +865,10 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
Net Amount:
-
{ Number(table2Data?.[0]?.NetAmount).toFixed(2)}
+
{Number(table2Data?.[0]?.NetAmount).toFixed(2)}
- +
@@ -905,12 +998,12 @@ const PurPrintStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
- +
- - - - + + + + {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&

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
- - + +