From bf7ffcd67bc2cffc9f4c9d8e8b58dd8aec7115b8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 5 Mar 2026 13:52:54 +0530 Subject: [PATCH] Purchase Order 1 - 12 print --- .../PurchaseOrder/PurchaseOrderPrint.jsx | 2 +- .../PurchaseOrdStyle10.jsx | 2958 +++++++++---- .../PurchaseOrdStyle11.jsx | 3030 +++++++++---- .../PurchaseOrdStyle12.jsx | 2377 ++++++++--- .../PurchsasePrintStyle/PurchaseOrdStyle2.jsx | 1419 ++++--- .../PurchsasePrintStyle/PurchaseOrdStyle3.jsx | 3580 ++++++++++++---- .../PurchsasePrintStyle/PurchaseOrdStyle4.jsx | 3756 ++++++++++++----- .../PurchsasePrintStyle/PurchaseOrdStyle5.jsx | 2683 ++++++++---- .../PurchsasePrintStyle/PurchaseOrdStyle6.jsx | 2570 +++++++---- .../PurchsasePrintStyle/PurchaseOrdStyle7.jsx | 3476 ++++++++++----- .../PurchsasePrintStyle/PurchaseOrdStyle8.jsx | 2059 ++++++--- .../PurchsasePrintStyle/PurchaseOrdStyle9.jsx | 2511 ++++++++--- .../PurchsasePrintStyle/PurchasePrint1.jsx | 1033 +++-- 13 files changed, 22852 insertions(+), 8602 deletions(-) diff --git a/src/Pages/PurchaseOrder/PurchaseOrderPrint.jsx b/src/Pages/PurchaseOrder/PurchaseOrderPrint.jsx index ea2451a..9d22582 100644 --- a/src/Pages/PurchaseOrder/PurchaseOrderPrint.jsx +++ b/src/Pages/PurchaseOrder/PurchaseOrderPrint.jsx @@ -9,12 +9,12 @@ import { } from '../../Services/Others'; import { useEffect, useState } from 'react'; import moment from 'moment'; -import PurchasePrint1 from './PurchsasePrintStyle/PurchasePrint1'; import { useSelector } from 'react-redux'; import { getPrintSelectionComponentData, GlobalprintDatas, } from '../../Features/ThemeChange/ThemeChange'; +import PurchasePrint1 from './PurchsasePrintStyle/PurchasePrint1'; import PurchaseOrdStyle2 from './PurchsasePrintStyle/PurchaseOrdStyle2'; import PurchaseOrdStyle3 from './PurchsasePrintStyle/PurchaseOrdStyle3'; import PurchaseOrdStyle4 from './PurchsasePrintStyle/PurchaseOrdStyle4'; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle10.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle10.jsx index 5d8a4ee..f7acbc4 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle10.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle10.jsx @@ -1,6 +1,9 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; -import { extractLastNumber, extractLastNumberOrderId } from "../../../Services/Others"; +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; import { GlobalprintSlNo, GlobalprintItem, @@ -20,61 +23,82 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, -} from '../../../Features/ThemeChange/ThemeChange' + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, +} from '../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../Features/BookingScreen/BookingData/BookingData'; -import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.scss"; -import QRCode from "react-qr-code"; -import signature from "../../../Images/signatureimage.jpg" -import { ApplicationPreferences } from "../../../Features/BrachLogin/BranchLogin"; -import { isMobile } from "react-device-detect"; - -const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, CashierName, totalQuantity, OrderDetailGST, OrderDetailIGST, - OrderDetailVAT, table2Data, PaymentStatus, PrintGreeting, printDatas }) => { +import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.scss'; +import QRCode from 'react-qr-code'; +import signature from '../../../Images/signatureimage.jpg'; +import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; +import { isMobile } from 'react-device-detect'; +const PurchaseOrdStyle10 = ({ + index, + ExtraChargeTotal, + Date1, + totalQuantityFilter, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PaymentStatus, + PrintGreeting, + printDatas, +}) => { const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) + const GlobalUpiID = useSelector(GlobalUpiIDprint); // const FieldDetails = useSelector(GloabalFieldDetails); const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo) - const GlobalItem = useSelector(GlobalprintItem) - const GlobalMRP = useSelector(GlobalprintMRP) - const GlobalDiscount = useSelector(GlobalprintDiscount) - const GlobalQuantity = useSelector(GlobalprintQuantity) - const GlobalRate = useSelector(GlobalprintRate) - const GlobalAmount = useSelector(GlobalprintAmount) - const GlobalHsnCode = useSelector(GlobalprintHsnCode) - const GlobalQrcodet = useSelector(GlobalprintQrcodet) - const GlobaldummyData = useSelector(GlobalPritdummyData) + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobalQrcodet = useSelector(GlobalprintQrcodet); + const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobalSignature = useSelector(GlobalprintSignature); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; let PageSize = printDatas?.PageSize; - const chunkSize = isMobile ? 10 : PageSize == "A5" ? 10 : 16; + const chunkSize = isMobile ? 10 : PageSize == 'A5' ? 10 : 16; let dataSource = table2Data?.productDetails || []; - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; // Paginate the data const productsData = table2Data?.productDetails || []; @@ -85,9 +109,12 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte for (let i = 0; i < dataSource.length; i += chunkSize) { paginatedChunks.push(dataSource.slice(i, i + chunkSize)); } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 10 : PageSize == "A5" ? 5 : 13); - + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 10 : PageSize == 'A5' ? 5 : 13); const keysLength = Object.keys(table2Data ?? {}).length; if (keysLength > 0) { @@ -95,7 +122,20 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte } const currentDate = new Date(); const day = currentDate.getDate().toString().padStart(2, '0'); - const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; const monthIndex = currentDate.getMonth(); const year = currentDate.getFullYear().toString().slice(-2); @@ -108,85 +148,377 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte return total + (Number(item?.SalesQty) || 0); }, 0); + // + 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 + ); + + // + 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 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, + }; + return ( <> {FormatTheme ? (
{paginatedChunks.map((dataChunk, chunkIndex) => ( //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "257mm" : "257mm") : "", }} key={chunkIndex}> - - +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '257mm' + : '257mm' + : '', + }} + key={chunkIndex} + > {/*
*/} -
- -
-
+
+
- {GlobaldummyData ? 'ABC Shop' : table2Data?.BrName} {" "} + {GlobaldummyData ? 'ABC Shop' : table2Data?.BrName}{' '}
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} -

- Mobile:+91 {GlobaldummyData ? '8428XXXXXX' : table2Data?.BrMobile} + {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +

+ Mobile:+91{' '} + {GlobaldummyData ? '8428XXXXXX' : table2Data?.BrMobile}

- {table2Data?.OrderType === "E" &&
Estimate
} + {table2Data?.OrderType === 'E' && ( +
Estimate
+ )} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName + ' Bill' : ""}
} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatus?.length === 1 + ? PaymentStatus?.[0]?.PaymentTypeName + ' Bill' + : ''} +
+ )}
- -
-
{GlobaldummyData ? formattedDate : Date1}
+
+ {' '} + {GlobaldummyData ? formattedDate : Date1}{' '} +

-
+
- {SLNO && } - {Item && } - {HsnCode && } - {MRP && } - {Rate && } - {Quantity && } - {Discount && } - {Amount && } + {SLNO && ( + + )} + {Item && } + {HsnCode && ( + + )} + {MRP && ( + + )} + {Rate && ( + + )} + {Quantity && ( + + )} + {Discount && ( + + )} + {Amount && ( + + )} {dataChunk.map((row, rowIndex) => ( - - {SLNO && } + + {SLNO && ( + + )} {/* Item Name fallback order */} - {Item && } + {Item && ( + + )} {/* HSN fallback order */} - {HsnCode && } + {HsnCode && ( + + )} {/* MRP fallback order */} - {MRP && } + {MRP && ( + + )} {/* Rate fallback order */} - {Rate && } + {Rate && ( + + )} {/* Quantity fallback order */} - {Quantity && } + {Quantity && ( + + )} {/* Discount fallback order */} - {Discount && } + {Discount && ( + + )} {/* Amount fallback order */} - {Amount && } + {Amount && ( + + )} ))} @@ -194,282 +526,561 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+
+
- <> -
-
-
+
- - - - {/*
+ fontWeight: '600', + }} + > + {/*
Amount :
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
*/} -
+
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
S.NoItemHSNMRPRateQtyDiscAmount + S.No + Item + HSN + + MRP + + Rate + + Qty + + Disc + + Amount +
{rowIndex + 1 + chunkIndex * chunkSize}
+ {rowIndex + 1 + chunkIndex * chunkSize} + {row.ProdName || row.ItemName || row.ProductName || row.Item || row.Name || ""} + {row.ProdName || + row.ItemName || + row.ProductName || + row.Item || + row.Name || + ''} + {row.HSN || row.HSNCode || row.HsnCode || row.Hsn || ""} + {row.HSN || + row.HSNCode || + row.HsnCode || + row.Hsn || + ''} + {row.MRP !== undefined ? Number(row.MRP).toFixed(2) : (row.Mrp !== undefined ? Number(row.Mrp).toFixed(2) : "")} + {row.MRP !== undefined + ? Number(row.MRP).toFixed(2) + : row.Mrp !== undefined + ? Number(row.Mrp).toFixed(2) + : ''} + {row.Rate !== undefined ? Number(row.Rate).toFixed(2) : (row.SaleRate !== undefined ? Number(row.SaleRate).toFixed(2) : "")} + {row.Rate !== undefined + ? Number(row.Rate).toFixed(2) + : row.SaleRate !== undefined + ? Number(row.SaleRate).toFixed(2) + : ''} + {row.SalesQty !== undefined ? Number(row.SalesQty).toFixed(2) : (row.Qty !== undefined ? Number(row.Qty).toFixed(2) : "")} + {row.SalesQty !== undefined + ? Number(row.SalesQty).toFixed(2) + : row.Qty !== undefined + ? Number(row.Qty).toFixed(2) + : ''} + {row.discount !== undefined ? Number(row.discount).toFixed(2) : (row.Disc !== undefined ? Number(row.Disc).toFixed(2) : "")} + {row.discount !== undefined + ? Number(row.discount).toFixed(2) + : row.Disc !== undefined + ? Number(row.Disc).toFixed(2) + : ''} + {row.TotalAmt !== undefined ? Number(row.TotalAmt).toFixed(2) : (row.Amount !== undefined ? Number(row.Amount).toFixed(2) : "")} + {row.TotalAmt !== undefined + ? Number(row.TotalAmt).toFixed(2) + : row.Amount !== undefined + ? Number(row.Amount).toFixed(2) + : ''} +
+ + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+
+ + )} +
+
+
+ {/*
{PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName : "Split"}   Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
*/}
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - + {' '} + Purchase Order No:{' '} + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}{' '}
-
- - } -
-
-
- {/*
{PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName : "Split"}   Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
*/} -
Purchase Order No: {GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
+ {GlobaldummyData &&
Cashier : Cashier Name
} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
Cashier : {CashierName}
+ )} + {GlobaldummyData && ( +
Customer : Customer Name
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Supplier Name : {table2Data?.CustSuppName} +
+ )} - {GlobaldummyData && -
Cashier : Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : {CashierName} -
- } - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Supplier Name : {table2Data?.CustSuppName} -
- } - - {table2Data?.BookingTypeName == 'Dine In' && -
- Waiter : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} -
} - {/*
CARD NO : ********67
+ {table2Data?.BookingTypeName == 'Dine In' && ( +
+ Waiter :{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )} + {/*
CARD NO : ********67
CARD HOLDER : CARD HOLDER NAME
TOTAL SAVING : 100
*/} +
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+ QR Code +
+ {' '} + Scan To Pay{' '} +
+
+ {' '} + ₹{' '} + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}
- {GlobaldummyData ? GlobalQrcodet &&
- QR Code -
Scan To Pay
-
₹ {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
: - (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
- - -
- - {/*
Purchase Order No: {GlobaldummyData ? '5' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)} +
+ {/*
Purchase Order No: {GlobaldummyData ? '5' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} - {/*
Terms & Condition
+ {/*
Terms & Condition
Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy
*/} - - - -
-
- { - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {TermsnAdCondition == true && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} -
-
- {PrintGreeting?.SettingValue === "Y" && -
Thank You
- } - - } +
+ {Notestext && ( +
+

{Notestext}

+ +
+
+ )} + +
+ {TermsnAdCondition == true && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} + + )}
))} @@ -477,19 +1088,20 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte
-
<> @@ -497,14 +1109,15 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte
-
{/*
@@ -516,7 +1129,6 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
*/} - {/*
Amount :
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
@@ -524,202 +1136,409 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) - + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + Total Amount
+ {Number(item.WithOutTaxAmount).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- - } + )}
-
+
{/*
{PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName : "Split"}   Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
*/} -
Purchase Order No : {GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
+
+ {' '} + Purchase Order No :{' '} + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}{' '} +
- {GlobaldummyData && -
Cashier : Cashier Name
+ {GlobaldummyData &&
Cashier : Cashier Name
} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData &&
Cashier : {CashierName}
} + {GlobaldummyData &&
Customer : Customer Name
} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
Supplier Name : {table2Data?.CustSuppName}
+ )} - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : {CashierName} + {table2Data?.BookingTypeName == 'Dine In' && ( +
+ Waiter :{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
- } - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Supplier Name : {table2Data?.CustSuppName} -
- } - - {table2Data?.BookingTypeName == 'Dine In' && -
- Waiter : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} -
} + )} {/*
CARD NO : ********67
CARD HOLDER : CARD HOLDER NAME
TOTAL SAVING : 100
*/}
- {GlobaldummyData ? GlobalQrcodet &&
- QR Code -
Scan To Pay
-
₹ {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
: - (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QR Code +
+ {' '} + Scan To Pay{' '} +
+
+ {' '} + ₹{' '} + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}
-
- {/*
Purchase Order No {GlobaldummyData ? '5' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} {/*
Terms & Condition
@@ -728,50 +1547,114 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte > Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy
*/} - - -
-
- { - Notestext && (
-

{Notestext}

+ {Notestext && ( +
+

{Notestext}


-
) - } +
+ )} - -
- {TermsnAdCondition == true && - (
-

+

+ {TermsnAdCondition == true && ( +
+

Terms & Conditions

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} +
      + {TermsAndConditions?.map((item) => ( +
    1. + {item?.TermsandConditions} +
    2. + ))} {/*
    3. Please check the product before leaving the counter.
    4. */}
    -
) - } - - {Signature == true && (
-

Signature

- -
)} +
+ )} + {Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && -
Thank You
- } + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You{' '} +
+ )}
@@ -783,98 +1666,348 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte id={`PrintStyle10`} style={{ fontFamily: "'Courier New', Courier, monospace" }} > -
-
+
- {GlobaldummyData ? 'ABC Shop' : table2Data?.BrName} {" "} + {GlobaldummyData ? 'ABC Shop' : table2Data?.BrName}{' '}
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} -

- Mobile:+91 {GlobaldummyData ? '8428XXXXXX' : table2Data?.BrMobile} + {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +

+ Mobile:+91{' '} + {GlobaldummyData ? '8428XXXXXX' : table2Data?.BrMobile}

- {table2Data?.OrderType === "E" &&
Estimate
} + {table2Data?.OrderType === 'E' && ( +
Estimate
+ )} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ''} +
+ )}
- -
-
{GlobaldummyData ? formattedDate : Date1}
+
+ {' '} + {GlobaldummyData ? formattedDate : Date1}{' '} +

{ <> - {
Take Away
} + { +
+ Take Away +
+ } - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } + {GlobaldummyData + ? GlobalSlNo && + : SLNO && } + {GlobaldummyData + ? GlobalItem && + : Item && } + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} {productsData?.map((item, index) => { return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && - } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } + : {}), + }} + > + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} - ) + ); })}
S.NS.NItemItemQtyQtyHSNHSNMRPMRPDis Dis RateRateAmtAmtS.NS.NItemItem + Qty + + Qty + + HSN + + HSN + + MRP + + MRP + + Dis{' '} + + Dis{' '} + + Rate + + Rate + + Amt + + Amt +
{index + 1}{index + 1}{item?.ProdName}({item?.Size + item?.UomName}) -
{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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map(item2 => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); +
{item?.SalesQty}{item?.SalesQty}{item?.HSN}{item?.HSN}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Rate}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} + {index + 1} + + {index + 1} + + {item?.ProdName}({item?.Size + item?.UomName}) + +
{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 + ) + )?.map((a) => { + return
{a.SerialNumber}
; + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
+ {item?.SalesQty} + + {item?.SalesQty} + + {item?.HSN} + + {item?.HSN} + + {item?.MRP} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item.discount} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.Rate} + + {item?.Rate} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
} - - - -

-
{/*
@@ -886,7 +2019,6 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
*/} - {/*
Amount :
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
@@ -899,259 +2031,505 @@ const PurchaseOrdStyle10 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilte
{((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) - + + SGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + Total Amount
+ {Number(item.WithOutTaxAmount).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number(item.WithOutTaxAmount).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- - } + )}
-
+
+ {GlobaldummyData &&
Cashier : Cashier Name
} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData &&
Cashier : {CashierName}
} + {GlobaldummyData &&
Customer : Customer Name
} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
Customer : {table2Data?.CustSuppName}
+ )} - {GlobaldummyData && -
Cashier : Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : {CashierName} -
- } - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - - {table2Data?.BookingTypeName == 'Dine In' && -
+ {table2Data?.BookingTypeName == 'Dine In' && ( +
Waiter : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} -
} - {/*
CARD NO : ********67
-
CARD HOLDER : CARD HOLDER NAME
-
TOTAL SAVING : 100
*/} +
+ )}
- {GlobaldummyData ? GlobalQrcodet &&
- QR Code -
Scan To Pay
-
₹ {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
: - (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QR Code +
+ {' '} + Scan To Pay{' '} +
+
+ {' '} + ₹{' '} + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}
-
- -
YOUR ORDER NO: {GlobaldummyData ? '5' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)} +
+ YOUR ORDER NO:{' '} + {GlobaldummyData + ? '5' + : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
- {/*
Terms & Condition
-
- Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy -
*/} - - -
-
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} +
+ {TermsnAdCondition == true && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {TermsnAdCondition == true && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} - + {Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && -
Thank You
- } + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You{' '} +
+ )}
)} - - ); }; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle11.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle11.jsx index d8bdf4f..d84f124 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle11.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle11.jsx @@ -1,8 +1,11 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import QRcode from '../../../Images/QRcode.png'; -import Logo from '../../../Images/Logo.jpg' -import { extractLastNumber, extractLastNumberOrderId } from '../../../Services/Others'; +import Logo from '../../../Images/Logo.jpg'; +import { + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; import { GlobalprintSlNo, GlobalprintItem, @@ -22,82 +25,110 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, } from '../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../Features/BookingScreen/BookingData/BookingData'; -import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.scss"; +import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.scss'; import QRCode from 'react-qr-code'; -import signature from "../../../Images/signatureimage.jpg" +import signature from '../../../Images/signatureimage.jpg'; import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; import { isMobile } from 'react-device-detect'; - -const PurchaseOrdStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, totalQuantityFilter, BranchCity, BranchZip, CashierName, totalQuantity, - OrderDetailGST, OrderDetailIGST, OrderDetailVAT, table2Data, PaymentStatus, PrintGreeting, printDatas }) => { - +const PurchaseOrdStyle11 = ({ + index, + ExtraChargeTotal, + Date1, + base64Image, + totalQuantityFilter, + BranchCity, + BranchZip, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PaymentStatus, + PrintGreeting, + printDatas, +}) => { const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) + const GlobalUpiID = useSelector(GlobalUpiIDprint); // const FieldDetails = useSelector(GloabalFieldDetails); const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; - const GlobalSlNo = useSelector(GlobalprintSlNo) - const GlobalItem = useSelector(GlobalprintItem) - const GlobalMRP = useSelector(GlobalprintMRP) - const GlobalDiscount = useSelector(GlobalprintDiscount) - const GlobalQuantity = useSelector(GlobalprintQuantity) - const GlobalRate = useSelector(GlobalprintRate) - const GlobalAmount = useSelector(GlobalprintAmount) - const GlobalHsnCode = useSelector(GlobalprintHsnCode) - const GlobalQrcodet = useSelector(GlobalprintQrcodet) - const GlobaldummyData = useSelector(GlobalPritdummyData) + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobalQrcodet = useSelector(GlobalprintQrcodet); + const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobalSignature = useSelector(GlobalprintSignature); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); const appPreferences = useSelector(ApplicationPreferences); - const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails - const dinePreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "dine in" && type?.PreferredStatus === 'Y') - const takeAwayPreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "take away" && type?.PreferredStatus === 'Y') - - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; + const bookingTypePreference = appPreferences?.find( + (preference) => preference?.PreferredCatName === 'Booking Type' + )?.PreferenceCatDetails; + const dinePreference = bookingTypePreference?.find( + (type) => + type?.PreferredSubCatName?.toLowerCase() === 'dine in' && + type?.PreferredStatus === 'Y' + ); + const takeAwayPreference = bookingTypePreference?.find( + (type) => + type?.PreferredSubCatName?.toLowerCase() === 'take away' && + type?.PreferredStatus === 'Y' + ); + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; const keysLength = Object.keys(table2Data ?? {}).length; - let PaymentStatusSuccess = PaymentStatus?.filter(ps => ps.PaymentStatus === "S") + let PaymentStatusSuccess = PaymentStatus?.filter( + (ps) => ps.PaymentStatus === 'S' + ); if (keysLength > 0) { dispatch(changeReprintDataFound(true)); } - - const productsData = table2Data?.productDetails || []; - - - - - const chunkSize = isMobile ? 10 : PageSize == "A5" ? 8 : 11; + const chunkSize = isMobile ? 10 : PageSize == 'A5' ? 8 : 11; let dataSource = []; if (GlobaldummyData || productsData?.length > 0) { @@ -111,33 +142,153 @@ const PurchaseOrdStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, total for (let i = 0; i < dataSource.length; i += chunkSize) { paginatedChunks.push(dataSource.slice(i, i + chunkSize)); } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 10 : PageSize == "A5" ? 5 : 10); + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 10 : PageSize == 'A5' ? 5 : 10); + // + 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 + ); + // + 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 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, + }; return ( <> - {FormatTheme ? -
{paginatedChunks.map((dataChunk, chunkIndex) => ( //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "257mm" : "257mm") : "", }} key={chunkIndex}> - - +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '257mm' + : '257mm' + : '', + }} + key={chunkIndex} + > {/*
*/} -
- -
- {base64Image ? image : null} +
+
+ {base64Image ? ( + image + ) : null}
-
+
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
{/*
@@ -146,600 +297,1419 @@ const PurchaseOrdStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, total

-
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
+ {' '} + MOBILE NO :{table2Data?.BrMobile}
-
MOBILE NO :{table2Data?.BrMobile}

-
{GlobaldummyData ? 'CASH' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}
-
Bill No : {GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
+
+ {GlobaldummyData + ? 'CASH' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : ''}{' '} +
+
+ Bill No :{' '} + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +

- -
+
{ <> {/* {takeAwayPreference &&
Take Away
} */} - - {SLNO && } - {Item && } - {Quantity && } - {HsnCode && } - {MRP && } - {Discount && } - {Rate && } - {Amount && } + + {SLNO && ( + + )} + {Item && ( + + )} + {Quantity && ( + + )} + {HsnCode && ( + + )} + {MRP && ( + + )} + {Discount && ( + + )} + {Rate && ( + + )} + {Amount && ( + + )} {dataSource?.map((item, index) => { return ( - - {SLNO && } - {Item && - } - {Quantity && } - {HsnCode && } - {MRP && } - {Discount && } - {Rate && } - {Amount && } + : {}), + }} + > + {SLNO && } + {Item && ( + + )} + {Quantity && ( + + )} + {HsnCode && ( + + )} + {MRP && ( + + )} + {Discount && ( + + )} + {Rate && ( + + )} + {Amount && ( + + )} - ) + ); })}
S.NItemQtyHSNMRPDis RateAmt
+ SL.NO + + Item + + Qty + + HSN + + MRP + + Dis{' '} + + Rate + + Amt +
{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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map((item2, idx) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); +
{item?.SalesQty}{item?.HSN}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}{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 + ) + )?.map((a) => { + return ( +
+ {a.SerialNumber} +
+ ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2, idx) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
+ {item?.SalesQty} + + {item?.HSN} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.Rate} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
} -
- {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - <> -
-
-
-
-
- {/*
Qty
-
Items
*/} - - {/*
SUB TOTAL
-
ROUND OFF
*/} -
-
- {/*
{GlobaldummyData ? '9' : calculatedTotalQuantity}
-
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
*/} - - {/*
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount) ? Number(table2Data?.NetAmount) : 0}
*/} - {/*
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
*/} + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+
+
+
+
+
- - {/*
Amount :{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}/-
*/}
-
-
+
-
-
- -
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => +
+
+
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- - + + - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + CGST ( + {OrderDetailGST?.[0] + ?.TaxPercentage / 2} + %) + + SGST ( + {OrderDetailGST?.[0] + ?.TaxPercentage / 2} + %) + + Total Amount {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} - - - Taxable Amount - - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - + + {OrderDetailIGST?.map((item) => ( + + + - Total Amount - - - {OrderDetailVAT?.map((item) => - - - + + + ))} +
+ Taxable Amount + + IGST ( + { + OrderDetailIGST?.[0] + ?.TaxPercentage + } + %) + + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} +
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - + {Number(item.TotalAmt).toFixed( + 2 + )} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - - - ) - } -
+ Taxable Amount + + VAT ( + { + OrderDetailVAT?.[0] + ?.TaxPercentage + } + %) + {Number(item.TotalAmt).toFixed(2)}
- - } + + Total Amount + + + {OrderDetailVAT?.map((item) => ( + + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed( + 2 + )} + + + ))} + + + )} +
+
+ + )} +
+
+
+
+ +
+
+ {GlobaldummyData && ( +
+ {' '} + Cashier : Cashier Name +
+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+ Cashier : {CashierName} +
+ )} + + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} + +
+ {Date1} +
+
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0}
-
- - } +
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} +
+
+ +
+ {Notestext && ( +
+

{Notestext}

+ +
+ )} + +
+ {TermsnAdCondition == true && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {Signature == true && ( +
+

+ Signature +

+ +
+ )}
-
-
- -
- - {GlobaldummyData && -
Cashier : Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : {CashierName} + {PrintGreeting?.SettingValue === 'Y' && ( +
+
+ Thank You{' '}
- } - - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - -
{Date1}
- {/*
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} -
- {GlobaldummyData ? GlobalQrcodet &&
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
-
- : - (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
-
- - -
- { - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {TermsnAdCondition == true && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} - -
-
- - {PrintGreeting?.SettingValue === "Y" && -
-
Thank You
-
- } - - - } - +
+ )} + + )}
))} - {shouldFooterBeOnNewPage && FormatTheme && + {shouldFooterBeOnNewPage && FormatTheme && (
-
<>
-
+
-
-
- {/*
Qty
-
Items
*/} - - {/*
SUB TOTAL
-
ROUND OFF
*/} -
-
- {/*
{GlobaldummyData ? '9' : calculatedTotalQuantity}
-
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
*/} - - {/*
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount) ? Number(table2Data?.NetAmount) : 0}
*/} - {/*
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
*/} -
+
+
+
- {(DineInData?.length > 0 && TakeawayData?.length > 0 && takeAwayPreference) && -
TakeAway :{Number(TakeawayTotal).toFixed(2)}/-
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && dinePreference) && -
DineIn :{Number(DineInTotal).toFixed(2)}/-
- } + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + takeAwayPreference && ( +
+ TakeAway :{Number(TakeawayTotal).toFixed(2)}/- +
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + dinePreference && ( +
+ DineIn :{Number(DineInTotal).toFixed(2)}/- +
+ )} {/*
Amount :{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}/-
*/}

-
+
- -
+
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +
+

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) - + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + Total Amount
- {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ( + { + OrderDetailIGST?.[0] + ?.TaxPercentage + } + %) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- } + )}
-
-
{PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : "Split"}  Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
+
+
+ {PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : 'Split'}{' '} +  Payment :   + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} + /-{' '} +
-
- -
- - {GlobaldummyData && -
Cashier : Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : {CashierName} +
+
+ {GlobaldummyData && ( +
+ {' '} + Cashier : Cashier Name
- } + )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+ Cashier : {CashierName} +
+ )} - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name
- } + )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} - - -
{Date1}
- {/*
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} +
+ {Date1} +
- {GlobaldummyData ? GlobalQrcodet &&
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
-
- : - (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}

- -
- { - Notestext && (
-

{Notestext}

+ {Notestext && ( +
+

{Notestext}


-
) - } +
+ )} +
+ {TermsnAdCondition == true && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {TermsnAdCondition == true && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} - + {Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && -
-
Thank You
+ {PrintGreeting?.SettingValue === 'Y' && ( +
+
+ Thank You{' '} +
- } - + )}
- } -
- : -
+ ) : ( +
-
- {base64Image ? image : null} +
+ {base64Image ? ( + image + ) : null}
-
+
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
{/*
@@ -748,84 +1718,382 @@ const PurchaseOrdStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, total

-
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
+ {' '} + MOBILE NO :{table2Data?.BrMobile}
-
MOBILE NO :{table2Data?.BrMobile}

-
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
-
Bill No : {GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
+
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ''} +
+
+ Bill No :{' '} + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +

{ <> - {
Take Away
} + { +
+ Take Away +
+ } - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} {dataSource?.map((item, index) => { return ( - - {SLNO && } - {Item && - } - {Quantity && } - {HsnCode && } - {MRP && } - {Discount && } - {Rate && } - {Amount && } + : {}), + }} + > + {SLNO && } + {Item && ( + + )} + {Quantity && ( + + )} + {HsnCode && ( + + )} + {MRP && ( + + )} + {Discount && ( + + )} + {Rate && ( + + )} + {Amount && ( + + )} - ) + ); })}
S.NS.NItemItemQtyQtyHSNHSNMRPMRPDis Dis RateRateAmtAmt
+ SL.NO + + SL.NO + + Item + + Item + + Qty + + Qty + + HSN + + HSN + + MRP + + MRP + + Dis{' '} + + Dis{' '} + + Rate + + Rate + + Amt + + Amt +
{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)) - ?.map((a, idx) => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map((item2, idx) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); +
{item?.SalesQty}{item?.HSN}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}{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 + ) + )?.map((a, idx) => { + return ( +
+ {a.SerialNumber} +
+ ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || item1.IMEI2 !== '' + )?.map((item2, idx) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
+ {item?.SalesQty} + {item?.HSN} + {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + {item?.Rate} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
} - - - -
-
+
-
-
+
+
{/*
Qty
Items
*/} {/*
SUB TOTAL
ROUND OFF
*/}
-
+
{/*
{GlobaldummyData ? '9' : calculatedTotalQuantity}
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
*/} @@ -833,235 +2101,487 @@ const PurchaseOrdStyle11 = ({ index, ExtraChargeTotal, Date1, base64Image, total {/*
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
*/}
- - - {/*
Amount :{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}/-
*/}

-
+
- -
+
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +
+

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) - + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + Total Amount
+ {Number(item.WithOutTaxAmount).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- } + )}
-
- {/*
-
CARD : *********12
-
CARD HOLDER : CARD HOLDER NAME
-
TOTAL SAVING : 0.00
-
*/} -
- - {GlobaldummyData && -
Cashier : Cashier Name
- - } - - - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} +
+
+ {GlobaldummyData && ( +
+ {' '} + Cashier : Cashier Name
- } + )} -
{Date1}
+ {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} + +
+ {Date1} +
{/*
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/}
- {GlobaldummyData ? GlobalQrcodet &&
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2) ? Number(table2Data?.NetAmount).toFixed(2) : 0}
-
- : - (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2) + ? Number(table2Data?.NetAmount).toFixed(2) + : 0} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}

- -
- { - Notestext && (
-

{Notestext}

+ {Notestext && ( +
+

{Notestext}


-
) - } +
+ )} +
+ {TermsnAdCondition == true && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {TermsnAdCondition == true && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == ture && (
-

Signature

- -
)} - + {Signature == ture && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && -
+ {PrintGreeting?.SettingValue === 'Y' && ( +
{/*
Terms & Condition
Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy
*/} -
Thank You
+
+ Thank You +
- } - + )}
- - - -
- } - +
+ )} ); }; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle12.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle12.jsx index b8d7afa..db94bad 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle12.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle12.jsx @@ -1,6 +1,9 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { extractLastNumber, extractLastNumberOrderId } from '../../../Services/Others'; +import { + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; import { GlobalprintSlNo, GlobalprintItem, @@ -20,69 +23,89 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableBodyFontColor, + GlobalSelectedFooterColor, + GlobalRowType, + GlobalSelectedFooterFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableHeaderFontColor, } from '../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../Features/BookingScreen/BookingData/BookingData'; import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.scss'; -import signature from "../../../Images/signatureimage.jpg" +import signature from '../../../Images/signatureimage.jpg'; import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; import { isMobile } from 'react-device-detect'; - -const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, totalQuantityFilter, CashierName, totalQuantity, OrderDetailGST, OrderDetailIGST, - OrderDetailVAT, table2Data, PrintGreeting, printDatas }) => { - +const PurchaseOrdStyle12 = ({ + index, + ExtraChargeTotal, + Date1, + base64Image, + totalQuantityFilter, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PrintGreeting, + printDatas, +}) => { const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) + const GlobalUpiID = useSelector(GlobalUpiIDprint); // const FieldDetails = useSelector(GloabalFieldDetails); const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); - const GlobalSlNo = useSelector(GlobalprintSlNo) - const GlobalItem = useSelector(GlobalprintItem) - const GlobalMRP = useSelector(GlobalprintMRP) - const GlobalDiscount = useSelector(GlobalprintDiscount) - const GlobalQuantity = useSelector(GlobalprintQuantity) - const GlobalRate = useSelector(GlobalprintRate) - const GlobalAmount = useSelector(GlobalprintAmount) - const GlobalHsnCode = useSelector(GlobalprintHsnCode) - - const GlobaldummyData = useSelector(GlobalPritdummyData) + const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobalSignature = useSelector(GlobalprintSignature); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); const appPreferences = useSelector(ApplicationPreferences); - const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails - - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; + const bookingTypePreference = appPreferences?.find( + (preference) => preference?.PreferredCatName === 'Booking Type' + )?.PreferenceCatDetails; + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; const keysLength = Object.keys(table2Data ?? {}).length; const printDocument = () => { window.print(); - } + }; if (keysLength > 0) { dispatch(changeReprintDataFound(true)); @@ -90,25 +113,25 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total const productsData = table2Data?.productDetails || []; - - - const chunkSize = isMobile ? 10 : PageSize == "A5" ? 8 : 11; + const chunkSize = isMobile ? 10 : PageSize == 'A5' ? 8 : 11; let dataSource = []; if (productsData?.length > 0) { dataSource = productsData; - } - else { + } else { dataSource = productsData; } - const paginatedChunks = []; for (let i = 0; i < dataSource.length; i += chunkSize) { paginatedChunks.push(dataSource.slice(i, i + chunkSize)); } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 10 : PageSize == "A5" ? 5 : 10); + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 10 : PageSize == 'A5' ? 5 : 10); const style12 = ``; const PrintA4 = async () => { - - await printDiv("PrintStyle12", style12, 'FontApply'); + await printDiv('PrintStyle12', style12, 'FontApply'); }; const purchaseData = table2Data?.productDetails || []; const calculatedTotalQuantity = purchaseData?.reduce((total, item) => { return total + (Number(item?.SalesQty) || 0); }, 0); + + // + 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 + ); + + // + 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 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, + }; + return ( <> - {FormatTheme ? -
- + {FormatTheme ? ( +
{paginatedChunks.map((dataChunk, chunkIndex) => ( //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "257mm" : "257mm") : "", }} key={chunkIndex}> - - +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '257mm' + : '257mm' + : '', + }} + key={chunkIndex} + > {/*
*/} -
+
+
+
+
-
- -
-
- -
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : ''} +
+
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
-
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : ""}
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
+ {GlobaldummyData && ( +

+ {' '} + Cashier : Cashier Name +

+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+ Cashier : {CashierName} +
+ )} - {GlobaldummyData && -

Cashier : Cashier Name

- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : {CashierName} + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name
- } - - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Supplier name : {table2Data?.CustSuppName} -
- } - + )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Supplier name : {table2Data?.CustSuppName} +
+ )}
-
-
-
Purchase Order : {GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{Date1}
+
+
+ Purchase Order :{' '} + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+ {Date1} +
-
+
{ <>
- {SLNO && } - {Item && } - {Quantity && } - {MRP && } - {Rate && } - {HsnCode && } - {Discount && } - {Amount && } + {SLNO && ( + + )} + {Item && ( + + )} + {Quantity && ( + + )} + {MRP && ( + + )} + {Rate && ( + + )} + {HsnCode && ( + + )} + {Discount && ( + + )} + {Amount && ( + + )} - {console.log('dataChunk', dataChunk) - } + {console.log('dataChunk', dataChunk)} {dataChunk.map((item, index) => ( - - {SLNO && } - {Item && - + {SLNO && ( + + )} + {Item && ( + } - {Quantity && } - {MRP && } - {Rate && } - {HsnCode && } - {Discount && } - {Amount && } +
+ ({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 + ) + )?.map((a) => { + return ( +
+ {a.SerialNumber} +
+ ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2, idx) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+ + )} + {Quantity && ( + + )} + {MRP && ( + + )} + {Rate && ( + + )} + {HsnCode && ( + + )} + {Discount && ( + + )} + {Amount && ( + + )} ))} @@ -362,13 +724,23 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total } - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - <> - - {/*
*/} -
-
- {/*
+ {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> + {/*
*/} +
+
+ {/*
Items
@@ -387,7 +759,7 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total
*/} - {/*
+ {/*
Extra Charges
@@ -397,135 +769,276 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total
*/} - {/*
*/} + {/*
*/} - - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && -
S.NoDescriptionQtyMRPRateHSN(%)AmtS.No + Description + + Qty + + MRP + + Rate + + HSN + + (%) + + Amt +
{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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map((item2, idx) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); - } - ) : ""}
-
{item?.SalesQty}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item?.Rate}{item?.HSN}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} + {item?.SalesQty} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item?.Rate} + + {item?.HSN} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
- - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- - + + - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + Total Amount {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} - - - Taxable Amount - - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - + + {OrderDetailIGST?.map((item) => ( + + + - Total Amount - - - {OrderDetailVAT?.map((item) => - - - + + + ))} +
+ Taxable Amount + + IGST ( + { + OrderDetailIGST?.[0] + ?.TaxPercentage + } + %) + + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} +
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - - - ) - } -
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage} + %) + {Number(item.TotalAmt).toFixed(2)}
- - } + + Total Amount + + + {OrderDetailVAT?.map((item) => ( + + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + -
- - } -
+ + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} +
+ + )} +
- {/*
*/} + {/*
*/} -
- - -
- {/*
+
+ {/*
Recived Amt
@@ -543,96 +1056,153 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total 0.00
*/} - -
-
- - -
- -
- -
- {/*
Your Order No: {GlobaldummyData ? '53' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} - +
+
- -
- - -
- { - Notestext && (
-

{Notestext}

- -
-
) - } - -
- {(
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map((item, index) =>
  1. {item?.TermsandConditions}
  2. )} -
-
) - } - - {(
-

Signature

- -
)} - +
+
+ {/*
Your Order No: {GlobaldummyData ? '53' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} +
-
- {PrintGreeting?.SettingValue === "Y" && -
- Thank You +
+ {Notestext && ( +
+

{Notestext}

+ +
+
+ )} + +
+ { +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item, index) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
+ } + + { +
+

+ Signature +

+ +
+ } +
- } - - } + {PrintGreeting?.SettingValue === 'Y' && ( +
Thank You
+ )} + + )}
))} - - {shouldFooterBeOnNewPage && FormatTheme && + {shouldFooterBeOnNewPage && FormatTheme && (
-
<> -
-
-
+
+
{/*
Items @@ -664,132 +1234,267 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total {/*
*/} - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2} + %) - + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2} + %) + Total Amount
- {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage} + %) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}
- } + )}
{/*
*/} -
- - -
+
{/*
Recived Amt @@ -808,136 +1513,319 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total 0.00
*/} -
-
-
- -
+
+
{/*
Your Order No: {GlobaldummyData ? '53' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} -
- - -
- -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition === true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map((item, index) =>
  1. {item?.TermsandConditions}
  2. )} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable + or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition === true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item, index) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
+ )} + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && -
- Thank -
- } + {PrintGreeting?.SettingValue === 'Y' && ( +
Thank
+ )}
- } - + )}
- - - : -
-
- + ) : ( +
+
{/*

{table2Data?.BrName}

*/} -
-
+
+
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
- {GlobaldummyData && -

Cashier : Cashier Name

+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+ {GlobaldummyData && ( +

+ {' '} + Cashier : Cashier Name +

+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+ Cashier : {CashierName} +
+ )} - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : {CashierName} + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name
- } + )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Supplier Name : {table2Data?.CustSuppName} +
+ )} - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Supplier Name : {table2Data?.CustSuppName} + {table2Data?.OrderType === 'E' && ( +
+ Estimate{' '}
- } - - - {table2Data?.OrderType === "E" &&
Estimate
} + )}
-
{/*

{table2Data?.PaymentTypeName}  Payment :  {Number(table2Data?.NetAmount).toFixed(2)}/-

*/} -
-
Purchase Order No : {GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{Date1}
+
+
+ Purchase Order No :{' '} + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+ {Date1} +
{/*
*/} @@ -947,46 +1835,292 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalAmount && : Amount && } + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && } + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && } + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} {productsData?.map((item, index) => { return ( + + {GlobaldummyData + ? GlobalSlNo && + : SLNO && } + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && - } - - - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalAmount && : Amount && } + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} - ) + ); })}
S.NoS.NoDescriptionDesQtyQtyMRPMRPRateRateHSNHSN(%)(%)AmtAmtS.NoS.NoDescriptionDes + Qty + + Qty + + MRP + + MRP + + Rate + + Rate + + HSN + + HSN + + (%) + + (%) + + Amt + + Amt +
{index + 1}{index + 1}{item?.ProdName} +
{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 + ) + )?.map((a) => { + return
{a.SerialNumber}
; + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
{index + 1}{index + 1}{item?.ProdName} -
{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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map(item2 => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); - } - ) : ""}
-
{item?.SalesQty}{item?.SalesQty}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item?.Rate}{item?.Rate}{item?.HSN}{item?.HSN}{item?.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} + {item?.SalesQty} + + {item?.SalesQty} + + {item?.MRP} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item?.Rate} + + {item?.Rate} + + {item?.HSN} + + {item?.HSN} + + {item?.discount} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
@@ -994,8 +2128,17 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total }
-
-
+
+
{/*
Items @@ -1025,81 +2168,125 @@ const PurchaseOrdStyle12 = ({ index, ExtraChargeTotal, Date1, base64Image, total
*/} - - - - {/*
*/} -
- - -
- - +
-
-
- -
+
+
{/*
Your Order No: {GlobaldummyData ? '53' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} -
- -
- -
- { - Notestext && (
-

{Notestext}

+ {Notestext && ( +
+

{Notestext}


-
) - } +
+ )} -
- {(
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map((item, index) =>
  1. {item?.TermsandConditions}
  2. )} -
-
) +
+ { +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item, index) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
} - {(
-

Signature

- -
)} - + { +
+

+ Signature +

+ +
+ }
- {PrintGreeting?.SettingValue === "Y" && -
- Thank You -
- } + {PrintGreeting?.SettingValue === 'Y' && ( +
Thank You
+ )} {/*
print
*/}
- } - + )} - ) -} + ); +}; -export default PurchaseOrdStyle12 +export default PurchaseOrdStyle12; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle2.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle2.jsx index 0fb816b..b962086 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle2.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle2.jsx @@ -1,539 +1,936 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; -import { extractLastNumberOrderId } from "../../../Services/Others"; +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { extractLastNumberOrderId } from '../../../Services/Others'; +import { extractLastNumber } from '../../../Services/Others'; import { - extractLastNumber, -} from "../../../Services/Others"; -import { - GlobalprintSlNo, - GlobalprintItem, - GlobalprintMRP, - GlobalprintDiscount, - GlobalprintQuantity, - GlobalprintRate, - GlobalprintAmount, - GlobalprintHsnCode, - GlobalPritdummyData, - changeReprintDataFound, - GloabalFieldDetails, - GlobalprintSignature, - GlobalprinttermsAndConditions, - GlobalSignatureImage, - Globalnotes, - GlobalthemeFormat, - GlobalBillName, -} from "../../../Features/ThemeChange/ThemeChange"; -import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.scss"; -import signature from "../../../Images/signatureimage.jpg"; -import { isMobile } from "react-device-detect"; + GlobalprintSlNo, + GlobalprintItem, + GlobalprintMRP, + GlobalprintDiscount, + GlobalprintQuantity, + GlobalprintRate, + GlobalprintAmount, + GlobalprintHsnCode, + GlobalPritdummyData, + changeReprintDataFound, + GloabalFieldDetails, + GlobalprintSignature, + GlobalprinttermsAndConditions, + GlobalSignatureImage, + Globalnotes, + GlobalthemeFormat, + GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, +} from '../../../Features/ThemeChange/ThemeChange'; +import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.scss'; +import signature from '../../../Images/signatureimage.jpg'; +import { isMobile } from 'react-device-detect'; const PurchaseOrdStyle2 = ({ - index, - totalQuantityFilter, - Date1, - totalQuantity, - table2Data, - PrintLogo, - PrintGreeting, - printDatas, + index, + totalQuantityFilter, + Date1, + totalQuantity, + table2Data, + PrintLogo, + PrintGreeting, + printDatas, }) => { - const dispatch = useDispatch(); + const dispatch = useDispatch(); - const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { + const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - // const FieldDetails = useSelector(GloabalFieldDetails); + // const FieldDetails = useSelector(GloabalFieldDetails); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo); - const GlobalItem = useSelector(GlobalprintItem); - const GlobalMRP = useSelector(GlobalprintMRP); - const GlobalDiscount = useSelector(GlobalprintDiscount); - const GlobalQuantity = useSelector(GlobalprintQuantity); - const GlobalRate = useSelector(GlobalprintRate); - const GlobalAmount = useSelector(GlobalprintAmount); - const GlobalHsnCode = useSelector(GlobalprintHsnCode); - const GlobaldummyData = useSelector(GlobalPritdummyData); - const GlobalSignature = useSelector(GlobalprintSignature); - const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); - const GlobalSignatureImages = useSelector(GlobalSignatureImage); - const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobaldummyData = useSelector(GlobalPritdummyData); + const GlobalSignature = useSelector(GlobalprintSignature); + const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); + const GlobalSignatureImages = useSelector(GlobalSignatureImage); + const GlobalIsnotes = useSelector(Globalnotes); + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; - const keysLength = Object.keys(table2Data ?? {}).length; - if (keysLength > 0) { - dispatch(changeReprintDataFound(true)); - } - const currentDate = new Date(); - const day = currentDate.getDate().toString().padStart(2, "0"); - const monthNames = [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", - ]; - const monthIndex = currentDate.getMonth(); - const year = currentDate.getFullYear().toString().slice(-2); - const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; + const keysLength = Object.keys(table2Data ?? {}).length; + if (keysLength > 0) { + dispatch(changeReprintDataFound(true)); + } + const currentDate = new Date(); + const day = currentDate.getDate().toString().padStart(2, '0'); + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; + const monthIndex = currentDate.getMonth(); + const year = currentDate.getFullYear().toString().slice(-2); + const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - // Use purchase order product details - - const purchaseData = table2Data?.productDetails || []; - const chunkSize = isMobile ? 16 : PageSize == "A5" ? 11 : 16; - const paginatedChunks = []; - for (let i = 0; i < purchaseData.length; i += chunkSize) { - paginatedChunks.push(purchaseData.slice(i, i + chunkSize)); - } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > ( PageSize == "A5" ? 5 : 13); -; + // Use purchase order product details - return ( - <> - {FormatTheme ? -
- {paginatedChunks.map((dataChunk, chunkIndex) => ( - //
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", height: FormatTheme ? PageSize == "A5" ? '170mm' : "257mm" : "", }} key={chunkIndex}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "257mm" : "257mm") : "", }} key={chunkIndex}> - {/*
*/} -
-
-
- {/* Logo can be added here if needed */} -
-
-
{table2Data?.BrName}
-
{(table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')}
-
Mobile : +91 {table2Data?.BrMobile}
-
-
-
{BillName ? BillName : "Purchase Order"}
-
-
-
Order No : {table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
-
{Date1}
-
-
-
-
- - - - {SLNO && } - {Item && } - {HsnCode && } - {Quantity && } - {MRP && } - {Amount && } - {Discount && } - {Rate && } - - - - {dataChunk.map((item, idx) => ( - - {SLNO == true&& } - {Item== true&& } - {HsnCode == true&& } - {Quantity== true&& } - {MRP== true && } - {Amount== true && } - {Discount == true&& } - {Rate== true&& } - - ))} - -
S.NoItemHSNQtyMRPAmtDis Rate
{chunkIndex * chunkSize + idx + 1}{item?.ProdName}{item?.HSN}{item?.SalesQty}{item?.MRP}{item?.TotalAmt}{item?.discount || 0}{item?.Rate}
-
+ const purchaseData = table2Data?.productDetails || []; + const chunkSize = isMobile ? 16 : PageSize == 'A5' ? 11 : 16; + const paginatedChunks = []; + for (let i = 0; i < purchaseData.length; i += chunkSize) { + paginatedChunks.push(purchaseData.slice(i, i + chunkSize)); + } + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 13); -
- {/* Notes Section */} - {Notestext && ( -
-

{Notestext}

-
-
- )} + // + 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 + ); - {/* Terms & Conditions and Signature */} -
- {/* Terms & Conditions */} - { TermsnAdCondition == true && TermsAndConditions?.length > 0 && ( -
-

- Terms & Conditions -

-
    - { TermsnAdCondition == true && TermsAndConditions.map((item, idx) => ( -
  1. - {item?.TermsandConditions} -
  2. - ))} -
-
- )} + // + 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; - {/* Signature */} - { Signature == true && ( -
-

- Signature -

- -
- )} -
+ // + const headerStyle = { + backgroundColor: GlobaldummyData + ? SelectedHeaderColor + : headerColor?.background, - {/* Thank You Message */} - {PrintGreeting?.SettingValue === "Y" && ( -
- Thank You -
- )} -
-
- ))} + 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, + }; + + return ( + <> + {FormatTheme ? ( +
+ {paginatedChunks.map((dataChunk, chunkIndex) => ( + //
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", height: FormatTheme ? PageSize == "A5" ? '170mm' : "257mm" : "", }} key={chunkIndex}> +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '257mm' + : '257mm' + : '', + }} + key={chunkIndex} + > + {/*
*/} +
+
+
+ {/* Logo can be added here if needed */} +
+
+
+ {table2Data?.BrName} +
+
+ {(table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
Mobile : +91 {table2Data?.BrMobile}
+
- : -
-
-
- {GlobaldummyData ? "XYZ Shop" : table2Data?.BrName} -
-
- {GlobaldummyData - ? "BranchAddress, Town- 635XXX City - State" - : (table2Data?.AddressDetails?.[0]?.Address1 || "") + - (table2Data?.AddressDetails?.[0]?.City - ? (table2Data?.AddressDetails?.[0]?.Address1 && - table2Data?.AddressDetails?.[0]?.City - ? "-" - : "") + table2Data?.AddressDetails?.[0]?.City - : "") + - (table2Data?.AddressDetails?.[0]?.Zip - ? (table2Data?.AddressDetails?.[0]?.City && - table2Data?.AddressDetails?.[0]?.Zip - ? "-" - : "") + table2Data?.AddressDetails?.[0]?.Zip - : "")} -
-
- Mobile : +91 {GlobaldummyData ? "986XXXXXXX" : table2Data?.BrMobile} -
-
- {GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Purchase Order" : BillName ? BillName : "Purchase Order"} -
+
+ {BillName ? BillName : 'Purchase Order'} +
+
+
+
+ Order No :{' '} + {table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
+
+
+ {Date1} +
+
+
+
+
+ + + + {SLNO && ( + + )} + {Item && } + {HsnCode && ( + + )} + {Quantity && ( + + )} + {MRP && ( + + )} + {Amount && ( + + )} + {Discount && ( + + )} + {Rate && ( + + )} + + + + {dataChunk.map((item, idx) => ( + + {SLNO == true && ( + + )} + {Item == true && } + {HsnCode == true && } + {Quantity == true && } + {MRP == true && } + {Amount == true && } + {Discount == true && } + {Rate == true && } + + ))} + +
+ S.No + Item + HSN + + Qty + + MRP + + Amt + + Dis{' '} + + Rate +
{chunkIndex * chunkSize + idx + 1}{item?.ProdName}{item?.HSN}{item?.SalesQty}{item?.MRP}{item?.TotalAmt}{item?.discount || 0}{item?.Rate}
+
-
+
+ {/* Notes Section */} + {Notestext && ( +
+

{Notestext}

+
+
+ )} -
-
- {table2Data?.CustSuppName && - table2Data?.CustSuppName !== undefined && - table2Data?.CustSuppName !== null && - !GlobaldummyData && ( -
- Supplier : {table2Data?.CustSuppName} -
- )} -
- Order No: - {GlobaldummyData - ? "PO001" - : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} -
-
- -
-
- Date : {GlobaldummyData ? formattedDate : Date1} -
-
-
- -
- -
- - - - {GlobaldummyData - ? GlobalSlNo && - : SLNO == true && } - {GlobaldummyData - ? GlobalItem && - : Item == true && } - {GlobaldummyData - ? GlobalHsnCode && - : HsnCode == true && ( - - )} - {GlobaldummyData - ? GlobalQuantity && - : Quantity == true && ( - - )} - {GlobaldummyData - ? GlobalMRP && - : MRP == true && } - {GlobaldummyData - ? GlobalRate && - : Rate == true && } - {GlobaldummyData - ? GlobalAmount && ( - - ) - : Amount == true && ( - - )} - - - - {purchaseData?.map( - (item, index) => ( - - {GlobaldummyData - ? GlobalSlNo && ( - - ) - : SLNO == true && ( - - )} - {GlobaldummyData - ? GlobalItem && - : Item == true && ( - - )} - {GlobaldummyData - ? GlobalHsnCode && ( - - ) - : HsnCode == true && ( - - )} - {GlobaldummyData - ? GlobalQuantity && ( - - ) - : Quantity == true && ( - - )} - {GlobaldummyData - ? GlobalMRP && ( - - ) - : MRP == true && ( - - )} - {GlobaldummyData - ? GlobalRate && ( - - ) - : Rate == true && ( - - )} - {GlobaldummyData - ? GlobalAmount && ( - - ) - : Amount == true && ( - - )} - - ) - )} - -
S.NoS.NoItemItemHSNHSNQtyQtyMRPMRPRateRate - Amt - - Amt -
- {index + 1} - - {index + 1} - {item?.ProdName} -
{item?.ProdName}
-
- {item?.Size ? item?.Size : "1"}{" "} - {item?.SinglePc == "Y" - ? "PCS" - : item?.Type != "C" - ? item?.UomName - : "COMBO"} -
-
- {item?.HSN} - - {item?.HSN} - - {item?.SalesQty} - - {item?.SalesQty} - - {item?.MRP} - - {item?.SinglePc === "Y" - ? item?.Rate - : item?.MRP} - - {item?.Rate} - - {item?.Rate} - - {item?.TotalAmt} - - {item?.TotalAmt} -
-
- -
-
- -
- - - - - -
- -
- { - Notestext && (
-

{Notestext}

-
-
) - } - -
- {(
-

- Terms & Conditions -

-
    - { TermsnAdCondition == true && TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} - -
-
- - {PrintGreeting?.SettingValue === "Y" && ( -
- Thank You -
+ {/* Terms & Conditions and Signature */} +
+ {/* Terms & Conditions */} + {TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsnAdCondition == true && + TermsAndConditions.map((item, idx) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
)} + {/* Signature */} + {Signature == true && ( +
+

+ Signature +

+ +
+ )}
- } - - ); + + {/* Thank You Message */} + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} +
+
+ ))} +
+ ) : ( +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
+ Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Purchase Order' + : BillName + ? BillName + : 'Purchase Order'} +
+
+ +
+ +
+
+ {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Supplier : {table2Data?.CustSuppName} +
+ )} +
+ Order No: + {GlobaldummyData + ? 'PO001' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+ +
+
+ Date : {GlobaldummyData ? formattedDate : Date1} +
+
+
+ +
+ +
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO == true && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item == true && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode == true && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity == true && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP == true && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate == true && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + + + {purchaseData?.map((item, index) => ( + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO == true && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item == true && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode == true && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity == true && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP == true && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate == true && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + ))} + +
+ S.No + + S.No + ItemItem + HSN + + HSN + + Qty + + Qty + + MRP + + MRP + + Rate + + Rate + + Amt + + Amt +
{index + 1}{index + 1}{item?.ProdName} +
{item?.ProdName}
+
+ {item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} +
+
{item?.HSN}{item?.HSN} + {item?.SalesQty} + + {item?.SalesQty} + {item?.MRP} + {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} + {item?.Rate}{item?.Rate} + {item?.TotalAmt} + + {item?.TotalAmt} +
+
+ +
+
+ +
+ +
+ {Notestext && ( +
+

{Notestext}

+
+
+ )} + +
+ { +
+

+ Terms & Conditions +

+
    + {TermsnAdCondition == true && + TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
+ } + + {Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} +
+ )} + + ); }; export default PurchaseOrdStyle2; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle3.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle3.jsx index 27f3001..54fc7aa 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle3.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle3.jsx @@ -1,8 +1,8 @@ -import React from "react"; -import { useSelector } from "react-redux"; -import signature from "../../../Images/signatureimage.jpg"; +import React from 'react'; +import { useSelector } from 'react-redux'; +import signature from '../../../Images/signatureimage.jpg'; import { - GlobalprintSlNo, + GlobalprintSlNo, GlobalprintItem, GlobalprintMRP, GlobalprintDiscount, @@ -20,10 +20,22 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, -} from "../../../Features/ThemeChange/ThemeChange"; -import { useDispatch } from "react-redux"; -import { extractLastNumber, extractLastNumberOrderId } from "../../../Services/Others"; -import { isMobile } from "react-device-detect"; + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, +} from '../../../Features/ThemeChange/ThemeChange'; +import { useDispatch } from 'react-redux'; +import { + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; +import { isMobile } from 'react-device-detect'; const PurchaseOrdStyle3 = ({ index, @@ -38,923 +50,2659 @@ const PurchaseOrdStyle3 = ({ PrintLogo, PrintGreeting, printDatas, - }) => { - - const dispatch = useDispatch(); - // const FieldDetails = useSelector(GloabalFieldDetails); - const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { + const dispatch = useDispatch(); + // const FieldDetails = useSelector(GloabalFieldDetails); + const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - console.log(table2Data,'table2Data?.BrMobile'); - - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo); - const GlobalItem = useSelector(GlobalprintItem); - const GlobalMRP = useSelector(GlobalprintMRP); - const GlobalDiscount = useSelector(GlobalprintDiscount); - const GlobalQuantity = useSelector(GlobalprintQuantity); - const GlobalRate = useSelector(GlobalprintRate); - const GlobalAmount = useSelector(GlobalprintAmount); - const GlobalHsnCode = useSelector(GlobalprintHsnCode); - const GlobalQrcodet = useSelector(GlobalprintQrcodet); - const GlobaldummyData = useSelector(GlobalPritdummyData); - const GlobalSignature = useSelector(GlobalprintSignature); - const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); - const GlobalSignatureImages = useSelector(GlobalSignatureImage); - const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) + console.log(table2Data, 'table2Data?.BrMobile'); - - console.log(printDatas, "GlobalthemeFormatr"); - - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; - - - - const keysLength = Object.keys(table2Data ?? {}).length; - if (keysLength > 0) { - dispatch(changeReprintDataFound(true)); - } - const currentDate = new Date(); - const day = currentDate.getDate().toString().padStart(2, '0'); - const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - const monthIndex = currentDate.getMonth(); - const year = currentDate.getFullYear().toString().slice(-2); - - const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - - const purchaseData = table2Data?.productDetails || []; - // Calculate SalesWiseOffers total amount - - const products = [ - { ProdName: 'ITEM 1', Rate: 88.00, SalesQty: 2, MRP: 100, TotalAmt: 176, discount: 0, HSN: '01' }, - { ProdName: 'ITEM 2', Rate: 300.00, SalesQty: 1, MRP: 350, TotalAmt: 300, discount: 0, HSN: '02' }, - { ProdName: 'ITEM 3', Rate: 200.00, SalesQty: 1, MRP: 250, TotalAmt: 200, discount: 0, HSN: '03' }, - { ProdName: 'ITEM 4', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '04' }, - { ProdName: 'ITEM 5', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '05' }, - { ProdName: 'ITEM 6', Rate: 130.00, SalesQty: 1, MRP: 150, TotalAmt: 130, discount: 0, HSN: '06' }, - { ProdName: 'ITEM 7', Rate: 230.00, SalesQty: 1, MRP: 250, TotalAmt: 230, discount: 0, HSN: '08' }, - ]; - - const chunkSize =isMobile ? 16 : PageSize == "A5" ? 11 : 16; - - let dataSource = []; - - if (GlobaldummyData || purchaseData?.length > 0) { - dataSource = GlobaldummyData ? products : purchaseData; - } - - // Paginate the data - const paginatedChunks = []; - for (let i = 0; i < dataSource.length; i += chunkSize) { - paginatedChunks.push(dataSource.slice(i, i + chunkSize)); - } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 11 : PageSize == "A5" ? 5 : 10); + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobalQrcodet = useSelector(GlobalprintQrcodet); + const GlobaldummyData = useSelector(GlobalPritdummyData); + const GlobalSignature = useSelector(GlobalprintSignature); + const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); + const GlobalSignatureImages = useSelector(GlobalSignatureImage); + const GlobalIsnotes = useSelector(Globalnotes); + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + + console.log(printDatas, 'GlobalthemeFormatr'); + + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; + + const keysLength = Object.keys(table2Data ?? {}).length; + if (keysLength > 0) { + dispatch(changeReprintDataFound(true)); + } + const currentDate = new Date(); + const day = currentDate.getDate().toString().padStart(2, '0'); + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; + const monthIndex = currentDate.getMonth(); + const year = currentDate.getFullYear().toString().slice(-2); + + const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; + + const purchaseData = table2Data?.productDetails || []; + // Calculate SalesWiseOffers total amount + + const products = [ + { + ProdName: 'ITEM 1', + Rate: 88.0, + SalesQty: 2, + MRP: 100, + TotalAmt: 176, + discount: 0, + HSN: '01', + }, + { + ProdName: 'ITEM 2', + Rate: 300.0, + SalesQty: 1, + MRP: 350, + TotalAmt: 300, + discount: 0, + HSN: '02', + }, + { + ProdName: 'ITEM 3', + Rate: 200.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 200, + discount: 0, + HSN: '03', + }, + { + ProdName: 'ITEM 4', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '04', + }, + { + ProdName: 'ITEM 5', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '05', + }, + { + ProdName: 'ITEM 6', + Rate: 130.0, + SalesQty: 1, + MRP: 150, + TotalAmt: 130, + discount: 0, + HSN: '06', + }, + { + ProdName: 'ITEM 7', + Rate: 230.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 230, + discount: 0, + HSN: '08', + }, + ]; + + const chunkSize = isMobile ? 16 : PageSize == 'A5' ? 11 : 16; + + let dataSource = []; + + if (GlobaldummyData || purchaseData?.length > 0) { + dataSource = GlobaldummyData ? products : purchaseData; + } + + // Paginate the data + const paginatedChunks = []; + for (let i = 0; i < dataSource.length; i += chunkSize) { + paginatedChunks.push(dataSource.slice(i, i + chunkSize)); + } + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 11 : PageSize == 'A5' ? 5 : 10); + + // + 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 + ); + + // + 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 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, + }; return ( - <> - {FormatTheme ? -
- - {paginatedChunks.map((dataChunk, chunkIndex) => ( - //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "295mm" : "257mm") : "", }} key={chunkIndex}> - - {/*
*/} -
-
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} - - {table2Data?.BrGSTIN &&
GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN}, CIN :u00045hhsgbubufsdug
} -
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
- -
-
-
-
-
-
BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
-
-
-
- -
- -
-
- {(purchaseData?.length > 0 || GlobaldummyData) && -
- -
- {GlobaldummyData ? GlobalSlNo &&
S.No
: SLNO &&
S.No
} - {GlobaldummyData ? GlobalItem &&
ITEM
: Item &&
ITEM
} - {GlobaldummyData ? GlobalHsnCode &&
HSN
: HsnCode &&
HSN
} - {GlobaldummyData ? GlobalMRP &&
MRP
: MRP &&
MRP
} - {GlobaldummyData ? GlobalQuantity &&
QTY
: Quantity &&
QTY
} - {GlobaldummyData ? GlobalRate &&
RATE
: Rate &&
RATE
} - {GlobaldummyData ? GlobalDiscount &&
DIS
: Discount &&
DIS
} - {GlobaldummyData ? GlobalAmount &&
AMT
: Amount &&
AMT
} -
- -
- {dataChunk?.map((item, index) => ( -
- {GlobaldummyData ? GlobalSlNo &&
{index + 1}
: SLNO &&
{chunkIndex * chunkSize + index + 1}
} - {GlobaldummyData ? GlobalItem &&
{item?.ProdName}
: 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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map(item2 => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); - } - ) : ""} -
-
} - {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} - {GlobaldummyData ? GlobalMRP &&
{item?.MRP}
: MRP &&
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
} - {GlobaldummyData ? GlobalQuantity &&
{item?.SalesQty}
: Quantity &&
{item?.SalesQty}
} - {GlobaldummyData ? GlobalRate &&
{item?.Rate}
: Rate &&
{item?.Rate}
} - {GlobaldummyData ? GlobalDiscount &&
{item?.discount}
: Discount &&
{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}
} - {GlobaldummyData ? GlobalAmount &&
{item?.TotalAmt}
: Amount &&
{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
} -
- ))} -
-
- } - -
- - - -
- - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - - <> -
- - -
- -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
- - } - -
- {/*
*/} - - {/*
*/} - - - - -
- -
-
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
- - - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - - -
- - -
- {/*
*/} - - {/*
*/} - -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - -
-
- - - {PrintGreeting?.SettingValue === "Y" && - <> - {/*
*/} - -
Thank You
- - } - - - } -
- ))} - - {shouldFooterBeOnNewPage && FormatTheme && -
-
+ <> + {FormatTheme ? ( +
+ {paginatedChunks.map((dataChunk, chunkIndex) => ( + //
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}> +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '295mm' + : '257mm' + : '', + }} + key={chunkIndex} + > + {/*
*/} +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {' '} + {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} + {table2Data?.BrGSTIN && ( +
+ GST NO : + {GlobaldummyData + ? '334bhbsagbysfgbfgbu' + : table2Data?.BrGSTIN} + , CIN :u00045hhsgbubufsdug +
+ )} +
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+
+
+
+
+
+
+ {' '} + BILL NO : + {GlobaldummyData + ? '51' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}{' '} +
+
+ {' '} + {GlobaldummyData ? formattedDate : Date1} +
+
+
+
+
-
- <> - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
- - } - -
-
- - {/*
*/} - - -
- -
-
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
- - - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - - -
- - -
- {/*
*/} - -
- -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - -
-
- - - {PrintGreeting?.SettingValue === "Y" && - <> - {/*
*/} - -
Thank You
- - } - - -
-
-
- } -
- - : -
- -
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} - - {table2Data?.BrGSTIN &&
GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN}, CIN :u00045hhsgbubufsdug
} -
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
- -
-
-
-
-
-
BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
-
-
-
-
- {(purchaseData?.length > 0 || GlobaldummyData) && -
- -
- {GlobaldummyData ? GlobalSlNo &&
S.No
: SLNO &&
S.No
} - {GlobaldummyData ? GlobalItem &&
ITEM
: Item &&
ITEM
} - {GlobaldummyData ? GlobalHsnCode &&
HSN
: HsnCode &&
HSN
} - {GlobaldummyData ? GlobalMRP &&
MRP
: MRP &&
MRP
} - {GlobaldummyData ? GlobalQuantity &&
QTY
: Quantity &&
QTY
} - {GlobaldummyData ? GlobalRate &&
RATE
: Rate &&
RATE
} - {GlobaldummyData ? GlobalDiscount &&
DIS
: Discount &&
DIS
} - {GlobaldummyData ? GlobalAmount &&
AMT
: Amount &&
AMT
} -
- -
- {(GlobaldummyData ? products : purchaseData)?.map((item, index) => ( -
- {GlobaldummyData ? GlobalSlNo &&
{index + 1}
: SLNO &&
{index + 1}
} - {GlobaldummyData ? GlobalItem &&
{item?.ProdName}
: 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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map(item2 => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); - } - ) : ""} -
-
} - {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} - {GlobaldummyData ? GlobalMRP &&
{item?.MRP}
: MRP &&
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
} - {GlobaldummyData ? GlobalQuantity &&
{item?.SalesQty}
: Quantity &&
{item?.SalesQty}
} - {GlobaldummyData ? GlobalRate &&
{item?.Rate}
: Rate &&
{item?.Rate}
} - {GlobaldummyData ? GlobalDiscount &&
{item?.discount}
: Discount &&
{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}
} - {GlobaldummyData ? GlobalAmount &&
{item?.TotalAmt}
: Amount &&
{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
} -
- ))} -
-
- } - -
- -
- - {/*
*/} - - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
- - } - -
-
- - {/*
*/} - - - -
- -
-
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
- - - - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - - -
- - -
- - -
- -
- { - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- { - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - { Signature == true && (
-

Signature

- -
)} - -
-
- - - {PrintGreeting?.SettingValue === "Y" && - <> - {/*
*/} - -
Thank You
- - } - {/*
print
*/} -
} - +
+
+ {(purchaseData?.length > 0 || GlobaldummyData) && ( +
+
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ S.No +
+ ) + : SLNO && ( +
+ S.No +
+ )} + {GlobaldummyData + ? GlobalItem && ( +
+ ITEM +
+ ) + : Item && ( +
+ ITEM +
+ )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ HSN +
+ ) + : HsnCode && ( +
+ HSN +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ MRP +
+ ) + : MRP && ( +
+ MRP +
+ )} + {GlobaldummyData + ? GlobalQuantity && ( +
+ QTY +
+ ) + : Quantity && ( +
+ QTY +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ RATE +
+ ) + : Rate && ( +
+ RATE +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ DIS{' '} +
+ ) + : Discount && ( +
+ DIS{' '} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ AMT +
+ ) + : Amount && ( +
+ AMT +
+ )} +
+ +
+ {dataChunk?.map((item, index) => ( +
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ {index + 1} +
+ ) + : SLNO && ( +
+ {chunkIndex * chunkSize + index + 1} +
+ )} + {GlobaldummyData + ? GlobalItem && ( +
+ {item?.ProdName} +
+ ) + : 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 + ) + )?.map((a) => { + return
{a.SerialNumber}
; + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
+ )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ {item?.HSN} +
+ ) + : HsnCode && ( +
+ {item?.HSN} +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ {item?.MRP} +
+ ) + : MRP && ( +
+ {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} +
+ )} + {GlobaldummyData + ? GlobalQuantity && ( +
+ {item?.SalesQty} +
+ ) + : Quantity && ( +
+ {item?.SalesQty} +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ {item?.Rate} +
+ ) + : Rate && ( +
+ {item?.Rate} +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ {item?.discount} +
+ ) + : Discount && ( +
+ {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ {item?.TotalAmt} +
+ ) + : Amount && ( +
+ {' '} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+ )} +
+ ))} +
+
+ )} +
+
+ + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+ +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+ + )} +
+ {/*
*/} + + {/*
*/} + +
+
+
+ Your Order No : + {GlobaldummyData + ? '01' + : table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
+ + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} +
+
+ {/*
*/} + + {/*
*/} + +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : Notestext && ( +
+

+ {Notestext} +

+ +
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not + exchangeable or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( + <> + {/*
*/} + +
+ Thank You{' '} +
+ + )} + + )} +
+ ))} + + {shouldFooterBeOnNewPage && FormatTheme && ( +
+
+
+ <> +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+ + )} +
+
+ + {/*
*/} + +
+
+
+ Your Order No : + {GlobaldummyData + ? '01' + : table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
+ + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} +
+
+ {/*
*/} + +
+ +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : Notestext && ( +
+

+ {Notestext} +

+ +
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not + exchangeable or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( + <> + {/*
*/} + +
+ Thank You{' '} +
+ + )} + +
+
+
+ )} +
+ ) : ( +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {' '} + {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} + {table2Data?.BrGSTIN && ( +
+ GST NO : + {GlobaldummyData + ? '334bhbsagbysfgbfgbu' + : table2Data?.BrGSTIN} + , CIN :u00045hhsgbubufsdug +
+ )} +
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+
+
+
+
+
+
+ {' '} + BILL NO : + {GlobaldummyData + ? '51' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}{' '} +
+
+ {' '} + {GlobaldummyData ? formattedDate : Date1} +
+
+
+
+
+ {(purchaseData?.length > 0 || GlobaldummyData) && ( +
+
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ S.No +
+ ) + : SLNO && ( +
+ S.No +
+ )} + {GlobaldummyData + ? GlobalItem && ( +
+ ITEM +
+ ) + : Item && ( +
+ ITEM +
+ )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ HSN +
+ ) + : HsnCode && ( +
+ HSN +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ MRP +
+ ) + : MRP && ( +
+ MRP +
+ )} + {GlobaldummyData + ? GlobalQuantity && ( +
+ QTY +
+ ) + : Quantity && ( +
+ QTY +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ RATE +
+ ) + : Rate && ( +
+ RATE +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ DIS{' '} +
+ ) + : Discount && ( +
+ DIS{' '} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ AMT +
+ ) + : Amount && ( +
+ AMT +
+ )} +
+ +
+ {(GlobaldummyData ? products : purchaseData)?.map( + (item, index) => ( +
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ {index + 1} +
+ ) + : SLNO && ( +
+ {index + 1} +
+ )} + {GlobaldummyData + ? GlobalItem && ( +
+ {item?.ProdName} +
+ ) + : 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 + ) + )?.map((a) => { + return
{a.SerialNumber}
; + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
+ )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ {item?.HSN} +
+ ) + : HsnCode && ( +
+ {item?.HSN} +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ {item?.MRP} +
+ ) + : MRP && ( +
+ {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} +
+ )} + {GlobaldummyData + ? GlobalQuantity && ( +
+ {item?.SalesQty} +
+ ) + : Quantity && ( +
+ {item?.SalesQty} +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ {item?.Rate} +
+ ) + : Rate && ( +
+ {item?.Rate} +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ {item?.discount} +
+ ) + : Discount && ( +
+ {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ {item?.TotalAmt} +
+ ) + : Amount && ( +
+ {' '} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+ )} +
+ ) + )} +
+
+ )} +
+ +
+ + {/*
*/} + +
+ {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+ + )} +
+
+ + {/*
*/} + +
+
+
+ Your Order No : + {GlobaldummyData + ? '01' + : table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
+ + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} +
+
+ +
+ +
+ {Notestext && ( +
+

{Notestext}

+ +
+
+ )} + +
+ {TermsnAdCondition == true && TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( + <> + {/*
*/} + +
+ Thank You +
+ + )} + {/*
print
*/} +
+ )} + ); }; -export default PurchaseOrdStyle3; \ No newline at end of file +export default PurchaseOrdStyle3; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle4.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle4.jsx index d06d84d..e740b24 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle4.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle4.jsx @@ -1,999 +1,2807 @@ import { useDispatch } from 'react-redux'; -import { extractLastNumber, extractLastNumberOrderId } from '../../../Services/Others'; import { - GlobalprintSlNo, - GlobalprintItem, - GlobalprintMRP, - GlobalprintDiscount, - GlobalprintQuantity, - GlobalprintRate, - GlobalprintAmount, - GlobalprintHsnCode, - GlobalprintQrcodet, - GlobalPritdummyData, - changeReprintDataFound, - GloabalFieldDetails, - GlobalprintSignature, - GlobalprinttermsAndConditions, - GlobalSignatureImage, - Globalnotes, - GlobalthemeFormat, - GlobalBillName, -} from "../../../Features/ThemeChange/ThemeChange"; + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; +import { + GlobalprintSlNo, + GlobalprintItem, + GlobalprintMRP, + GlobalprintDiscount, + GlobalprintQuantity, + GlobalprintRate, + GlobalprintAmount, + GlobalprintHsnCode, + GlobalprintQrcodet, + GlobalPritdummyData, + changeReprintDataFound, + GloabalFieldDetails, + GlobalprintSignature, + GlobalprinttermsAndConditions, + GlobalSignatureImage, + Globalnotes, + GlobalthemeFormat, + GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, +} from '../../../Features/ThemeChange/ThemeChange'; import { useSelector } from 'react-redux'; import { isMobile } from 'react-device-detect'; -const PurchaseOrdStyle4 = ({ index, Date1, base64Image, totalQuantityFilter, CashierName, totalQuantity, OrderDetailGST, OrderDetailIGST, OrderDetailVAT, - table2Data, PaymentStatus, PrintGreeting, printDatas }) => { - const dispatch = useDispatch(); - - // const FieldDetails = useSelector(GloabalFieldDetails); - const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { - acc[item.ConfigName] = true; - return acc; - }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo); - const GlobalItem = useSelector(GlobalprintItem); - const GlobalMRP = useSelector(GlobalprintMRP); - const GlobalDiscount = useSelector(GlobalprintDiscount); - const GlobalQuantity = useSelector(GlobalprintQuantity); - const GlobalRate = useSelector(GlobalprintRate); - const GlobalAmount = useSelector(GlobalprintAmount); - const GlobalHsnCode = useSelector(GlobalprintHsnCode); - const GlobalQrcodet = useSelector(GlobalprintQrcodet); - const GlobaldummyData = useSelector(GlobalPritdummyData); - const GlobalSignature = useSelector(GlobalprintSignature); - const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); - const GlobalSignatureImages = useSelector(GlobalSignatureImage); - const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) - - - - - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; - - - const keysLength = Object.keys(table2Data ?? {}).length; - - if (keysLength > 0) { - dispatch(changeReprintDataFound(true)); - } - const currentDate = new Date(); - const day = currentDate.getDate().toString().padStart(2, '0'); - const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - const monthIndex = currentDate.getMonth(); - const year = currentDate.getFullYear().toString().slice(-2); - - const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - const productsData = table2Data?.productDetails || []; - - const products = [ - { ProdName: 'ITEM 1', Rate: 88.00, SalesQty: 2, MRP: 100, TotalAmt: 176, discount: 0, HSN: '01' }, - { ProdName: 'ITEM 2', Rate: 300.00, SalesQty: 1, MRP: 350, TotalAmt: 300, discount: 0, HSN: '02' }, - { ProdName: 'ITEM 3', Rate: 200.00, SalesQty: 1, MRP: 250, TotalAmt: 200, discount: 0, HSN: '03' }, - { ProdName: 'ITEM 4', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '04' }, - { ProdName: 'ITEM 5', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '05' }, - { ProdName: 'ITEM 6', Rate: 130.00, SalesQty: 1, MRP: 150, TotalAmt: 130, discount: 0, HSN: '06' }, - { ProdName: 'ITEM 7', Rate: 230.00, SalesQty: 1, MRP: 250, TotalAmt: 230, discount: 0, HSN: '08' }, - ]; - - const chunkSize = isMobile ? 16 : PageSize == "A5" ? 10 : 16; - - let dataSource = []; - - if (GlobaldummyData || productsData?.length > 0) { - dataSource = GlobaldummyData ? products : productsData; - } - - // Paginate the data - const paginatedChunks = []; - for (let i = 0; i < dataSource.length; i += chunkSize) { - paginatedChunks.push(dataSource.slice(i, i + chunkSize)); - } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 10 : PageSize == "A5" ? 5 : 10); - - - return ( - <> - {FormatTheme ? -
- {paginatedChunks.map((dataChunk, chunkIndex) => ( - //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "295mm" : "257mm") : "", }} key={chunkIndex}> - - - - {/*
*/} -
-
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} - -
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
-
- - -
-
Bill No :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
-
- - - - -
-
- - -
- {(productsData?.length > 0 || GlobaldummyData) && - <> -
Purchase Order
-
- - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - - - {dataChunk?.map((item, index) => { - return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - ) - })} - -
S.NoS.NoItemItemQtyQtyHSNHSNMRPMRPDis Dis RateRateAmtAmt
{index + 1}{chunkIndex * chunkSize + index + 1}{item?.ProdName} -
{item?.ProdName}
-
- {( - (item?.Size || "1") + - (item?.SinglePc === "Y" ? " PCS" : item?.Type !== "C" ? ` ${item?.UomName}` : " COMBO") + - (item?.BrandName ? ` ${item?.BrandName}` : "") + - ( - item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls - .filter((items) => items.SerialNumber) - .map((a, index) => ` ${a.SerialNumber}`).join("") - : "" - ) + - ( - item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls - .filter((item1) => item1.IMEI1 || item1.IMEI2) - .map((item2, index) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return ` ${[imei1, imei2].filter(Boolean).join(",")}`; - }).join("") - : "" - ) - ).trim()} -
-
{item?.SalesQty}{item?.SalesQty}{item?.HSN}{item?.HSN}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Rate}{item?.TotalAmt} {item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- - } - -
- - - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - - <> - - - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
- - } -
-
- -
- - {/*
*/} -
- -
- {/*
Scan to Pay
*/} -
YOUR ORDER NO:{table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
-
- - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } -
-
-
- -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - -
-
- - {PrintGreeting?.SettingValue === "Y" && -
- Thank You -
- } - - } -
- ))} - - {shouldFooterBeOnNewPage && FormatTheme && -
-
- <> - - - - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
- - } -
- - -
-
- -
- {/*
Scan to Pay
*/} -
YOUR ORDER NO:{table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
-
- - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } -
-
-
- -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - -
-
- - {PrintGreeting?.SettingValue === "Y" && -
- Thank You -
- } - -
-
- } -
- : -
-
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} - -
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
+const PurchaseOrdStyle4 = ({ + index, + Date1, + base64Image, + totalQuantityFilter, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PaymentStatus, + PrintGreeting, + printDatas, +}) => { + const dispatch = useDispatch(); + + // const FieldDetails = useSelector(GloabalFieldDetails); + const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { + acc[item.ConfigName] = true; + return acc; + }, {}); + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobalQrcodet = useSelector(GlobalprintQrcodet); + const GlobaldummyData = useSelector(GlobalPritdummyData); + const GlobalSignature = useSelector(GlobalprintSignature); + const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); + const GlobalSignatureImages = useSelector(GlobalSignatureImage); + const GlobalIsnotes = useSelector(Globalnotes); + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); + + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; + + const keysLength = Object.keys(table2Data ?? {}).length; + + if (keysLength > 0) { + dispatch(changeReprintDataFound(true)); + } + const currentDate = new Date(); + const day = currentDate.getDate().toString().padStart(2, '0'); + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; + const monthIndex = currentDate.getMonth(); + const year = currentDate.getFullYear().toString().slice(-2); + + const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; + const productsData = table2Data?.productDetails || []; + + const products = [ + { + ProdName: 'ITEM 1', + Rate: 88.0, + SalesQty: 2, + MRP: 100, + TotalAmt: 176, + discount: 0, + HSN: '01', + }, + { + ProdName: 'ITEM 2', + Rate: 300.0, + SalesQty: 1, + MRP: 350, + TotalAmt: 300, + discount: 0, + HSN: '02', + }, + { + ProdName: 'ITEM 3', + Rate: 200.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 200, + discount: 0, + HSN: '03', + }, + { + ProdName: 'ITEM 4', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '04', + }, + { + ProdName: 'ITEM 5', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '05', + }, + { + ProdName: 'ITEM 6', + Rate: 130.0, + SalesQty: 1, + MRP: 150, + TotalAmt: 130, + discount: 0, + HSN: '06', + }, + { + ProdName: 'ITEM 7', + Rate: 230.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 230, + discount: 0, + HSN: '08', + }, + ]; + + const chunkSize = isMobile ? 16 : PageSize == 'A5' ? 10 : 16; + + let dataSource = []; + + if (GlobaldummyData || productsData?.length > 0) { + dataSource = GlobaldummyData ? products : productsData; + } + + // Paginate the data + const paginatedChunks = []; + for (let i = 0; i < dataSource.length; i += chunkSize) { + paginatedChunks.push(dataSource.slice(i, i + chunkSize)); + } + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 10 : PageSize == 'A5' ? 5 : 10); + + // + 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 + ); + + // + 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 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, + }; + + return ( + <> + {FormatTheme ? ( +
+ {paginatedChunks.map((dataChunk, chunkIndex) => ( + //
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}> +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '295mm' + : '257mm' + : '', + }} + key={chunkIndex} + > + {/*
*/} +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+
+ +
+
+ Bill No : + {GlobaldummyData + ? '51' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
{GlobaldummyData ? formattedDate : Date1}
+
+ +
+
+ +
+ {(productsData?.length > 0 || GlobaldummyData) && ( + <> +
+ Purchase Order
- {/*
+
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + + + {dataChunk?.map((item, index) => { + return ( + + {GlobaldummyData + ? GlobalSlNo && + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + ); + })} + +
+ S.No + + S.No + ItemItem + Qty + + Qty + + HSN + + HSN + + MRP + + MRP + + Dis{' '} + + Dis{' '} + + Rate + + Rate + + Amt + + Amt +
{index + 1} + {chunkIndex * chunkSize + index + 1} + {item?.ProdName} +
{item?.ProdName}
+
+ {( + (item?.Size || '1') + + (item?.SinglePc === 'Y' + ? ' PCS' + : item?.Type !== 'C' + ? ` ${item?.UomName}` + : ' COMBO') + + (item?.BrandName + ? ` ${item?.BrandName}` + : '') + + (item?.ProductIdentifierDtls + ?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => items.SerialNumber + ) + .map( + (a, index) => + ` ${a.SerialNumber}` + ) + .join('') + : '') + + (item?.ProductIdentifierDtls + ?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 || item1.IMEI2 + ) + .map((item2, index) => { + const imei1 = + item2.IMEI1 || ''; + const imei2 = + item2.IMEI2 || ''; + return ` ${[imei1, imei2].filter(Boolean).join(',')}`; + }) + .join('') + : '') + ).trim()} +
+
+ {item?.SalesQty} + + {item?.SalesQty} + + {item?.HSN} + + {item?.HSN} + + {item?.MRP} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item.discount} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.Rate} + + {item?.Rate} + + {item?.TotalAmt} + + {' '} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} +
+
+ + )} +
+ + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+ + )} +
+
+ + {/*
*/} +
+
+ {/*
Scan to Pay
*/} +
+ YOUR ORDER NO: + {table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
+
+ {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} +
+
+
+ +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : Notestext && ( +
+

+ {Notestext} +

+ +
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not + exchangeable or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} + + )} +
+ ))} + + {shouldFooterBeOnNewPage && FormatTheme && ( +
+
+ <> +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+ + )} +
+ +
+
+
+ {/*
Scan to Pay
*/} +
+ YOUR ORDER NO: + {table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
+
+ {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} +
+
+
+ +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : Notestext && ( +
+

{Notestext}

+ +
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable + or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} + +
+
+ )} +
+ ) : ( +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+
+ {/*
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrMobile}
*/} -
-
Bill No :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
-
+
+
+ Bill No : + {GlobaldummyData + ? '51' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
{GlobaldummyData ? formattedDate : Date1}
+
-
- {(productsData?.length > 0 || GlobaldummyData) && - <> -
Purchase Order
-
- - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - - - {(GlobaldummyData ? products : productsData)?.map((item, index) => { - return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - ) - })} - -
S.NoS.NoItemItemQtyQtyHSNHSNMRPMRPDis Dis RateRateAmtAmt
{index + 1}{index + 1}{item?.ProdName} -
{item?.ProdName}
-
- {( - (item?.Size || "1") + - (item?.SinglePc === "Y" ? " PCS" : item?.Type !== "C" ? ` ${item?.UomName}` : " COMBO") + - (item?.BrandName ? ` ${item?.BrandName}` : "") + - ( - item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls - .filter((items) => items.SerialNumber) - .map((a, index) => ` ${a.SerialNumber}`).join("") - : "" - ) + - ( - item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls - .filter((item1) => item1.IMEI1 || item1.IMEI2) - .map((item2, index) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return ` ${[imei1, imei2].filter(Boolean).join(",")}`; - }).join("") - : "" - ) - ).trim()} -
-
{item?.SalesQty}{item?.SalesQty}{item?.HSN}{item?.HSN}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Rate}{item?.TotalAmt} {item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- - } - {DineInData?.length > 0 && - <> -
Dine In
-
- - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - - - {(GlobaldummyData ? products : DineInData)?.map((item, index) => { - return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - ) - })} - -
S.NoS.NoItemItemQtyQtyHSNHSNMRPMRPDis Dis RateRateAmtAmt
{index + 1}{index + 1}{item?.ProdName} -
{item?.ProdName}
-
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
-
{item?.SalesQty}{item?.SalesQty}{item?.HSN}{item?.HSN}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Rate}{item?.TotalAmt} {item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- - } -
- - - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
+
+ {(productsData?.length > 0 || GlobaldummyData) && ( + <> +
+ Purchase Order +
+
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && } + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + + + {(GlobaldummyData ? products : productsData)?.map( + (item, index) => { + return ( + 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
-
+ S.No + + S.No + ItemItem + Qty + + Qty + + HSN + + HSN + + MRP + + MRP + + Dis{' '} + + Dis{' '} + + Rate + + Rate + + Amt + + Amt +
- - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
- - } -
- -
-
- -
- {/*
Scan to Pay
*/} -
YOUR ORDER NO:{table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
-
- - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} + : {}), + }} + > + {GlobaldummyData + ? GlobalSlNo && {index + 1} + : SLNO && {index + 1}} + {GlobaldummyData + ? GlobalItem && {item?.ProdName} + : Item && ( + +
{item?.ProdName}
+
+ {( + (item?.Size || '1') + + (item?.SinglePc === 'Y' + ? ' PCS' + : item?.Type !== 'C' + ? ` ${item?.UomName}` + : ' COMBO') + + (item?.BrandName + ? ` ${item?.BrandName}` + : '') + + (item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => items.SerialNumber + ) + .map( + (a, index) => + ` ${a.SerialNumber}` + ) + .join('') + : '') + + (item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 || item1.IMEI2 + ) + .map((item2, index) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ` ${[imei1, imei2].filter(Boolean).join(',')}`; + }) + .join('') + : '') + ).trim()}
- } + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + {item?.SalesQty} + + ) + : Quantity && ( + + {item?.SalesQty} + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + {item?.HSN} + + ) + : HsnCode && ( + + {item?.HSN} + + )} + {GlobaldummyData + ? GlobalMRP && ( + + {item?.MRP} + + ) + : MRP && ( + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + {item.discount} + + ) + : Discount && ( + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} + {GlobaldummyData + ? GlobalRate && ( + + {item?.Rate} + + ) + : Rate && ( + + {item?.Rate} + + )} + {GlobaldummyData + ? GlobalAmount && ( + + {item?.TotalAmt} + + ) + : Amount && ( + + {' '} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} + + )} + + ); + } + )} + + +
+ + )} + {DineInData?.length > 0 && ( + <> +
+ Dine In +
+
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && } + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + + + {(GlobaldummyData ? products : DineInData)?.map( + (item, index) => { + return ( + + {GlobaldummyData + ? GlobalSlNo && + : SLNO && } + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + ); + } + )} + +
+ S.No + + S.No + ItemItem + Qty + + Qty + + HSN + + HSN + + MRP + + MRP + + Dis{' '} + + Dis{' '} + + Rate + + Rate + + Amt + + Amt +
{index + 1}{index + 1}{item?.ProdName} +
{item?.ProdName}
+
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+
+ {item?.SalesQty} + + {item?.SalesQty} + + {item?.HSN} + + {item?.HSN} + + {item?.MRP} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item.discount} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.Rate} + + {item?.Rate} + + {item?.TotalAmt} + + {' '} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+
+ + )} +
+
+ {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} -
-
+ {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+ + )} +
+ +
+
+
+ {/*
Scan to Pay
*/} +
+ YOUR ORDER NO: + {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)} +
+
+ {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName}
+ )} +
+
+
-
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

- {GlobaldummyData ? GlobalIsnotes && - (

-

Notes : 10 days Return policy

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - -
+
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable or + refundable. +
  2. +
  3. + Please check the product before leaving the counter. +
  4. +
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} - {PrintGreeting?.SettingValue === "Y" && -
- Thank You -
- } -
} - + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
- ); -} + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} +
+ )} + + ); +}; -export default PurchaseOrdStyle4; \ No newline at end of file +export default PurchaseOrdStyle4; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle5.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle5.jsx index bf71823..7d51283 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle5.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle5.jsx @@ -1,5 +1,8 @@ import { useDispatch } from 'react-redux'; -import { extractLastNumber, extractLastNumberOrderId } from '../../../Services/Others'; +import { + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; import { GlobalprintSlNo, GlobalprintItem, @@ -19,74 +22,142 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, -} from "../../../Features/ThemeChange/ThemeChange"; + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, +} from '../../../Features/ThemeChange/ThemeChange'; import { useSelector } from 'react-redux'; import { isMobile } from 'react-device-detect'; - - -const PurchaseOrdStyle5 = ({ index, ExtraChargeTotal, totalQuantityFilter, Date1, CashierName, totalQuantity, OrderDetailGST, OrderDetailIGST, - OrderDetailVAT, table2Data, PaymentStatus, PrintGreeting, printDatas }) => { - +const PurchaseOrdStyle5 = ({ + index, + ExtraChargeTotal, + totalQuantityFilter, + Date1, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PaymentStatus, + PrintGreeting, + printDatas, +}) => { const dispatch = useDispatch(); // const FieldDetails = useSelector(GloabalFieldDetails); const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo) - const GlobalItem = useSelector(GlobalprintItem) - const GlobalMRP = useSelector(GlobalprintMRP) - const GlobalDiscount = useSelector(GlobalprintDiscount) - const GlobalQuantity = useSelector(GlobalprintQuantity) - const GlobalRate = useSelector(GlobalprintRate) - const GlobalAmount = useSelector(GlobalprintAmount) - const GlobalHsnCode = useSelector(GlobalprintHsnCode) - const GlobaldummyData = useSelector(GlobalPritdummyData) + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobalSignature = useSelector(GlobalprintSignature); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) - - - - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; - + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; const currentDate = new Date(); const day = currentDate.getDate().toString().padStart(2, '0'); - const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; const monthIndex = currentDate.getMonth(); const year = currentDate.getFullYear().toString().slice(-2); const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - const TakeawayData = table2Data?.productDetails + const TakeawayData = table2Data?.productDetails; const products = [ - { ProdName: 'ITEM 1', Rate: 88.00, SalesQty: 2, MRP: 100, TotalAmt: 176, discount: 0, HSN: '01', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 2', Rate: 300.00, SalesQty: 1, MRP: 350, TotalAmt: 300, discount: 0, HSN: '02', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 3', Rate: 200.00, SalesQty: 1, MRP: 250, TotalAmt: 200, discount: 0, HSN: '03', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 4', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '04', Size: 250, UomName: 'g' }, + { + ProdName: 'ITEM 1', + Rate: 88.0, + SalesQty: 2, + MRP: 100, + TotalAmt: 176, + discount: 0, + HSN: '01', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 2', + Rate: 300.0, + SalesQty: 1, + MRP: 350, + TotalAmt: 300, + discount: 0, + HSN: '02', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 3', + Rate: 200.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 200, + discount: 0, + HSN: '03', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 4', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '04', + Size: 250, + UomName: 'g', + }, ]; - const chunkSize = isMobile ? 9 : PageSize == "A5" ? 5 : 9; + const chunkSize = isMobile ? 9 : PageSize == 'A5' ? 5 : 9; let dataSource = []; if (GlobaldummyData || TakeawayData?.length > 0) { @@ -98,900 +169,2018 @@ const PurchaseOrdStyle5 = ({ index, ExtraChargeTotal, totalQuantityFilter, Date1 for (let i = 0; i < dataSource.length; i += chunkSize) { paginatedChunks.push(dataSource.slice(i, i + chunkSize)); } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 7 : PageSize == "A5" ? 2 : 7); + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 7 : PageSize == 'A5' ? 2 : 7); + + // + 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 + ); + + // + 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 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, + }; + return ( <> - {FormatTheme ? -
+ {FormatTheme ? ( +
{paginatedChunks.map((dataChunk, chunkIndex) => ( //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "295mm" : "257mm") : "", }} key={chunkIndex}> - +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '295mm' + : '257mm' + : '', + }} + key={chunkIndex} + > {/*
*/} -
-
+
+
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
- +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
{/*
Low Prices... Love the Saving...
*/} -
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
Mobile :{GlobaldummyData ? '1234567890' : table2Data?.BrMobile}
- {table2Data?.OrderType === "E" &&
Estimate
} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}
} +
+ {' '} + Mobile : + {GlobaldummyData ? '1234567890' : table2Data?.BrMobile}{' '} +
+ {table2Data?.OrderType === 'E' && ( +
Estimate
+ )} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? 'Cash' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : ''}{' '} +
+ )}
- -
- {" "} -
{GlobaldummyData ? formattedDate : Date1}
{" "} -
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
{" "} +
+ {' '} +
{GlobaldummyData ? formattedDate : Date1}
{' '} +
+ {' '} + Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}{' '} +
{' '}

-
- {(TakeawayData?.length > 0 || GlobaldummyData) && +
+ {(TakeawayData?.length > 0 || GlobaldummyData) && ( <> {/* {
TakeAway
} */} -
- {GlobaldummyData ? GlobalSlNo &&
S.No
: SLNO &&
S.No
} - {GlobaldummyData ? (GlobalItem || GlobalQuantity) && -
{GlobaldummyData ? GlobalItem && 'ITEM /DES /' : 'ITEM /DES /'} {GlobaldummyData ? GlobalQuantity && 'QTY' : 'QTY'}
: -
{GlobaldummyData ? GlobalItem && 'ITEM /DES /' : Item && 'ITEM /DES /'} {GlobaldummyData ? GlobalQuantity && 'QTY' : Quantity && 'QTY'}
} - {GlobaldummyData ? GlobalHsnCode &&
HSN
: HsnCode &&
HSN
} - {GlobaldummyData ? GlobalMRP &&
MRP
: MRP &&
MRP
} - {GlobaldummyData ? GlobalRate &&
RATE
: Rate &&
RATE
} - {GlobaldummyData ? GlobalDiscount &&
DIS
: Discount &&
DIS
} - {GlobaldummyData ? GlobalAmount &&
Amt
: Amount &&
AMT
} +
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ S.No +
+ ) + : SLNO && ( +
+ S.No +
+ )} + {GlobaldummyData ? ( + (GlobalItem || GlobalQuantity) && ( +
+ {' '} + {GlobaldummyData + ? GlobalItem && 'ITEM /DES /' + : 'ITEM /DES /'}{' '} + {GlobaldummyData + ? GlobalQuantity && 'QTY' + : 'QTY'}{' '} +
+ ) + ) : ( +
+ {' '} + {GlobaldummyData + ? GlobalItem && 'ITEM /DES /' + : Item && 'ITEM /DES /'}{' '} + {GlobaldummyData + ? GlobalQuantity && 'QTY' + : Quantity && 'QTY'}{' '} +
+ )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ HSN +
+ ) + : HsnCode && ( +
+ HSN +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ MRP +
+ ) + : MRP && ( +
+ MRP +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ RATE +
+ ) + : Rate && ( +
+ RATE +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ DIS{' '} +
+ ) + : Discount && ( +
+ DIS{' '} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ {' '} + Amt{' '} +
+ ) + : Amount && ( +
+ {' '} + AMT{' '} +
+ )}

{dataChunk?.map((item, index) => ( -
- {GlobaldummyData ? GlobalSlNo &&
{index + 1}
: SLNO &&
{chunkIndex * chunkSize + index + 1}
} - { - GlobaldummyData ? (GlobalItem || GlobalQuantity) && -
- { - (GlobaldummyData ? GlobalItem && +
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ {index + 1} +
+ ) + : SLNO && ( +
+ {chunkIndex * chunkSize + index + 1} +
+ )} + {GlobaldummyData ? ( + (GlobalItem || GlobalQuantity) && ( +
+ {GlobaldummyData ? ( + GlobalItem && ( <>
{item?.ProdName}
{item?.Size + item?.UomName}
- : - <> -
{item?.ProdName}
-
{item?.Size + item?.UomName + '-' + - (GlobaldummyData ? GlobalQuantity && item?.SalesQty : item?.SalesQty)}
) - } -
: -
- { - (GlobaldummyData ? GlobalItem && <> + ) : ( + <> +
{item?.ProdName}
+
+ {item?.Size + + item?.UomName + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
+ + )} +
+ ) + ) : ( +
+ {GlobaldummyData ? ( + GlobalItem && ( + <>
{item?.ProdName}
{item?.Size + item?.UomName}
- : - <> -
{item?.ProdName}
-
- { - (item?.Size || "1") + - (item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO") + - (item?.BrandName || "") + - ( - item?.ProductIdentifierDtls?.filter( - (items) => items.SerialNumber && items.SerialNumber !== "" - )?.map((a, index) =>
{a.SerialNumber}
) || "" - ) + - ( - item?.ProductIdentifierDtls?.filter( - (item1) => item1.IMEI1 || item1.IMEI2 - )?.map((item2, index) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return ( -
- {[imei1, imei2].filter(Boolean).join(",")} -
- ); - }) || "") + - "-" + (GlobaldummyData ? (GlobalQuantity && item?.SalesQty) : item?.SalesQty) - } -
- - )} -
- } - {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} - {GlobaldummyData ? GlobalMRP &&
{item?.MRP}
: MRP &&
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
} - {GlobaldummyData ? GlobalRate &&
{item?.Rate}
: Rate &&
{item?.Rate}
} - {GlobaldummyData ? GlobalDiscount &&
{item?.discount}
: Discount &&
{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}
} - {GlobaldummyData ? GlobalAmount &&
{item?.TotalAmt}
: Amount &&
{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
} + + ) + ) : ( + <> +
{item?.ProdName}
+
+ {(item?.Size || '1') + + (item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO') + + (item?.BrandName || '') + + (item?.ProductIdentifierDtls?.filter( + (items) => + items.SerialNumber && + items.SerialNumber !== '' + )?.map((a, index) => ( +
+ {a.SerialNumber} +
+ )) || '') + + (item?.ProductIdentifierDtls?.filter( + (item1) => item1.IMEI1 || item1.IMEI2 + )?.map((item2, index) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) || '') + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
+ + )} +
+ )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ {item?.HSN} +
+ ) + : HsnCode && ( +
+ {item?.HSN} +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ {item?.MRP} +
+ ) + : MRP && ( +
+ {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ {item?.Rate} +
+ ) + : Rate && ( +
+ {item?.Rate} +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ {item?.discount} +
+ ) + : Discount && ( +
+ {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ {item?.TotalAmt} +
+ ) + : Amount && ( +
+ {' '} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+ )}
))} - } - + )}
- {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
- <> - -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- - + + - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} - - - Taxable Amount - - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - + + {OrderDetailIGST?.map((item) => ( + + + - Total Amount - - - {OrderDetailVAT?.map((item) => - - - + + + ))} +
+ Taxable Amount + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) + + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} +
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - - - ) - } -
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
- - - - {/*
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} -
- - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } -
- - -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} + + Total Amount + + + {OrderDetailVAT?.map((item) => ( + + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} +
+
+ + )}
-
- {PrintGreeting?.SettingValue === "Y" && -
Thank You
- } + {/*
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} +
+ {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} +
- - } +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+
+
+ ) + : Notestext && ( +
+

+ {Notestext} +

+
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not + exchangeable or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} + + )}
))} - {shouldFooterBeOnNewPage && FormatTheme && + {shouldFooterBeOnNewPage && FormatTheme && (
-
<>
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) - + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + Total Amount
+ {Number(item.WithOutTaxAmount).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- - } + )}
{/*
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} -
- - - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} +
+ {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name
- } - - - + )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )}
- -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable + or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && -
Thank You
- } - + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )}
- } -
- : -
- -
+ )} +
+ ) : ( +
+
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
- +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
{/*
Low Prices... Love the Saving...
*/} -
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
Mobile :{GlobaldummyData ? '1234567890' : table2Data?.BrMobile}
- {table2Data?.OrderType === "E" &&
Estimate
} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
} +
+ {' '} + Mobile : + {GlobaldummyData ? '1234567890' : table2Data?.BrMobile}{' '} +
+ {table2Data?.OrderType === 'E' && ( +
Estimate
+ )} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ''} +
+ )}
- -
- - -
- {" "} -
{GlobaldummyData ? formattedDate : Date1}
{" "} -
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
{" "} +
+ {' '} +
{GlobaldummyData ? formattedDate : Date1}
{' '} +
+ {' '} + Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}{' '} +
{' '}

- {(TakeawayData?.length > 0 || GlobaldummyData) && + {(TakeawayData?.length > 0 || GlobaldummyData) && ( <> {/* {
TakeAway
} */} -
- {GlobaldummyData ? GlobalSlNo &&
S.No
: SLNO &&
S.No
} - {GlobaldummyData ? (GlobalItem || GlobalQuantity) && -
{GlobaldummyData ? GlobalItem && 'ITEM /DES /' : 'ITEM /DES /'} {GlobaldummyData ? GlobalQuantity && 'QTY' : 'QTY'}
: -
{GlobaldummyData ? GlobalItem && 'ITEM /DES /' : Item && 'ITEM /DES /'} {GlobaldummyData ? GlobalQuantity && 'QTY' : Quantity && 'QTY'}
} - {GlobaldummyData ? GlobalHsnCode &&
HSN
: HsnCode &&
HSN
} - {GlobaldummyData ? GlobalMRP &&
MRP
: MRP &&
MRP
} - {GlobaldummyData ? GlobalRate &&
RATE
: Rate &&
RATE
} - {GlobaldummyData ? GlobalDiscount &&
DIS
: Discount &&
DIS
} - {GlobaldummyData ? GlobalAmount &&
Amt
: Amount &&
AMT
} +
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ S.No +
+ ) + : SLNO && ( +
+ S.No +
+ )} + {GlobaldummyData ? ( + (GlobalItem || GlobalQuantity) && ( +
+ {' '} + {GlobaldummyData + ? GlobalItem && 'ITEM /DES /' + : 'ITEM /DES /'}{' '} + {GlobaldummyData ? GlobalQuantity && 'QTY' : 'QTY'}{' '} +
+ ) + ) : ( +
+ {' '} + {GlobaldummyData + ? GlobalItem && 'ITEM /DES /' + : Item && 'ITEM /DES /'}{' '} + {GlobaldummyData + ? GlobalQuantity && 'QTY' + : Quantity && 'QTY'}{' '} +
+ )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ HSN +
+ ) + : HsnCode && ( +
+ HSN +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ MRP +
+ ) + : MRP && ( +
+ MRP +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ RATE +
+ ) + : Rate && ( +
+ RATE +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ DIS{' '} +
+ ) + : Discount && ( +
+ DIS{' '} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ {' '} + Amt{' '} +
+ ) + : Amount && ( +
+ {' '} + AMT{' '} +
+ )}

- {(GlobaldummyData ? products : TakeawayData)?.map((item, index) => ( -
- {GlobaldummyData ? GlobalSlNo &&
{index + 1}
: SLNO &&
{index + 1}
} - { - GlobaldummyData ? (GlobalItem || GlobalQuantity) && -
- { - (GlobaldummyData ? GlobalItem && - <> -
{item?.ProdName}
-
{item?.Size + item?.UomName}
- : - <> -
{item?.ProdName}
-
{item?.Size + item?.UomName + '-' + - (GlobaldummyData ? GlobalQuantity && item?.SalesQty : item?.SalesQty)}
- - ) - } -
: -
- { - (GlobaldummyData ? GlobalItem && <> -
{item?.ProdName}
-
{item?.Size + item?.UomName}
- : + {(GlobaldummyData ? products : TakeawayData)?.map( + (item, index) => ( +
+ {GlobaldummyData + ? GlobalSlNo && ( +
+ {index + 1} +
+ ) + : SLNO && ( +
+ {index + 1} +
+ )} + {GlobaldummyData ? ( + (GlobalItem || GlobalQuantity) && ( +
+ {GlobaldummyData ? ( + GlobalItem && ( + <> +
{item?.ProdName}
+
{item?.Size + item?.UomName}
+ + ) + ) : ( <>
{item?.ProdName}
- { - (item?.Size || "1") + - (item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO") + - (item?.BrandName || "") + - ( - item?.ProductIdentifierDtls?.filter( - (items) => items.SerialNumber && items.SerialNumber !== "" - )?.map((a, index) =>
{a.SerialNumber}
) || "" - ) + - ( - item?.ProductIdentifierDtls?.filter( - (item1) => item1.IMEI1 || item1.IMEI2 - )?.map((item2, index) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return ( -
- {[imei1, imei2].filter(Boolean).join(",")} -
- ); - }) || "") + - "-" + (GlobaldummyData ? (GlobalQuantity && item?.SalesQty) : item?.SalesQty) - } + {item?.Size + + item?.UomName + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)}
)} +
+ ) + ) : ( +
+ {GlobaldummyData ? ( + GlobalItem && ( + <> +
{item?.ProdName}
+
{item?.Size + item?.UomName}
+ + ) + ) : ( + <> +
{item?.ProdName}
+
+ {(item?.Size || '1') + + (item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO') + + (item?.BrandName || '') + + (item?.ProductIdentifierDtls?.filter( + (items) => + items.SerialNumber && + items.SerialNumber !== '' + )?.map((a, index) => ( +
+ {a.SerialNumber} +
+ )) || '') + + (item?.ProductIdentifierDtls?.filter( + (item1) => item1.IMEI1 || item1.IMEI2 + )?.map((item2, index) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) || '') + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
+ + )}
- } - {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} - {GlobaldummyData ? GlobalMRP &&
{item?.MRP}
: MRP &&
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
} - {GlobaldummyData ? GlobalRate &&
{item?.Rate}
: Rate &&
{item?.Rate}
} - {GlobaldummyData ? GlobalDiscount &&
{item?.discount}
: Discount &&
{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}
} - {GlobaldummyData ? GlobalAmount &&
{item?.TotalAmt}
: Amount &&
{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
} -
- ))} + )} + {GlobaldummyData + ? GlobalHsnCode && ( +
+ {item?.HSN} +
+ ) + : HsnCode && ( +
+ {item?.HSN} +
+ )} + {GlobaldummyData + ? GlobalMRP && ( +
+ {item?.MRP} +
+ ) + : MRP && ( +
+ {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} +
+ )} + {GlobaldummyData + ? GlobalRate && ( +
+ {item?.Rate} +
+ ) + : Rate && ( +
+ {item?.Rate} +
+ )} + {GlobaldummyData + ? GlobalDiscount && ( +
+ {item?.discount} +
+ ) + : Discount && ( +
+ {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} +
+ )} + {GlobaldummyData + ? GlobalAmount && ( +
+ {item?.TotalAmt} +
+ ) + : Amount && ( +
+ {' '} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+ )} +
+ ) + )} - } + )}
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) - + + SGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + Total Amount
+ {Number(item.WithOutTaxAmount).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number(item.WithOutTaxAmount).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- - } + )}


- {/*
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} -
- - - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} +
+ {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name
- } - - + )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )}
-
********************************************************************************************************************************
+
+ ******************************************************************************************************************************** +
- - - - -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable or + refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
+ )} -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && -
Thank You
- } + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )}
-
- - -
- } + )} ); }; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle6.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle6.jsx index bcc7681..95002c6 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle6.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle6.jsx @@ -1,10 +1,10 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; -import QRcode from "../../../Images/QRcode.png"; +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import QRcode from '../../../Images/QRcode.png'; import { extractLastNumber, extractLastNumberOrderId, -} from "../../../Services/Others"; +} from '../../../Services/Others'; import { GlobalprintSlNo, GlobalprintItem, @@ -24,12 +24,21 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, -} from "../../../Features/ThemeChange/ThemeChange"; + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedFooterFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedTableBodyFontColor, +} from '../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../Features/BookingScreen/BookingData/BookingData'; -import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.scss"; -import QRCode from "react-qr-code"; -import signature from "../../../Images/signatureimage.jpg" -import { isMobile } from "react-device-detect"; +import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.scss'; +import QRCode from 'react-qr-code'; +import signature from '../../../Images/signatureimage.jpg'; +import { isMobile } from 'react-device-detect'; const PurchaseOrdStyle6 = ({ index, @@ -43,24 +52,24 @@ const PurchaseOrdStyle6 = ({ table2Data, PaymentStatus, PrintGreeting, - printDatas + printDatas, }) => { const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) + const GlobalUpiID = useSelector(GlobalUpiIDprint); // const FieldDetails = useSelector(GloabalFieldDetails); - const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { + const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; const GlobalSlNo = useSelector(GlobalprintSlNo); const GlobalItem = useSelector(GlobalprintItem); const GlobalMRP = useSelector(GlobalprintMRP); @@ -75,205 +84,421 @@ const PurchaseOrdStyle6 = ({ const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; const keysLength = Object.keys(table2Data ?? {}).length; if (keysLength > 0) { dispatch(changeReprintDataFound(true)); } const purchaseData = table2Data?.productDetails || []; - const chunkSize = isMobile ? 11 : PageSize == "A5" ? 8 : 11; + const chunkSize = isMobile ? 11 : PageSize == 'A5' ? 8 : 11; let dataSource = purchaseData; - const paginatedChunks = []; for (let i = 0; i < dataSource.length; i += chunkSize) { paginatedChunks.push(dataSource.slice(i, i + chunkSize)); } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > isMobile ? 18 :(PageSize == "A5" ? 5 : 18); + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > isMobile ? 18 : PageSize == 'A5' ? 5 : 18; // Calculate total quantity properly const calculatedTotalQuantity = purchaseData?.reduce((total, item) => { return total + (Number(item?.SalesQty) || 0); }, 0); + + // + 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 + ); + + // + 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 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, + }; + return ( <> - {FormatTheme ? -
- + {FormatTheme ? ( +
{paginatedChunks.map((dataChunk, chunkIndex) => ( //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "295mm" : "257mm") : "", }} key={chunkIndex}> - - +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '295mm' + : '257mm' + : '', + }} + key={chunkIndex} + > {/*
*/} -
-
-
- {GlobaldummyData ? "XYZ Shop" : table2Data?.BrName} +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
+
Mobile : {table2Data?.BrMobile}
- {table2Data?.OrderType === "E" &&
Estimate
} + {table2Data?.OrderType === 'E' && ( +
+ Estimate{' '} +
+ )} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash' : BillName ? BillName : PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName : ""}
} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? 'Cash' + : BillName + ? BillName + : PaymentStatus?.length === 1 + ? PaymentStatus?.[0]?.PaymentTypeName + : ''}{' '} +
+ )}
- Order No :{" "} + Order No :{' '} {GlobaldummyData - ? "553" - : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)} + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
-
{Date1}
+
{Date1}

-
+
- + {GlobaldummyData - ? GlobalSlNo && - : SLNO && } + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} {GlobaldummyData ? ( - ( - - ) + ) : ( - )} {GlobaldummyData ? GlobalHsnCode && ( - - ) + + ) : HsnCode && ( - - )} + + )} {GlobaldummyData ? GlobalMRP && ( - - ) + + ) : MRP && ( - - )} + + )} {GlobaldummyData ? GlobalDiscount && ( - - ) + + ) : Discount && ( - - )} + + )} {GlobaldummyData ? GlobalRate && ( - - ) + + ) : Rate && ( - - )} + + )} {GlobaldummyData ? GlobalAmount && ( - - ) + + ) : Amount && ( - - )} + + )} {dataChunk.map((item, index) => { - return ( - + {GlobaldummyData ? GlobalSlNo && - : SLNO && } + : SLNO && ( + + )} {GlobaldummyData ? ( (GlobalItem || GlobalQuantity) && ( ) ) : ( - ) + + ) : HsnCode && ( - - )} + + )} {GlobaldummyData ? GlobalMRP && ( - - ) + + ) : MRP && ( - - )} + + )} {GlobaldummyData ? GlobalDiscount && ( - - ) + + ) : Discount && ( - - )} + + )} {GlobaldummyData ? GlobalRate && ( - - ) + + ) : Rate && ( - - )} + + )} {GlobaldummyData ? GlobalAmount && ( - - ) + + ) : Amount && ( - - )} + + )} ); })} @@ -372,292 +585,558 @@ const PurchaseOrdStyle6 = ({ - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - <> + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
- +
+ {Notestext && ( +
+

{Notestext}

-
- - -
- - -
- { - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- { -
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
+
- } + )} - {(
-

Signature

- -
)} +
+ { +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ } + { +
+

+ Signature +

+ +
+ } +
-
- - - {PrintGreeting?.SettingValue === "Y" && - <> -
Thank You
- - } - - } + {PrintGreeting?.SettingValue === 'Y' && ( + <> +
+ Thank You{' '} +
+ + )} + + )}
))} - {shouldFooterBeOnNewPage && FormatTheme && + {shouldFooterBeOnNewPage && FormatTheme && (
-
<> -
- -
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && -
S.NoS.No + S.No + + S.No + - {GlobaldummyData - ? GlobalItem && "ITEM /DES/" - : "ITEM /DES/"}{" "} - {GlobaldummyData ? GlobalQuantity && "QTY" : "QTY"} - + {GlobaldummyData + ? GlobalItem && 'ITEM /DES/' + : 'ITEM /DES/'}{' '} + {GlobaldummyData ? GlobalQuantity && 'QTY' : 'QTY'} + + {GlobaldummyData - ? GlobalItem && "ITEM /DES/" - : Item && "ITEM /DES/"}{" "} + ? GlobalItem && 'ITEM /DES/' + : Item && 'ITEM /DES/'}{' '} {GlobaldummyData - ? GlobalQuantity && "QTY" - : Quantity && "QTY"} + ? GlobalQuantity && 'QTY' + : Quantity && 'QTY'} HSN + HSN + HSN + HSN + MRP + MRP + MRP + MRP + - Dis{" "} - + Dis{' '} + - Dis{" "} - + Dis{' '} + - Rate - + Rate + - Rate - + Rate + - AMt - + AMt + - Amt - + Amt +
{index + 1}{chunkIndex * chunkSize + index + 1} + {chunkIndex * chunkSize + index + 1} + - {(GlobaldummyData - ? GlobalItem && + {GlobaldummyData ? ( + GlobalItem && ( + <> +
{item?.ProdName}
+
{item?.Size + item?.UomName}
+ + ) + ) : ( <>
{item?.ProdName}
-
{item?.Size + item?.UomName}
- - : - <> -
{item?.ProdName}
-
{item?.Size + item?.UomName + "-" + +
+ {item?.Size + + item?.UomName + + '-' + GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty} + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty}
)} -
{(GlobaldummyData ? GlobalItem && - item?.ProdName + `(${item?.Size + item?.UomName})` + item?.ProdName + + `(${item?.Size + item?.UomName})` : Item && - item?.ProdName + - `(${item?.Size ? item?.Size : "1"}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})`) + - "-" + + item?.ProdName + + `(${item?.Size ? item?.Size : '1'}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`) + + '-' + (GlobaldummyData ? GlobalQuantity && item?.SalesQty : Quantity && item?.SalesQty)} @@ -281,89 +506,77 @@ const PurchaseOrdStyle6 = ({ )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - + {item?.HSN} + - {item?.HSN} - + {item?.HSN} + - {item?.MRP} - + {item?.MRP} + - {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} - + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + - {item.discount} - + {item.discount} + - {item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} - - + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + - {item?.Rate} - + {item?.Rate} + - {item?.Rate} - + {item?.Rate} + - {item?.TotalAmt} - + {item?.TotalAmt} + - {item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} - - + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
- - - - - - - - {OrderDetailGST?.map((item) => +

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) - + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2}%) + Total Amount
+ {Number(item.WithOutTaxAmount).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage}%) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- - } + )}
- -
{GlobaldummyData ? GlobalQrcodet && ( -
- QRcode -
Scan to Pay
-
- ₹ - {GlobaldummyData - ? "1,066" - : Number(table2Data?.NetAmount).toFixed(2)} +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
-
- ) - : (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} + ) + : GlobalQrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}
-
- - {GlobaldummyData && -
Cashier :
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
Cashier : +
+ {GlobaldummyData && ( +
+ {' '} + Cashier :{' '}
- } - + )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+ Cashier : +
+ )} - {table2Data?.BookingTypeName == "Dine In" && ( -
- {" "} + {table2Data?.BookingTypeName == 'Dine In' && ( +
+ {' '} Waiter :
)}
-
-
+
+
{GlobaldummyData - ? "553" + ? '553' : table2Data?.SalesId && - extractLastNumber(table2Data?.SalesId)} + extractLastNumber(table2Data?.SalesId)}
-
+
{/* {GlobaldummyData ? "CASH" : PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName : "Split"} */}
- {GlobaldummyData && -
Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
{CashierName} + {GlobaldummyData && ( +
+ {' '} + Cashier Name
- } + )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+ {CashierName} +
+ )} - {GlobaldummyData && -
Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
{table2Data?.CustSuppName} + {GlobaldummyData && ( +
+ {' '} + Customer Name
- } + )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ {table2Data?.CustSuppName} +
+ )} - - {table2Data?.BookingTypeName == "Dine In" && ( -
+ {table2Data?.BookingTypeName == 'Dine In' && ( +
{table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
)} @@ -666,221 +1145,443 @@ const PurchaseOrdStyle6 = ({

-
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable + or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )}
- - {PrintGreeting?.SettingValue === "Y" && + {PrintGreeting?.SettingValue === 'Y' && ( <> -
Thank You
+
+ Thank You +
- } + )}
- } - + )}
- : -
-
-
- {GlobaldummyData ? "XYZ Shop" : table2Data?.BrName} + ) : ( +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
+
Mobile : {table2Data?.BrMobile}
- {table2Data?.OrderType === "E" &&
Estimate
} + {table2Data?.OrderType === 'E' && ( +
+ Estimate{' '} +
+ )} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ''} +
+ )}
- - -
{Date1}
+
{Date1}

- {(GlobaldummyData) && + {GlobaldummyData && ( <>
- + {GlobaldummyData - ? GlobalSlNo && - : SLNO && } + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} {GlobaldummyData ? ( (GlobalItem || GlobalQuantity) && ( - ) ) : ( - )} {GlobaldummyData ? GlobalHsnCode && ( - - ) + + ) : HsnCode && ( - - )} + + )} {GlobaldummyData ? GlobalMRP && ( - - ) + + ) : MRP && ( - - )} + + )} {GlobaldummyData ? GlobalDiscount && ( - - ) + + ) : Discount && ( - - )} + + )} {GlobaldummyData ? GlobalRate && ( - - ) + + ) : Rate && ( - - )} + + )} {GlobaldummyData ? GlobalAmount && ( - - ) + + ) : Amount && ( - - )} + + )} {(GlobaldummyData ? products : productsData)?.map( (item, index) => { return ( - + {GlobaldummyData ? GlobalSlNo && - : SLNO && } + : SLNO && ( + + )} {GlobaldummyData ? ( (GlobalItem || GlobalQuantity) && ( ) ) : ( - ) + + ) : HsnCode && ( - - )} + + )} {GlobaldummyData ? GlobalMRP && ( - - ) + + ) : MRP && ( - - )} + + )} {GlobaldummyData ? GlobalDiscount && ( - - ) + + ) : Discount && ( - - )} + + )} {GlobaldummyData ? GlobalRate && ( - - ) + + ) : Rate && ( - - )} + + )} {GlobaldummyData ? GlobalAmount && ( - - ) + + ) : Amount && ( - - )} + + )} ); } @@ -979,211 +1668,351 @@ const PurchaseOrdStyle6 = ({
S.NoS.No + S.No + + S.No + + {GlobaldummyData - ? GlobalItem && "ITEM /DES/" - : "ITEM /DES/"}{" "} - {GlobaldummyData ? GlobalQuantity && "QTY" : "QTY"} + ? GlobalItem && 'ITEM /DES/' + : 'ITEM /DES/'}{' '} + {GlobaldummyData ? GlobalQuantity && 'QTY' : 'QTY'} + {GlobaldummyData - ? GlobalItem && "ITEM /DES/" - : Item && "ITEM /DES/"}{" "} + ? GlobalItem && 'ITEM /DES/' + : Item && 'ITEM /DES/'}{' '} {GlobaldummyData - ? GlobalQuantity && "QTY" - : Quantity && "QTY"} + ? GlobalQuantity && 'QTY' + : Quantity && 'QTY'} HSN + HSN + HSN + HSN + MRP + MRP + MRP + MRP + - Dis{" "} - + Dis{' '} + - Dis{" "} - + Dis{' '} + - Rate - + Rate + - Rate - + Rate + - AMt - + AMt + - Amt - + Amt +
{index + 1}{index + 1} + {index + 1} + - {(GlobaldummyData - ? GlobalItem && + {GlobaldummyData ? ( + GlobalItem && ( + <> +
{item?.ProdName}
+
{item?.Size + item?.UomName}
+ + ) + ) : ( <>
{item?.ProdName}
-
{item?.Size + item?.UomName}
- - : - <> -
{item?.ProdName}
-
{item?.Size + item?.UomName + "-" + +
+ {item?.Size + + item?.UomName + + '-' + GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty} + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty}
)} -
{(GlobaldummyData ? GlobalItem && - item?.ProdName + `(${item?.Size + item?.UomName})` + item?.ProdName + + `(${item?.Size + item?.UomName})` : Item && - item?.ProdName + - `(${item?.Size ? item?.Size : "1"}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})`) + - "-" + + item?.ProdName + + `(${item?.Size ? item?.Size : '1'}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`) + + '-' + (GlobaldummyData ? GlobalQuantity && item?.SalesQty : Quantity && item?.SalesQty)} @@ -888,89 +1589,77 @@ const PurchaseOrdStyle6 = ({ )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - + {item?.HSN} + - {item?.HSN} - + {item?.HSN} + - {item?.MRP} - + {item?.MRP} + - {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} - + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + - {item.discount} - + {item.discount} + - {item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} - - + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + - {item?.Rate} - + {item?.Rate} + - {item?.Rate} - + {item?.Rate} + - {item?.TotalAmt} - + {item?.TotalAmt} + - {item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} - - + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
- } + )}
-
+
-
Items :{GlobaldummyData ? "8" : totalQuantityFilter?.length}
+
+ Items : + {GlobaldummyData ? '8' : totalQuantityFilter?.length}{' '} +
-
Qty : {GlobaldummyData ? "9" : calculatedTotalQuantity}
+
Qty : {GlobaldummyData ? '9' : calculatedTotalQuantity}
{((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => +

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( +
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- - - - - - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
+ Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) - + + SGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + Total Amount
+ {Number(item.WithOutTaxAmount).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- - - + - ) - } -
- {Number(item.WithOutTaxAmount).toFixed(2)} + + Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( + + + {Number(item.WithOutTaxAmount).toFixed(2)} + + + {Number(item.TaxAmt).toFixed(2)} + + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}

- - } + )}
- -
{GlobaldummyData ? GlobalQrcodet && ( -
- QRcode -
Scan to Pay
-
- ₹ - {GlobaldummyData - ? "1,066" - : Number(table2Data?.NetAmount).toFixed(2)} +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
-
- ) - : (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} + ) + : GlobalQrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}
-
- - - - {table2Data?.BookingTypeName == "Dine In" && ( -
- {" "} +
+ {table2Data?.BookingTypeName == 'Dine In' && ( +
+ {' '} Waiter :
)}
-
-
+
+
{GlobaldummyData - ? "553" + ? '553' : table2Data?.SalesId && - extractLastNumber(table2Data?.SalesId)} + extractLastNumber(table2Data?.SalesId)}
-
+
{/* {GlobaldummyData ? "CASH" : PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName : "Split"} */}
- {GlobaldummyData && -
Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && -
{CashierName} + {GlobaldummyData && ( +
+ {' '} + Cashier Name
- } + )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+ {CashierName} +
+ )} - {GlobaldummyData && -
Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
{table2Data?.CustSuppName} + {GlobaldummyData && ( +
+ {' '} + Customer Name
- } + )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ {table2Data?.CustSuppName} +
+ )} - - {table2Data?.BookingTypeName == "Dine In" && ( -
+ {table2Data?.BookingTypeName == 'Dine In' && ( +
{table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
)} @@ -1191,71 +2020,200 @@ const PurchaseOrdStyle6 = ({

-
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable or + refundable. +
  2. +
  3. + Please check the product before leaving the counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )}
- - {PrintGreeting?.SettingValue === "Y" && + {PrintGreeting?.SettingValue === 'Y' && ( <> -
Thank You
+
+ Thank You{' '} +
- } + )}
- - } + )} ); }; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle7.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle7.jsx index eb01cbf..da5f0d6 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle7.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle7.jsx @@ -2,990 +2,2536 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { extractLastNumberOrderId } from '../../../Services/Others'; import { - GlobalprintSlNo, - GlobalprintItem, - GlobalprintMRP, - GlobalprintDiscount, - GlobalprintQuantity, - GlobalprintRate, - GlobalprintAmount, - GlobalprintHsnCode, - GlobalprintQrcodet, - GlobalPritdummyData, - GloabalFieldDetails, - changeReprintDataFound, - GlobalprintSignature, - GlobalprinttermsAndConditions, - GlobalSignatureImage, - Globalnotes, - GlobalthemeFormat, - GlobalBillName, + GlobalprintSlNo, + GlobalprintItem, + GlobalprintMRP, + GlobalprintDiscount, + GlobalprintQuantity, + GlobalprintRate, + GlobalprintAmount, + GlobalprintHsnCode, + GlobalprintQrcodet, + GlobalPritdummyData, + GloabalFieldDetails, + changeReprintDataFound, + GlobalprintSignature, + GlobalprinttermsAndConditions, + GlobalSignatureImage, + Globalnotes, + GlobalthemeFormat, + GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, } from '../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../Features/BookingScreen/BookingData/BookingData'; -import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.scss" +import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.scss'; -import signature from "../../../Images/signatureimage.jpg" +import signature from '../../../Images/signatureimage.jpg'; import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; import { isMobile } from 'react-device-detect'; -const PurchaseOrdStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, CashierName, totalQuantity, OrderDetailGST, - OrderDetailIGST, OrderDetailVAT, table2Data, PaymentStatus, PrintGreeting, printDatas }) => { - - const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) - // const FieldDetails = useSelector(GloabalFieldDetails); - const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { - acc[item.ConfigName] = true; - return acc; - }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo); - const GlobalItem = useSelector(GlobalprintItem); - const GlobalMRP = useSelector(GlobalprintMRP); - const GlobalDiscount = useSelector(GlobalprintDiscount); - const GlobalQuantity = useSelector(GlobalprintQuantity); - const GlobalRate = useSelector(GlobalprintRate); - const GlobalAmount = useSelector(GlobalprintAmount); - const GlobalHsnCode = useSelector(GlobalprintHsnCode); - const GlobalQrcodet = useSelector(GlobalprintQrcodet); - const GlobaldummyData = useSelector(GlobalPritdummyData); - const GlobalSignature = useSelector(GlobalprintSignature); - const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); - const GlobalSignatureImages = useSelector(GlobalSignatureImage); - const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) - const appPreferences = useSelector(ApplicationPreferences); - - - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; - - - let PaymentStatusSuccess = PaymentStatus?.filter(ps => ps.PaymentStatus === "S") - const keysLength = Object.keys(table2Data ?? {}).length; - if (keysLength > 0) { - dispatch(changeReprintDataFound(true)); - } - const currentDate = new Date(); - const day = currentDate.getDate().toString().padStart(2, '0'); - const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - const monthIndex = currentDate.getMonth(); - const year = currentDate.getFullYear().toString().slice(-2); - - const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - const TakeawayData = table2Data?.productDetails || []; - - const productsData = table2Data?.productDetails || []; - - - const products = [ - { ProdName: 'ITEM 1', Rate: 88.00, SalesQty: 2, MRP: 100, TotalAmt: 176, discount: 0, HSN: '01', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 2', Rate: 300.00, SalesQty: 1, MRP: 350, TotalAmt: 300, discount: 0, HSN: '02', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 3', Rate: 200.00, SalesQty: 1, MRP: 250, TotalAmt: 200, discount: 0, HSN: '03', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 4', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '04', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 5', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '05', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 6', Rate: 130.00, SalesQty: 1, MRP: 150, TotalAmt: 130, discount: 0, HSN: '06', Size: 250, UomName: 'g' }, - { ProdName: 'ITEM 7', Rate: 230.00, SalesQty: 1, MRP: 250, TotalAmt: 230, discount: 0, HSN: '08', Size: 250, UomName: 'g' }, - ]; - - const chunkSize = isMobile ? 11 : PageSize == "A5" ? 8 : 11; - let dataSource = []; - - if (GlobaldummyData || TakeawayData?.length > 0) { - dataSource = GlobaldummyData ? products : TakeawayData; - } - - // Paginate the data - const paginatedChunks = []; - for (let i = 0; i < dataSource.length; i += chunkSize) { - paginatedChunks.push(dataSource.slice(i, i + chunkSize)); - } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 10 : PageSize == "A5" ? 5 : 10); - return ( - <> - {FormatTheme ? -
- {paginatedChunks.map((dataChunk, chunkIndex) => ( - //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "295mm" : "257mm") : "", }} key={chunkIndex}> - - - {/*
*/} -
- -
-
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} -
- {table2Data?.OrderType === "E" &&
Estimate
} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}
} -
- -
- -
-
-
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
-
-
{GlobaldummyData ? formattedDate : Date1}
-
-
- -
-
- -
-
- - {(TakeawayData?.length > 0 || GlobaldummyData) && - <> - {/* {
TakeAway
} */} -
- - - - - - {GlobaldummyData ? GlobalSlNo && : SLNO == true && } - {GlobaldummyData ? GlobalItem && : Item == true && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode == true && } - {GlobaldummyData ? GlobalQuantity && : Quantity == true && } - {GlobaldummyData ? GlobalMRP && : MRP == true && } - {GlobaldummyData ? GlobalRate && : Rate == true && } - {GlobaldummyData ? GlobalDiscount && : Discount == true && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - - - {dataChunk?.map((item, index) => ( - - {GlobaldummyData ? GlobalSlNo && : SLNO == true && } - {GlobaldummyData ? GlobalItem && - : Item == true && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode == true && } - {GlobaldummyData ? GlobalQuantity && : Quantity == true && } - {GlobaldummyData ? GlobalMRP && : MRP == true && } - {GlobaldummyData ? GlobalRate && : Rate == true && } - {GlobaldummyData ? GlobalDiscount && : Discount == true && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - ))} - -
SSItemItemHSNHSNQtyQtyMRPMRPRateRateDis Dis AmtAmt
{index + 1}{chunkIndex * chunkSize + index + 1}{item?.ProdName} -
{item?.ProdName}
-
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
-
{item?.HSN}{item?.HSN}{item?.SalesQty}{item?.SalesQty}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item?.Rate}{item?.Rate}{item.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- } - -
-
- - - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - <> -
- -
-
- - {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
-
- - {/*
Amount : ₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
*/} -
- -
- - - - {GlobaldummyData && -
-
Customer : Customer Name
-
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-
Customer : {table2Data?.CustSuppName}
-
- } - - - {GlobaldummyData ? GlobalQrcodet && -
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- : (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} - -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - -
-
- - - - {PrintGreeting?.SettingValue === "Y" && - <> -
Thank You Visit Again
-
- - } - - } -
- ))} - - {shouldFooterBeOnNewPage && FormatTheme && -
-
- <> -
- -
-
- - {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
-
- - -
- -
- - - - - {GlobaldummyData && -
-
Customer : Customer Name
-
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-
Customer : {table2Data?.CustSuppName}
-
- } - - - {GlobaldummyData ? GlobalQrcodet && -
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- : (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} - -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - -
-
- - - - {PrintGreeting?.SettingValue === "Y" && - <> -
Thank You Visit Again
-
- - } - -
-
- } -
- - - : -
-
-
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
{GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} -
- {table2Data?.OrderType === "E" &&
Estimate
} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
} -
- -
- -
-
-
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
-
-
{GlobaldummyData ? formattedDate : Date1}
-
-
- -
- -
- - - - {(TakeawayData?.length > 0 || GlobaldummyData) && - <> - {/* {
TakeAway
} */} -
- - - - - - {GlobaldummyData ? GlobalSlNo && : SLNO == true && } - {GlobaldummyData ? GlobalItem && : Item == true && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode == true && } - {GlobaldummyData ? GlobalQuantity && : Quantity == true && } - {GlobaldummyData ? GlobalMRP && : MRP == true && } - {GlobaldummyData ? GlobalRate && : Rate == true && } - {GlobaldummyData ? GlobalDiscount && : Discount == true && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - - - {(GlobaldummyData ? products : TakeawayData)?.map((item, index) => ( - - {GlobaldummyData ? GlobalSlNo && : SLNO == true && } - {GlobaldummyData ? GlobalItem && - : Item == true && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode == true && } - {GlobaldummyData ? GlobalQuantity && : Quantity == true && } - {GlobaldummyData ? GlobalMRP && : MRP == true && } - {GlobaldummyData ? GlobalRate && : Rate == true && } - {GlobaldummyData ? GlobalDiscount && : Discount == true && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - ))} - -
S.NSItemItemHSNHSNQtyQtyMRPMRPRateRateDis Dis AmtAmt
{index + 1}{index + 1}{item?.ProdName} -
{item?.ProdName}
-
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
-
{item?.HSN}{item?.HSN}{item?.SalesQty}{item?.SalesQty}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item?.Rate}{item?.Rate}{item.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- } - -
- -
- -
-
- - {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
-
- - -
- -
- - {GlobaldummyData && -
-
Customer : Customer Name
-
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-
Customer : {table2Data?.CustSuppName}
-
- } - - - - - {GlobaldummyData ? GlobalQrcodet && -
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- : (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} - -
{ + const dispatch = useDispatch(); + const GlobalUpiID = useSelector(GlobalUpiIDprint); + // const FieldDetails = useSelector(GloabalFieldDetails); + const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { + acc[item.ConfigName] = true; + return acc; + }, {}); + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobalQrcodet = useSelector(GlobalprintQrcodet); + const GlobaldummyData = useSelector(GlobalPritdummyData); + const GlobalSignature = useSelector(GlobalprintSignature); + const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); + const GlobalSignatureImages = useSelector(GlobalSignatureImage); + const GlobalIsnotes = useSelector(Globalnotes); + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); + const appPreferences = useSelector(ApplicationPreferences); + + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; + + let PaymentStatusSuccess = PaymentStatus?.filter( + (ps) => ps.PaymentStatus === 'S' + ); + const keysLength = Object.keys(table2Data ?? {}).length; + if (keysLength > 0) { + dispatch(changeReprintDataFound(true)); + } + const currentDate = new Date(); + const day = currentDate.getDate().toString().padStart(2, '0'); + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; + const monthIndex = currentDate.getMonth(); + const year = currentDate.getFullYear().toString().slice(-2); + + const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; + const TakeawayData = table2Data?.productDetails || []; + + const productsData = table2Data?.productDetails || []; + + const products = [ + { + ProdName: 'ITEM 1', + Rate: 88.0, + SalesQty: 2, + MRP: 100, + TotalAmt: 176, + discount: 0, + HSN: '01', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 2', + Rate: 300.0, + SalesQty: 1, + MRP: 350, + TotalAmt: 300, + discount: 0, + HSN: '02', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 3', + Rate: 200.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 200, + discount: 0, + HSN: '03', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 4', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '04', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 5', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '05', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 6', + Rate: 130.0, + SalesQty: 1, + MRP: 150, + TotalAmt: 130, + discount: 0, + HSN: '06', + Size: 250, + UomName: 'g', + }, + { + ProdName: 'ITEM 7', + Rate: 230.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 230, + discount: 0, + HSN: '08', + Size: 250, + UomName: 'g', + }, + ]; + + const chunkSize = isMobile ? 11 : PageSize == 'A5' ? 8 : 11; + let dataSource = []; + + if (GlobaldummyData || TakeawayData?.length > 0) { + dataSource = GlobaldummyData ? products : TakeawayData; + } + + // Paginate the data + const paginatedChunks = []; + for (let i = 0; i < dataSource.length; i += chunkSize) { + paginatedChunks.push(dataSource.slice(i, i + chunkSize)); + } + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 10 : PageSize == 'A5' ? 5 : 10); + + // + 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 + ); + + // + 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 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, + }; + + return ( + <> + {FormatTheme ? ( +
+ {paginatedChunks.map((dataChunk, chunkIndex) => ( + //
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}> +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '295mm' + : '257mm' + : '', + }} + key={chunkIndex} + > + {/*
*/} +
+
+
+
+ {' '} + {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+ {table2Data?.OrderType === 'E' && ( +
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {' '} + Estimate{' '} +
+ )} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? 'Cash' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : ''}{' '} +
+ )} +
-
-
) : - Notestext && (
-

{Notestext}

+
-
-
) - } +
+
+
+ Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+
+
+ {GlobaldummyData ? formattedDate : Date1} +
+
+
+
+
-
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } +
+
+ {(TakeawayData?.length > 0 || GlobaldummyData) && ( + <> + {/* {
TakeAway
} */} +
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO == true && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item == true && } + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode == true && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity == true && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP == true && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate == true && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount == true && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + + + {dataChunk?.map((item, index) => ( + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO == true && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item == true && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode == true && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity == true && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP == true && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate == true && ( + + )} + {GlobaldummyData + ? GlobalDiscount && + : Discount == true && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + ))} + +
S.NoS.NoItemItemHSNHSNQtyQtyMRPMRPRateRateDis Dis + Amt + + Amt +
+ {index + 1} + + {chunkIndex * chunkSize + index + 1} + {item?.ProdName} +
{item?.ProdName}
+
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+
+ {item?.HSN} + + {item?.HSN} + + {item?.SalesQty} + + {item?.SalesQty} + + {item?.MRP} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item?.Rate} + + {item?.Rate} + {item.discount} + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} +
+
+ + )} +
+
- {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + { + OrderDetailIGST?.[0] + ?.TaxPercentage + } + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+
+ + )}
+
+ + {/*
Amount : ₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
*/}
+
+ {GlobaldummyData && ( +
+
+ Customer : Customer Name +
+
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+
+ Customer : {table2Data?.CustSuppName} +
+
+ )} - {PrintGreeting?.SettingValue === "Y" && - <> -
Thank You Visit Again
-
- - } + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} + +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : Notestext && ( +
+

+ {Notestext} +

+ +
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not + exchangeable or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( + <> +
+ Thank You Visit Again +
+
+ + )} + + )} +
+ ))} + + {shouldFooterBeOnNewPage && FormatTheme && ( +
+
+ <> +
+
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+ +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2} + %) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2} + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+
+ + )} +
+
+
+ +
+ + {GlobaldummyData && ( +
+
+ Customer : Customer Name +
+
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+
+ Customer : {table2Data?.CustSuppName} +
+
+ )} + + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} + +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : Notestext && ( +
+

{Notestext}

+ +
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable + or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( + <> +
+ Thank You Visit Again +
+
+ + )} + +
+
+ )} +
+ ) : ( +
+
+
+
+ {' '} + {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')} +
+ {table2Data?.OrderType === 'E' && ( +
+ {' '} + Estimate{' '} +
+ )} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ''}{' '} +
+ )} +
+ +
+ +
+
+
+ Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+
+
+ {GlobaldummyData ? formattedDate : Date1} +
+
+
+ +
+ +
+ {(TakeawayData?.length > 0 || GlobaldummyData) && ( + <> + {/* {
TakeAway
} */} +
+ + + + {GlobaldummyData + ? GlobalSlNo && + : SLNO == true && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item == true && } + {GlobaldummyData + ? GlobalHsnCode && + : HsnCode == true && ( + + )} + {GlobaldummyData + ? GlobalQuantity && + : Quantity == true && ( + + )} + {GlobaldummyData + ? GlobalMRP && + : MRP == true && ( + + )} + {GlobaldummyData + ? GlobalRate && + : Rate == true && ( + + )} + {GlobaldummyData + ? GlobalDiscount && + : Discount == true && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + + + {(GlobaldummyData ? products : TakeawayData)?.map( + (item, index) => ( + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO == true && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item == true && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode == true && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity == true && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP == true && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate == true && ( + + )} + {GlobaldummyData + ? GlobalDiscount && + : Discount == true && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + ) + )} + +
S.NoS.No + Item + ItemHSNHSNQtyQtyMRPMRPRateRateDis Dis Amt + Amt +
+ {index + 1} + + {index + 1} + {item?.ProdName} +
{item?.ProdName}
+
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+
+ {item?.HSN} + + {item?.HSN} + + {item?.SalesQty} + + {item?.SalesQty} + + {item?.MRP} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item?.Rate} + + {item?.Rate} + {item.discount} + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
- } - - ); + + )} +
+ +
+
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+ +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+
+ + )} +
+
+
+ +
+ + {GlobaldummyData && ( +
+
+ Customer : Customer Name +
+
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+
+ Customer : {table2Data?.CustSuppName} +
+
+ )} + + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} + +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

+ +
+
+ ) + : Notestext && ( +
+

{Notestext}

+ +
+
+ )} + +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable or + refundable. +
  2. +
  3. + Please check the product before leaving the counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ + {PrintGreeting?.SettingValue === 'Y' && ( + <> +
+ Thank You Visit Again +
+
+ + )} +
+ )} + + ); }; export default PurchaseOrdStyle7; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle8.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle8.jsx index 7bd57d8..84ec5c8 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle8.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle8.jsx @@ -1,672 +1,1521 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import QrImage from '../../../Images/QRcode.png'; -import { extractLastNumber, extractLastNumberOrderId } from '../../../Services/Others'; import { - GlobalprintSlNo, - GlobalprintItem, - GlobalprintMRP, - GlobalprintDiscount, - GlobalprintQuantity, - GlobalprintRate, - GlobalprintAmount, - GlobalprintHsnCode, - GlobalprintQrcodet, - GlobalPritdummyData, - changeReprintDataFound, - GloabalFieldDetails, - GlobalprintSignature, - GlobalprinttermsAndConditions, - GlobalSignatureImage, - Globalnotes, - GlobalthemeFormat, - GlobalBillName, + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; +import { + GlobalprintSlNo, + GlobalprintItem, + GlobalprintMRP, + GlobalprintDiscount, + GlobalprintQuantity, + GlobalprintRate, + GlobalprintAmount, + GlobalprintHsnCode, + GlobalprintQrcodet, + GlobalPritdummyData, + changeReprintDataFound, + GloabalFieldDetails, + GlobalprintSignature, + GlobalprinttermsAndConditions, + GlobalSignatureImage, + Globalnotes, + GlobalthemeFormat, + GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, } from '../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../Features/BookingScreen/BookingData/BookingData'; import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.scss'; import QRCode from 'react-qr-code'; -import signature from "../../../Images/signatureimage.jpg" +import signature from '../../../Images/signatureimage.jpg'; import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; import { isMobile } from 'react-device-detect'; -const PurchaseOrdStyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, BranchAddress, BranchCity, BranchZip, CashierName, totalQuantity, OrderDetailGST, OrderDetailIGST, - OrderDetailVAT, table2Data, PrintGreeting, printDatas }) => { +const PurchaseOrdStyle8 = ({ + index, + ExtraChargeTotal, + Date1, + totalQuantityFilter, + BranchAddress, + BranchCity, + BranchZip, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PrintGreeting, + printDatas, +}) => { + const dispatch = useDispatch(); + const GlobalUpiID = useSelector(GlobalUpiIDprint); + // const FieldDetails = useSelector(GloabalFieldDetails); - const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) - // const FieldDetails = useSelector(GloabalFieldDetails); + const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { + acc[item.ConfigName] = true; + return acc; + }, {}); + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobalQrcodet = useSelector(GlobalprintQrcodet); + const GlobaldummyData = useSelector(GlobalPritdummyData); + const GlobalSignature = useSelector(GlobalprintSignature); + const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); + const GlobalSignatureImages = useSelector(GlobalSignatureImage); + const GlobalIsnotes = useSelector(Globalnotes); + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); + const appPreferences = useSelector(ApplicationPreferences); + const bookingTypePreference = appPreferences?.find( + (preference) => preference?.PreferredCatName === 'Booking Type' + )?.PreferenceCatDetails; + const dinePreference = bookingTypePreference?.find( + (type) => + type?.PreferredSubCatName?.toLowerCase() === 'dine in' && + type?.PreferredStatus === 'Y' + ); + const takeAwayPreference = bookingTypePreference?.find( + (type) => + type?.PreferredSubCatName?.toLowerCase() === 'take away' && + type?.PreferredStatus === 'Y' + ); - const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { - acc[item.ConfigName] = true; - return acc; - }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo); - const GlobalItem = useSelector(GlobalprintItem); - const GlobalMRP = useSelector(GlobalprintMRP); - const GlobalDiscount = useSelector(GlobalprintDiscount); - const GlobalQuantity = useSelector(GlobalprintQuantity); - const GlobalRate = useSelector(GlobalprintRate); - const GlobalAmount = useSelector(GlobalprintAmount); - const GlobalHsnCode = useSelector(GlobalprintHsnCode); - const GlobalQrcodet = useSelector(GlobalprintQrcodet); - const GlobaldummyData = useSelector(GlobalPritdummyData); - const GlobalSignature = useSelector(GlobalprintSignature); - const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); - const GlobalSignatureImages = useSelector(GlobalSignatureImage); - const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) - const appPreferences = useSelector(ApplicationPreferences); - const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails - const dinePreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "dine in" && type?.PreferredStatus === 'Y') - const takeAwayPreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "take away" && type?.PreferredStatus === 'Y') + console.log(GlobalDiscount, Discount, 'Discount'); - console.log(GlobalDiscount, Discount, "Discount"); + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize; - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; + const keysLength = Object.keys(table2Data ?? {}).length; + if (keysLength > 0) { + dispatch(changeReprintDataFound(true)); + } - const keysLength = Object.keys(table2Data ?? {}).length; - if (keysLength > 0) { - dispatch(changeReprintDataFound(true)); - } + const currentDate = new Date(); + const day = currentDate.getDate().toString().padStart(2, '0'); + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; + const monthIndex = currentDate.getMonth(); + const year = currentDate.getFullYear().toString().slice(-2); - const currentDate = new Date(); - const day = currentDate.getDate().toString().padStart(2, '0'); - const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - const monthIndex = currentDate.getMonth(); - const year = currentDate.getFullYear().toString().slice(-2); + const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; + const productsData = table2Data?.productDetails || []; + console.log('productsData:', productsData); // Debug log + const offers = table2Data?.OrderOfferDetails || []; - const productsData = table2Data?.productDetails || []; - console.log('productsData:', productsData); // Debug log - const offers = table2Data?.OrderOfferDetails || []; + console.log(printDatas, 'printDatasjk'); + const chunkSize = isMobile ? 10 : PageSize == 'A5' ? 10 : 16; + // Assign dataSource directly from table2Data.productDetails + let dataSource = table2Data?.productDetails || []; + // Paginate the data + const paginatedChunks = []; + for (let i = 0; i < dataSource.length; i += chunkSize) { + paginatedChunks.push(dataSource.slice(i, i + chunkSize)); + } + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 10 : PageSize == 'A5' ? 5 : 13); + console.log(paginatedChunks, 'paginatedChunks'); + const purchaseData = table2Data?.productDetails || []; + const calculatedTotalQuantity = purchaseData?.reduce((total, item) => { + return total + (Number(item?.SalesQty) || 0); + }, 0); - console.log(printDatas, "printDatasjk") - const chunkSize = isMobile ? 10 : PageSize == "A5" ? 10 : 16; - // Assign dataSource directly from table2Data.productDetails - let dataSource = table2Data?.productDetails || []; + // + 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 + ); - // Paginate the data - const paginatedChunks = []; - for (let i = 0; i < dataSource.length; i += chunkSize) { - paginatedChunks.push(dataSource.slice(i, i + chunkSize)); - } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > ( isMobile ? 10 : PageSize == "A5" ? 5 : 13); - console.log(paginatedChunks, "paginatedChunks"); + // + 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 headerStyle = { + backgroundColor: GlobaldummyData + ? SelectedHeaderColor + : headerColor?.background, - const purchaseData = table2Data?.productDetails || []; - const calculatedTotalQuantity = purchaseData?.reduce((total, item) => { - return total + (Number(item?.SalesQty) || 0); - }, 0); - return ( - <> - {FormatTheme ? -
- {paginatedChunks.map((dataChunk, chunkIndex) => ( - //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "295mm" : "257mm") : "", }} key={chunkIndex}> + 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, + }; -
- {/*

{table2Data?.BrName}

*/} -
{table2Data?.BrName}
-
- {BranchAddress || ''} {BranchCity ? (BranchAddress && BranchCity ? '-' : '') + BranchCity : ''} {BranchZip ? (BranchCity && BranchZip ? '-' : '') + BranchZip : ''} -
-
Mobile : +91 {table2Data?.BrMobile}
-
- {table2Data?.OrderType === "E" &&
Estimate
} + const rowtypeStyle = GlobaldummyData + ? SelectedRowType + : tableBodyColor?.rowType; - {table2Data?.OrderType === "E" ? "" :
{BillName ? BillName : "Payment" + ' Bill'}
} + const footerColorStyle = { + backgroundColor: GlobaldummyData + ? SelectedTableFooterColor + : footerColor?.background, + color: GlobaldummyData ? SelectedTableFooterFontColor : footerColor?.font, + }; -
- {/*
Purchase Order No :{table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
*/} -
{formattedDate}
-
+ return ( + <> + {FormatTheme ? ( +
+ {paginatedChunks.map((dataChunk, chunkIndex) => ( + //
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}> +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '295mm' + : '257mm' + : '', + }} + key={chunkIndex} + > + {/*
*/} +
+
+ {/*

{table2Data?.BrName}

*/} +
+ {table2Data?.BrName} +
+
+ {BranchAddress || ''}{' '} + {BranchCity + ? (BranchAddress && BranchCity ? '-' : '') + BranchCity + : ''}{' '} + {BranchZip + ? (BranchCity && BranchZip ? '-' : '') + BranchZip + : ''} +
+
+ {' '} + Mobile : +91 {table2Data?.BrMobile} +
+
+ {table2Data?.OrderType === 'E' && ( +
+ Estimate{' '} +
+ )} -
-
-
- {(productsData?.length > 0) && + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {BillName ? BillName : 'Payment' + ' Bill'} +
+ )} + +
+ {/*
Purchase Order No :{table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
*/} +
+ {formattedDate} +
+
+ +
+
+
+ {productsData?.length > 0 && ( + <> +
+ + + + {SLNO && ( + + )} + {Item && ( + + )} + {HsnCode && ( + + )} + {MRP && ( + + )} + {Rate && ( + + )} + {Discount && ( + + )} + {Quantity && ( + + )} + {Amount && ( + + )} + + + + {dataChunk?.map((item, index) => { + return ( + + {SLNO && ( + + )} + {Item && } + {HsnCode && } + {MRP && ( + + )} + {Rate && ( + + )} + {Discount && ( + + )} + {Quantity && ( + + )} + {Amount && ( + + )} + + ); + })} + +
+ S.No + Dis + HSN + + MRP + + Rate + + (%) + + Qty + + Amt +
+ {chunkIndex * chunkSize + index + 1} + {item?.ProdName}{item?.HSN} + {item?.MRP} + + {item?.Rate} + + {item?.discount} + + {item?.SalesQty} + + {item?.TotalAmt} +
+
+ + )} +
+ + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+ +
+
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
+ +
+

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} + + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( <> -
- - - - {SLNO && } - {Item && } - {HsnCode && } - {MRP && } - {Rate && } - {Discount && } - {Quantity && } - {Amount && } - - - - {dataChunk?.map((item, index) => { - return ( - - {SLNO && } - {Item && } - {HsnCode && } - {MRP && } - {Rate && } - {Discount && } - {Quantity && } - {Amount && } - - ) - })} - -
S.NoDisHSNMRPRate(%)QtyAmt
{chunkIndex * chunkSize + index + 1}{item?.ProdName}{item?.HSN}{item?.MRP}{item?.Rate}{item?.discount}{item?.SalesQty}{item?.TotalAmt}
-
+
+ + + + + + + + {OrderDetailIGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + IGST ( + { + OrderDetailIGST?.[0] + ?.TaxPercentage + } + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
- } -
+ )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && + + + {OrderDetailVAT?.map((item) => ( + + + - <> -
+ + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage} + %) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+
+ + )} +
+
+
+
-
+
+
+ {/*

Split Payment:

*/} + {/* {Object.keys(aggregatedPayments).map((paymentType) => ( */} + {/*
*/} + {/* {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} */} + {/*
*/} + {/* ))} */} +
-
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
+ {/*
Cashier : {CashierName}
*/} -
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
-
- -
- - -
- -
- -
- {/*

Split Payment:

*/} - {/* {Object.keys(aggregatedPayments).map((paymentType) => ( */} - {/*
*/} - {/* {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} */} - {/*
*/} - {/* ))} */} -
- - {/*
Cashier : {CashierName}
*/} - - {/* {CashierName && CashierName !== undefined && CashierName !== null && + {/* {CashierName && CashierName !== undefined && CashierName !== null &&
Cashier : {CashierName}
} */} -
Supplier Name : {table2Data?.CustSuppName}
+
+ {' '} + Supplier Name : {table2Data?.CustSuppName} +
- - {(table2Data?.BookingTypeName === "Dine In" && dinePreference) &&
Waiter: {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
} -
- - - -
- { - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- { - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} - -
-
- - - {PrintGreeting?.SettingValue === "Y" && -
- Thank You -
- } - - } -
- ))} - - - -
- : -
-
- {/*

{table2Data?.BrName}

*/} -
{table2Data?.BrName}
-
- {BranchAddress || ''} {BranchCity ? (BranchAddress && BranchCity ? '-' : '') + BranchCity : ''} {BranchZip ? (BranchCity && BranchZip ? '-' : '') + BranchZip : ''} -
-
Mobile : +91 {table2Data?.BrMobile}
-
- {table2Data?.OrderType === "E" &&
Estimate
} - - {table2Data?.OrderType === "E" ? "" :
{BillName ? BillName : "Payment" + ' Bill'}
} - -
- {/*
Purchase Order No :{table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
*/} -
{formattedDate}
+ {table2Data?.BookingTypeName === 'Dine In' && + dinePreference && ( +
+ Waiter:{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )}
-
- {(productsData?.length > 0) && - <> -
- - - - {SLNO && } - {Item && } - {HsnCode && } - {MRP && } - {Rate && } - {Discount && } - {Quantity && } - {Amount && } - - - - {productsData?.map((item, index) => { - return ( - - {SLNO && } - {Item && } - {HsnCode && } - {MRP && } - {Rate && } - {Discount && } - {Quantity && } - {Amount && } - - ) - })} - -
S.NoDisHSNMRPRate(%)QtyAmt
{index + 1}{item?.ProdName}{item?.HSN}{item?.MRP}{item?.Rate}{item?.discount}{item?.SalesQty}{item?.TotalAmt}
+
+ {Notestext && ( +
+

{Notestext}

+ +
+
+ )} + +
+ {TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
- - } -
+ )} + {Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
-
+ {PrintGreeting?.SettingValue === 'Y' && ( +
Thank You
+ )} + + )} +
+ ))} +
+ ) : ( +
+
+ {/*

{table2Data?.BrName}

*/} +
+ {table2Data?.BrName} +
+
+ {BranchAddress || ''}{' '} + {BranchCity + ? (BranchAddress && BranchCity ? '-' : '') + BranchCity + : ''}{' '} + {BranchZip + ? (BranchCity && BranchZip ? '-' : '') + BranchZip + : ''} +
+
+ {' '} + Mobile : +91 {table2Data?.BrMobile} +
+
+ {table2Data?.OrderType === 'E' && ( +
+ Estimate{' '} +
+ )} -
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
+ {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {BillName ? BillName : 'Payment' + ' Bill'} +
+ )} -
-

- --------- GST Breakup Details -----------

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - +
+ {/*
Purchase Order No :{table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
*/} +
+ {formattedDate} +
+
- - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailVAT?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - +
+ {productsData?.length > 0 && ( + <> +
+ + + + {SLNO && ( + + )} + {Item && } + {HsnCode && ( + + )} + {MRP && ( + + )} + {Rate && ( + + )} + {Discount && ( + + )} + {Quantity && ( + + )} + {Amount && ( + + )} + + + + {productsData?.map((item, index) => { + return ( + - - - - + : index % 2 === 1 && rowtypeStyle === 'odd' + ? { + ...tableBodyStyle, + } + : {}), + }} + > + {SLNO && ( + + )} + {Item && } + {HsnCode && } + {MRP && ( + + )} + {Rate && ( + + )} + {Discount && ( + + )} + {Quantity && ( + + )} + {Amount && ( + + )} + + ); + })} + +
+ S.No + Dis + HSN + + MRP + + Rate + + (%) + + Qty + + Amt +
{index + 1}{item?.ProdName}{item?.HSN}{item?.MRP}{item?.Rate} + {item?.discount} + + {item?.SalesQty} + + {item?.TotalAmt} +
+
+ + )} +
+
+
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <>
-
+
+

+ --------- GST Breakup Details ----------- +

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + CGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + SGST ({OrderDetailGST?.[0]?.TaxPercentage / 2}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} -
- {/*

Split Payment:

*/} - {/* {Object.keys(aggregatedPayments).map((paymentType) => ( */} - {/*
*/} - {/* {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} */} - {/*
*/} - {/* ))} */} -
+ {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + - {/*
Cashier : {CashierName}
*/} + + + {OrderDetailIGST?.map((item) => ( + + + - {/* {CashierName && CashierName !== undefined && CashierName !== null && + + + ))} +
+ Taxable Amount + + IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+
+ + )} +
+
+
+ +
+ +
+
+ {/*

Split Payment:

*/} + {/* {Object.keys(aggregatedPayments).map((paymentType) => ( */} + {/*
*/} + {/* {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} */} + {/*
*/} + {/* ))} */} +
+ + {/*
Cashier : {CashierName}
*/} + + {/* {CashierName && CashierName !== undefined && CashierName !== null &&
Cashier : {CashierName}
} */} -
Supplier Name : {table2Data?.CustSuppName}
+
+ {' '} + Supplier Name : {table2Data?.CustSuppName} +
+ {table2Data?.BookingTypeName === 'Dine In' && ( +
+ Waiter: {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )} +
- {table2Data?.BookingTypeName === "Dine In" &&
Waiter: {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
} -
+
+ {Notestext && ( +
+

{Notestext}

+
+
+ )} - -
- { - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- { - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} - -
-
- - - {PrintGreeting?.SettingValue === "Y" && -
- Thank You -
- } - +
+ {TermsnAdCondition == true && TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
- } + )} - - ) -} + {Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
-export default PurchaseOrdStyle8 + {PrintGreeting?.SettingValue === 'Y' && ( +
Thank You
+ )} +
+ )} + + ); +}; + +export default PurchaseOrdStyle8; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle9.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle9.jsx index 41fd38f..cf8e907 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle9.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchaseOrdStyle9.jsx @@ -1,7 +1,10 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import QrImage from '../../../Images/QRcode.png'; -import { extractLastNumber, extractLastNumberOrderId } from '../../../Services/Others'; +import { + extractLastNumber, + extractLastNumberOrderId, +} from '../../../Services/Others'; import { GlobalprintSlNo, GlobalprintItem, @@ -21,62 +24,82 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, } from '../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../Features/BookingScreen/BookingData/BookingData'; import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.scss'; import QRCode from 'react-qr-code'; -import signature from "../../../Images/signatureimage.jpg" +import signature from '../../../Images/signatureimage.jpg'; import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; import { isMobile } from 'react-device-detect'; -const PurchaseOrdStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, CashierName, totalQuantity, - OrderDetailGST, OrderDetailIGST, OrderDetailVAT, table2Data, PrintGreeting, printDatas }) => { - +const PurchaseOrdStyle9 = ({ + index, + ExtraChargeTotal, + Date1, + totalQuantityFilter, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PrintGreeting, + printDatas, +}) => { const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) + const GlobalUpiID = useSelector(GlobalUpiIDprint); // const FieldDetails = useSelector(GloabalFieldDetails); const FieldDetails = printDatas?.FieldDetails?.reduce((acc, item) => { acc[item.ConfigName] = true; return acc; }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const GlobalSlNo = useSelector(GlobalprintSlNo) - const GlobalItem = useSelector(GlobalprintItem) - const GlobalMRP = useSelector(GlobalprintMRP) - const GlobalDiscount = useSelector(GlobalprintDiscount) - const GlobalQuantity = useSelector(GlobalprintQuantity) - const GlobalRate = useSelector(GlobalprintRate) - const GlobalAmount = useSelector(GlobalprintAmount) - const GlobalHsnCode = useSelector(GlobalprintHsnCode) - const GlobalQrcodet = useSelector(GlobalprintQrcodet) - const GlobaldummyData = useSelector(GlobalPritdummyData) + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalQuantity = useSelector(GlobalprintQuantity); + const GlobalRate = useSelector(GlobalprintRate); + const GlobalAmount = useSelector(GlobalprintAmount); + const GlobalHsnCode = useSelector(GlobalprintHsnCode); + const GlobalQrcodet = useSelector(GlobalprintQrcodet); + const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobalSignature = useSelector(GlobalprintSignature); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); const appPreferences = useSelector(ApplicationPreferences); - const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails - - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; - + const bookingTypePreference = appPreferences?.find( + (preference) => preference?.PreferredCatName === 'Booking Type' + )?.PreferenceCatDetails; + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; const keysLength = Object.keys(table2Data ?? {}).length; if (keysLength > 0) { @@ -85,14 +108,27 @@ const PurchaseOrdStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter const currentDate = new Date(); const day = currentDate.getDate().toString().padStart(2, '0'); - const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + const monthNames = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; const monthIndex = currentDate.getMonth(); const year = currentDate.getFullYear().toString().slice(-2); const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - console.log(printDatas, "printDatasjk") - const chunkSize = isMobile ? 10 : PageSize == "A5" ? 10 : 16; + console.log(printDatas, 'printDatasjk'); + const chunkSize = isMobile ? 10 : PageSize == 'A5' ? 10 : 16; // Assign dataSource directly from table2Data.productDetails let dataSource = table2Data?.productDetails || []; @@ -101,36 +137,190 @@ const PurchaseOrdStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter for (let i = 0; i < dataSource.length; i += chunkSize) { paginatedChunks.push(dataSource.slice(i, i + chunkSize)); } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 10 : PageSize == "A5" ? 5 : 13); + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 10 : PageSize == 'A5' ? 5 : 13); + // + 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 + ); + // + 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 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, + }; return ( <> - {FormatTheme ? -
+ {FormatTheme ? ( +
{paginatedChunks.map((dataChunk, chunkIndex) => ( //
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}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "295mm" : "257mm") : "", }} key={chunkIndex}> - - +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '295mm' + : '257mm' + : '', + }} + key={chunkIndex} + > {/*
*/} -
- -
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
+
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
{/*
Low Prices... Love the Saving...
*/} -
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
- {table2Data?.OrderType === "E" &&
Estimate
} +
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+ {table2Data?.OrderType === 'E' && ( +
+ Estimate +
+ )} {/* {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}
} */} @@ -139,307 +329,660 @@ const PurchaseOrdStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter {table2Data?.BrGSTIN &&
GST NO :{table2Data?.BrGSTIN}, CIN :u00045hhsgbubufsdug
}
PH : +91 {table2Data?.BrMobile}
} */} -
-
PURCHASE ORDER No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
+
+
+ {' '} + PURCHASE ORDER No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+ {' '} + {GlobaldummyData ? formattedDate : Date1}{' '} +
-
- +
-
+
{paginatedChunks.map((dataChunk, chunkIndex) => ( - - {SLNO && } - {Item && } - {Quantity && } - {HsnCode && } - {MRP && } - {Discount && } - {Rate && } - {Amount && } + + {SLNO && ( + + )} + {Item && ( + + )} + {Quantity && ( + + )} + {HsnCode && ( + + )} + {MRP && ( + + )} + {Discount && ( + + )} + {Rate && ( + + )} + {Amount && ( + + )} - + {dataChunk.map((item, index) => ( - - {SLNO && } - {Item && - } - {Quantity && } - {HsnCode && } - {MRP && } - {Discount && } - {Rate && } - {Amount && } + : {}), + }} + > + {SLNO && ( + + )} + {Item && ( + + )} + {Quantity && ( + + )} + {HsnCode && ( + + )} + {MRP && ( + + )} + {Discount && ( + + )} + {Rate && ( + + )} + {Amount && ( + + )} ))}
S.NoItemQtyHSNMRPDis RateAmt
+ S.No + + Item + + Qty + + HSN + + MRP + + Dis{' '} + + Rate + + Amt +
{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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map((item2, idx) => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); +
{item?.SalesQty}{item?.HSN}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}{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 + ) + )?.map((a) => { + return ( +
+ {a.SerialNumber} +
+ ); + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || item1.IMEI2 !== '' + )?.map((item2, idx) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
+ {item?.SalesQty} + {item?.HSN} + {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + {item?.Rate} + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
))}
- {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - <> + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
-
+
- - - -
- - - -
- - {/*
+ {/*
Net Amount:
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
*/} -
+
+
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( + <> +
-
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - - - - - - - {OrderDetailIGST?.map((item) => - - - - + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+
- Taxable Amount - - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + - + + - - - ) - } -
+ Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / + 2} + %) + + Total Amount {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + {OrderDetailGST?.map((item) => ( + + + + + + + ))} +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ )} -
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) -
+ + + - + + + {OrderDetailIGST?.map((item) => ( + + + -
+ Taxable Amount + + IGST ( + { + OrderDetailIGST?.[0] + ?.TaxPercentage + } + %) +
+ Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} +
- - } - -
-
- - - } + + {Number(item.TotalAmt).toFixed(2)} + + + ))} + + + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage} + %) +
+ + )} +
+
+ + )} +
-
+
+ {/*
{PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : "Split"}   Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
*/} +
-
- {/*
{PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : "Split"}   Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
*/} -
- -
- - {GlobaldummyData && -
-

Customer : Customer Name

- -
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-

Supplier Name : {table2Data?.CustSuppName}

- -
- } - - - -
- - {/*
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} - - -
- -
- { - Notestext && (
-

{Notestext}

- -
-
) - } - - -
- { - (TermsnAdCondition == true &&
-

- Terms & Conditions +

+ {GlobaldummyData && ( +
+

+ Customer : Customer Name

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} - +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+

+ Supplier Name : {table2Data?.CustSuppName} +

+
+ )}
-
-
- {PrintGreeting?.SettingValue === "Y" && - <> -
+ {/*
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} +
-
+
+ {Notestext && ( +
+

{Notestext}

+
+
+ )} - {/*
Terms & Condition
+
+ {TermsnAdCondition == true && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} + + {Signature == true && ( +
+

+ Signature +

+ +
+ )} +
+
+ +
+ {PrintGreeting?.SettingValue === 'Y' && ( + <> +
+ +
+ {/*
Terms & Condition
Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy

*/} -
Thank You
-
+
+ Thank You +
+
-
- - } -
- - - } +
+ + )} +
+ + )}
))} - {shouldFooterBeOnNewPage && FormatTheme && + {shouldFooterBeOnNewPage && FormatTheme && (
-
<> - -
- - +
{/*
Amount :
@@ -458,11 +1001,8 @@ const PurchaseOrdStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter {GlobaldummyData ? '9' : calculatedTotalQuantity}
*/} -
- -
{/*
@@ -470,297 +1010,666 @@ const PurchaseOrdStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
*/} -
- +
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && + {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && ( <>
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - ) - } -
- Taxable Amount - - CGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - SGST ({(OrderDetailGST?.[0]?.TaxPercentage) / 2}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.CGST).toFixed(2)} - - {Number(item.SGST).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- } - - {(OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) && - <> -
- - - -
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + - - - + - {OrderDetailIGST?.map((item) => + {OrderDetailGST?.map((item) => ( - - + + - - - ) - } + ))}
Taxable Amount - IGST ({OrderDetailIGST?.[0]?.TaxPercentage}%) + + CGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2} + %) - + + SGST ( + {OrderDetailGST?.[0]?.TaxPercentage / 2} + %) + Total Amount
- {Number(item.WithOutTaxAmount).toFixed(2)} + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} - {Number(item.TaxAmt).toFixed(2)} + + {Number(item.CGST).toFixed(2)} + + {Number(item.SGST).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} {Number(item.TotalAmt).toFixed(2)}
- - } - {(OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0) && - <> -
- + )} - - - - - - - {OrderDetailVAT?.map((item) => - - + + + + + ))} +
- Taxable Amount - - VAT ({OrderDetailVAT?.[0]?.TaxPercentage}%) - - - Total Amount -
- {Number(item.WithOutTaxAmount).toFixed(2)} + {OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0 && ( + <> +
+ + + - - + - ) - } -
+ Taxable Amount - {Number(item.TaxAmt).toFixed(2)} + + IGST ( + {OrderDetailIGST?.[0]?.TaxPercentage} + %) {Number(item.TotalAmt).toFixed(2)} + Total Amount +
- - } + {OrderDetailIGST?.map((item) => ( +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} + {OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0 && ( + <> +
+ + + + + + + + {OrderDetailVAT?.map((item) => ( + + + + + + + ))} +
+ Taxable Amount + + VAT ( + {OrderDetailVAT?.[0]?.TaxPercentage}%) + + Total Amount +
+ {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )}
- - } + )} - -
+
{/*
{PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : "Split"}   Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
*/}
- - {GlobaldummyData && + {GlobaldummyData && (
-

Cashier : Cashier Name

- +

+ Cashier : Cashier Name +

- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && + )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && ( +
+

+ Cashier : {CashierName} +

+
+ )} + {GlobaldummyData && (
-

Cashier : {CashierName}

- +

+ Customer : Customer Name +

- } - {GlobaldummyData && -
-

Customer : Customer Name

+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+

+ Supplier Name : {table2Data?.CustSuppName} +

+
+ )} + {table2Data?.BookingTypeName == 'Dine In' && ( +
+ Waiter :{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-

Supplier Name : {table2Data?.CustSuppName}

- -
- } - - - {table2Data?.BookingTypeName == 'Dine In' && -
- Waiter : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} -
} - + )} {/*
CARD :
*********12
CARD HOLDER :
CARD HOLDER NAME
*/} - {GlobaldummyData ? GlobalQrcodet && -
- QRcode -
Scan to Pay
-
₹ {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
: - (Qrcodet && table2Data?.PaymentTypeName == 'UPI') && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} - - + {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹{' '} + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + table2Data?.PaymentTypeName == 'UPI' && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}
{/*
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
*/} +
-
- -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable + or refundable. +
  2. +
  3. + Please check the product before leaving the + counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && + {PrintGreeting?.SettingValue === 'Y' && ( <>
-
- - {/*
Terms & Condition
Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy Xxxx Yyyy

*/} -
Thank You
+
+ Thank You{' '} +

- } + )}
-
- } + )}
- : -
- -
-
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
+ ) : ( +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
{/*
Low Prices... Love the Saving...
*/} -
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (table2Data?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.AddressDetails?.[0]?.City ? (table2Data?.AddressDetails?.[0]?.Address1 && table2Data?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.AddressDetails?.[0]?.City : '') + (table2Data?.AddressDetails?.[0]?.Zip ? (table2Data?.AddressDetails?.[0]?.City && table2Data?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.AddressDetails?.[0]?.Zip : '')} +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
- {table2Data?.OrderType === "E" &&
Estimate
} +
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+ {table2Data?.OrderType === 'E' && ( +
+ Estimate +
+ )} {/* {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
} */} @@ -769,126 +1678,528 @@ const PurchaseOrdStyle9 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter {table2Data?.BrGSTIN &&
GST NO :{table2Data?.BrGSTIN}, CIN :u00045hhsgbubufsdug
}
PH : +91 {table2Data?.BrMobile}
} */} -
-
PURCHASE ORDER NO :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
+
+
+ {' '} + PURCHASE ORDER NO : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+ {' '} + {GlobaldummyData ? formattedDate : Date1}{' '} +
-
- - +
- {(GlobaldummyData) && + {GlobaldummyData && ( <> - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} {dataChunk?.map((item, index) => { return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && - } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalAmount && : Amount && } + : {}), + }} + > + {GlobaldummyData + ? GlobalSlNo && + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} - ) + ); })}
S.NoS.NoItemItemQtyQtyHSNHSNMRPMRPDis Dis RateRateAmtAmt
+ S.No + + S.No + + Item + + Item + + Qty + + Qty + + HSN + + HSN + + MRP + + MRP + + Dis{' '} + + Dis{' '} + + Rate + + Rate + + Amt + + Amt +
{index + 1}{chunkIndex * chunkSize + index + 1}{item?.ProdName} -
{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)) - ?.map(a => { return (
{a.SerialNumber}
) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") - ?.map(item2 => { - const imei1 = item2.IMEI1 || ""; - const imei2 = item2.IMEI2 || ""; - return (
{[imei1, imei2].filter(Boolean).join(",")}
); +
{item?.SalesQty}{item?.SalesQty}{item?.HSN}{item?.HSN}{item?.MRP}{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}{item.discount}{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}{item?.Rate}{item?.Rate}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}{index + 1}{chunkIndex * chunkSize + index + 1}{item?.ProdName} +
{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 + ) + )?.map((a) => { + return
{a.SerialNumber}
; + }) + : ''}{' '} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+
+ {item?.SalesQty} + + {item?.SalesQty} + + {item?.HSN} + + {item?.HSN} + + {item?.MRP} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + {item.discount} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + {item?.Rate} + + {item?.Rate} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
- } + )} -
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

-
-
) : - Notestext && (
-

{Notestext}

+
+
+ ) + : Notestext && ( +
+

{Notestext}

-
-
) - } +
+
+ )} +
+ {GlobaldummyData + ? GlobaltermsAndConditions && ( +
+

+ Terms & Conditions +

+
    +
  1. + Once goods are sold, they are not exchangeable or + refundable. +
  2. +
  3. + Please check the product before leaving the counter. +
  4. +
+
+ ) + : TermsnAdCondition == true && + TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} + {/*
  3. Please check the product before leaving the counter.
  4. */} +
+
+ )} -
- {GlobaldummyData ? GlobaltermsAndConditions && - (
-

- Terms & Conditions -

-
    -
  1. Once goods are sold, they are not exchangeable or refundable.
  2. -
  3. Please check the product before leaving the counter.
  4. -
-
) - : - (TermsnAdCondition == true && TermsAndConditions?.length > 0) && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} - {/*
  3. Please check the product before leaving the counter.
  4. */} -
-
) - } - - {GlobaldummyData ? GlobalSignature && (
-

Signature

- -
) : Signature == true && (
-

Signature

- -
)} - + {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

+ +
+ ) + : Signature == true && ( +
+

+ Signature +

+ +
+ )}
- -
- } - + )} ); -} +}; export default PurchaseOrdStyle9; diff --git a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchasePrint1.jsx b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchasePrint1.jsx index 87fde93..da7c6c2 100644 --- a/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchasePrint1.jsx +++ b/src/Pages/PurchaseOrder/PurchsasePrintStyle/PurchasePrint1.jsx @@ -1,18 +1,10 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; import { extractLastNumber, extractLastNumberOrderId, -} from "../../../Services/Others"; +} from '../../../Services/Others'; import { - GlobalprintSlNo, - GlobalprintItem, - GlobalprintMRP, - GlobalprintDiscount, - GlobalprintQuantity, - GlobalprintRate, - GlobalprintAmount, - GlobalprintHsnCode, GlobalPritdummyData, changeReprintDataFound, GloabalFieldDetails, @@ -22,10 +14,19 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, -} from "../../../Features/ThemeChange/ThemeChange"; -import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss"; -import signature from "../../../Images/signatureimage.jpg" -import { isMobile } from "react-device-detect"; + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, +} from '../../../Features/ThemeChange/ThemeChange'; +import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss'; +import signature from '../../../Images/signatureimage.jpg'; +import { isMobile } from 'react-device-detect'; const PurchasePrint1 = ({ index, @@ -36,7 +37,6 @@ const PurchasePrint1 = ({ PrintGreeting, printDatas, }) => { - console.log('table2Datatable2Data', printDatas); const dispatch = useDispatch(); @@ -45,42 +45,52 @@ const PurchasePrint1 = ({ acc[item.ConfigName] = true; return acc; }, {}); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobalSignature = useSelector(GlobalprintSignature); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); const keysLength = Object.keys(table2Data ?? {}).length; - let TermsAndConditions = printDatas?.TermsandConditions - let SignatureImg = printDatas?.Signature - let Notestext = printDatas?.Notes - let BillName = printDatas?.PrintHdrName - let FormatTheme = printDatas?.PrintType == "S" ? true : false - let PageSize = printDatas?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; + let TermsAndConditions = printDatas?.TermsandConditions; + let SignatureImg = printDatas?.Signature; + let Notestext = printDatas?.Notes; + let BillName = printDatas?.PrintHdrName; + let FormatTheme = printDatas?.PrintType == 'S' ? true : false; + let PageSize = printDatas?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; if (keysLength > 0) { dispatch(changeReprintDataFound(true)); } const currentDate = new Date(); - const day = currentDate.getDate().toString().padStart(2, "0"); + const day = currentDate.getDate().toString().padStart(2, '0'); const monthNames = [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', ]; const monthIndex = currentDate.getMonth(); const year = currentDate.getFullYear().toString().slice(-2); @@ -88,10 +98,10 @@ const PurchasePrint1 = ({ // For purchase orders, we use all product details const purchaseData = table2Data?.productDetails || []; - console.log(purchaseData, "purchaseData"); + console.log(purchaseData, 'purchaseData'); // const chunkSize = PageSize == "A5" ? 8 : 11; - const chunkSize = isMobile ? 11 : PageSize == "A5" ? 8 : 11; + const chunkSize = isMobile ? 11 : PageSize == 'A5' ? 8 : 11; let dataSource = GlobaldummyData ? [] : purchaseData; // Paginate the data @@ -99,52 +109,182 @@ const PurchasePrint1 = ({ for (let i = 0; i < dataSource.length; i += chunkSize) { paginatedChunks.push(dataSource.slice(i, i + chunkSize)); } - const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0; + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; // const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == "A5" ? 5 : 10); - const shouldFooterBeOnNewPage = lastChunkRows > (isMobile ? 11 : PageSize == "A5" ? 5 : 10); + const shouldFooterBeOnNewPage = + lastChunkRows > (isMobile ? 11 : PageSize == 'A5' ? 5 : 10); + // + 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 + ); + // + 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 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, + }; return ( <> - {FormatTheme ? + {FormatTheme ? (
{paginatedChunks.map((dataChunk, chunkIndex) => ( //
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme ? "" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : "257mm" : "", }} key={chunkIndex}> -
0 ? ' print-page-break' : ''}`} style={{ display: "flex", flexDirection: "column", justifyContent: ((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme ? "space-between" : "", height: FormatTheme ? PageSize == "A5" ? '170mm' : (isMobile ? "257mm" : "257mm") : "", }} key={chunkIndex}> - +
0 ? ' print-page-break' : ''}` + } + style={{ + display: 'flex', + flexDirection: 'column', + justifyContent: + chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme + ? 'space-between' + : '', + height: FormatTheme + ? PageSize == 'A5' + ? '170mm' + : isMobile + ? '257mm' + : '257mm' + : '', + }} + key={chunkIndex} + > {/*
*/} -
-
-
- {GlobaldummyData ? "XYZ Shop" : table2Data?.BrName} +
+
+
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
+
{GlobaldummyData - ? "BranchAddress, Town- 635XXX City - State" - : (table2Data?.AddressDetails?.[0]?.Address1 || "") + - (table2Data?.AddressDetails?.[0]?.City - ? (table2Data?.AddressDetails?.[0]?.Address1 && - table2Data?.AddressDetails?.[0]?.City - ? "-" - : "") + table2Data?.AddressDetails?.[0]?.City - : "") + - (table2Data?.AddressDetails?.[0]?.Zip - ? (table2Data?.AddressDetails?.[0]?.City && - table2Data?.AddressDetails?.[0]?.Zip - ? "-" - : "") + table2Data?.AddressDetails?.[0]?.Zip - : "")} + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
- Mobile : +91 {GlobaldummyData ? "986XXXXXXX" : table2Data?.BrMobile} +
+ Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
-
- {GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Purchase Order" : BillName ? BillName : "Purchase Order"} +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Purchase Order' + : BillName + ? BillName + : 'Purchase Order'}
@@ -152,25 +292,25 @@ const PurchasePrint1 = ({
- {( -
+ { +
Supplier : {table2Data?.CustSuppName}
- )} -
+ } +
Order No: {GlobaldummyData - ? "PO001" + ? 'PO001' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
-
+
Date : {GlobaldummyData ? formattedDate : Date1}
@@ -179,181 +319,319 @@ const PurchasePrint1 = ({
-
+
- - {SLNO == true && } - {Item == true && } + + {SLNO == true && ( + + )} + {Item == true && ( + + )} {HsnCode == true && ( - + )} {Quantity == true && ( - + + )} + {MRP == true && ( + + )} + {Rate == true && ( + )} - {MRP == true && } - {Rate == true && } {Amount == true && ( - )} - {dataChunk?.map( - (item, index) => ( - - {SLNO == true && ( - - )} - {Item == true && ( - - )} - {HsnCode == true && ( - - )} - {Quantity == true && ( - - )} - {MRP == true && ( - - )} - {Rate == true && ( - - )} - {Amount == true && ( - - )} - - ) - )} + {dataChunk?.map((item, index) => ( + + {SLNO == true && ( + + )} + {Item == true && ( + + )} + {HsnCode == true && ( + + )} + {Quantity == true && ( + + )} + {MRP == true && ( + + )} + {Rate == true && ( + + )} + {Amount == true && ( + + )} + + ))}
S.NoItem
+ S.No + ItemHSN + HSN + Qty + Qty + + MRP + + Rate + MRPRate + Amt
- {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?.HSN} - - {item?.SalesQty} - - {item?.SinglePc === "Y" - ? item?.Rate - : item?.MRP} - - {item?.Rate} - - {item?.TotalAmt} -
+ {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?.HSN} + {item?.SalesQty} + + {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} + {item?.Rate} + {item?.TotalAmt} +
- {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - <> - {/*
*/} -
- -
-
+ {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> {/*
*/} +
+
+ {/*
*/} -
- { - Notestext && (
-

{Notestext}

-
-
) - } - -
- { - (TermsAndConditions?.length > 0) && (
-

- Terms & Conditions +

+ {Notestext && ( +
+

+ {Notestext}

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} -
-
) - } +
+
+ )} - {(
-

Signature

- -
)} -
- {PrintGreeting?.SettingValue === "Y" && ( -
- Thank You +
+ {TermsAndConditions?.length > 0 && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
+ )} + + { +
+

+ Signature +

+ +
+ }
- )} + {PrintGreeting?.SettingValue === 'Y' && ( +
+ Thank You +
+ )} +
-
- - } + + )}
))} -
: -
+
+ ) : ( +
-
- {GlobaldummyData ? "XYZ Shop" : table2Data?.BrName} +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
+
{GlobaldummyData - ? "BranchAddress, Town- 635XXX City - State" - : (table2Data?.AddressDetails?.[0]?.Address1 || "") + - (table2Data?.AddressDetails?.[0]?.City - ? (table2Data?.AddressDetails?.[0]?.Address1 && - table2Data?.AddressDetails?.[0]?.City - ? "-" - : "") + table2Data?.AddressDetails?.[0]?.City - : "") + - (table2Data?.AddressDetails?.[0]?.Zip - ? (table2Data?.AddressDetails?.[0]?.City && - table2Data?.AddressDetails?.[0]?.Zip - ? "-" - : "") + table2Data?.AddressDetails?.[0]?.Zip - : "")} + ? 'BranchAddress, Town- 635XXX City - State' + : (table2Data?.AddressDetails?.[0]?.Address1 || '') + + (table2Data?.AddressDetails?.[0]?.City + ? (table2Data?.AddressDetails?.[0]?.Address1 && + table2Data?.AddressDetails?.[0]?.City + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.City + : '') + + (table2Data?.AddressDetails?.[0]?.Zip + ? (table2Data?.AddressDetails?.[0]?.City && + table2Data?.AddressDetails?.[0]?.Zip + ? '-' + : '') + table2Data?.AddressDetails?.[0]?.Zip + : '')}
-
- Mobile : +91 {GlobaldummyData ? "986XXXXXXX" : table2Data?.BrMobile} +
+ Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
-
- {GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Purchase Order" : BillName ? BillName : "Purchase Order"} +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Purchase Order' + : BillName + ? BillName + : 'Purchase Order'}
@@ -365,24 +643,24 @@ const PurchasePrint1 = ({ table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && ( -
+
Supplier : {table2Data?.CustSuppName}
)} -
+
Order No: {GlobaldummyData - ? "PO001" + ? 'PO001' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
-
+
Date : {GlobaldummyData ? formattedDate : Date1}
@@ -394,144 +672,225 @@ const PurchasePrint1 = ({ - {SLNO == true && } - {Item == true && } + {SLNO == true && ( + + )} + {Item == true && ( + + )} {HsnCode == true && ( - + )} {Quantity == true && ( - + + )} + {MRP == true && ( + + )} + {Rate == true && ( + )} - {MRP == true && } - {Rate == true && } {Amount == true && ( - )} - { - console.log('Debug values:', { SLNO, Item, HsnCode, Quantity, MRP, Rate, Amount }) - // console.log('purchaseData:', purchaseData) - } + {console.log('Debug values:', { + SLNO, + Item, + HsnCode, + Quantity, + MRP, + Rate, + Amount, + })} - {purchaseData?.map( - (item, index) => ( - - {SLNO == true && ( - - )} - {Item == true && ( - - )} - {HsnCode == true && ( - - )} - {Quantity == true && ( - - )} - {MRP == true && ( - - )} - {Rate == true && ( - - )} - {Amount == true && ( - - )} - - ) - )} + {purchaseData?.map((item, index) => ( + + {SLNO == true && ( + + )} + {Item == true && ( + + )} + {HsnCode == true && ( + + )} + {Quantity == true && ( + + )} + {MRP == true && ( + + )} + {Rate == true && ( + + )} + {Amount == true && ( + + )} + + ))}
S.NoItemS.NoItemHSNHSNQtyQtyMRPRateMRPRate + Amt
- {index + 1} - -
{item?.ProdName}
-
- {item?.Size ? item?.Size : "1"}{" "} - {item?.SinglePc == "Y" - ? "PCS" - : item?.Type != "C" - ? item?.UomName - : "COMBO"} -
-
- {item?.HSN} - - {item?.SalesQty} - - {item?.SinglePc === "Y" - ? item?.Rate - : item?.MRP} - - {item?.Rate} - - {item?.TotalAmt} -
{index + 1} +
{item?.ProdName}
+
+ {item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} +
+
{item?.HSN}{item?.SalesQty} + {item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} + {item?.Rate}{item?.TotalAmt}

-
- -
+

-
- { - Notestext && (
-

{Notestext}

+
+ {Notestext && ( +
+

{Notestext}


-
) - } +
+ )} -
- {TermsnAdCondition == true && (
-

- Terms & Conditions -

-
    - {TermsAndConditions?.map(item => (
  1. {item?.TermsandConditions}
  2. ))} -
-
) - } - - {Signature == true && (
-

Signature

- -
)} +
+ {TermsnAdCondition == true && ( +
+

+ Terms & Conditions +

+
    + {TermsAndConditions?.map((item) => ( +
  1. + {item?.TermsandConditions} +
  2. + ))} +
+
+ )} + {Signature == true && ( +
+

+ Signature +

+ +
+ )}
- {PrintGreeting?.SettingValue === "Y" && ( -
+ {PrintGreeting?.SettingValue === 'Y' && ( +
Thank You
)} -
- } + )} ); };