diff --git a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle8.jsx b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle8.jsx index 9c09539..607419a 100644 --- a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle8.jsx +++ b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintstyle8.jsx @@ -4,7 +4,19 @@ 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/PrintStyle8.scss'; import { extractLastNumber } from "../../../Services/Others"; @@ -27,11 +39,26 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B 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 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 @@ -74,7 +101,51 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B } const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == "A5" ? 5 : 13); + 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 ( <> @@ -85,8 +156,8 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B {/*
*/} -
-
+
+
{/*

{table2Data?.[0]?.BrName}

*/}
{table2Data?.[0]?.BrName}
@@ -94,21 +165,19 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B (table2Data?.[0]?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.[0]?.AddressDetails?.[0]?.City ? (table2Data?.[0]?.AddressDetails?.[0]?.Address1 && table2Data?.[0]?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.City : '') + (table2Data?.[0]?.AddressDetails?.[0]?.Zip ? (table2Data?.[0]?.AddressDetails?.[0]?.City && table2Data?.[0]?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.Zip : '') }
-
- Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.[0]?.BrMobile}
+
+ Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.[0]?.BrMobile}
- {
- {BillName}
} - + {
{BillName}
}
Bill No :{table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}
-
{ Date1}
+
{Date1}

-
+
{(TakeawayData?.length > 0) && <> @@ -116,32 +185,43 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B - {SLNO && } - {Item && } - {HsnCode && } - {MRP && } - {Rate && } + {SLNO && } + {Item && } + {HsnCode && } + {MRP && } + {Rate && } { - Discount && } - {Quantity && } - {Amount && } + Discount && } + {Quantity && } + {Amount && } {dataChunk?.map((item, index) => { return ( - - { SLNO && } + + {SLNO && } {Item && } - { HsnCode && } - { MRP && } - { Rate && } - { Discount && } - { Quantity && } - { Amount && } + {HsnCode && } + {MRP && } + {Rate && } + {Discount && } + {Quantity && } + {Amount && } ) })} @@ -157,7 +237,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B <>
-
+
Items
:
@@ -311,12 +391,12 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
- +
- + {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
Customer : {table2Data?.CustSuppName}
@@ -325,7 +405,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
- +
@@ -335,8 +415,8 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B pageBreakBefore: "avoid", pageBreakInside: "avoid", minHeight: "auto", - }} - > + ...footerColorStyle + }} > { Notestext && (

{Notestext}

@@ -344,8 +424,6 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
) } - -
{ (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
@@ -359,16 +437,13 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
) } - { Signature == true && (
+ {Signature == true && (

Signature

)}
- - - }
@@ -395,7 +470,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B > <>
-
+
Items
:
@@ -549,18 +624,18 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
- +
- - + + {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData &&
Cashier : {CashierName}
} - + {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
Customer : {table2Data?.CustSuppName}
@@ -576,6 +651,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B pageBreakBefore: "avoid", pageBreakInside: "avoid", minHeight: "auto", + ...footerColorStyle }} > { @@ -600,7 +676,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
) } - { Signature == true && (
+ {Signature == true && (

Signature

)} @@ -609,7 +685,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
- +
@@ -618,7 +694,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
:
-
+
{/*

{table2Data?.[0]?.BrName}

*/}
{GlobaldummyData ? 'XYZ Shop' : table2Data?.[0]?.BrName}
@@ -626,18 +702,18 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B 'BranchAddress, Town- 635XXX City - State' : (BranchAddress || '') + (BranchCity ? (BranchAddress && BranchCity ? '-' : '') + BranchCity : '') + (BranchZip ? (BranchCity && BranchZip ? '-' : '') + BranchZip : '')}
- +
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.[0]?.BrMobile}
- +
- {BillName}
+ {BillName}
Bill No :{ - table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}
-
{ Date1}
+ table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}
+
{Date1}

@@ -648,22 +724,33 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
S.NoDesHSNMRPRtS.NoDesHSNMRPRt(%)QtyAmt(%)QtyAmt
{chunkIndex * chunkSize + index + 1}
{chunkIndex * chunkSize + index + 1}
{item?.ProdName}
-
({ item?.Type != "C" ? item?.UomName : "COMBO"})
+
({item?.Type != "C" ? item?.UomName : "COMBO"})
{item?.HSN}{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}{item?.Price}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Qty}{(table2Data?.[0]?.NetAmount).toFixed(2)}{item?.HSN}{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}{item?.Price}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Qty}{(table2Data?.[0]?.NetAmount).toFixed(2)}
- {SLNO && } - {Item && } - {HsnCode && } - {MRP && } - {Rate && } - {Discount && } - {Quantity && } - {Amount && } + {SLNO && } + {Item && } + {HsnCode && } + {MRP && } + {Rate && } + {Discount && } + {Quantity && } + {Amount && } {(TakeawayData)?.map((item, index) => { return ( - - { SLNO && } - { Item && + {SLNO && } + {Item && } @@ -683,7 +770,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B }
-
+
Items
:
@@ -692,7 +779,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
Qty
:
-
{ totalQuantity}
+
{totalQuantity}
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
@@ -706,7 +793,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
Amount
:
-
{ Number(table2Data?.[0]?.NetAmount).toFixed(2)}
+
{Number(table2Data?.[0]?.NetAmount).toFixed(2)}
@@ -845,7 +932,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
- + {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
Customer : {table2Data?.CustSuppName}
@@ -854,7 +941,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
- +
@@ -864,6 +951,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B pageBreakBefore: "avoid", pageBreakInside: "avoid", minHeight: "auto", + ...footerColorStyle }} > { @@ -888,7 +976,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
) } - { Signature == true && (
+ {Signature == true && (

Signature

)} @@ -897,7 +985,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
- +
}
S.NoDesHSNMRPRt(%)QtyAmtS.NoDesHSNMRPRt(%)QtyAmt
{index + 1} +
{index + 1}
{item?.ProdName}
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})