From f1761326709f4d80e9ee464ccbeb2a22404d9e5d Mon Sep 17 00:00:00 2001 From: karthikalakshmi Date: Tue, 3 Feb 2026 13:55:24 +0530 Subject: [PATCH] FIX #60 Print Header Integrated code missing --- .../ThermalPrinter/PrintStyle6.jsx | 10 +- .../ThermalPrinter/PrintStyle7.jsx | 5468 +++++++++++---- .../ThermalPrinter/PrintStyle8.jsx | 5979 +++++++++++++---- .../ThermalPrinter/PrintStyle9.jsx | 2987 ++++---- src/Pages/Preference/PreferenceList.jsx | 13 +- src/Pages/StockMaster/StockForm.jsx | 1659 ++--- .../BSBillingEditQuantity.scss | 43 +- .../BSBillingTables/BSPacking/BSPacking.scss | 22 +- src/Styles/PurchaseReturn/purchasereturn.scss | 12 +- 9 files changed, 11019 insertions(+), 5174 deletions(-) diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx index 2f03b14..145eb88 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx @@ -29,6 +29,7 @@ import { GlobalprintLogo, GlobalprintCredit, GlobalprintTax, + GlobalSelectedPrintHeaderColor, } from '../../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint, @@ -123,6 +124,7 @@ const Printstyle6 = ({ const paymentTypeUPI = PaymentStatus?.find( (ps) => ps.PaymentTypeName === 'UPI' ); + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); console.log(GlobalDiscount, Discount, 'Discount'); @@ -400,7 +402,9 @@ const Printstyle6 = ({ /> ) : null} - {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
@@ -3170,7 +3174,9 @@ const Printstyle6 = ({ /> ) : null}
- {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx index 6ef6187..b47d70c 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx @@ -1,1433 +1,4099 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import QRcode from '../../../../Images/QRcode.png' +import QRcode from '../../../../Images/QRcode.png'; import { extractLastNumberOrderId } from '../../../../Services/Others'; import { - GlobalprintSlNo, - GlobalprintItem, - GlobalprintMRP, - GlobalprintDiscount, - GlobalprintQuantity, - GlobalprintRate, - GlobalprintAmount, - GlobalprintHsnCode, - GlobalprintQrcodet, - GlobalPritdummyData, - GloabalFieldDetails, - changeReprintDataFound, - GlobalprintSignature, - GlobalprinttermsAndConditions, - GlobalSignatureImage, - Globalnotes, - GlobalthemeFormat, - GlobalBillName, - GlobalprintCashierName, - GlobalprintLogo, - GlobalprintCredit, - GlobalprintTax, + GlobalprintSlNo, + GlobalprintItem, + GlobalprintMRP, + GlobalprintDiscount, + GlobalprintQuantity, + GlobalprintRate, + GlobalprintAmount, + GlobalprintHsnCode, + GlobalprintQrcodet, + GlobalPritdummyData, + GloabalFieldDetails, + changeReprintDataFound, + GlobalprintSignature, + GlobalprinttermsAndConditions, + GlobalSignatureImage, + Globalnotes, + GlobalthemeFormat, + GlobalBillName, + GlobalprintCashierName, + GlobalprintLogo, + GlobalprintCredit, + GlobalprintTax, + GlobalSelectedPrintHeaderColor, } from '../../../../Features/ThemeChange/ThemeChange'; -import Logo from '../../../../Images/Logo.jpg' -import { GlobalUpiIDprint, PreferenceData } from '../../../../Features/BookingScreen/BookingData/BookingData'; -import "../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.scss" +import Logo from '../../../../Images/Logo.jpg'; +import { + GlobalUpiIDprint, + PreferenceData, +} from '../../../../Features/BookingScreen/BookingData/BookingData'; +import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.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'; import { settingDataSelector } from '../../../../Features/PreferenceMaster/PreferenceMaster'; -const PrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, CashierName, totalQuantity, OrderDetailGST, - OrderDetailIGST, OrderDetailVAT, table2Data, PaymentStatus, PrintGreeting, base64Image, PrintLogo, printDatas, isPdf, sportsAppPreference, SalesModePref, - MembershipApplied = null +const PrintStyle7 = ({ + index, + ExtraChargeTotal, + Date1, + totalQuantityFilter, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PaymentStatus, + PrintGreeting, + base64Image, + PrintLogo, + printDatas, + isPdf, + sportsAppPreference, + SalesModePref, + MembershipApplied = null, }) => { + const dispatch = useDispatch(); + const GlobalUpiID = useSelector(GlobalUpiIDprint); + const FieldDetails = useSelector(GloabalFieldDetails); + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Tax = FieldDetails?.['Tax']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const CashierNameField = FieldDetails?.['CashierName']; + const LogoField = FieldDetails?.['Logo']; + const CreditDetails = FieldDetails?.['Credit details']; + const WeightasKg = FieldDetails?.['Weight']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalTax = useSelector(GlobalprintTax); + 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 GlobalCashierName = useSelector(GlobalprintCashierName); + const GlobalLogo = useSelector(GlobalprintLogo); + const GlobalCredit = useSelector(GlobalprintCredit); + const SettingData = useSelector(PreferenceData); + const estimatePrintHeader = + SettingData?.[0]?.SettingDtlDetails?.find( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' + )?.SettingValue === 'Y'; + 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 paymentTypeUPI = PaymentStatus?.find( + (ps) => ps.PaymentTypeName === 'UPI' + ); + console.log(GlobalDiscount, Discount, 'Discount'); + console.log(printDatas, 'printDatasjk'); + 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 PackageDetails = table2Data?.PackageDtl; + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); - const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) - const FieldDetails = useSelector(GloabalFieldDetails); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Tax = FieldDetails?.["Tax"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const CashierNameField = FieldDetails?.["CashierName"]; - const LogoField = FieldDetails?.["Logo"]; - const CreditDetails = FieldDetails?.["Credit details"]; - const WeightasKg = FieldDetails?.['Weight']; - const GlobalSlNo = useSelector(GlobalprintSlNo); - const GlobalItem = useSelector(GlobalprintItem); - const GlobalMRP = useSelector(GlobalprintMRP); - const GlobalDiscount = useSelector(GlobalprintDiscount); - const GlobalTax = useSelector(GlobalprintTax); - 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 GlobalCashierName = useSelector(GlobalprintCashierName); - const GlobalLogo = useSelector(GlobalprintLogo); - const GlobalCredit = useSelector(GlobalprintCredit); - const SettingData = useSelector(PreferenceData); - const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find(setting => setting?.SettingIdName?.toLowerCase() === 'estimateprintheader')?.SettingValue === 'Y' - 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 paymentTypeUPI = PaymentStatus?.find((ps) => ps.PaymentTypeName === "UPI") - console.log(GlobalDiscount, Discount, "Discount"); - console.log(printDatas, "printDatasjk") - 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 PackageDetails = table2Data?.PackageDtl; + 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); - let PaymentStatusSuccess = PaymentStatus?.filter(ps => ps.PaymentStatus === "S") - const keysLength = Object.keys(table2Data ?? {}).length; - if (keysLength > 0) { - dispatch(changeReprintDataFound(true)); + const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; + const TakeawayData = table2Data?.productDetails?.filter( + (item) => item.BookingTypeName?.toLowerCase() === 'takeaway' + ); + const DineInData = table2Data?.productDetails?.filter( + (item) => item.BookingTypeName?.toLowerCase() === 'dine in' + ); + + const TakeawayTotal = TakeawayData?.reduce( + (accumulator, currentValue) => accumulator + currentValue.TotalAmt, + 0 + ); + const DineInTotal = DineInData?.reduce( + (accumulator, currentValue) => accumulator + currentValue.TotalAmt, + 0 + ); + const aggregatedPayments = PaymentStatusSuccess?.reduce( + (acc, paymentdata) => { + const paymentType = paymentdata?.PaymentTypeName; + const amount = Number(paymentdata?.Amount); + + if (acc[paymentType]) { + acc[paymentType] += amount; + } else { + acc[paymentType] = amount; + } + + return acc; + }, + {} + ); + const productsData = table2Data?.productDetails || []; + const offers = table2Data?.OrderOfferDetails || []; + + let TotalOfferAmount = 0; + + // Calculate SalesWiseOffers total amount + offers.forEach((offer) => { + if (offer.TableName === 'SalesWiseOffers') { + TotalOfferAmount += offer.OfferAmount; } - 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 hasMappedOffer = offers.some((offer) => + ['ItemWiseOffers', 'BundleOffers', 'QuantityWiseOffers'].includes( + offer.TableName + ) + ); - const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - const TakeawayData = table2Data?.productDetails?.filter(item => item.BookingTypeName?.toLowerCase() === "takeaway") - const DineInData = table2Data?.productDetails?.filter(item => item.BookingTypeName?.toLowerCase() === "dine in") - - const TakeawayTotal = TakeawayData?.reduce( - (accumulator, currentValue) => accumulator + currentValue.TotalAmt, - 0, + if (hasMappedOffer) { + const productTotal = productsData?.reduce( + (acc, item) => + acc + (item?.Type != 'C' ? item.OfferAmt : item.OfferValue || 0), + 0 ); - const DineInTotal = DineInData?.reduce( - (accumulator, currentValue) => accumulator + currentValue.TotalAmt, - 0, + TotalOfferAmount += productTotal; + } else { + const Combothere = productsData?.filter((item) => item?.Type == 'C'); + const CombothereTotal = Combothere?.reduce( + (acc, item) => acc + (item.OfferValue || 0), + 0 ); - const aggregatedPayments = PaymentStatusSuccess?.reduce((acc, paymentdata) => { - const paymentType = paymentdata?.PaymentTypeName; - const amount = Number(paymentdata?.Amount); - - if (acc[paymentType]) { - acc[paymentType] += amount; - } else { - acc[paymentType] = amount; - } - - return acc; - }, {}); - const productsData = table2Data?.productDetails || []; - const offers = table2Data?.OrderOfferDetails || []; - - let TotalOfferAmount = 0; - - // Calculate SalesWiseOffers total amount - offers.forEach(offer => { - if (offer.TableName === 'SalesWiseOffers') { - TotalOfferAmount += offer.OfferAmount; - } - }); - const hasMappedOffer = offers.some(offer => - ["ItemWiseOffers", "BundleOffers", "QuantityWiseOffers"].includes(offer.TableName) - ); - - if (hasMappedOffer) { - - const productTotal = productsData?.reduce((acc, item) => acc + (item?.Type != "C" ? item.OfferAmt : item.OfferValue || 0), 0); - TotalOfferAmount += productTotal; - } else { - const Combothere = productsData?.filter(item => item?.Type == "C") - const CombothereTotal = Combothere?.reduce((acc, item) => acc + (item.OfferValue || 0), 0); - TotalOfferAmount += CombothereTotal; - } - const products = [ - { ProdName: 'ITEM 1', Rate: 88.00, SalesQty: 2, MRP: 100, TotalAmt: 176, discount: 0, HSN: '01', Size: 250, UomName: 'g', ProdTaxPercentage: 5 }, - { ProdName: 'ITEM 2', Rate: 300.00, SalesQty: 1, MRP: 350, TotalAmt: 300, discount: 0, HSN: '02', Size: 250, UomName: 'g', ProdTaxPercentage: 5 }, - { ProdName: 'ITEM 3', Rate: 200.00, SalesQty: 1, MRP: 250, TotalAmt: 200, discount: 0, HSN: '03', Size: 250, UomName: 'g', ProdTaxPercentage: 0 }, - { ProdName: 'ITEM 4', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '04', Size: 250, UomName: 'g', ProdTaxPercentage: 18 }, - { ProdName: 'ITEM 5', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '05', Size: 250, UomName: 'g', ProdTaxPercentage: 40 }, - { ProdName: 'ITEM 6', Rate: 130.00, SalesQty: 1, MRP: 150, TotalAmt: 130, discount: 0, HSN: '06', Size: 250, UomName: 'g', ProdTaxPercentage: 0 }, - { ProdName: 'ITEM 7', Rate: 230.00, SalesQty: 1, MRP: 250, TotalAmt: 230, discount: 0, HSN: '08', Size: 250, UomName: 'g', ProdTaxPercentage: 5 }, - ]; - - const chunkSize = PageSize == "A5" ? 8 : 11; - let dataSource = []; - - if (GlobaldummyData || TakeawayData?.length > 0) { - dataSource = GlobaldummyData ? products : TakeawayData; - } else if (DineInData?.length > 0) { - dataSource = DineInData; - } - - // 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 > (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: isMobile ? "295mm" : FormatTheme ? PageSize == "A5" ? '170mm' : "257mm" : "", }} key={chunkIndex}> - - - {/*
*/} -
-
- {((!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {/*
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
*/} -
- {(GlobaldummyData && GlobalLogo) ? image : null} - {(base64Image && (PrintLogo?.SettingValue === "Y" || LogoField)) ? image : null} -
{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 {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} -
)} - {(!estimatePrintHeader && table2Data?.OrderType === "E") &&
Estimate {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} -
- -
-
-
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
-
-
{GlobaldummyData ? formattedDate : Date1}
-
-
- -
-
- -
-
- - {(TakeawayData?.length > 0 || GlobaldummyData) && - <> - {takeAwayPreference &&
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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - ))} - -
SSItemItemHSNHSNQty{ WeightasKg ?'Qty/Kg' :'Qty'}MRPMRPRateRateDis Dis Tax % Tax % AmtAmt
{index + 1}{chunkIndex * chunkSize + index + 1}{item?.ProdName} -
{item?.ProdName}
- {(PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId).length > 0 ? -
- {PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId)?.map((item, index) => ( - - {item.ParcelCount} PCS {item.ParcelQty} PACK ({item.ParcelType}) - - ))} - -
- :
({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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- } - {(DineInData?.length > 0 && dinePreference) && - <> -
Dine In
- -
- - - - {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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - ))} - -
S.NoS.NOItemItemHSNHSNQty{ WeightasKg ?'Qty/Kg' :'Qty'}MRPMRPRateRateDis Dis Tax % Tax % 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?.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?.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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- } -
-
- - - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - <> -
-
-
Items : {GlobaldummyData ? '8' : totalQuantityFilter?.length}
-
Qty : {GlobaldummyData ? '9' : totalQuantity}
- {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
Off : {GlobaldummyData ? '10' : Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}
} -
-
- {(table2Data?.OrderType === "E") ? '' :
- - {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && (table2Data?.NetAmount !== 0) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - - ) - } -
- - Taxable Amount - - CGST - - SGST - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - Total Amount -
- {item?.TaxPercentage || 0}% - - {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
} -
- {(DineInData?.length > 0 && TakeawayData?.length > 0 && takeAwayPreference) && -
Take Away : ₹{Number(TakeawayTotal).toFixed(2)}
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && dinePreference) && -
Dine In: ₹{Number(DineInTotal).toFixed(2)}
- } -
Amount : ₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- -
-
-
{PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : "Split"}  Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
-
- {PaymentStatusSuccess?.length > 1 && - <> - {/*

Split Payment:

*/} - {Object.keys(aggregatedPayments).map((paymentType) => ( -
- {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} -
- ))} - - } - - {GlobaldummyData ? ( - GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) - ) : ( - CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === "Credit" && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

Advance Amount:{table2Data.CustomerDetails[0].OldCreditBal}

- ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

Opening Balance: {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)}

- ) : null} - - )} - - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

Current Advance Amount: {table2Data.CustomerDetails[0].CurrentCreditBal}

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

Current Balance Amount: {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)}

- ) : null} -
- ) - )} - {(GlobaldummyData && GlobalCashierName) && -
-
Cashier : Cashier Name
-
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && CashierNameField && -
-
Cashier : {CashierName}
-
- } - {GlobaldummyData && -
-
Customer : Customer Name
-
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-
Customer : {table2Data?.CustSuppName}
-
- } - - - {table2Data?.BookingTypeName == 'Dine In' && (table2Data?.SalesTableLinkDetails?.[0]?.WaiterName) && -
- Captain : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} -
} - {(sportsAppPreference && MembershipApplied) &&
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
} - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalQrcodet && -
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- : (Qrcodet && paymentTypeUPI) && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
} - -
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } -
} - - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {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 && -
-
- <> -
-
-
Items : {GlobaldummyData ? '8' : totalQuantityFilter?.length}
-
Qty : {GlobaldummyData ? '9' : totalQuantity}
- {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
Off : {GlobaldummyData ? '10' : Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}
} -
-
- {(table2Data?.OrderType === "E") ? '' :
- - {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && (table2Data?.NetAmount !== 0) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - - ) - } -
- - Taxable Amount - - CGST - - SGST - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - Total Amount -
- {item?.TaxPercentage || 0}% - - {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
} -
- {(DineInData?.length > 0 && TakeawayData?.length > 0 && takeAwayPreference) && -
Take Away : ₹{Number(TakeawayTotal).toFixed(2)}
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && dinePreference) && -
Dine In: ₹{Number(DineInTotal).toFixed(2)}
- } -
Amount : ₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- -
-
-
{PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : "Split"}  Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
-
- {PaymentStatusSuccess?.length > 1 && - <> - {/*

Split Payment:

*/} - {Object.keys(aggregatedPayments).map((paymentType) => ( -
- {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} -
- ))} - - } - - {GlobaldummyData ? ( - GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) - ) : ( - CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === "Credit" && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

Advance Amount:{table2Data.CustomerDetails[0].OldCreditBal}

- ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

Opening Balance: {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)}

- ) : null} - - )} - - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

Current Advance Amount: {table2Data.CustomerDetails[0].CurrentCreditBal}

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

Current Balance Amount: {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)}

- ) : null} -
- ) - )} - {(GlobaldummyData && GlobalCashierName) && -
-
Cashier : Cashier Name
-
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && CashierNameField && -
-
Cashier : {CashierName}
-
- } - {GlobaldummyData && -
-
Customer : Customer Name
-
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-
Customer : {table2Data?.CustSuppName}
-
- } - - - {table2Data?.BookingTypeName == 'Dine In' && (table2Data?.SalesTableLinkDetails?.[0]?.WaiterName) && -
- Captain : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} -
} - {(sportsAppPreference && MembershipApplied) &&
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
} - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalQrcodet && -
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- : (Qrcodet && paymentTypeUPI) && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
} - -
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } -
} - - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {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
-
- - } - -
-
- } -
- - - : -
-
- {((!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
-
- {(GlobaldummyData && GlobalLogo) ? image : null} - {(base64Image && (PrintLogo?.SettingValue === "Y" || LogoField)) ? image : null} -
{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 {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} -
)} - {(!estimatePrintHeader && table2Data?.OrderType === "E") &&
Estimate {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} -
- -
-
-
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
-
-
{GlobaldummyData ? formattedDate : Date1}
-
-
- -
- -
- - - - {(TakeawayData?.length > 0 || GlobaldummyData) && - <> - {takeAwayPreference &&
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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - ))} - -
S.NoS.NoItemItemHSNHSNQty{ WeightasKg ?'Qty/Kg' :'Qty'}MRPMRPRateRateDis Dis Tax % Tax % AmtAmt
{index + 1}{index + 1}{item?.ProdName} -
{item?.ProdName}
- {(PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId).length > 0 ? -
- {PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId)?.map((item, index) => ( - - {item.ParcelCount} PCS {item.ParcelQty} PACK ({item.ParcelType}) - - ))} -
- :
({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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- } - {(DineInData?.length > 0 && dinePreference) && - <> -
Dine In
- -
- - - - {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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - - - {(GlobaldummyData ? products : DineInData)?.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 ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalAmount && : Amount == true && } - - ))} - -
SSItemItemHSNHSNQty{ WeightasKg ?'Qty/Kg' :'Qty'}MRPMRPRateRateDis Dis Tax % Tax % 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?.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?.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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- } -
- -
-
-
Items : {GlobaldummyData ? '8' : totalQuantityFilter?.length}
-
Qty : {GlobaldummyData ? '9' : totalQuantity}
- {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
Off : {GlobaldummyData ? '10' : Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}
} -
-
- {(table2Data?.OrderType === "E") ? '' :
- - {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && (table2Data?.NetAmount !== 0) && - <> -
- -
-
- --------- GST Breakup Details -----------
- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - - ) - } -
- - Taxable Amount - - CGST - - SGST - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - Total Amount -
- {item?.TaxPercentage || 0}% - - {Number(item.WithOutTaxAmount).toFixed(2)} - - {Number(item.TaxAmt).toFixed(2)} - {Number(item.TotalAmt).toFixed(2)}
- - } - -
-
- - - } -
} -
- {(DineInData?.length > 0 && TakeawayData?.length > 0 && takeAwayPreference) && -
Take Away : ₹{Number(TakeawayTotal).toFixed(2)}
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && dinePreference) && -
Dine In: ₹{Number(DineInTotal).toFixed(2)}
- } -
Amount : ₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- -
-
-
{PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : "Split"}  Payment :  {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/-
-
- {PaymentStatusSuccess?.length > 1 && - <> - {/*

Split Payment:

*/} - {Object.keys(aggregatedPayments).map((paymentType) => ( -
- {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} -
- ))} - - } - - {GlobaldummyData ? ( - GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) - ) : ( - CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === "Credit" && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

Advance Amount:{table2Data.CustomerDetails[0].OldCreditBal}

- ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

Opening Balance: {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)}

- ) : null} - - )} - - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

Current Advance Amount: {table2Data.CustomerDetails[0].CurrentCreditBal}

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

Current Balance Amount: {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)}

- ) : null} -
- ) - )} - {(GlobaldummyData && GlobalCashierName) && -
-
Cashier : Cashier Name
-
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && CashierNameField && -
-
Cashier : {CashierName}
-
- } - {GlobaldummyData && -
-
Customer : Customer Name
-
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
-
Customer : {table2Data?.CustSuppName}
-
- } - - - {table2Data?.BookingTypeName == 'Dine In' && (table2Data?.SalesTableLinkDetails?.[0]?.WaiterName) && -
- Captain : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} -
} - {(sportsAppPreference && MembershipApplied) &&
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
} - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalQrcodet && -
- QRcode -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
- : (Qrcodet && paymentTypeUPI) && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
} - -
0) { + dataSource = GlobaldummyData ? products : TakeawayData; + } else if (DineInData?.length > 0) { + dataSource = DineInData; + } + + // 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 > (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: isMobile + ? '295mm' + : FormatTheme + ? PageSize == 'A5' + ? '170mm' + : '257mm' + : '', + }} + key={chunkIndex} + > + {/*
*/} +
+
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {/*
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
*/} +
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ {GlobaldummyData && GlobalLogo ? ( + image + ) : null} + {base64Image && + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + image + ) : null} +
+ {' '} + {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{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? 'Cash' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : ''}{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} +
+ )} + {!estimatePrintHeader && table2Data?.OrderType === 'E' && ( +
+ {' '} + Estimate{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} +
-
-
) : - Notestext && (
-

{Notestext}

+
+
+
+ Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+
+
+ {GlobaldummyData ? formattedDate : Date1} +
+
+
-
-
) - } -
} +
+
+
+
+ {(TakeawayData?.length > 0 || GlobaldummyData) && ( + <> + {takeAwayPreference && ( +
+ 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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + ))} + +
SSItemItemHSNHSNQty + {WeightasKg ? 'Qty/Kg' : 'Qty'} + MRPMRPRateRateDis Dis Tax % Tax % + Amt + + Amt +
+ {index + 1} + + {chunkIndex * chunkSize + index + 1} + {item?.ProdName} +
{item?.ProdName}
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
+ {PackageDetails?.filter( + (pkg) => + pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} +
+ ) : ( +
+ ({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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 0} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} +
+
+ + )} + {DineInData?.length > 0 && dinePreference && ( + <> +
+ Dine In +
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {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 + ? 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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + ))} + +
S.NoS.NOItemItemHSNHSNQty + {WeightasKg ? 'Qty/Kg' : 'Qty'} + MRPMRPRateRateDis Dis Tax % Tax % + 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?.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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 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 && ( + <> +
+
+
+ Items :{' '} + {GlobaldummyData ? '8' : totalQuantityFilter?.length} +
+
+ Qty : {GlobaldummyData ? '9' : totalQuantity} +
+ {(table2Data?.OverallDisc > 0 || + TotalOfferAmount > 0) && ( +
+ Off :{' '} + {GlobaldummyData + ? '10' + : Number( + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} +
+ )} +
+
+ {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && + table2Data?.NetAmount !== 0 && ( + <> +
-
} +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + + ))} +
+ Taxable Amount + + CGST + + SGST + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed( + 2 + )} + + {Number( + item.TotalAmt + ).toFixed(2)} +
+ + )} +
+
+ + )} +
+ )} +
+ {DineInData?.length > 0 && + TakeawayData?.length > 0 && + takeAwayPreference && ( +
+ Take Away : ₹{Number(TakeawayTotal).toFixed(2)} +
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + dinePreference && ( +
+ Dine In: ₹{Number(DineInTotal).toFixed(2)} +
+ )} +
+ Amount : ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+
+
+ {PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : 'Split'}{' '} +  Payment :   + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} + /-{' '} +
+
+ {PaymentStatusSuccess?.length > 1 && ( + <> + {/*

Split Payment:

*/} + {Object.keys(aggregatedPayments).map((paymentType) => ( +
+ {paymentType}:{' '} + {aggregatedPayments[paymentType].toFixed(2)} +
+ ))} + + )} + {GlobaldummyData + ? GlobalCredit && ( +
+
Advance Amount:
+
Opening Balance:
+
+ ) + : CreditDetails && + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > + 0 ? ( +

+ Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

+ ) : table2Data.CustomerDetails[0].OldCreditBal < + 0 ? ( +

+ {' '} + Opening Balance:{' '} + {Math.abs( + table2Data.CustomerDetails[0].OldCreditBal + )} +

+ ) : null} + + )} - {PrintGreeting?.SettingValue === "Y" && - <> -
Thank You Visit Again
-
- - } + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > + 0 ? ( +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

+ ) : null} +
+ )} + {GlobaldummyData && GlobalCashierName && ( +
+
+ Cashier : Cashier Name +
+
+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && + CashierNameField && ( +
+
+ Cashier : {CashierName} +
+
+ )} + {GlobaldummyData && ( +
+
+ Customer : Customer Name +
+
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+
+ Customer : {table2Data?.CustSuppName} +
+
+ )} + + {table2Data?.BookingTypeName == 'Dine In' && + table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && ( +
+ Captain :{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )} + {sportsAppPreference && MembershipApplied && ( +
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} +
+ )} + +
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

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

+ {Notestext} +

+ +
+
+ )} +
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {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 && ( +
+
+ <> +
+
+
+ Items :{' '} + {GlobaldummyData ? '8' : totalQuantityFilter?.length} +
+
+ Qty : {GlobaldummyData ? '9' : totalQuantity} +
+ {(table2Data?.OverallDisc > 0 || + TotalOfferAmount > 0) && ( +
+ Off :{' '} + {GlobaldummyData + ? '10' + : Number( + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} +
+ )} +
+
+ {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && + table2Data?.NetAmount !== 0 && ( + <> +
+ +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + + ))} +
+ Taxable Amount + + CGST + + SGST + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {Number( + item.WithOutTaxAmount + ).toFixed(2)} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed( + 2 + )} +
+ + )} +
+
+ + )} +
+ )} +
+ {DineInData?.length > 0 && + TakeawayData?.length > 0 && + takeAwayPreference && ( +
+ Take Away : ₹{Number(TakeawayTotal).toFixed(2)} +
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + dinePreference && ( +
+ Dine In: ₹{Number(DineInTotal).toFixed(2)} +
+ )} +
+ Amount : ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ +
+
+
+ {PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : 'Split'}{' '} +  Payment :   + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} + /-{' '} +
+
+ {PaymentStatusSuccess?.length > 1 && ( + <> + {/*

Split Payment:

*/} + {Object.keys(aggregatedPayments).map((paymentType) => ( +
+ {paymentType}:{' '} + {aggregatedPayments[paymentType].toFixed(2)} +
+ ))} + + )} + + {GlobaldummyData + ? GlobalCredit && ( +
+
Advance Amount:
+
Opening Balance:
+
+ ) + : CreditDetails && + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > + 0 ? ( +

+ Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

+ ) : table2Data.CustomerDetails[0].OldCreditBal < + 0 ? ( +

+ {' '} + Opening Balance:{' '} + {Math.abs( + table2Data.CustomerDetails[0].OldCreditBal + )} +

+ ) : null} + + )} + + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > + 0 ? ( +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

+ ) : null} +
+ )} + {GlobaldummyData && GlobalCashierName && ( +
+
+ Cashier : Cashier Name +
+
+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && + CashierNameField && ( +
+
+ Cashier : {CashierName} +
+
+ )} + {GlobaldummyData && ( +
+
+ Customer : Customer Name +
+
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+
+ Customer : {table2Data?.CustSuppName} +
+
+ )} + + {table2Data?.BookingTypeName == 'Dine In' && + table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && ( +
+ Captain :{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )} + {sportsAppPreference && MembershipApplied && ( +
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} +
+ )} + +
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

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

+ {Notestext} +

+ +
+
+ )} +
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {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 +
+
+ + )} + +
+
+ )} +
+ ) : ( +
+
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+
+ {GlobaldummyData && GlobalLogo ? ( + image + ) : null} + {base64Image && + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + image + ) : null} +
+ {' '} + {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{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ''}{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} +
+ )} + {!estimatePrintHeader && table2Data?.OrderType === 'E' && ( +
+ {' '} + Estimate{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} +
+ +
+
+
+ Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+
+
+ {GlobaldummyData ? formattedDate : Date1} +
+
+
+ +
+ +
+ {(TakeawayData?.length > 0 || GlobaldummyData) && ( + <> + {takeAwayPreference && ( +
+ 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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + ) + )} + +
S.NoS.No + Item + ItemHSNHSNQty + {WeightasKg ? 'Qty/Kg' : 'Qty'} + MRPMRPRateRateDis Dis Tax % Tax % Amt + Amt +
+ {index + 1} + + {index + 1} + {item?.ProdName} +
{item?.ProdName}
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount} PCS{' '} + {item.ParcelQty} PACK ( + {item.ParcelType}) + + ))} +
+ ) : ( +
+ ({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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 0} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+
+ + )} + {DineInData?.length > 0 && dinePreference && ( + <> +
+ Dine In +
+ +
+ + + + {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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + + + {(GlobaldummyData ? products : DineInData)?.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 + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount == true && ( + + )} + + ) + )} + +
SSItemItemHSNHSNQty + {WeightasKg ? 'Qty/Kg' : 'Qty'} + MRPMRPRateRateDis Dis Tax % Tax % + 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(',')} +
+ ); + }) + : ''} +
+
+ {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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 0} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+
+ + )} +
+ +
+
+
+ Items : {GlobaldummyData ? '8' : totalQuantityFilter?.length} +
+
+ Qty : {GlobaldummyData ? '9' : totalQuantity} +
+ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( +
+ Off :{' '} + {GlobaldummyData + ? '10' + : Number( + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} +
+ )} +
+
+ {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && + table2Data?.NetAmount !== 0 && ( + <> +
+ +
+
+ --------- GST Breakup Details ----------- +
+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + + ))} +
+ Taxable Amount + + CGST + + SGST + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {Number(item.WithOutTaxAmount).toFixed( + 2 + )} + + {Number(item.TaxAmt).toFixed(2)} + + {Number(item.TotalAmt).toFixed(2)} +
+ + )} +
+
+ + )} +
+ )} +
+ {DineInData?.length > 0 && + TakeawayData?.length > 0 && + takeAwayPreference && ( +
+ Take Away : ₹{Number(TakeawayTotal).toFixed(2)} +
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + dinePreference && ( +
+ Dine In: ₹{Number(DineInTotal).toFixed(2)} +
+ )} +
+ Amount : ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ +
+
+
+ {PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : 'Split'}{' '} +  Payment :   + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} + /-{' '} +
+
+ {PaymentStatusSuccess?.length > 1 && ( + <> + {/*

Split Payment:

*/} + {Object.keys(aggregatedPayments).map((paymentType) => ( +
+ {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} +
+ ))} + + )} + + {GlobaldummyData + ? GlobalCredit && ( +
+
Advance Amount:
+
Opening Balance:
+
+ ) + : CreditDetails && + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( +

+ Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

+ ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( +

+ {' '} + Opening Balance:{' '} + {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)} +

+ ) : null} + + )} + + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)} +

+ ) : null} +
+ )} + {GlobaldummyData && GlobalCashierName && ( +
+
+ Cashier : Cashier Name +
+
+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && + CashierNameField && ( +
+
+ Cashier : {CashierName} +
+
+ )} + {GlobaldummyData && ( +
+
+ Customer : Customer Name +
+
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+
+ Customer : {table2Data?.CustSuppName} +
+
+ )} + + {table2Data?.BookingTypeName == 'Dine In' && + table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && ( +
+ Captain : {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )} + {sportsAppPreference && MembershipApplied && ( +
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+ QRcode +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + paymentTypeUPI && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} +
+ )} + +
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

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

{Notestext}

+ +
+
+ )} +
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {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 PrintStyle7; diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx index 1838949..fa9cb3a 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx @@ -1,1517 +1,4542 @@ 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, - GlobalprintCashierName, - GlobalprintLogo, - GlobalprintCredit, - GlobalprintTax, + extractLastNumber, + extractLastNumberOrderId, +} from '../../../../Services/Others'; +import { + GlobalprintSlNo, + GlobalprintItem, + GlobalprintMRP, + GlobalprintDiscount, + GlobalprintQuantity, + GlobalprintRate, + GlobalprintAmount, + GlobalprintHsnCode, + GlobalprintQrcodet, + GlobalPritdummyData, + changeReprintDataFound, + GloabalFieldDetails, + GlobalprintSignature, + GlobalprinttermsAndConditions, + GlobalSignatureImage, + Globalnotes, + GlobalthemeFormat, + GlobalBillName, + GlobalprintCashierName, + GlobalprintLogo, + GlobalprintCredit, + GlobalprintTax, + GlobalSelectedPrintHeaderColor, } from '../../../../Features/ThemeChange/ThemeChange'; -import Logo from '../../../../Images/Logo.jpg' -import { GlobalUpiIDprint, PreferenceData } from '../../../../Features/BookingScreen/BookingData/BookingData'; +import Logo from '../../../../Images/Logo.jpg'; +import { + GlobalUpiIDprint, + PreferenceData, +} 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'; import { settingDataSelector } from '../../../../Features/PreferenceMaster/PreferenceMaster'; -const Printstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, BranchAddress, BranchCity, BranchZip, CashierName, totalQuantity, OrderDetailGST, OrderDetailIGST, - OrderDetailVAT, table2Data, PaymentStatus, PrintGreeting, base64Image, PrintLogo, printDatas, isPdf, sportsAppPreference, SalesModePref, MembershipApplied = null }) => { +const Printstyle8 = ({ + index, + ExtraChargeTotal, + Date1, + totalQuantityFilter, + BranchAddress, + BranchCity, + BranchZip, + CashierName, + totalQuantity, + OrderDetailGST, + OrderDetailIGST, + OrderDetailVAT, + table2Data, + PaymentStatus, + PrintGreeting, + base64Image, + PrintLogo, + printDatas, + isPdf, + sportsAppPreference, + SalesModePref, + MembershipApplied = null, +}) => { + const dispatch = useDispatch(); + const GlobalUpiID = useSelector(GlobalUpiIDprint); + const FieldDetails = useSelector(GloabalFieldDetails); + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Tax = FieldDetails?.['Tax']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; + const CashierNameField = FieldDetails?.['CashierName']; + const LogoField = FieldDetails?.['Logo']; + const CreditDetails = FieldDetails?.['Credit details']; + const WeightasKg = FieldDetails?.['Weight']; + const GlobalSlNo = useSelector(GlobalprintSlNo); + const GlobalItem = useSelector(GlobalprintItem); + const GlobalMRP = useSelector(GlobalprintMRP); + const GlobalDiscount = useSelector(GlobalprintDiscount); + const GlobalTax = useSelector(GlobalprintTax); + 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 GlobalCashierName = useSelector(GlobalprintCashierName); + const GlobalLogo = useSelector(GlobalprintLogo); + const GlobalCredit = useSelector(GlobalprintCredit); + const SettingData = useSelector(PreferenceData); + const estimatePrintHeader = + SettingData?.[0]?.SettingDtlDetails?.find( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'estimateprintheader' + )?.SettingValue === 'Y'; + 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 paymentTypeUPI = PaymentStatus?.find( + (ps) => ps.PaymentTypeName === 'UPI' + ); + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); - const dispatch = useDispatch(); - const GlobalUpiID = useSelector(GlobalUpiIDprint) - const FieldDetails = useSelector(GloabalFieldDetails); - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Tax = FieldDetails?.["Tax"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; - const CashierNameField = FieldDetails?.["CashierName"]; - const LogoField = FieldDetails?.["Logo"]; - const CreditDetails = FieldDetails?.["Credit details"]; - const WeightasKg = FieldDetails?.['Weight']; - const GlobalSlNo = useSelector(GlobalprintSlNo); - const GlobalItem = useSelector(GlobalprintItem); - const GlobalMRP = useSelector(GlobalprintMRP); - const GlobalDiscount = useSelector(GlobalprintDiscount); - const GlobalTax = useSelector(GlobalprintTax); - 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 GlobalCashierName = useSelector(GlobalprintCashierName); - const GlobalLogo = useSelector(GlobalprintLogo); - const GlobalCredit = useSelector(GlobalprintCredit); - const SettingData = useSelector(PreferenceData); - const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find(setting => setting?.SettingIdName?.toLowerCase() === 'estimateprintheader')?.SettingValue === 'Y' - 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 paymentTypeUPI = PaymentStatus?.find((ps) => ps.PaymentTypeName === "UPI") + 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"]; + let PaymentStatusSuccess = PaymentStatus?.filter( + (ps) => ps.PaymentStatus === 'S' + ); + const keysLength = Object.keys(table2Data ?? {}).length; + if (keysLength > 0) { + dispatch(changeReprintDataFound(true)); + } + const PackageDetails = table2Data?.PackageDtl; + 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); - let PaymentStatusSuccess = PaymentStatus?.filter(ps => ps.PaymentStatus === "S") - const keysLength = Object.keys(table2Data ?? {}).length; - if (keysLength > 0) { - dispatch(changeReprintDataFound(true)); + const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; + + const TakeawayData = table2Data?.productDetails?.filter( + (item) => item.BookingTypeName?.toLowerCase() === 'takeaway' + ); + const DineInData = table2Data?.productDetails?.filter( + (item) => item.BookingTypeName?.toLowerCase() === 'dine in' + ); + + const TakeawayTotal = TakeawayData?.reduce( + (accumulator, currentValue) => accumulator + currentValue.TotalAmt, + 0 + ); + const DineInTotal = DineInData?.reduce( + (accumulator, currentValue) => accumulator + currentValue.TotalAmt, + 0 + ); + + const aggregatedPayments = PaymentStatusSuccess?.reduce( + (acc, paymentdata) => { + const paymentType = paymentdata?.PaymentTypeName; + const amount = Number(paymentdata?.Amount); + + if (acc[paymentType]) { + acc[paymentType] += amount; + } else { + acc[paymentType] = amount; + } + + return acc; + }, + {} + ); + const productsData = table2Data?.productDetails || []; + const offers = table2Data?.OrderOfferDetails || []; + + let TotalOfferAmount = 0; + + // Calculate SalesWiseOffers total amount + offers.forEach((offer) => { + if (offer.TableName === 'SalesWiseOffers') { + TotalOfferAmount += offer.OfferAmount; } - const PackageDetails = table2Data?.PackageDtl; - 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 hasMappedOffer = offers.some((offer) => + ['ItemWiseOffers', 'BundleOffers', 'QuantityWiseOffers'].includes( + offer.TableName + ) + ); - const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; - - const TakeawayData = table2Data?.productDetails?.filter(item => item.BookingTypeName?.toLowerCase() === "takeaway") - const DineInData = table2Data?.productDetails?.filter(item => item.BookingTypeName?.toLowerCase() === "dine in") - - const TakeawayTotal = TakeawayData?.reduce( - (accumulator, currentValue) => accumulator + currentValue.TotalAmt, - 0, + if (hasMappedOffer) { + const productTotal = productsData?.reduce( + (acc, item) => + acc + (item?.Type != 'C' ? item.OfferAmt : item.OfferValue || 0), + 0 ); - const DineInTotal = DineInData?.reduce( - (accumulator, currentValue) => accumulator + currentValue.TotalAmt, - 0, + TotalOfferAmount += productTotal; + } else { + const Combothere = productsData?.filter((item) => item?.Type == 'C'); + const CombothereTotal = Combothere?.reduce( + (acc, item) => acc + (item.OfferValue || 0), + 0 ); - - const aggregatedPayments = PaymentStatusSuccess?.reduce((acc, paymentdata) => { - const paymentType = paymentdata?.PaymentTypeName; - const amount = Number(paymentdata?.Amount); - - if (acc[paymentType]) { - acc[paymentType] += amount; - } else { - acc[paymentType] = amount; - } - - return acc; - }, {}); - const productsData = table2Data?.productDetails || []; - const offers = table2Data?.OrderOfferDetails || []; - - let TotalOfferAmount = 0; - - // Calculate SalesWiseOffers total amount - offers.forEach(offer => { - if (offer.TableName === 'SalesWiseOffers') { - TotalOfferAmount += offer.OfferAmount; - } - }); - const hasMappedOffer = offers.some(offer => - ["ItemWiseOffers", "BundleOffers", "QuantityWiseOffers"].includes(offer.TableName) - ); - - if (hasMappedOffer) { - - const productTotal = productsData?.reduce((acc, item) => acc + (item?.Type != "C" ? item.OfferAmt : item.OfferValue || 0), 0); - TotalOfferAmount += productTotal; - } else { - const Combothere = productsData?.filter(item => item?.Type == "C") - const CombothereTotal = Combothere?.reduce((acc, item) => acc + (item.OfferValue || 0), 0); - TotalOfferAmount += CombothereTotal; - } - const products = [ - { ProdName: 'ITEM 1', Rate: 88.00, SalesQty: 2, MRP: 100, TotalAmt: 176, discount: 0, HSN: '01', Size: 250, UomName: 'g', ProdTaxPercentage: 5 }, - { ProdName: 'ITEM 2', Rate: 300.00, SalesQty: 1, MRP: 350, TotalAmt: 300, discount: 0, HSN: '02', Size: 250, UomName: 'g', ProdTaxPercentage: 5 }, - { ProdName: 'ITEM 3', Rate: 200.00, SalesQty: 1, MRP: 250, TotalAmt: 200, discount: 0, HSN: '03', Size: 250, UomName: 'g', ProdTaxPercentage: 0 }, - { ProdName: 'ITEM 4', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '04', Size: 250, UomName: 'g', ProdTaxPercentage: 18 }, - { ProdName: 'ITEM 5', Rate: 30.00, SalesQty: 1, MRP: 50, TotalAmt: 30, discount: 0, HSN: '05', Size: 250, UomName: 'g', ProdTaxPercentage: 40 }, - { ProdName: 'ITEM 6', Rate: 130.00, SalesQty: 1, MRP: 150, TotalAmt: 130, discount: 0, HSN: '06', Size: 250, UomName: 'g', ProdTaxPercentage: 0 }, - { ProdName: 'ITEM 7', Rate: 230.00, SalesQty: 1, MRP: 250, TotalAmt: 230, discount: 0, HSN: '08', Size: 250, UomName: 'g', ProdTaxPercentage: 5 }, - ]; - - console.log(printDatas, "printDatasjk") - const chunkSize = PageSize == "A5" ? 10 : 16; - let dataSource = []; - - if (GlobaldummyData || TakeawayData?.length > 0) { - dataSource = GlobaldummyData ? products : TakeawayData; - } else if (DineInData?.length > 0) { - dataSource = DineInData; - } - - // 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 > (PageSize == "A5" ? 5 : 13); - - 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: isMobile ? "295mm" : FormatTheme ? PageSize == "A5" ? '170mm' : "257mm" : "", }} key={chunkIndex}> - - - {/*
*/} -
- {((!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {/*

{table2Data?.BrName}

*/} - -
- {(GlobalLogo && GlobaldummyData) ? image : null} - {(base64Image && (PrintLogo?.SettingValue === "Y" || LogoField)) ? image : null} -
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
- - -
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (BranchAddress || '') + (BranchCity ? (BranchAddress && BranchCity ? '-' : '') + BranchCity : '') + (BranchZip ? (BranchCity && BranchZip ? '-' : '') + BranchZip : '')} -
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
-
)} - {table2Data?.OrderType === "E" &&
Estimate {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} - - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} - -
-
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
-
- -
-
-
- {(TakeawayData?.length > 0 || GlobaldummyData) && - <> - {takeAwayPreference &&
TakeAway
} - -
- - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - - - {dataChunk?.map((item, index) => { - return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - ) - })} - -
S.NoS.NoDisDesHSNHSNMRPMRPRateRt(%)(%)Tax %Tax %Qty{ WeightasKg ?'Qty/Kg' :'Qty'}AmtAmt
{chunkIndex * chunkSize + index + 1}{chunkIndex * chunkSize + index + 1}{item?.ProdName} -
{item?.ProdName}
- {( - PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId).length > 0 ? -
- {PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId)?.map((item, index) => ( - - {item.ParcelCount}PCS{item.ParcelQty}PACK({item.ParcelType}) - - ))} -
- :
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
)} -
{item?.HSN}{item?.HSN}{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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.SalesQty}{item?.SalesQty}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- - } - {(DineInData?.length > 0 && dinePreference) && - <> -
Dine In
- -
- - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - - - {dataChunk?.map((item, index) => { - return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - ) - })} - -
S.NoS.NoDisDesHSNHSNMRPMRPRateRt(%)(%)Tax %Tax %Qty{ WeightasKg ?'Qty/Kg' :'Qty'}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?.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?.HSN}{item?.HSN}{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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.SalesQty}{item?.SalesQty}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- - } -
- - {((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme && - - <> -
-
-
-
Items
-
:
-
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
-
-
-
Qty
-
:
-
{GlobaldummyData ? '9' : totalQuantity}
-
- {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && -
-
Off
-
:
-
{GlobaldummyData ? '10' : Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}
-
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && takeAwayPreference) && -
-
Take Away
-
:
-
{GlobaldummyData ? '1,066' : Number(TakeawayTotal).toFixed(2)}
-
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && dinePreference) && -
-
Dine In
-
:
-
{GlobaldummyData ? '1,066' : Number(DineInTotal).toFixed(2)}
-
- } -
-
Amount
-
:
-
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
-
- -
- - {(table2Data?.OrderType === "E") ? '' :
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && (table2Data?.NetAmount !== 0) && - <> -
- -
-

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

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - - ) - } -
- - Taxable Amount - - CGST - - SGST - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 ? ( - GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) - ) : ( - CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === "Credit" && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

Advance Amount:{table2Data.CustomerDetails[0].OldCreditBal}

- ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

Opening Balance: {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)}

- ) : null} - - )} - - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

Current Advance Amount: {table2Data.CustomerDetails[0].CurrentCreditBal}

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

Current Balance Amount: {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)}

- ) : null} -
- ) - )} -
- -
- {PaymentStatusSuccess?.length > 1 && - <> - {/*

Split Payment:

*/} - {Object.keys(aggregatedPayments).map((paymentType) => ( -
- {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} -
- ))} - - } - {GlobaldummyData && GlobalCashierName && -
Cashier : Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && CashierNameField && -
Cashier : {CashierName} -
- } - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - - - {(table2Data?.BookingTypeName === "Dine In" && dinePreference) && (table2Data?.SalesTableLinkDetails?.[0]?.WaiterName) &&
Captain: {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
} -
- - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalQrcodet &&
-
- image -
-
Scan to Pay:
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
: - (Qrcodet && paymentTypeUPI) && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
} -
- -
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
- {(sportsAppPreference && MembershipApplied) &&
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
} - -
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } -
} - - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {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 && -
-
- <> -
-
-
-
Items
-
:
-
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
-
-
-
Qty
-
:
-
{GlobaldummyData ? '9' : totalQuantity}
-
- {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && -
-
Off
-
:
-
{GlobaldummyData ? '10' : Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}
-
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && takeAwayPreference) && -
-
Take Away
-
:
-
{GlobaldummyData ? '1,066' : Number(TakeawayTotal).toFixed(2)}
-
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && dinePreference) && -
-
Dine In
-
:
-
{GlobaldummyData ? '1,066' : Number(DineInTotal).toFixed(2)}
-
- } -
-
Amount
-
:
-
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
-
- -
- - {(table2Data?.OrderType === "E") ? '' :
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && (table2Data?.NetAmount !== 0) && - <> -
- -
-

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

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - - ) - } -
- - Taxable Amount - - CGST - - SGST - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 ? ( - GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) - ) : ( - CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === "Credit" && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

Advance Amount:{table2Data.CustomerDetails[0].OldCreditBal}

- ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

Opening Balance: {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)}

- ) : null} - - )} - - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

Current Advance Amount: {table2Data.CustomerDetails[0].CurrentCreditBal}

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

Current Balance Amount: {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)}

- ) : null} -
- ) - )} -
- -
- {PaymentStatusSuccess?.length > 1 && - <> - {/*

Split Payment:

*/} - {Object.keys(aggregatedPayments).map((paymentType) => ( -
- {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} -
- ))} - - } - {GlobaldummyData && GlobalCashierName && -
Cashier : Cashier Name
- - } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && CashierNameField && -
Cashier : {CashierName} -
- } - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - {(table2Data?.BookingTypeName === "Dine In" && dinePreference) && (table2Data?.SalesTableLinkDetails?.[0]?.WaiterName) &&
Captain: {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
} -
- - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalQrcodet &&
-
- image -
-
Scan to Pay:
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
: - (Qrcodet && paymentTypeUPI) && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
} -
- -
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
- {(sportsAppPreference && MembershipApplied) &&
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
} - -
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

- -
-
) : - Notestext && (
-

{Notestext}

- -
-
) - } -
} - - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {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 -
- } - -
-
- } - + TotalOfferAmount += CombothereTotal; + } + const products = [ + { + ProdName: 'ITEM 1', + Rate: 88.0, + SalesQty: 2, + MRP: 100, + TotalAmt: 176, + discount: 0, + HSN: '01', + Size: 250, + UomName: 'g', + ProdTaxPercentage: 5, + }, + { + ProdName: 'ITEM 2', + Rate: 300.0, + SalesQty: 1, + MRP: 350, + TotalAmt: 300, + discount: 0, + HSN: '02', + Size: 250, + UomName: 'g', + ProdTaxPercentage: 5, + }, + { + ProdName: 'ITEM 3', + Rate: 200.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 200, + discount: 0, + HSN: '03', + Size: 250, + UomName: 'g', + ProdTaxPercentage: 0, + }, + { + ProdName: 'ITEM 4', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '04', + Size: 250, + UomName: 'g', + ProdTaxPercentage: 18, + }, + { + ProdName: 'ITEM 5', + Rate: 30.0, + SalesQty: 1, + MRP: 50, + TotalAmt: 30, + discount: 0, + HSN: '05', + Size: 250, + UomName: 'g', + ProdTaxPercentage: 40, + }, + { + ProdName: 'ITEM 6', + Rate: 130.0, + SalesQty: 1, + MRP: 150, + TotalAmt: 130, + discount: 0, + HSN: '06', + Size: 250, + UomName: 'g', + ProdTaxPercentage: 0, + }, + { + ProdName: 'ITEM 7', + Rate: 230.0, + SalesQty: 1, + MRP: 250, + TotalAmt: 230, + discount: 0, + HSN: '08', + Size: 250, + UomName: 'g', + ProdTaxPercentage: 5, + }, + ]; + + console.log(printDatas, 'printDatasjk'); + const chunkSize = PageSize == 'A5' ? 10 : 16; + let dataSource = []; + + if (GlobaldummyData || TakeawayData?.length > 0) { + dataSource = GlobaldummyData ? products : TakeawayData; + } else if (DineInData?.length > 0) { + dataSource = DineInData; + } + + // 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 > (PageSize == 'A5' ? 5 : 13); + + 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: isMobile + ? '295mm' + : FormatTheme + ? PageSize == 'A5' + ? '170mm' + : '257mm' + : '', + }} + key={chunkIndex} + > + {/*
*/} +
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {/*

{table2Data?.BrName}

*/} + +
+ {GlobalLogo && GlobaldummyData ? ( + image + ) : null} + {base64Image && + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + image + ) : null} +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} +
+
+ +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (BranchAddress || '') + + (BranchCity + ? (BranchAddress && BranchCity ? '-' : '') + + BranchCity + : '') + + (BranchZip + ? (BranchCity && BranchZip ? '-' : '') + BranchZip + : '')} +
+
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+
+ )} + {table2Data?.OrderType === 'E' && ( +
+ Estimate{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} + + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? 'Cash' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + : ''}{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} + +
+
+ Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+ {GlobaldummyData ? formattedDate : Date1} +
- : -
- {((!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {/*

{table2Data?.BrName}

*/} -
- {(GlobalLogo && GlobaldummyData) ? image : null} - {(base64Image && (PrintLogo?.SettingValue === "Y" || LogoField)) ? image : null} -
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
-
-
- {GlobaldummyData ? - 'BranchAddress, Town- 635XXX City - State' : - (BranchAddress || '') + (BranchCity ? (BranchAddress && BranchCity ? '-' : '') + BranchCity : '') + (BranchZip ? (BranchCity && BranchZip ? '-' : '') + BranchZip : '')} -
-
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
-
)} - {table2Data?.OrderType === "E" &&
Estimate {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} - - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} - -
-
Bill No :{GlobaldummyData ? '553' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
-
{GlobaldummyData ? formattedDate : Date1}
-
- -
- {(TakeawayData?.length > 0 || GlobaldummyData) && - <> - {takeAwayPreference &&
TakeAway
} - -
- - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - - - {(GlobaldummyData ? products : TakeawayData)?.map((item, index) => { - return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - ) - })} - -
S.NoS.NoDisDesHSNHSNMRPMRPRateRt(%)(%)Tax %Tax %Qty{ WeightasKg ?'Qty/Kg' :'Qty'}AmtAmt
{index + 1}{index + 1}{item?.ProdName} -
{item?.ProdName}
- {(PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId).length > 0 ? -
- {PackageDetails?.filter((pkg) => pkg.ProdId === item.ProdId)?.map((item, index) => ( - - {item.ParcelCount}PCS{item.ParcelQty}PACK({item.ParcelType}) - - ))} -
- :
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
)} -
{item?.HSN}{item?.HSN}{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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.SalesQty}{item?.SalesQty}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- - } - {(DineInData?.length > 0 && dinePreference) && - <> -
Dine In
- -
- - - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - - - {(GlobaldummyData ? products : DineInData)?.map((item, index) => { - return ( - - {GlobaldummyData ? GlobalSlNo && : SLNO && } - {GlobaldummyData ? GlobalItem && : Item && } - {GlobaldummyData ? GlobalHsnCode && : HsnCode && } - {GlobaldummyData ? GlobalMRP && : MRP && } - {GlobaldummyData ? GlobalRate && : Rate && } - {GlobaldummyData ? GlobalDiscount && : Discount && } - {GlobaldummyData ? GlobalTax && : (Tax && table2Data?.OrderType !== 'E') && } - {GlobaldummyData ? GlobalQuantity && : Quantity && } - {GlobaldummyData ? GlobalAmount && : Amount && } - - ) - })} - -
S.NoS.NoDisDesHSNHSNMRPMRPRateRt(%)(%)Tax %Tax %Qty{ WeightasKg ?'Qty/Kg' :'Qty'}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?.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?.HSN}{item?.HSN}{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?.ProdTaxPercentage}{item?.ProdTaxPercentage || 0}{item?.SalesQty}{item?.SalesQty}{item?.TotalAmt}{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0}
-
- - } -
-
-
-
Items
-
:
-
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
-
-
-
Qty
-
:
-
{GlobaldummyData ? '9' : totalQuantity}
-
- {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && -
-
Off
-
:
-
{GlobaldummyData ? '10' : Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}
-
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && takeAwayPreference) && -
-
Take Away
-
:
-
{GlobaldummyData ? '1,066' : Number(TakeawayTotal).toFixed(2)}
-
- } - {(DineInData?.length > 0 && TakeawayData?.length > 0 && dinePreference) && -
-
Dine In
-
:
-
{GlobaldummyData ? '1,066' : Number(DineInTotal).toFixed(2)}
-
- } -
-
Amount
-
:
-
{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
-
- -
- - {(table2Data?.OrderType === "E") ? '' :
-
- {((OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) || - (OrderDetailIGST?.length > 0 && OrderDetailIGST?.[0]?.TaxAmt > 0) || - (OrderDetailVAT?.length > 0 && OrderDetailVAT?.[0]?.TaxAmt > 0)) && (table2Data?.NetAmount !== 0) && - <> -
- -
-

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

- {(OrderDetailGST?.length > 0 && OrderDetailGST?.[0]?.TaxAmt > 0) && - - - - - - - - - - {OrderDetailGST?.map((item) => - - - - - - - - ) - } -
- - Taxable Amount - - CGST - - SGST - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 - - - Total Amount -
- {item?.TaxPercentage || 0}% - - {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 ? ( - GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) - ) : ( - CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === "Credit" && ( - <> - {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( -

Advance Amount:{table2Data.CustomerDetails[0].OldCreditBal}

- ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( -

Opening Balance: {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)}

- ) : null} - - )} - - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

Current Advance Amount: {table2Data.CustomerDetails[0].CurrentCreditBal}

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

Current Balance Amount: {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)}

- ) : null} -
- ) +
+
+
+ {(TakeawayData?.length > 0 || GlobaldummyData) && ( + <> + {takeAwayPreference && ( +
+ TakeAway +
)} -
-
- {PaymentStatusSuccess?.length > 1 && - <> - {/*

Split Payment:

*/} - {Object.keys(aggregatedPayments).map((paymentType) => ( -
- {paymentType}: {aggregatedPayments[paymentType].toFixed(2)} +
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && } + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + + + {dataChunk?.map((item, index) => { + return ( + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && + : HsnCode && } + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + ); + })} + +
+ S.No + + S.No + DisDes + HSN + + HSN + + MRP + + MRP + + Rate + + Rt + + (%) + + (%) + + Tax % + + Tax % + + Qty + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + Amt + + Amt +
+ {chunkIndex * chunkSize + index + 1} + + {chunkIndex * chunkSize + index + 1} + {item?.ProdName} +
{item?.ProdName}
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
+ {PackageDetails?.filter( + (pkg) => + pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount}PCS + {item.ParcelQty}PACK( + {item.ParcelType}) + + ))} +
+ ) : ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+ )} +
{item?.HSN}{item?.HSN} + {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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 0} + + {item?.SalesQty} + + {item?.SalesQty} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} +
+
+ + )} + {DineInData?.length > 0 && dinePreference && ( + <> +
+ Dine In +
+ +
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && } + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + + + {dataChunk?.map((item, index) => { + return ( + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && + : HsnCode && } + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + ); + })} + +
+ S.No + + S.No + DisDes + HSN + + HSN + + MRP + + MRP + + Rate + + Rt + + (%) + + (%) + + Tax % + + Tax % + + Qty + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + 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(',')} +
+ ); + }) + : ''}
- ))} - - } - {GlobaldummyData && GlobalCashierName && -
Cashier : Cashier Name
+
{item?.HSN}{item?.HSN} + {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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 0} + + {item?.SalesQty} + + {item?.SalesQty} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || + 0} +
+
+ + )} +
- } - {CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData && CashierNameField && -
Cashier : {CashierName} -
- } - {GlobaldummyData && -
Customer : Customer Name
- - } - {table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData && -
Customer : {table2Data?.CustSuppName} -
- } - - - {table2Data?.BookingTypeName === "Dine In" && dinePreference && (table2Data?.SalesTableLinkDetails?.[0]?.WaiterName) &&
Captain: {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
} + {chunkIndex === paginatedChunks.length - 1 && + !shouldFooterBeOnNewPage && + FormatTheme && ( + <> +
+
+
+
Items
+
:
+
+ {GlobaldummyData ? '8' : totalQuantityFilter?.length}
+
+
+
Qty
+
:
+
+ {GlobaldummyData ? '9' : totalQuantity} +
+
+ {(table2Data?.OverallDisc > 0 || + TotalOfferAmount > 0) && ( +
+
Off
+
:
+
+ {GlobaldummyData + ? '10' + : Number( + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} +
+
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + takeAwayPreference && ( +
+
Take Away
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(TakeawayTotal).toFixed(2)} +
+
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + dinePreference && ( +
+
Dine In
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(DineInTotal).toFixed(2)} +
+
+ )} +
+
Amount
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalQrcodet &&
+
+ {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && + table2Data?.NetAmount !== 0 && ( + <> +
+ +
+

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

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + + ))} +
+ Taxable Amount + + CGST + + SGST + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + ? GlobalCredit && ( +
+
Advance Amount:
+
Opening Balance:
+
+ ) + : CreditDetails && + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > + 0 ? ( +

+ Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

+ ) : table2Data.CustomerDetails[0].OldCreditBal < + 0 ? ( +

+ {' '} + Opening Balance:{' '} + {Math.abs( + table2Data.CustomerDetails[0].OldCreditBal + )} +

+ ) : null} + + )} + + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > + 0 ? ( +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

+ ) : null} +
+ )} +
+
+ {PaymentStatusSuccess?.length > 1 && ( + <> + {/*

Split Payment:

*/} + {Object.keys(aggregatedPayments).map( + (paymentType) => ( +
+ {paymentType}:{' '} + {aggregatedPayments[paymentType].toFixed(2)} +
+ ) + )} + + )} + {GlobaldummyData && GlobalCashierName && ( +
+ {' '} + Cashier : Cashier Name +
+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && + CashierNameField && ( +
+ Cashier : {CashierName} +
+ )} + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} + + {table2Data?.BookingTypeName === 'Dine In' && + dinePreference && + table2Data?.SalesTableLinkDetails?.[0] + ?.WaiterName && ( +
+ Captain:{' '} + { + table2Data?.SalesTableLinkDetails?.[0] + ?.WaiterName + } +
+ )} +
+ + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+
+ image +
+
Scan to Pay:
+
+ {' '} + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed( + 2 + )} +
+
+ ) + : Qrcodet && + paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed( + 2 + )} +
+
+ )} +
+ )} +
+ +
+ Your Order No : + {GlobaldummyData + ? '01' + : table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
+ {sportsAppPreference && MembershipApplied && ( +
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
+ )} + +
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalIsnotes && (
- image +

+ Notes : 10 days Return policy +

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

+ {Notestext} +

+ +
+
+ )} +
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {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 && ( +
+
+ <> +
+
+
+
Items
+
:
+
+ {GlobaldummyData ? '8' : totalQuantityFilter?.length} +
+
+
+
Qty
+
:
+
+ {GlobaldummyData ? '9' : totalQuantity} +
+
+ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( +
+
Off
+
:
+
+ {GlobaldummyData + ? '10' + : Number( + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} +
+
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + takeAwayPreference && ( +
+
Take Away
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(TakeawayTotal).toFixed(2)} +
+
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + dinePreference && ( +
+
Dine In
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(DineInTotal).toFixed(2)} +
+
+ )} +
+
Amount
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+
+ +
+ {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && + table2Data?.NetAmount !== 0 && ( + <> +
+ +
+

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

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + + ))} +
+ Taxable Amount + + CGST + + SGST + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + ? GlobalCredit && ( +
+
Advance Amount:
+
Opening Balance:
+
+ ) + : CreditDetails && + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > + 0 ? ( +

+ Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

+ ) : table2Data.CustomerDetails[0].OldCreditBal < + 0 ? ( +

+ {' '} + Opening Balance:{' '} + {Math.abs( + table2Data.CustomerDetails[0].OldCreditBal + )} +

+ ) : null} + + )} + + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > + 0 ? ( +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

+ ) : null} +
+ )} +
+
+ {PaymentStatusSuccess?.length > 1 && ( + <> + {/*

Split Payment:

*/} + {Object.keys(aggregatedPayments).map( + (paymentType) => ( +
+ {paymentType}:{' '} + {aggregatedPayments[paymentType].toFixed(2)} +
+ ) + )} + + )} + {GlobaldummyData && GlobalCashierName && ( +
+ {' '} + Cashier : Cashier Name +
+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && + CashierNameField && ( +
+ Cashier : {CashierName} +
+ )} + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} + {table2Data?.BookingTypeName === 'Dine In' && + dinePreference && + table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && ( +
+ Captain:{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )} +
+ + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+
+ image
Scan to Pay:
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
: - (Qrcodet && paymentTypeUPI) && -
- -
Scan to Pay
-
₹{GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}
-
} -
} -
+
+ {' '} + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} +
+ )} +
-
Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
- {(sportsAppPreference && MembershipApplied) &&
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
} +
+ Your Order No : + {GlobaldummyData + ? '01' + : table2Data?.SalesId && + extractLastNumber(table2Data?.SalesId)} +
+ {sportsAppPreference && MembershipApplied && ( +
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
+ )} -
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

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

+ {Notestext} +

+ +
+
+ )} +
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
- {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {GlobaldummyData ? GlobalIsnotes && - (
-

Notes : 10 days Return policy

+ > + {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. */} +
+
+ )} -
-
) : - Notestext && (
-

{Notestext}

+ {GlobaldummyData + ? GlobalSignature && ( +
+

+ Signature +

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

+ Signature +

+ +
+ )} +
+ )} +
-
-
) - } -
} - - - {(!estimatePrintHeader && table2Data?.OrderType === "E") ? '' :
- {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
- - - {PrintGreeting?.SettingValue === "Y" && -
- Thank You Visit Again -
- } - {/*
print
*/} + )} + +
+
+ )} +
+ ) : ( +
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {/*

{table2Data?.BrName}

*/} +
+ {GlobalLogo && GlobaldummyData ? ( + image + ) : null} + {base64Image && + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + image + ) : null} +
+ {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
- } +
- - ) -} +
+ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (BranchAddress || '') + + (BranchCity + ? (BranchAddress && BranchCity ? '-' : '') + BranchCity + : '') + + (BranchZip + ? (BranchCity && BranchZip ? '-' : '') + BranchZip + : '')} +
+
+ {' '} + Mobile : +91{' '} + {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile} +
+
+ )} + {table2Data?.OrderType === 'E' && ( +
+ Estimate{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} -export default Printstyle8 + {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalBilltext + ? GlobalBilltext + : 'Cash' + ' Bill' + : BillName + ? BillName + : PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ''}{' '} + {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} +
+ )} + +
+
+ Bill No : + {GlobaldummyData + ? '553' + : table2Data?.OrderId && + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )} +
+
+ {GlobaldummyData ? formattedDate : Date1} +
+
+ +
+ {(TakeawayData?.length > 0 || GlobaldummyData) && ( + <> + {takeAwayPreference && ( +
+ TakeAway +
+ )} + +
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && ( + + ) + : Item && } + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + + + {(GlobaldummyData ? products : TakeawayData)?.map( + (item, index) => { + return ( + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && + : HsnCode && } + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + ); + } + )} + +
+ S.No + + S.No + DisDes + HSN + + HSN + + MRP + + MRP + + Rate + + Rt + + (%) + + (%) + + Tax % + + Tax % + + Qty + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + Amt + + Amt +
+ {index + 1} + + {index + 1} + {item?.ProdName} +
{item?.ProdName}
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount}PCS + {item.ParcelQty}PACK( + {item.ParcelType}) + + ))} +
+ ) : ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+ )} +
{item?.HSN}{item?.HSN} + {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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 0} + + {item?.SalesQty} + + {item?.SalesQty} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+
+ + )} + {DineInData?.length > 0 && dinePreference && ( + <> +
+ Dine In +
+ +
+ + + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && } + {GlobaldummyData + ? GlobalHsnCode && ( + + ) + : HsnCode && ( + + )} + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + + + {(GlobaldummyData ? products : DineInData)?.map( + (item, index) => { + return ( + + {GlobaldummyData + ? GlobalSlNo && ( + + ) + : SLNO && ( + + )} + {GlobaldummyData + ? GlobalItem && + : Item && ( + + )} + {GlobaldummyData + ? GlobalHsnCode && + : HsnCode && } + {GlobaldummyData + ? GlobalMRP && ( + + ) + : MRP && ( + + )} + {GlobaldummyData + ? GlobalRate && ( + + ) + : Rate && ( + + )} + {GlobaldummyData + ? GlobalDiscount && ( + + ) + : Discount && ( + + )} + {GlobaldummyData + ? GlobalTax && ( + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + )} + {GlobaldummyData + ? GlobalQuantity && ( + + ) + : Quantity && ( + + )} + {GlobaldummyData + ? GlobalAmount && ( + + ) + : Amount && ( + + )} + + ); + } + )} + +
+ S.No + + S.No + DisDes + HSN + + HSN + + MRP + + MRP + + Rate + + Rt + + (%) + + (%) + + Tax % + + Tax % + + Qty + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + 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(',')} +
+ ); + }) + : ''} +
+
{item?.HSN}{item?.HSN} + {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?.ProdTaxPercentage} + + {item?.ProdTaxPercentage || 0} + + {item?.SalesQty} + + {item?.SalesQty} + + {item?.TotalAmt} + + {item?.Type != 'C' + ? item?.TotalAmt - item?.OfferAmt || 0 + : item?.TotalAmt - item?.OfferValue || 0} +
+
+ + )} +
+
+
+
Items
+
:
+
+ {GlobaldummyData ? '8' : totalQuantityFilter?.length} +
+
+
+
Qty
+
:
+
+ {GlobaldummyData ? '9' : totalQuantity} +
+
+ {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( +
+
Off
+
:
+
+ {GlobaldummyData + ? '10' + : Number( + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)} +
+
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + takeAwayPreference && ( +
+
Take Away
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(TakeawayTotal).toFixed(2)} +
+
+ )} + {DineInData?.length > 0 && + TakeawayData?.length > 0 && + dinePreference && ( +
+
Dine In
+
:
+
+ {GlobaldummyData ? '1,066' : Number(DineInTotal).toFixed(2)} +
+
+ )} +
+
Amount
+
:
+
+ {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+
+ +
+ {table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+
+ {((OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0) || + (OrderDetailIGST?.length > 0 && + OrderDetailIGST?.[0]?.TaxAmt > 0) || + (OrderDetailVAT?.length > 0 && + OrderDetailVAT?.[0]?.TaxAmt > 0)) && + table2Data?.NetAmount !== 0 && ( + <> +
+ +
+

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

+ {OrderDetailGST?.length > 0 && + OrderDetailGST?.[0]?.TaxAmt > 0 && ( + + + + + + + + + {OrderDetailGST?.map((item) => ( + + + + + + + + ))} +
+ Taxable Amount + + CGST + + SGST + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + + Total Amount +
+ {item?.TaxPercentage || 0}% + + {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 + ? GlobalCredit && ( +
+
Advance Amount:
+
Opening Balance:
+
+ ) + : CreditDetails && + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' && ( + <> + {table2Data.CustomerDetails[0].OldCreditBal > 0 ? ( +

+ Advance Amount: + {table2Data.CustomerDetails[0].OldCreditBal} +

+ ) : table2Data.CustomerDetails[0].OldCreditBal < 0 ? ( +

+ {' '} + Opening Balance:{' '} + {Math.abs(table2Data.CustomerDetails[0].OldCreditBal)} +

+ ) : null} + + )} + + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs(table2Data.CustomerDetails[0].CurrentCreditBal)} +

+ ) : null} +
+ )} +
+
+ {PaymentStatusSuccess?.length > 1 && ( + <> + {/*

Split Payment:

*/} + {Object.keys(aggregatedPayments).map((paymentType) => ( +
+ {paymentType}:{' '} + {aggregatedPayments[paymentType].toFixed(2)} +
+ ))} + + )} + {GlobaldummyData && GlobalCashierName && ( +
+ {' '} + Cashier : Cashier Name +
+ )} + {CashierName && + CashierName !== undefined && + CashierName !== null && + !GlobaldummyData && + CashierNameField && ( +
+ Cashier : {CashierName} +
+ )} + {GlobaldummyData && ( +
+ {' '} + Customer : Customer Name +
+ )} + {table2Data?.CustSuppName && + table2Data?.CustSuppName !== undefined && + table2Data?.CustSuppName !== null && + !GlobaldummyData && ( +
+ Customer : {table2Data?.CustSuppName} +
+ )} + + {table2Data?.BookingTypeName === 'Dine In' && + dinePreference && + table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && ( +
+ Captain:{' '} + {table2Data?.SalesTableLinkDetails?.[0]?.WaiterName} +
+ )} +
+ + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalQrcodet && ( +
+
+ image +
+
Scan to Pay:
+
+ {' '} + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ ) + : Qrcodet && + paymentTypeUPI && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )} +
+ )} +
+ +
+ Your Order No : + {GlobaldummyData + ? '01' + : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)} +
+ {sportsAppPreference && MembershipApplied && ( +
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
+ )} + +
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {GlobaldummyData + ? GlobalIsnotes && ( +
+

+ Notes : 10 days Return policy +

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

{Notestext}

+ +
+
+ )} +
+ )} + + {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( + '' + ) : ( +
+ {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
+ )} + {/*
print
*/} +
+ )} + + ); +}; + +export default Printstyle8; diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx index 67d49e8..8ccf08b 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx @@ -28,9 +28,13 @@ import { GlobalprintLogo, GlobalprintCredit, GlobalprintTax, + GlobalSelectedPrintHeaderColor, } from '../../../../Features/ThemeChange/ThemeChange'; import Logo from '../../../../Images/Logo.jpg'; -import { GlobalUpiIDprint, PreferenceData } from '../../../../Features/BookingScreen/BookingData/BookingData'; +import { + GlobalUpiIDprint, + PreferenceData, +} from '../../../../Features/BookingScreen/BookingData/BookingData'; import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.scss'; import QRCode from 'react-qr-code'; import signature from '../../../../Images/signatureimage.jpg'; @@ -119,6 +123,7 @@ const PrintStyle9 = ({ const paymentTypeUPI = PaymentStatus?.find( (ps) => ps.PaymentTypeName === 'UPI' ); + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); let TermsAndConditions = printDatas?.TermsandConditions; let SignatureImg = printDatas?.Signature; let Notestext = printDatas?.Notes; @@ -230,7 +235,7 @@ const PrintStyle9 = ({ HSN: '01', Size: 250, UomName: 'g', - ProdTaxPercentage: 5 + ProdTaxPercentage: 5, }, { ProdName: 'ITEM 2', @@ -242,7 +247,7 @@ const PrintStyle9 = ({ HSN: '02', Size: 250, UomName: 'g', - ProdTaxPercentage: 5 + ProdTaxPercentage: 5, }, { ProdName: 'ITEM 3', @@ -254,7 +259,7 @@ const PrintStyle9 = ({ HSN: '03', Size: 250, UomName: 'g', - ProdTaxPercentage: 0 + ProdTaxPercentage: 0, }, { ProdName: 'ITEM 4', @@ -266,7 +271,7 @@ const PrintStyle9 = ({ HSN: '04', Size: 250, UomName: 'g', - ProdTaxPercentage: 18 + ProdTaxPercentage: 18, }, { ProdName: 'ITEM 5', @@ -278,7 +283,7 @@ const PrintStyle9 = ({ HSN: '05', Size: 250, UomName: 'g', - ProdTaxPercentage: 40 + ProdTaxPercentage: 40, }, { ProdName: 'ITEM 6', @@ -290,7 +295,7 @@ const PrintStyle9 = ({ HSN: '06', Size: 250, UomName: 'g', - ProdTaxPercentage: 0 + ProdTaxPercentage: 0, }, { ProdName: 'ITEM 7', @@ -302,7 +307,7 @@ const PrintStyle9 = ({ HSN: '08', Size: 250, UomName: 'g', - ProdTaxPercentage: 5 + ProdTaxPercentage: 5, }, ]; @@ -351,8 +356,8 @@ const PrintStyle9 = ({ flexDirection: 'column', justifyContent: chunkIndex === paginatedChunks.length - 1 && - !shouldFooterBeOnNewPage && - FormatTheme + !shouldFooterBeOnNewPage && + FormatTheme ? 'space-between' : '', height: isMobile @@ -399,7 +404,7 @@ const PrintStyle9 = ({ /> ) : null} {base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( @@ -432,18 +438,18 @@ const PrintStyle9 = ({ {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?.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 + : '')}
@@ -495,10 +501,10 @@ const PrintStyle9 = ({ {GlobaldummyData ? '553' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
{' '} @@ -551,114 +557,120 @@ const PrintStyle9 = ({ {GlobaldummyData ? GlobalSlNo && ( - S.No - ) + S.No + ) : SLNO && S.No} {GlobaldummyData ? GlobalItem && ( - Item - ) + Item + ) : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - { WeightasKg ?'Qty/Kg' :'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} - {GlobaldummyData ? - GlobalTax && - - Tax % - : - (Tax && table2Data?.OrderType !== 'E') && - - Tax % - - } + + Dis{' '} + + )} + {GlobaldummyData + ? GlobalTax && ( + + Tax % + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + Tax % + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -668,205 +680,207 @@ const PrintStyle9 = ({ {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
{item?.ProdName}
- {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
- {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - )?.map((item, index) => ( - - {item.ParcelCount}PCS - {item.ParcelQty}PACK( - {item.ParcelType}) - - ))} - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > + +
{item?.ProdName}
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((item, index) => ( + + {item.ParcelCount}PCS + {item.ParcelQty}PACK( + {item.ParcelType}) + + ))} + {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 > + ? 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?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   - {item?.ProductIdentifierDtls?.length > + ? 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?.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 > + ? 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?.ProductIdentifierDtls.filter( + (item1) => + item1.IMEI1 !== '' || + item1.IMEI2 !== '' + )?.map((item2) => { + const imei1 = item2.IMEI1 || ''; + const imei2 = item2.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} +
+ )} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData - ? GlobalTax && - - {item?.ProdTaxPercentage} - : - (Tax && table2Data?.OrderType !== 'E') && - - {item?.ProdTaxPercentage || 0} - - } + ? GlobalTax && ( + + {item?.ProdTaxPercentage} + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {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} + + )} ); })} @@ -893,114 +907,120 @@ const PrintStyle9 = ({ {GlobaldummyData ? GlobalSlNo && ( - S.No - ) + S.No + ) : SLNO && S.No} {GlobaldummyData ? GlobalItem && ( - Item - ) + Item + ) : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - { WeightasKg ?'Qty/Kg' :'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} - {GlobaldummyData ? - GlobalTax && - - Tax % - : - (Tax && table2Data?.OrderType !== 'E') && - - Tax % - - } + + Dis{' '} + + )} + {GlobaldummyData + ? GlobalTax && ( + + Tax % + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + Tax % + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -1010,114 +1030,116 @@ const PrintStyle9 = ({ {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {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?.ProdName}
+
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+ + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData - ? GlobalTax && - - {item?.ProdTaxPercentage} - : - (Tax && table2Data?.OrderType !== 'E') && - - {item?.ProdTaxPercentage || 0} - - } + ? GlobalTax && ( + + {item?.ProdTaxPercentage} + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {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} + + )} ); })} @@ -1162,25 +1184,25 @@ const PrintStyle9 = ({ )} {(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && ( -
- Off : -
- {GlobaldummyData - ? '1,066' - : Number( +
+ Off : +
+ {GlobaldummyData + ? '1,066' + : Number( TotalOfferAmount + table2Data?.OverallDisc ).toFixed(2)} -
- )} +
+ )}
{item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {GlobaldummyData ? GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) +
+
Advance Amount:
+
Opening Balance:
+
+ ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
+ {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( + 0 ? (

Advance Amount: {table2Data.CustomerDetails[0].OldCreditBal} @@ -1621,26 +1649,26 @@ const PrintStyle9 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

- {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

- ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

- {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

- ) : null} -
- )} +

+ {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

+ ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

+ {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

+ ) : null} +
+ )}
{PaymentStatusSuccess?.length > 1 && ( <> @@ -1747,54 +1775,54 @@ const PrintStyle9 = ({
{GlobaldummyData ? GlobalQrcodet && ( -
- QRcode -
- Scan to Pay{' '} +
+ QRcode +
+ Scan to Pay{' '} +
+
+ ₹{' '} + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed( + 2 + )} +
-
- ₹{' '} - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed( - 2 - )} -
-
- ) + ) : Qrcodet && - paymentTypeUPI && ( -
- -
- Scan to Pay{' '} + paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '} +
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed( + 2 + )} +
-
- ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed( - 2 - )} -
-
- )} + )}
)}
@@ -1804,7 +1832,7 @@ const PrintStyle9 = ({ {GlobaldummyData ? '01' : table2Data?.SalesId && - extractLastNumber(table2Data?.SalesId)} + extractLastNumber(table2Data?.SalesId)}
@@ -1833,23 +1861,23 @@ const PrintStyle9 = ({
{GlobaldummyData ? GlobalIsnotes && ( -
-

- Notes : 10 days Return policy -

+
+

+ Notes : 10 days Return policy +

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

- {Notestext} -

+
+

+ {Notestext} +

-
-
- )} +
+
+ )}
)} @@ -1869,137 +1897,137 @@ const PrintStyle9 = ({ > {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} +

    + Terms & Conditions +

    +
      +
    1. + Once goods are sold, they are not + exchangeable or refundable.
    2. - ))} - {/*
    3. Please check the product before leaving the counter.
    4. */} -
    -
- )} +
  • + Please check the product before leaving + the counter. +
  • + +
    + ) + : 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 +

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

    - Signature -

    - -
    - )} +

    + Signature +

    + +
    + )}
    )}
    @@ -2097,8 +2125,8 @@ const PrintStyle9 = ({ {GlobaldummyData ? '1,066' : Number( - TotalOfferAmount + table2Data?.OverallDisc - ).toFixed(2)} + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)}
    )} @@ -2237,7 +2265,9 @@ const PrintStyle9 = ({ fontSize: '11px', textAlign: 'right', }} - >{item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {GlobaldummyData ? GlobalCredit && ( -
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > - 0 ? ( + 0 ? (

    Advance Amount: {table2Data.CustomerDetails[0].OldCreditBal} @@ -2530,26 +2564,26 @@ const PrintStyle9 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < - 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

    - ) : null} -
    - )} +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < + 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

    + ) : null} +
    + )}
    {PaymentStatusSuccess?.length > 1 && ( <> @@ -2650,50 +2684,50 @@ const PrintStyle9 = ({
    {GlobaldummyData ? GlobalQrcodet && ( -
    - QRcode -
    - Scan to Pay{' '} +
    + QRcode +
    + Scan to Pay{' '} +
    +
    + ₹{' '} + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    -
    - ₹{' '} - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    -
    - ) + ) : Qrcodet && - paymentTypeUPI && ( -
    - -
    - Scan to Pay{' '} + paymentTypeUPI && ( +
    + +
    + Scan to Pay{' '} +
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
    -
    - )} + )}
    )}
    @@ -2703,7 +2737,7 @@ const PrintStyle9 = ({ {GlobaldummyData ? '01' : table2Data?.SalesId && - extractLastNumber(table2Data?.SalesId)} + extractLastNumber(table2Data?.SalesId)}
    @@ -2732,23 +2766,23 @@ const PrintStyle9 = ({
    {GlobaldummyData ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    +
    +

    + Notes : 10 days Return policy +

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

    - {Notestext} -

    +
    +

    + {Notestext} +

    -
    -
    - )} +
    +
    + )}
    )} @@ -2768,137 +2802,137 @@ const PrintStyle9 = ({ > {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} +

      + Terms & Conditions +

      +
        +
      1. + Once goods are sold, they are not + exchangeable or refundable.
      2. - ))} - {/*
      3. Please check the product before leaving the counter.
      4. */} -
      -
    - )} +
  • + Please check the product before leaving the + counter. +
  • + +
    + ) + : 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 +

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

    - Signature -

    - -
    - )} +

    + Signature +

    + +
    + )}
    )}
    @@ -2955,7 +2989,7 @@ const PrintStyle9 = ({ /> ) : null} {base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( @@ -2989,18 +3024,18 @@ const PrintStyle9 = ({ {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?.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 + : '')}
    @@ -3060,10 +3095,10 @@ const PrintStyle9 = ({ {GlobaldummyData ? '553' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
    {' '} @@ -3112,90 +3147,92 @@ const PrintStyle9 = ({ {GlobaldummyData ? GlobalSlNo && ( - - S.No - - ) + + S.No + + ) : SLNO && S.No} {GlobaldummyData ? GlobalItem && Item : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - { WeightasKg ?'Qty/Kg' :'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} - {GlobaldummyData ? - GlobalTax && - - Tax % - : - (Tax && table2Data?.OrderType !== 'E') && - - Tax % - - } + + Dis{' '} + + )} + {GlobaldummyData + ? GlobalTax && ( + + Tax % + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + Tax % + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -3209,138 +3246,140 @@ const PrintStyle9 = ({ {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(',')} -
    - ); - }) - : ''} -
    - - )} + +
    {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 ? GlobalQuantity && ( - - {item?.SalesQty} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData - ? GlobalTax && - - {item?.ProdTaxPercentage} - : - (Tax && table2Data?.OrderType !== 'E') && - - {item?.ProdTaxPercentage || 0} - - } + ? GlobalTax && ( + + {item?.ProdTaxPercentage} + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {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} + + )} ); } @@ -3374,80 +3413,82 @@ const PrintStyle9 = ({ : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - { WeightasKg ?'Qty/Kg' :'Qty'} - - )} + + {WeightasKg ? 'Qty/Kg' : 'Qty'} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} - {GlobaldummyData ? - GlobalTax && - - Tax % - : - (Tax && table2Data?.OrderType !== 'E') && - - Tax % - - } + + Dis{' '} + + )} + {GlobaldummyData + ? GlobalTax && ( + + Tax % + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + Tax % + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -3461,106 +3502,108 @@ const PrintStyle9 = ({ {GlobaldummyData ? GlobalItem && {item?.ProdName} : 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} - - ) + + {item?.SalesQty} + + ) : Quantity && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {GlobaldummyData ? GlobalHsnCode && ( - - {item?.HSN} - - ) + + {item?.HSN} + + ) : HsnCode && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {GlobaldummyData ? GlobalMRP && ( - - {item?.MRP} - - ) + + {item?.MRP} + + ) : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} + + {item?.Type != 'C' + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} {GlobaldummyData - ? GlobalTax && - - {item?.ProdTaxPercentage} - : - (Tax && table2Data?.OrderType !== 'E') && - - {item?.ProdTaxPercentage || 0} - - } + ? GlobalTax && ( + + {item?.ProdTaxPercentage} + + ) + : Tax && + table2Data?.OrderType !== 'E' && ( + + {item?.ProdTaxPercentage || 0} + + )} {GlobaldummyData ? GlobalRate && ( - - {item?.Rate} - - ) + + {item?.Rate} + + ) : Rate && ( - - {item?.Rate} - - )} + + {item?.Rate} + + )} {GlobaldummyData ? GlobalAmount && ( - - {item?.TotalAmt} - - ) + + {item?.TotalAmt} + + ) : Amount && ( - - {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} + + )} ); } @@ -3613,8 +3656,8 @@ const PrintStyle9 = ({ {GlobaldummyData ? '1,066' : Number( - TotalOfferAmount + table2Data?.OverallDisc - ).toFixed(2)} + TotalOfferAmount + table2Data?.OverallDisc + ).toFixed(2)}
    )} @@ -3754,7 +3797,9 @@ const PrintStyle9 = ({ fontSize: '11px', textAlign: 'right', }} - >{item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {item?.TaxPercentage || 0}% + > + {item?.TaxPercentage || 0}% + {GlobaldummyData ? GlobalCredit && ( -
    -
    Advance Amount:
    -
    Opening Balance:
    -
    - ) +
    +
    Advance Amount:
    +
    Opening Balance:
    +
    + ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
    - {/* OLD CREDIT BAL */} - {PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' && ( + table2Data?.CustomerDetails?.length > 0 && ( +
    + {/* OLD CREDIT BAL */} + {PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' && ( <> {table2Data.CustomerDetails[0].OldCreditBal > 0 ? (

    @@ -4040,24 +4089,24 @@ const PrintStyle9 = ({ )} - {/* CURRENT CREDIT BAL */} - {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( -

    - {' '} - Current Advance Amount:{' '} - {table2Data.CustomerDetails[0].CurrentCreditBal} -

    - ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( -

    - {' '} - Current Balance Amount:{' '} - {Math.abs( - table2Data.CustomerDetails[0].CurrentCreditBal - )} -

    - ) : null} -
    - )} + {/* CURRENT CREDIT BAL */} + {table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? ( +

    + {' '} + Current Advance Amount:{' '} + {table2Data.CustomerDetails[0].CurrentCreditBal} +

    + ) : table2Data.CustomerDetails[0].CurrentCreditBal < 0 ? ( +

    + {' '} + Current Balance Amount:{' '} + {Math.abs( + table2Data.CustomerDetails[0].CurrentCreditBal + )} +

    + ) : null} +
    + )}
    {PaymentStatusSuccess?.length > 1 && ( <> @@ -4146,46 +4195,46 @@ const PrintStyle9 = ({
    {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 && - paymentTypeUPI && ( -
    - -
    Scan to Pay
    -
    - ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} + paymentTypeUPI && ( +
    + +
    Scan to Pay
    +
    + ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
    -
    - )} + )}
    )}
    @@ -4229,26 +4278,26 @@ const PrintStyle9 = ({
    {GlobaldummyData ? GlobalIsnotes && ( -
    -

    - Notes : 10 days Return policy -

    +
    +

    + Notes : 10 days Return policy +

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

    {Notestext}

    +
    +

    {Notestext}

    -
    -
    - )} +
    +
    + )}
    )} @@ -4268,137 +4317,137 @@ const PrintStyle9 = ({ > {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} +

      + Terms & Conditions +

      +
        +
      1. + Once goods are sold, they are not exchangeable or + refundable.
      2. - ))} - {/*
      3. Please check the product before leaving the counter.
      4. */} -
      -
    - )} +
  • + Please check the product before leaving the + counter. +
  • + +
    + ) + : 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 +

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

    - Signature -

    - -
    - )} +

    + Signature +

    + +
    + )} )} diff --git a/src/Pages/Preference/PreferenceList.jsx b/src/Pages/Preference/PreferenceList.jsx index 06142d0..7d3fea8 100644 --- a/src/Pages/Preference/PreferenceList.jsx +++ b/src/Pages/Preference/PreferenceList.jsx @@ -749,16 +749,6 @@ const PreferenceList = () => { {renderCheckbox('scanlayout', 'Do you Want Scan Layout Page?')} - - - -
    { icon={} />
    -
    + + ); diff --git a/src/Pages/StockMaster/StockForm.jsx b/src/Pages/StockMaster/StockForm.jsx index e4b86f9..cd2d1c6 100644 --- a/src/Pages/StockMaster/StockForm.jsx +++ b/src/Pages/StockMaster/StockForm.jsx @@ -83,13 +83,17 @@ import { postConfiguration } from '../../Features/ConfigMasterPage/ConfigMasterP import SupplierProductMappingForm from '../SupplierProductMapping/SuplierProductMappingForm.jsx'; import { getPurchaseSupplierAndWareHouseData } from '../../Features/PurchaseOrder/PurchaseOrder.js'; import FloatLabel from '../../Components/Forms/FloatLabel/index.jsx'; -import { FaLink, FaEye, FaUpload } from 'react-icons/fa'; +import { FaLink, FaEye } from 'react-icons/fa'; +import { TbUpload } from 'react-icons/tb'; import { getSupplaierIdBasedProducts, getSupplaierIdwithTypeBasedProducts, postSupplaierProducts, } from '../../Features/SupplierProductMapping/SupplierProductMapping.js'; -import { ApplicationPreferences, getCommonAppPreference } from '../../Features/BrachLogin/BranchLogin.js'; +import { + ApplicationPreferences, + getCommonAppPreference, +} from '../../Features/BrachLogin/BranchLogin.js'; import { getConfigType, getPaymentOptionFeatureApi, @@ -161,12 +165,12 @@ const EditableCell = ({ margin: 0, }} name={dataIndex} - // rules={[ - // (dataIndex == "imei1" || dataIndex == "imei2") && { - // pattern: /^[0-9]{15}$/, - // message: 'IMEI must be a 15-digit number' - // } - // ]} + // rules={[ + // (dataIndex == "imei1" || dataIndex == "imei2") && { + // pattern: /^[0-9]{15}$/, + // message: 'IMEI must be a 15-digit number' + // } + // ]} > - { const BrandData = useSelector(brandDataSelector); const UomData = useSelector(uomDataSelector); const ProductTypeData = useSelector(productTypeDataSelector); - const appPreferences = useSelector(ApplicationPreferences) + const appPreferences = useSelector(ApplicationPreferences); const [applicationRestrictedFields, setApplicationRestrictedFields] = useState({ DatesAndExpiry: false, @@ -247,7 +249,7 @@ const StockForm = ({ formType }) => { AmountPerPieceDetail: false, }); const [selectedAdditionalColumn, setSelectedAdditionalColumn] = useState([]); - console.log(selectedAdditionalColumn, "selectedAdditionalColumn") + console.log(selectedAdditionalColumn, 'selectedAdditionalColumn'); const [showColumnModal, setShowColumnModal] = useState(false); const [tempSelectedColumns, setTempSelectedColumns] = useState([]); const [tableFieldPreferences, setTableFieldPreferences] = useState([]); @@ -282,7 +284,7 @@ const StockForm = ({ formType }) => { const [imageSubCategoryUrl, setSubCategoryImageUrl] = useState(''); const [imageBrandUrl, setBrandImageUrl] = useState(''); const [PurchaseData, setPurchaseData] = useState([]); - console.log(PurchaseData, "PurchaseData") + console.log(PurchaseData, 'PurchaseData'); const [additionalInfoModal, setAdditionalInfoModal] = useState(false); const [selectedRowIndex, setSelectedRowIndex] = useState(null); const [selectedRowRecord, setSelectedRowRecord] = useState({}); @@ -357,7 +359,7 @@ const StockForm = ({ formType }) => { if (searchValue?.trim()) { const search = searchValue.toLowerCase(); - const filtered = PurchaseData.filter(item => + const filtered = PurchaseData.filter((item) => item?.ProdName?.toLowerCase().includes(search) ); @@ -367,7 +369,6 @@ const StockForm = ({ formType }) => { } }, [PurchaseData, searchValue]); - const items = [ { name: 'Home', @@ -384,7 +385,7 @@ const StockForm = ({ formType }) => { }, ]; const categoryId = appPreferences?.find( - p => p?.PreferredCatName?.toLowerCase() === "purchase entry" + (p) => p?.PreferredCatName?.toLowerCase() === 'purchase entry' )?.PreferredCatId; useEffect(() => { dispatch(changeBreadCrumb({ items: items })); @@ -552,8 +553,7 @@ const StockForm = ({ formType }) => { return acc + Number(item?.Amount || 0); }, 0); - const invoiceAmount = - !isNaN(total) && total !== 0 ? total : null; + const invoiceAmount = !isNaN(total) && total !== 0 ? total : null; setSelInvoiceAmount(invoiceAmount); @@ -568,7 +568,6 @@ const StockForm = ({ formType }) => { setTotalTaxAmount(totalTax); }, [PurchaseData]); - const getPurchaseOrders = async () => { const { data: res } = await dispatch( PendingOrdersPE({ CompId, AppId, BranchId }) @@ -614,19 +613,31 @@ const StockForm = ({ formType }) => { }; useEffect(() => { getFieldSetup(); - }, [categoryId]) + }, [categoryId]); const getFieldSetup = async () => { try { - const response = await dispatch(getFieldSetupData({ AppId, CompId, BranchId, categoryId, Type: "PE" })).unwrap(); + const response = await dispatch( + getFieldSetupData({ AppId, CompId, BranchId, categoryId, Type: 'PE' }) + ).unwrap(); if (response?.data?.statusCode === 1) { - console.log(response?.data?.data?.[0]?.ConfigDtl, "Field Setup Data"); - setSelectedFields(response?.data?.data?.[0]?.ConfigDtl?.filter(c => c.ConfigId && c.Access === 'Y')?.map(c => c.ConfigId) || []); - setSelectedAdditionalColumn(response?.data?.data?.[0]?.ConfigDtl?.filter(c => c.ConfigId && c.Access === 'Y')?.map(c => c.ConfigName) || []) - setTableFieldPreferences(response?.data?.data?.[0]?.ConfigDtl?.map(c => ({ - value: c.ConfigId, - label: c.ConfigName, - access: c.Access - })) || []); + console.log(response?.data?.data?.[0]?.ConfigDtl, 'Field Setup Data'); + setSelectedFields( + response?.data?.data?.[0]?.ConfigDtl?.filter( + (c) => c.ConfigId && c.Access === 'Y' + )?.map((c) => c.ConfigId) || [] + ); + setSelectedAdditionalColumn( + response?.data?.data?.[0]?.ConfigDtl?.filter( + (c) => c.ConfigId && c.Access === 'Y' + )?.map((c) => c.ConfigName) || [] + ); + setTableFieldPreferences( + response?.data?.data?.[0]?.ConfigDtl?.map((c) => ({ + value: c.ConfigId, + label: c.ConfigName, + access: c.Access, + })) || [] + ); } } catch (error) { console.error('Error fetching field setup:', error); @@ -743,8 +754,8 @@ const StockForm = ({ formType }) => { const allSupplierProducts = response?.data?.data || []; const matchingProdIds = []; - const NewImageProducts = [] - console.log(unmatchedProducts, "unmatchedProductsunmatchedProducts") + const NewImageProducts = []; + console.log(unmatchedProducts, 'unmatchedProductsunmatchedProducts'); // check if the unmatched products exists in our products list unmatchedProducts.forEach((item) => { const match = allSupplierProducts?.[0]?.ProductDetails.find( @@ -754,55 +765,54 @@ const StockForm = ({ formType }) => { ); if (match) { matchingProdIds.push(match.ProdId); - } - else { + } else { NewImageProducts.push(item?.parsedData); } }); - console.log(NewImageProducts, "NewImageProductsNewImageProducts") + console.log(NewImageProducts, 'NewImageProductsNewImageProducts'); // Bulk upload new image products if (NewImageProducts.length > 0) { - const newProductsData = NewImageProducts.map(product => ({ + const newProductsData = NewImageProducts.map((product) => ({ AppId: AppId || 0, - CompId: CompId || "", - BranchId: BranchId || "", + CompId: CompId || '', + BranchId: BranchId || '', CreatedBy: UserId || 0, - ProdName: product.description?.trim() || "", - ProdVariantName: "", - Size: 1 || "", - UOM: product.unit || "", + ProdName: product.description?.trim() || '', + ProdVariantName: '', + Size: 1 || '', + UOM: product.unit || '', MRP: parseFloat(product.rate) || 0, WhSalePrice: 0, SellPrice: parseFloat(product.rate) || 0, - ProdCat: "General", - ProdSubCat: "", - Brand: "", - AutoGenerateQr: "", - QRCode: "", + ProdCat: 'General', + ProdSubCat: '', + Brand: '', + AutoGenerateQr: '', + QRCode: '', StockAvailable: 'No', - TaxId: "", - HSNCode: "", - PartNumber: "", + TaxId: '', + HSNCode: '', + PartNumber: '', Rack: 0, - ManufDate: "", - ExpDate: "", - AvailableFrom: "", - AvailableTo: "", - ProdLogo: "", - OnePcsAvailable: "No", + ManufDate: '', + ExpDate: '', + AvailableFrom: '', + AvailableTo: '', + ProdLogo: '', + OnePcsAvailable: 'No', AutoGenerateSingleQr: 'No', TaxId: 'NIL - 0%', - OnePcQR: "", + OnePcQR: '', TokenAvailable: 'No', OpeningQty: 0, - QtyBasedPrice: "", - InwardDate: "", - SuppId: suppId || "", - Reference: "", + QtyBasedPrice: '', + InwardDate: '', + SuppId: suppId || '', + Reference: '', ReceivedQty: 0, AcceptedQty: 0, RejectedQty: 0, - RejectionReason: "", + RejectionReason: '', IssuedQty: 0, BalanceQty: 0, InwardPrice: 0, @@ -811,23 +821,32 @@ const StockForm = ({ formType }) => { Cess: 0, })); - const bulkResponse = await dispatch(bulkpostdata({ ProdDetails: newProductsData })).unwrap(); + const bulkResponse = await dispatch( + bulkpostdata({ ProdDetails: newProductsData }) + ).unwrap(); if (bulkResponse?.data?.statusCode === 1) { // After successful bulk upload, check the condition again const updatedResponse = await dispatch( - getSupplaierIdBasedProducts({ CompId, AppId, BranchId, SuppId: suppId }) + getSupplaierIdBasedProducts({ + CompId, + AppId, + BranchId, + SuppId: suppId, + }) ).unwrap(); if (updatedResponse?.data?.statusCode === 1) { - const updatedAllSupplierProducts = updatedResponse?.data?.data || []; + const updatedAllSupplierProducts = + updatedResponse?.data?.data || []; const updatedMatchingProdIds = []; unmatchedProducts.forEach((item) => { - const match = updatedAllSupplierProducts?.[0]?.ProductDetails.find( - (supp) => - supp?.ProdName?.toLowerCase() === - item?.parsedData?.description?.toLowerCase() - ); + const match = + updatedAllSupplierProducts?.[0]?.ProductDetails.find( + (supp) => + supp?.ProdName?.toLowerCase() === + item?.parsedData?.description?.toLowerCase() + ); if (match) { updatedMatchingProdIds.push(match.ProdId); } @@ -970,7 +989,6 @@ const StockForm = ({ formType }) => { for (const item of matchedProducts) { if (item.matchFound) { const newProduct = await ProductDropDownChange( - item?.selectedProduct?.ProdVariantName, item.selectedProdId, { label: item.selectedProduct.ProdName }, @@ -1147,7 +1165,7 @@ const StockForm = ({ formType }) => { const handleSuppInvoiceNoChange = (e) => { const value = e.target.value; formRef.current?.setFieldsValue({ SuppInvoiceNo: value }); - setExtractorData(prev => prev ? { ...prev, invoiceNo: value } : null); + setExtractorData((prev) => (prev ? { ...prev, invoiceNo: value } : null)); }; const handleInvoiceTypeChange = (value) => { @@ -1176,7 +1194,10 @@ const StockForm = ({ formType }) => { formRef?.current?.getFieldsValue(), 'formRefformRefformRefformRef' ); - if (extractorData?.invoiceNo !== null && extractorData?.invoiceNo !== "") { + if ( + extractorData?.invoiceNo !== null && + extractorData?.invoiceNo !== '' + ) { formRef?.current?.setFieldsValue({ SuppInvoiceNo: extractorData?.invoiceNo, }); @@ -1185,7 +1206,7 @@ const StockForm = ({ formType }) => { formRef?.current?.setFieldsValue({ PaymentAmount: extractorData?.TotalAmtData, }); - setPaymentAmount((extractorData?.TotalAmtData)); + setPaymentAmount(extractorData?.TotalAmtData); onSuppInvoiceDateChange( extractorData?.date, extractorData?.date?.format('DD-MM-YYYY') || '' @@ -1272,7 +1293,6 @@ const StockForm = ({ formType }) => { extractedItem, existingProducts ) => { - setProductSearchText(''); setSelectedProductName(option?.label ? option?.label : ''); formRef?.current?.resetFields(['VarProdId']); @@ -1282,7 +1302,10 @@ const StockForm = ({ formType }) => { // let x = (productsList || productData)?.find( // (e) => e.ProdId == ProdId // )?.ProdName; - let OnePcsAvailable = (productsList || productData)?.find((e) => e.ProdId == ProdId && e?.ProdVariantName == VariantName)?.OnePcsAvailable == 'Y'; + let OnePcsAvailable = + (productsList || productData)?.find( + (e) => e.ProdId == ProdId && e?.ProdVariantName == VariantName + )?.OnePcsAvailable == 'Y'; // let variantValues1 = await dispatch( // getProdvaraiantdata({ // CompId: SupplierCompId, @@ -1305,7 +1328,8 @@ const StockForm = ({ formType }) => { // })) // ); - if (true + if ( + true // cc?.[0]?.ProdVariantDetails?.length < 2 || // (extractedProduct ? cc?.[0]?.ProdVariantDetails?.length > 0 : false) ) { @@ -1314,14 +1338,20 @@ const StockForm = ({ formType }) => { formRef.current?.setFieldsValue({ ProdId: ProdId }); await setSelectedProductData(ProdId); // await setSelectedSupplierData(getSuppId?.[0]?.["SuppId"]) ,CustSuppId:getSuppId?.[0]?.["SuppId"] - if ((existingProducts || PurchaseData)?.some((e) => e.ProdId == ProdId && e?.ProdVariantName == VariantName)) { - const existingProduct = (existingProducts || PurchaseData)?.find((e) => e.ProdId == ProdId && e?.ProdVariantName == VariantName); + if ( + (existingProducts || PurchaseData)?.some( + (e) => e.ProdId == ProdId && e?.ProdVariantName == VariantName + ) + ) { + const existingProduct = (existingProducts || PurchaseData)?.find( + (e) => e.ProdId == ProdId && e?.ProdVariantName == VariantName + ); setMessageType('error'); - setMessageData(`Product "${existingProduct?.ProdName} - ${existingProduct?.ProdVariantName}" already exists`); + setMessageData( + `Product "${existingProduct?.ProdName} - ${existingProduct?.ProdVariantName}" already exists` + ); return null; - } - else { - + } else { let ProductData1 = (productsList || productData)?.find( (e) => e.ProdId == ProdId && e?.ProdVariantName == VariantName ); @@ -1788,11 +1818,8 @@ const StockForm = ({ formType }) => { [`splSalePrice${localId}`]: record?.SpecialPrice, [`OnePcsPrice${localId}`]: record?.OnePcsPrice, [`NoOfPcs${localId}`]: record?.NoOfPcs, - - }); - if (applicationRestrictedFields.BatchAndModelDetails) { form.setFieldsValue({ [`BatchRef${localId}`]: record?.BatchRef, @@ -1817,9 +1844,7 @@ const StockForm = ({ formType }) => { setPurchaseData((prev) => prev.map((item) => - item.localId === localId - ? { ...item, ...modifiedObject } - : item + item.localId === localId ? { ...item, ...modifiedObject } : item ) ); @@ -1829,7 +1854,6 @@ const StockForm = ({ formType }) => { } }; - const handleKeyPress = async (e, record) => { if (e.key === 'Enter') { try { @@ -1841,13 +1865,11 @@ const StockForm = ({ formType }) => { } }; - const formatDateForDisplay = (dateString) => { if (!dateString) return ''; return moment(dateString).format('DD-MMM-YY'); }; - const updateRowValues = (localId, updates) => { setPurchaseData((prev) => prev.map((item) => @@ -1872,7 +1894,7 @@ const StockForm = ({ formType }) => { form.setFieldsValue({ [`${key}${localId}`]: value, }); - } + }; const columns = [ { @@ -1889,9 +1911,7 @@ const StockForm = ({ formType }) => { key: 'ProdName', align: 'left', render: (text, record, index) => ( - - {record?.ProdName} - + {record?.ProdName} ), }, { @@ -1900,9 +1920,7 @@ const StockForm = ({ formType }) => { key: 'ProdVariantName', align: 'left', render: (text, record, index) => ( - - {record?.ProdVariantName} - + {record?.ProdVariantName} ), }, { @@ -2108,43 +2126,45 @@ const StockForm = ({ formType }) => { key: 'Amount', editable: true, }, - ...(selectedAdditionalColumn.includes("Mrp") ? [ - { - title: 'MRP', - dataIndex: 'MRP', - key: 'MRP', - editable: true, - // width: 150, - render: (text, record) => { - const localId = record.localId; + ...(selectedAdditionalColumn.includes('Mrp') + ? [ + { + title: 'MRP', + dataIndex: 'MRP', + key: 'MRP', + editable: true, + // width: 150, + render: (text, record) => { + const localId = record.localId; - return isEditing(record) ? ( - - { - const value = e.target.value; + return isEditing(record) ? ( + + { + const value = e.target.value; - if (!/^\d*\.?\d*$/.test(value)) { - setMessageType('error'); - setMessageData('Only numeric values are allowed'); - return; - } + if (!/^\d*\.?\d*$/.test(value)) { + setMessageType('error'); + setMessageData('Only numeric values are allowed'); + return; + } - updateRowValues(record.localId, { - MRP: value, - SellPrice: value, - }); - }} - onPressEnter={(e) => handleKeyPress(e, record)} - /> - - - ) : ( - text - ) - } - }] : []), + updateRowValues(record.localId, { + MRP: value, + SellPrice: value, + }); + }} + onPressEnter={(e) => handleKeyPress(e, record)} + /> + + ) : ( + text + ); + }, + }, + ] + : []), { title: ( @@ -2189,424 +2209,480 @@ const StockForm = ({ formType }) => { }, }, - ...(selectedAdditionalColumn.includes("Amount Per Piece") ? [ - { - title: "Amount per piece", - dataIndex: 'OnePcsPrice', - key: 'OnePcsPrice', - width: 70, - editable: true, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - handleKeyPress(e, record)} - onChange={(e) => { - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { ...item, OnePcsPrice: e.target.value } : item - ); - setPurchaseData(newData); - }} - placeholder="OnePcsPrice" - /> - - ) : ( - text - ); - }, - }] : []), - ...(selectedAdditionalColumn.includes("Amount Per Piece") ? [ - { - title: "Number of piece", - dataIndex: 'NoOfPcs', - key: 'NoOfPcs', - width: 70, - editable: true, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - handleKeyPress(e, record)} - onChange={(e) => { - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { ...item, NoOfPcs: e.target.value } : item - ); - setPurchaseData(newData); - }} - placeholder="NoOfPcs" - /> - - ) : ( - text - ); - }, - }] : []), - ...(selectedAdditionalColumn.includes("Wholesale Price") ? [ - { - title: "Wholesale price", - dataIndex: 'WhSalePrice', - key: 'WhSalePrice', - width: 70, - editable: true, - render: (text, record) => { - return isEditing(record) ? ( - - handleKeyPress(e, record)} - onChange={(e) => { - const value = e.target.value; - - // 🚫 block non-numeric - if (!/^\d*\.?\d*$/.test(value)) return; - - updateRowValue(record.localId, 'WhSalePrice', value); - }} - /> - - ) : ( - text - ); - }, - } - ] : []), - - ...(selectedAdditionalColumn.includes("Manufacture Date") ? [ - { - title: 'Manuf.Date', - dataIndex: 'ManufDate', - key: 'ManufDate', - editable: true, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - { - const formattedDate = dateString === '' ? undefined : moment(dateString, ['DD-MM-YYYY']).format('YYYY-MM-DDTHH:mm:ss'); - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { ...item, ManufDate: formattedDate } : item - ); - setPurchaseData(newData); - form.setFieldsValue({ - [`ManufDate${record?.localId}`]: formattedDate - }); - }} - valueData={record?.ManufDate} - cancelFuture={true} - /> - - ) : ( - formatDateForDisplay(text) - ); - }, - }] : []), - ...(selectedAdditionalColumn.includes("Expiry Date") ? [ - { - title: 'Exp.Date', - dataIndex: 'ExpDate', - key: 'ExpDate', - editable: true, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - { - const formattedDate = dateString === '' ? undefined : moment(dateString, ['DD-MM-YYYY']).format('YYYY-MM-DDTHH:mm:ss'); - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { ...item, ExpDate: formattedDate } : item - ); - setPurchaseData(newData); - form.setFieldsValue({ - [`ExpDate${record?.localId}`]: formattedDate - }); - }} - valueData={record?.ExpDate} - cancelFuture={false} - /> - - ) : ( - formatDateForDisplay(text) - ); - }, - }] : []), - - ...(selectedAdditionalColumn.includes("Hsn") ? [ - { - title: 'Hsn', - dataIndex: 'Hsn', - key: 'Hsn', - editable: true, - // width: 130, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - handleKeyPress(e, record)} - onChange={(e) => { - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { ...item, PurchaseHSNCode: e.target.value } : item - ); - setPurchaseData(newData); - }} - placeholder="HSN code" - /> - - ) : ( - text - ); - }, - }] : []), - ...(selectedAdditionalColumn.includes("Model No") ? [ - { - title: 'Model', - dataIndex: 'Model', - key: 'Model', - editable: true, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - handleKeyPress(e, record, index)} - onChange={(e) => { - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { ...item, ModelNumber: e.target.value } : item - ); - setPurchaseData(newData); - }} - placeholder="Model No" - /> - - ) : ( - text - ); - }, - }] : []), - ...(selectedAdditionalColumn.includes("Batch No") ? [ - { - title: 'Batch', - dataIndex: 'Batch', - key: 'Batch', - editable: true, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - handleKeyPress(e, record, index)} - onChange={(e) => { - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { ...item, BatchRef: e.target.value } : item - ); - setPurchaseData(newData); - }} - placeholder="Batch No" - /> - - ) : ( - text - ); - }, - }] : []), - - ...(selectedAdditionalColumn.includes("Rejected Qty") ? - [ - { - title: 'Rejected Qty', - dataIndex: 'RejectedQty', - key: 'RejectedQty', - editable: true, - render: (text, record, index) => { - return isEditing(record, index) ? ( - - handleKeyPress(e, record, index)} - onChange={(e) => { - const inputValue = e.target.value; - const rejectedQty = parseFloat(inputValue) || 0; - const receivedQty = parseFloat(record.ReceivedQty) || 0; - - if (inputValue !== '' && rejectedQty >= receivedQty) { - setMessageType('error'); - setMessageData('Rejected Qty cannot be greater than or Equal to Received Qty'); - form.setFieldsValue({ - [`RejectedQty${record?.localId}`]: record.RejectedQty || 0 - }); - return; - } - - const acceptedQty = receivedQty - rejectedQty; - const totalAmount = acceptedQty * (parseFloat(record.InwardPrice) || 0); - - const newData = PurchaseData.map((item) => - item.localId === record?.localId ? { - ...item, - RejectedQty: parseFloat(inputValue) || 0, - AcceptedQty: acceptedQty, - Amount: totalAmount - } : item - ); - setPurchaseData(newData); - }} - placeholder="Rejected Qty" - /> - - ) : ( - text - ); + ...(selectedAdditionalColumn.includes('Amount Per Piece') + ? [ + { + title: 'Amount per piece', + dataIndex: 'OnePcsPrice', + key: 'OnePcsPrice', + width: 70, + editable: true, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + handleKeyPress(e, record)} + onChange={(e) => { + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { ...item, OnePcsPrice: e.target.value } + : item + ); + setPurchaseData(newData); + }} + placeholder="OnePcsPrice" + /> + + ) : ( + text + ); + }, }, - }] : []), + ] + : []), + ...(selectedAdditionalColumn.includes('Amount Per Piece') + ? [ + { + title: 'Number of piece', + dataIndex: 'NoOfPcs', + key: 'NoOfPcs', + width: 70, + editable: true, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + handleKeyPress(e, record)} + onChange={(e) => { + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { ...item, NoOfPcs: e.target.value } + : item + ); + setPurchaseData(newData); + }} + placeholder="NoOfPcs" + /> + + ) : ( + text + ); + }, + }, + ] + : []), + ...(selectedAdditionalColumn.includes('Wholesale Price') + ? [ + { + title: 'Wholesale price', + dataIndex: 'WhSalePrice', + key: 'WhSalePrice', + width: 70, + editable: true, + render: (text, record) => { + return isEditing(record) ? ( + + handleKeyPress(e, record)} + onChange={(e) => { + const value = e.target.value; + // 🚫 block non-numeric + if (!/^\d*\.?\d*$/.test(value)) return; + updateRowValue(record.localId, 'WhSalePrice', value); + }} + /> + + ) : ( + text + ); + }, + }, + ] + : []), + ...(selectedAdditionalColumn.includes('Manufacture Date') + ? [ + { + title: 'Manuf.Date', + dataIndex: 'ManufDate', + key: 'ManufDate', + editable: true, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + { + const formattedDate = + dateString === '' + ? undefined + : moment(dateString, ['DD-MM-YYYY']).format( + 'YYYY-MM-DDTHH:mm:ss' + ); + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { ...item, ManufDate: formattedDate } + : item + ); + setPurchaseData(newData); + form.setFieldsValue({ + [`ManufDate${record?.localId}`]: formattedDate, + }); + }} + valueData={record?.ManufDate} + cancelFuture={true} + /> + + ) : ( + formatDateForDisplay(text) + ); + }, + }, + ] + : []), + ...(selectedAdditionalColumn.includes('Expiry Date') + ? [ + { + title: 'Exp.Date', + dataIndex: 'ExpDate', + key: 'ExpDate', + editable: true, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + { + const formattedDate = + dateString === '' + ? undefined + : moment(dateString, ['DD-MM-YYYY']).format( + 'YYYY-MM-DDTHH:mm:ss' + ); + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { ...item, ExpDate: formattedDate } + : item + ); + setPurchaseData(newData); + form.setFieldsValue({ + [`ExpDate${record?.localId}`]: formattedDate, + }); + }} + valueData={record?.ExpDate} + cancelFuture={false} + /> + + ) : ( + formatDateForDisplay(text) + ); + }, + }, + ] + : []), - ...(selectedAdditionalColumn.includes("Free Qty") ? [ - { - title: 'Free Qty', - dataIndex: 'Freeqty', - key: 'Freeqty', - editable: true, - render: (text, record) => { - return isEditing(record) ? ( - - handleKeyPress(e, record)} - onChange={(e) => { - const value = e.target.value; + ...(selectedAdditionalColumn.includes('Hsn') + ? [ + { + title: 'Hsn', + dataIndex: 'Hsn', + key: 'Hsn', + editable: true, + // width: 130, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + handleKeyPress(e, record)} + onChange={(e) => { + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { ...item, PurchaseHSNCode: e.target.value } + : item + ); + setPurchaseData(newData); + }} + placeholder="HSN code" + /> + + ) : ( + text + ); + }, + }, + ] + : []), + ...(selectedAdditionalColumn.includes('Model No') + ? [ + { + title: 'Model', + dataIndex: 'Model', + key: 'Model', + editable: true, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + handleKeyPress(e, record, index)} + onChange={(e) => { + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { ...item, ModelNumber: e.target.value } + : item + ); + setPurchaseData(newData); + }} + placeholder="Model No" + /> + + ) : ( + text + ); + }, + }, + ] + : []), + ...(selectedAdditionalColumn.includes('Batch No') + ? [ + { + title: 'Batch', + dataIndex: 'Batch', + key: 'Batch', + editable: true, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + handleKeyPress(e, record, index)} + onChange={(e) => { + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { ...item, BatchRef: e.target.value } + : item + ); + setPurchaseData(newData); + }} + placeholder="Batch No" + /> + + ) : ( + text + ); + }, + }, + ] + : []), - // 🚫 block non-numeric - if (!/^\d*$/.test(value)) return; + ...(selectedAdditionalColumn.includes('Rejected Qty') + ? [ + { + title: 'Rejected Qty', + dataIndex: 'RejectedQty', + key: 'RejectedQty', + editable: true, + render: (text, record, index) => { + return isEditing(record, index) ? ( + + handleKeyPress(e, record, index)} + onChange={(e) => { + const inputValue = e.target.value; + const rejectedQty = parseFloat(inputValue) || 0; + const receivedQty = parseFloat(record.ReceivedQty) || 0; - updateRowValue(record.localId, 'Freeqty', value); - }} - /> - - ) : ( - text - ); - }, - }, - ] : []), + if (inputValue !== '' && rejectedQty >= receivedQty) { + setMessageType('error'); + setMessageData( + 'Rejected Qty cannot be greater than or Equal to Received Qty' + ); + form.setFieldsValue({ + [`RejectedQty${record?.localId}`]: + record.RejectedQty || 0, + }); + return; + } - ...(selectedAdditionalColumn.includes("IMEI") ? [ - { - title: 'IMEI', - dataIndex: 'AdditionalInfo', - key: 'AdditionalInfo', - width: 120, - align: 'center', - render: (text, record, index) => { - const hasQty = record?.ReceivedQty && parseFloat(record.ReceivedQty) > 0; - return ( - <> - {' '} - { - if (hasQty) { + const acceptedQty = receivedQty - rejectedQty; + const totalAmount = + acceptedQty * (parseFloat(record.InwardPrice) || 0); - setSelectedRowIndex(index); - handleModelDataOpen(record); + const newData = PurchaseData.map((item) => + item.localId === record?.localId + ? { + ...item, + RejectedQty: parseFloat(inputValue) || 0, + AcceptedQty: acceptedQty, + Amount: totalAmount, + } + : item + ); + setPurchaseData(newData); + }} + placeholder="Rejected Qty" + /> + + ) : ( + text + ); + }, + }, + ] + : []), - } else { - setMessageType('error'); - setMessageData('Please Enter Qty'); - } - }} - className="shape-preview" - /> - - ); - }, - }] : []), + ...(selectedAdditionalColumn.includes('Free Qty') + ? [ + { + title: 'Free Qty', + dataIndex: 'Freeqty', + key: 'Freeqty', + editable: true, + render: (text, record) => { + return isEditing(record) ? ( + + handleKeyPress(e, record)} + onChange={(e) => { + const value = e.target.value; + + // 🚫 block non-numeric + if (!/^\d*$/.test(value)) return; + + updateRowValue(record.localId, 'Freeqty', value); + }} + /> + + ) : ( + text + ); + }, + }, + ] + : []), + + ...(selectedAdditionalColumn.includes('IMEI') + ? [ + { + title: 'IMEI', + dataIndex: 'AdditionalInfo', + key: 'AdditionalInfo', + width: 120, + align: 'center', + render: (text, record, index) => { + const hasQty = + record?.ReceivedQty && parseFloat(record.ReceivedQty) > 0; + return ( + <> + {' '} + { + if (hasQty) { + setSelectedRowIndex(index); + handleModelDataOpen(record); + } else { + setMessageType('error'); + setMessageData('Please Enter Qty'); + } + }} + className="shape-preview" + /> + + ); + }, + }, + ] + : []), { title: 'Action', dataIndex: 'Action', @@ -2629,14 +2705,11 @@ const StockForm = ({ formType }) => { }, ]; - const statusFormatters = (record) => { const localId = record?.localId; // Remove row using localId (not index) - const data = PurchaseData.filter( - (item) => item?.localId !== localId - ); + const data = PurchaseData.filter((item) => item?.localId !== localId); setDelete(true); @@ -2671,17 +2744,12 @@ const StockForm = ({ formType }) => { }); }; - - - const handleQtyChange = (e, record) => { const { localId } = record; const sourceData = PurchaseData; - const findIndex = sourceData.findIndex( - (item) => item?.localId === localId - ); + const findIndex = sourceData.findIndex((item) => item?.localId === localId); if (findIndex === -1) return; @@ -2727,8 +2795,6 @@ const StockForm = ({ formType }) => { }); }; - - const handlePurrateChange = (e, record) => { const { localId, PurcDisc, PurcDiscType } = record; const PurcRate = e.target.value; @@ -2801,7 +2867,6 @@ const StockForm = ({ formType }) => { }); }; - const handleSellPriceChange = (e, record) => { const { localId } = record; const value = e?.target?.value; @@ -2872,8 +2937,6 @@ const StockForm = ({ formType }) => { }); }; - - const purchaseStatusChange = (value) => { setPurchaseStatus(value); }; @@ -3000,8 +3063,6 @@ const StockForm = ({ formType }) => { }, []); }; - - const onFinish = async ({ PaymentType, PaymentAmount = 0, ...values }) => { try { // =============================== @@ -3016,7 +3077,9 @@ const StockForm = ({ formType }) => { if (invalidTaxItems.length > 0) { setMessageType('error'); - setMessageData('Please enter valid tax percentage (0–99%) for all items'); + setMessageData( + 'Please enter valid tax percentage (0–99%) for all items' + ); return; } @@ -3214,8 +3277,6 @@ const StockForm = ({ formType }) => { } }; - - const onComplete = useCallback(() => { setMessageData(null); setMessageType(null); @@ -3545,13 +3606,6 @@ const StockForm = ({ formType }) => { // command - - - ; - - - - const validateSellPrice = (record) => (_, value) => { if (!value) { return Promise.reject('Selling Price is required'); @@ -3623,7 +3677,6 @@ const StockForm = ({ formType }) => { }; const handleModelDataSumbitOrClose = () => { - setimeiSerialOpen(false); const productIdentifierDtls = dataSource ?.filter( @@ -3637,40 +3690,41 @@ const StockForm = ({ formType }) => { })); const newData = PurchaseData.map((item, index) => - index === selectedRowIndex ? { ...item, ProductIdentifierDtls: productIdentifierDtls } : item + index === selectedRowIndex + ? { ...item, ProductIdentifierDtls: productIdentifierDtls } + : item ); setPurchaseData(newData); }; const handleFieldSetupSubmit = async () => { - const postData = { - "AppId": AppId, - "CompId": CompId, - "BranchId": BranchId, - "Type": "PE", - "FormType": "Purchase Entry", - "TypeId": categoryId, - "ConfigDtl": selectedFields?.map((field) => ({ - "ConfigId": field, - "Access": 'Y', + AppId: AppId, + CompId: CompId, + BranchId: BranchId, + Type: 'PE', + FormType: 'Purchase Entry', + TypeId: categoryId, + ConfigDtl: selectedFields?.map((field) => ({ + ConfigId: field, + Access: 'Y', })), - "CreatedBy": UserId - } + CreatedBy: UserId, + }; const response = await dispatch(postFieldSetup(postData))?.unwrap(); if (response?.data?.statusCode === 1) { setSelectedAdditionalColumn([...tempSelectedColumns]); setShowColumnModal(false); - setTempSelectedColumns([]) - setMessageType("success"); + setTempSelectedColumns([]); + setMessageType('success'); setMessageData(response?.data?.response); await getFieldSetup(); } else { - setMessageType("error"); - setMessageData("Failed to set up fields"); + setMessageType('error'); + setMessageData('Failed to set up fields'); } - } + }; const handleModalSubmited = () => { setIsModalOpen(false); }; @@ -3778,7 +3832,7 @@ const StockForm = ({ formType }) => { )}
    -
    +
    { className="pruchaseCatBTN scan-receipt-btn" onClick={() => setExtractorModalVisible(true)} > -

    Scan Receipt (Auto-Fill)

    + {' '} +

    Scan Receipt (Auto-Fill)

    {
    -
    + { options={ SupplierData ? SupplierData.filter( - (obj, index, self) => - index === - self.findIndex( - (t) => t.SuppId === obj.SuppId - ) // remove dup SuppId - ).map((option) => ({ - key: `${option.SuppId}-${option.Type}`, // 👈 unique key - value: option.SuppId, - label: - option.Type === 'Branch' - ? `${option.SuppName} (${option.Type}) [${option.SuppId}]` - : `${option.SuppName} (${option.Type})`, - })) + (obj, index, self) => + index === + self.findIndex( + (t) => t.SuppId === obj.SuppId + ) // remove dup SuppId + ).map((option) => ({ + key: `${option.SuppId}-${option.Type}`, // 👈 unique key + value: option.SuppId, + label: + option.Type === 'Branch' + ? `${option.SuppName} (${option.Type}) [${option.SuppId}]` + : `${option.SuppName} (${option.Type})`, + })) : [] } label={} @@ -4098,88 +4153,88 @@ const StockForm = ({ formType }) => { item.ConfigId === SelectedPurchaseType && item.ConfigName === 'Cash' ) && ( - <> - - ({ - value: mode.ModeId, - label: mode.ModeName, - }))} - label={ - - } - className="field-DropDown" - onChangeFunction={handlePaymentModeChange} - valueData={selectedPaymentMode} - /> - - { - if ( - value === undefined || - value === null || - value === '' - ) { - return Promise.resolve(); - } - if (Number(value) === 0) { - return Promise.reject( - 'Payment Amount cannot be 0' - ); - } - if ( - isNaN(value) || - Number(value) < 0 - ) { - return Promise.reject( - 'Payment Amount cannot be less than 0' - ); - } + <> + + ({ + value: mode.ModeId, + label: mode.ModeName, + }))} + label={ + + } + className="field-DropDown" + onChangeFunction={handlePaymentModeChange} + valueData={selectedPaymentMode} + /> + + { + if ( + value === undefined || + value === null || + value === '' + ) { return Promise.resolve(); - }, + } + if (Number(value) === 0) { + return Promise.reject( + 'Payment Amount cannot be 0' + ); + } + if ( + isNaN(value) || + Number(value) < 0 + ) { + return Promise.reject( + 'Payment Amount cannot be less than 0' + ); + } + return Promise.resolve(); }, - ]} - > - - Payment Amount - - } - inputMode="decimal" - disable={!payAmountDisable} - isOnChange={paymentAmount ? true : false} - min={0} - type="number" - value={paymentAmount} - onChange={(e) => { - formRef?.current?.setFieldsValue({ - PaymentAmount: e?.target?.value, - }); - setPaymentAmount(e?.target?.value); - }} - /> - - - )} + }, + ]} + > + + Payment Amount + + } + inputMode="decimal" + disable={!payAmountDisable} + isOnChange={paymentAmount ? true : false} + min={0} + type="number" + value={paymentAmount} + onChange={(e) => { + formRef?.current?.setFieldsValue({ + PaymentAmount: e?.target?.value, + }); + setPaymentAmount(e?.target?.value); + }} + /> + + + )}
    @@ -4207,9 +4262,13 @@ const StockForm = ({ formType }) => { className="field-DropDown" value={selectedProductName} filterOption={(input, option) => { - const [prodId, variantName] = option.value.split('_'); + const [prodId, variantName] = + option.value.split('_'); const product = productData.find( - (p) => p.ProdId === prodId && (p.ProdVariantName || 'Variant1') === variantName + (p) => + p.ProdId === prodId && + (p.ProdVariantName || 'Variant1') === + variantName ); const nameMatch = option.label ?.toLowerCase() @@ -4222,16 +4281,18 @@ const StockForm = ({ formType }) => { options={ !scanner ? productData?.map((option) => ({ - - value: `${option.ProdId}_${option.ProdVariantName}`, - label: `${option.ProdName} (${option.Size} ${option.UomName})${option?.BrandName ? ` - ${option?.BrandName}` : ''} - ${option.ProdVariantName}`, - - })) + value: `${option.ProdId}_${option.ProdVariantName}`, + label: `${option.ProdName} (${option.Size} ${option.UomName})${option?.BrandName ? ` - ${option?.BrandName}` : ''} - ${option.ProdVariantName}`, + })) : [] } onSelect={async (value, option) => { const [prodId, variantName] = value.split('_'); - const product = productData.find(p => p.ProdId === prodId && (p.ProdVariantName) === variantName); + const product = productData.find( + (p) => + p.ProdId === prodId && + p.ProdVariantName === variantName + ); const newProduct = await ProductDropDownChange( product?.ProdVariantName, prodId, @@ -4274,56 +4335,64 @@ const StockForm = ({ formType }) => {
    - - setIsModalOpen(true)} size={18} /> + setIsModalOpen(true)} + size={18} + /> - + - {isModalOpen && ( @@ -4343,19 +4412,28 @@ const StockForm = ({ formType }) => { /> )} -
    - -
    +
    { - setTempSelectedColumns([...selectedAdditionalColumn]); + setTempSelectedColumns([ + ...selectedAdditionalColumn, + ]); setShowColumnModal(true); - }}> + }} + > @@ -4372,8 +4450,6 @@ const StockForm = ({ formType }) => { />
    - -
    { maxwidth: '500px', overflowX: 'auto', scrollbarWidth: 'thin', - maxHeight: "50vh" + maxHeight: '50vh', }} > {/*
    @@ -4403,7 +4479,9 @@ const StockForm = ({ formType }) => { ({ @@ -4413,18 +4491,16 @@ const StockForm = ({ formType }) => { })} pagination={false} locale={{ - emptyText: isSearching ? 'No matching products found' : 'No data', + emptyText: isSearching + ? 'No matching products found' + : 'No data', }} /> - - - - { color="901D77" icon={} /> - { autoComplete="off" label="GST No" autocapitalize="on" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4594,10 +4669,10 @@ const StockForm = ({ formType }) => { // isOnChange={formType == 'edit' ? true : false} inputMode="numeric" onInput={(e) => - (e.target.value = e.target.value.replace( - /[^0-9]/g, - '' - )) + (e.target.value = e.target.value.replace( + /[^0-9]/g, + '' + )) } /> @@ -4609,7 +4684,7 @@ const StockForm = ({ formType }) => { MailId} autocomplete="off" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4636,7 +4711,7 @@ const StockForm = ({ formType }) => { Point of Contact} autocomplete="off" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4658,7 +4733,7 @@ const StockForm = ({ formType }) => { label={} autocomplete="off" maxLength="10" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4669,7 +4744,7 @@ const StockForm = ({ formType }) => { POC MailId} autocomplete="off" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4952,18 +5027,18 @@ const StockForm = ({ formType }) => { Sales Price} - // isOnChange={(editstate?.SellPrice || QrcodeExistsData?.[0]?.SellPrice)? true : false} + // isOnChange={(editstate?.SellPrice || QrcodeExistsData?.[0]?.SellPrice)? true : false} /> ({ @@ -5023,7 +5098,7 @@ const StockForm = ({ formType }) => { // isOnchanges={(editstate?.Brand || SelectedBrand)?true:false} onChangeFunction={handleBrandDropDownChange} valueData={SelectedBrand} - // disabled={editstate?.Brand ? true : false} + // disabled={editstate?.Brand ? true : false} /> { onSelectFuntion={(e) => openAmountPerPieceAvailable(e) } - // disabled={editstate?.QRCode ? true : false} + // disabled={editstate?.QRCode ? true : false} /> {(QrcodeAuto == 'N' || editstate?.QRCode) && ( @@ -5162,38 +5237,38 @@ const StockForm = ({ formType }) => { {(QrcodeAutoSingle == 'N' || editstate?.OnePcQR) && ( -
    - - { - await validateSafeInput(value); // To block HTML tags & SQL keywords - return Promise.resolve(); - }, +
    + + { + await validateSafeInput(value); // To block HTML tags & SQL keywords + return Promise.resolve(); }, - ]} - > - + - {QrcodeSingleExistsVal && - QrcodeSingleExistsVal} - -
    - )} + /> + {QrcodeSingleExistsVal && + QrcodeSingleExistsVal} +
    +
    + )} )} @@ -5218,7 +5293,7 @@ const StockForm = ({ formType }) => {
    )} @@ -5681,7 +5756,7 @@ const StockForm = ({ formType }) => { width={600} buttonText="Submit" children={ -
    +
    'editable-row'} @@ -5705,30 +5780,36 @@ const StockForm = ({ formType }) => { handleSubmit={handleFieldSetupSubmit} handleCancel={() => { setShowColumnModal(false); - setSelectedFields([...selectedAdditionalColumn.map(col => - tableFieldPreferences?.find(pref => pref.label === col)?.value - ).filter(Boolean)]); + setSelectedFields([ + ...selectedAdditionalColumn + .map( + (col) => + tableFieldPreferences?.find((pref) => pref.label === col) + ?.value + ) + .filter(Boolean), + ]); setTempSelectedColumns([...selectedAdditionalColumn]); }} >
    {tableFieldPreferences?.map((option) => ( -
    +