diff --git a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintStyleA5.jsx b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintStyleA5.jsx
index 9f184f6..97e6aea 100644
--- a/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintStyleA5.jsx
+++ b/src/Pages/PurchaseQuotation/PurchasePrintTemplate/PurPrintStyleA5.jsx
@@ -10,7 +10,21 @@ import { printDiv } from "../../../Services/Others";
// import HpyImg from "../../../Images/happyemoji.png"
import '../../../Styles/BookingScreen/PrintTemplates/A4/PrintA4Style11.scss'
import { useSelector } from 'react-redux';
-import { GloabalFieldDetails, GlobalBillName, Globalnotes, GlobalprintAmount, GlobalprintDiscount, GlobalprintHsnCode, GlobalprintItem, GlobalprintMRP, GlobalprintQrcodet, GlobalprintQuantity, GlobalprintRate, GlobalprintSignature, GlobalprintSlNo, GlobalprinttermsAndConditions, GlobalPritdummyData, GlobalSignatureImage, GlobalthemeFormat } from '../../../Features/ThemeChange/ThemeChange';
+import {
+ Globalnotes, GlobalprintRate, GlobalprintSignature, GlobalprinttermsAndConditions, GlobalSignatureImage, GlobalthemeFormat,
+ GlobalSelectedPrintHeaderColor,
+ GlobalSelectedPrintHeaderFontColor,
+ GlobalSelectedTableHeaderColor,
+ GlobalSelectedTableHeaderFontColor,
+ GlobalSelectedTableBodyColor,
+ GlobalSelectedTableBodyFontColor,
+ GlobalRowType,
+ GlobalSelectedFooterColor,
+ GlobalSelectedFooterFontColor,
+ GlobalSelectedNetAmountColor,
+ GlobalSelectedNetAmountFontColor,
+ GlobalPritdummyData,
+} from '../../../Features/ThemeChange/ThemeChange';
import signature from "../../../Images/signatureimage.jpg"
import QRCode from 'react-qr-code';
import { isMobile } from 'react-device-detect';
@@ -21,13 +35,24 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
const GlobalSignature = useSelector(GlobalprintSignature);
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
// const FieldDetails = useSelector(GloabalFieldDetails);
- const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => {
- acc[item.ConfigName] = true;
- return acc;
- }, {});
+ const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => {
+ acc[item.ConfigName] = true;
+ return acc;
+ }, {});
const GlobalIsnotes = useSelector(Globalnotes);
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
- console.log(FieldDetails, "FieldDetails")
+ const GlobaldummyData = useSelector(GlobalPritdummyData);
+ 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);
const SLNO = FieldDetails?.["Sl.No"];
const Item = FieldDetails?.["Item"];
const MRP = FieldDetails?.["MRP"];
@@ -40,6 +65,12 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
const Signature = FieldDetails?.["signature"];
const TermsnAdCondition = FieldDetails?.["terms&conditions"];
const isNotes = FieldDetails?.["Notes"];
+ 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 currentDate = new Date();
console.log(FieldDetails, "FieldDetails")
@@ -88,7 +119,51 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
}
const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0;
const shouldFooterBeOnNewPage = lastChunkRows > 6;
+ 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 (
{paginatedChunks.map((dataChunk, chunkIndex) => (
-
+
-
+
{/* Logo Image */}
- {/* {base64Image && (
-
-

-
- )} */}
+ {base64Image && (
+
+

+
+ )}
{/* Store Info */}
- {table2Data?.[0]?.BranchName}
+ {table2Data?.[0]?.BranchName}
{/* Address */}
@@ -157,7 +232,7 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
return
{parts}
;
})}
- Mobile: +91 {table2Data?.customerMobile}
+ Mobile: +91 {table2Data?.customerMobile}
{/* Order Type */}
@@ -167,19 +242,6 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
-
- {/*
-
- {table2Data?.OrderType === "E"
- ? "Estimate"
- : (GlobaldummyData
- ? "Cash"
- : PaymentStatusSuccess?.length === 1
- ? PaymentStatusSuccess?.[0]?.PaymentTypeName
- : "") + table2Data?.OrderId && "Cash: " + extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)} {GlobaldummyData && "685"}
-
-
*/}
-
@@ -211,7 +273,7 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
-
+
@@ -229,21 +291,21 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
- {SLNO == true && | S.No | }
- {Item == true && Item | }
+ {SLNO == true && S.No | }
+ {Item == true && Item | }
{HsnCode == true && (
- HSN |
+ HSN |
)}
{Quantity == true && (
- Qty |
+ Qty |
)}
- {MRP == true && MRP | }
- {Rate == true && Rate | }
+ {MRP == true && MRP | }
+ {Rate == true && Rate | }
{Discount == true && (
- Dis |
+ Dis |
)}
{Amount == true && (
-
+ |
Amt
|
)}
@@ -252,7 +314,18 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
{dataChunk?.map((item, index) => (
-
+
{SLNO == true && (
|
{chunkIndex * chunkSize + index + 1}
@@ -357,7 +430,7 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
{/* {GlobaldummyData ? "1066" : Number(table2Data?.NetAmount).toFixed(2)} */}
- Amount :{Number(dataSource?.[0]?.NetAmt).toFixed(2)}
+ Amount :{Number(dataSource?.[0]?.NetAmt).toFixed(2)}
@@ -428,33 +501,36 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
{Date1}
>
- {Notestext && (
-
- {Notestext}
-
+
+ {Notestext && (
+
+ )}
+
+
+
+ {(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
+
+
+ Terms & Conditions
+
+
+ {TermsAndConditions?.map(item => (- {item?.TermsandConditions}
))}
+
+
+ )}
+ {Signature == true && (
+
+ Signature
+ 
+
+ )}
+
- )}
-
-
-
- {(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-
-
- Terms & Conditions
-
-
- {TermsAndConditions?.map(item => (- {item?.TermsandConditions}
))}
-
-
- )}
- {Signature == true && (
-
- Signature
- 
-
- )}
-
+
}
@@ -509,7 +585,7 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
{/* {GlobaldummyData ? "1066" : Number(table2Data?.NetAmount).toFixed(2)} */}
- Amount :{Number(dataSource?.[0]?.NetAmt).toFixed(2)}
+ Amount :{Number(dataSource?.[0]?.NetAmt).toFixed(2)}
@@ -580,32 +656,34 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
{Date1}
>
- {Notestext && (
-
- {Notestext}
-
+
+ {Notestext && (
+
+ )}
+
+
+
+ {(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
+
+
+ Terms & Conditions
+
+
+ {TermsAndConditions?.map(item => (- {item?.TermsandConditions}
))}
+
+
+ )}
+ {Signature == true && (
+
+ Signature
+ 
+
+ )}
+
- )}
-
-
-
- {(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-
-
- Terms & Conditions
-
-
- {TermsAndConditions?.map(item => (- {item?.TermsandConditions}
))}
-
-
- )}
- {Signature == true && (
-
- Signature
- 
-
- )}
-
)}
@@ -648,7 +726,7 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
{/* {GlobaldummyData ? "1066" : Number(table2Data?.NetAmount).toFixed(2)} */}
- Amount :{Number(table2Data?.NetAmount).toFixed(2)}
+ Amount :{Number(table2Data?.NetAmount).toFixed(2)}
@@ -719,33 +797,36 @@ const PurPrintStyleA5 = ({ index, ExtraChargeTotal, UpiId, Date1, base64Image, t
{Date1}
>
- {Notestext && (
-
- {Notestext}
-
+
+ {Notestext && (
+
+ )}
+
+
+
+ {(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
+
+
+ Terms & Conditions
+
+
+ {TermsAndConditions?.map(item => (- {item?.TermsandConditions}
))}
+
+
+ )}
+ {Signature == true && (
+
+ Signature
+ 
+
+ )}
+
- )}
-
-
-
- {(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-
-
- Terms & Conditions
-
-
- {TermsAndConditions?.map(item => (- {item?.TermsandConditions}
))}
-
-
- )}
- {Signature == true && (
-
- Signature
- 
-
- )}
-
+
)}
| |