diff --git a/src/Pages/DeliveryChallan/DCPrintTemplates/DCA4/DCA4Standard.jsx b/src/Pages/DeliveryChallan/DCPrintTemplates/DCA4/DCA4Standard.jsx index 5cb21a2..3176e9a 100644 --- a/src/Pages/DeliveryChallan/DCPrintTemplates/DCA4/DCA4Standard.jsx +++ b/src/Pages/DeliveryChallan/DCPrintTemplates/DCA4/DCA4Standard.jsx @@ -1,9 +1,9 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; import { extractLastNumber, extractLastNumberOrderId, -} from "../../../../Services/Others"; +} from '../../../../Services/Others'; import { GlobalprintSlNo, GlobalprintItem, @@ -23,13 +23,33 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, -} from "../../../../Features/ThemeChange/ThemeChange"; + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalSelectedFooterColor, + GlobalRowType, + GlobalSelectedFooterFontColor, +} from '../../../../Features/ThemeChange/ThemeChange'; // import "../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/DCPrintStyle1.scss"; -import QRCode from "react-qr-code"; -import { GlobalUpiIDprint } from "../../../../Features/BookingScreen/BookingData/BookingData"; -import signature from "../../../../Images/signatureimage.jpg" -const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCity, BranchZip, Date1, - table2Data, PaymentStatus, PrintGreeting, printDatas, DCPrintTemplateDtl }) => { +import QRCode from 'react-qr-code'; +import { GlobalUpiIDprint } from '../../../../Features/BookingScreen/BookingData/BookingData'; +import signature from '../../../../Images/signatureimage.jpg'; +const DCInvoiceTemplate = ({ + BranchName, + BranchDetails, + BranchAddress, + BranchCity, + BranchZip, + Date1, + table2Data, + PaymentStatus, + PrintGreeting, + printDatas, + DCPrintTemplateDtl, +}) => { const formatDate = (dateString = '') => { const date = new Date(dateString); const day = date.getDate().toString().padStart(2, '0'); @@ -57,17 +77,17 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit acc[item.ConfigName] = true; return acc; }, {}); - console.log(table2Data, "FieldDetails") - const SLNO = FieldDetails?.["Sl.No"]; - const Item = FieldDetails?.["Item"]; - console.log(Item, "Item") - const MRP = FieldDetails?.["MRP"]; - const Discount = FieldDetails?.["Discount"]; - const Quantity = FieldDetails?.["Quantity"]; - const Rate = FieldDetails?.["Rate"]; - const Amount = FieldDetails?.["Amount"]; - const HsnCode = FieldDetails?.["HsnCode"]; - const Qrcodet = FieldDetails?.["Qrcode"]; + console.log(table2Data, 'FieldDetails'); + const SLNO = FieldDetails?.['Sl.No']; + const Item = FieldDetails?.['Item']; + console.log(Item, 'Item'); + const MRP = FieldDetails?.['MRP']; + const Discount = FieldDetails?.['Discount']; + const Quantity = FieldDetails?.['Quantity']; + const Rate = FieldDetails?.['Rate']; + const Amount = FieldDetails?.['Amount']; + const HsnCode = FieldDetails?.['HsnCode']; + const Qrcodet = FieldDetails?.['Qrcode']; const GlobalSlNo = useSelector(GlobalprintSlNo); const GlobalItem = useSelector(GlobalprintItem); const GlobalMRP = useSelector(GlobalprintMRP); @@ -82,41 +102,41 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalIsnotes = useSelector(Globalnotes); - const GlobalthemeFormatr = useSelector(GlobalthemeFormat) - const GlobalBilltext = useSelector(GlobalBillName) + const GlobalthemeFormatr = useSelector(GlobalthemeFormat); + const GlobalBilltext = useSelector(GlobalBillName); const keysLength = Object.keys(table2Data ?? {}).length; - console.log(GlobalDiscount, Discount, "Discount"); + console.log(GlobalDiscount, Discount, 'Discount'); - let BankDetails = BranchDetails?.BankDetails - let TermsAndConditions = DCPrintTemplateDtl?.TermsandConditions - let SignatureImg = DCPrintTemplateDtl?.Signature - let Notestext = DCPrintTemplateDtl?.Notes - let BillName = DCPrintTemplateDtl?.PrintHdrName - let FormatTheme = DCPrintTemplateDtl?.PrintType == "S" ? true : false - let PageSize = DCPrintTemplateDtl?.PageSize - const Signature = FieldDetails?.["signature"]; - const TermsnAdCondition = FieldDetails?.["terms&conditions"]; - console.log(BranchDetails, "BranchDetails"); - console.log(table2Data, "FormatThemekjhjk", PaymentStatus) + let BankDetails = BranchDetails?.BankDetails; + let TermsAndConditions = DCPrintTemplateDtl?.TermsandConditions; + let SignatureImg = DCPrintTemplateDtl?.Signature; + let Notestext = DCPrintTemplateDtl?.Notes; + let BillName = DCPrintTemplateDtl?.PrintHdrName; + let FormatTheme = DCPrintTemplateDtl?.PrintType == 'S' ? true : false; + let PageSize = DCPrintTemplateDtl?.PageSize; + const Signature = FieldDetails?.['signature']; + const TermsnAdCondition = FieldDetails?.['terms&conditions']; + console.log(BranchDetails, 'BranchDetails'); + console.log(table2Data, 'FormatThemekjhjk', PaymentStatus); if (keysLength > 0) { dispatch(changeReprintDataFound(true)); } const currentDate = new Date(); - const day = currentDate.getDate().toString().padStart(2, "0"); + const day = currentDate.getDate().toString().padStart(2, '0'); const monthNames = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', ]; const monthIndex = currentDate.getMonth(); const year = currentDate.getFullYear().toString().slice(-2); @@ -124,13 +144,13 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`; const TakeawayData = table2Data?.productDetails?.filter( - (item) => item.BookingTypeName?.toLowerCase() === "takeaway" + (item) => item.BookingTypeName?.toLowerCase() === 'takeaway' ); const DineInData = table2Data?.productDetails?.filter( - (item) => item.BookingTypeName?.toLowerCase() === "dine in" + (item) => item.BookingTypeName?.toLowerCase() === 'dine in' ); let PaymentStatusSuccess = PaymentStatus?.filter( - (ps) => ps.PaymentStatus === "S" + (ps) => ps.PaymentStatus === 'S' ); const TakeawayTotal = TakeawayData?.reduce( (accumulator, currentValue) => accumulator + currentValue.TotalAmt, @@ -159,63 +179,71 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit const offers = table2Data?.OrderOfferDetails || []; let TotalOfferAmount = 0; - console.log(table2Data, "productsDatakl") + console.log(table2Data, 'productsDatakl'); // Calculate SalesWiseOffers total amount - offers.forEach(offer => { + offers.forEach((offer) => { if (offer.TableName === 'SalesWiseOffers') { TotalOfferAmount += offer.OfferAmount; } }); - const hasMappedOffer = offers.some(offer => - ["ItemWiseOffers", "BundleOffers", "QuantityWiseOffers"].includes(offer.TableName) + 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); + 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); + const Combothere = productsData?.filter((item) => item?.Type == 'C'); + const CombothereTotal = Combothere?.reduce( + (acc, item) => acc + (item.OfferValue || 0), + 0 + ); TotalOfferAmount += CombothereTotal; } - const invoiceData = { company: { - name: "Prematix Software Solution Pvt Ltd.", - address: "#589, 2nd floor, VP Chambers, 1st cross, 3rd block, Koramangala, Bengaluru- 560034.", - phone: "9344270900", - email: "info@prematix.com", - gstin: "29AAICP0469K1ZX" + name: 'Prematix Software Solution Pvt Ltd.', + address: + '#589, 2nd floor, VP Chambers, 1st cross, 3rd block, Koramangala, Bengaluru- 560034.', + phone: '9344270900', + email: 'info@prematix.com', + gstin: '29AAICP0469K1ZX', }, invoice: { - state: "Karnataka", - stateCode: "29", - date: "13/04/2024", - number: "BLR/01/2024-25", - reverseCharge: "", - placeOfSupply: "", - dateOfSupply: "", - vehicleNumber: "", - transportationMode: "" + state: 'Karnataka', + stateCode: '29', + date: '13/04/2024', + number: 'BLR/01/2024-25', + reverseCharge: '', + placeOfSupply: '', + dateOfSupply: '', + vehicleNumber: '', + transportationMode: '', }, billTo: { - name: "Ooty Boat House", - address: "No:2, North Lake Road,", - state: "Tamil Nadu", - stateCode: "33", - gstin: "", - poNumber: "BLR/14/2024", - poDate: "11/04/2024" + name: 'Ooty Boat House', + address: 'No:2, North Lake Road,', + state: 'Tamil Nadu', + stateCode: '33', + gstin: '', + poNumber: 'BLR/14/2024', + poDate: '11/04/2024', }, items: [ { sr: 1, - name: "Acrylic Scanner Box", - hsn: "39204900", - uom: "INR", + name: 'Acrylic Scanner Box', + hsn: '39204900', + uom: 'INR', qty: 1, rate: 6501, amount: 6501, @@ -225,15 +253,15 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit cgstAmount: 0, sgstRate: 0, sgstAmount: 0, - igstRate: 18.00, + igstRate: 18.0, igstAmount: 1170, - totalAmount: 7671 + totalAmount: 7671, }, { sr: 2, name: '32" Wide Angle view display FHD', - hsn: "84716030", - uom: "INR", + hsn: '84716030', + uom: 'INR', qty: 1, rate: 48317, amount: 48317, @@ -243,15 +271,15 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit cgstAmount: 0, sgstRate: 0, sgstAmount: 0, - igstRate: 18.00, + igstRate: 18.0, igstAmount: 8697, - totalAmount: 57014 + totalAmount: 57014, }, { sr: 3, - name: "Service charges", - hsn: "999630", - uom: "INR", + name: 'Service charges', + hsn: '999630', + uom: 'INR', qty: 1, rate: 25000, amount: 25000, @@ -261,11 +289,10 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit cgstAmount: 0, sgstRate: 0, sgstAmount: 0, - igstRate: 18.00, + igstRate: 18.0, igstAmount: 4500, - totalAmount: 29500 + totalAmount: 29500, }, - ], totals: { beforeTax: 83660, @@ -274,63 +301,110 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit cgst: 0, totalGst: 15059, afterTax: 98719, - amountInWords: "Ninety Eight Thousand Seven Hundred and Nineteen Rupees Only" + amountInWords: + 'Ninety Eight Thousand Seven Hundred and Nineteen Rupees Only', }, bankDetails: { - bankName: "State Bank of India", - accountNo: "34850253701", - ifscCode: "SBIN0006242", - branchName: "Mookandapalli" - } + bankName: 'State Bank of India', + accountNo: '34850253701', + ifscCode: 'SBIN0006242', + branchName: 'Mookandapalli', + }, }; - const chunkSize = PageSize == "A5" ? 8 : 9; + const chunkSize = PageSize == 'A5' ? 8 : 9; let dataSource = table2Data?.ProductDetails || []; - 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" ? 4 : 6); + const lastChunkRows = + paginatedChunks.length > 0 + ? paginatedChunks[paginatedChunks.length - 1].length + : 0; + const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 4 : 6); - console.log(table2Data, "table2Datah") + console.log(table2Data, 'table2Datah'); const companyName = table2Data?.CompName; - const companyAddress = table2Data?.AddressDetails?.[0]?.Address1 + table2Data?.AddressDetails?.[0]?.Address2 || "#589, 2nd floor, VP Chambers, 1st cross, 3rd block, Koramangala, Bengaluru- 560034."; - const companyPhone = table2Data?.BrMobile + "," + table2Data?.BrMobile2 !== null ? table2Data?.BrMobile2 : ""; - const companyEmail = table2Data?.CompanyEmail || "info@prematix.com"; + const companyAddress = + table2Data?.AddressDetails?.[0]?.Address1 + + table2Data?.AddressDetails?.[0]?.Address2 || + '#589, 2nd floor, VP Chambers, 1st cross, 3rd block, Koramangala, Bengaluru- 560034.'; + const companyPhone = + table2Data?.BrMobile + ',' + table2Data?.BrMobile2 !== null + ? table2Data?.BrMobile2 + : ''; + const companyEmail = table2Data?.CompanyEmail || 'info@prematix.com'; const companyGSTIN = table2Data?.CompGSTIN; - - const InvoiceAmountWords = ({ amount }) => { const numberToWords = (num) => { const a = [ - "", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", - "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", - "Eighteen", "Nineteen" + '', + 'One', + 'Two', + 'Three', + 'Four', + 'Five', + 'Six', + 'Seven', + 'Eight', + 'Nine', + 'Ten', + 'Eleven', + 'Twelve', + 'Thirteen', + 'Fourteen', + 'Fifteen', + 'Sixteen', + 'Seventeen', + 'Eighteen', + 'Nineteen', + ]; + const b = [ + '', + '', + 'Twenty', + 'Thirty', + 'Forty', + 'Fifty', + 'Sixty', + 'Seventy', + 'Eighty', + 'Ninety', ]; - const b = ["", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"]; - if (num === 0) return "Zero"; + if (num === 0) return 'Zero'; if (num < 20) return a[num]; - if (num < 100) return b[Math.floor(num / 10)] + (num % 10 ? " " + a[num % 10] : ""); + if (num < 100) + return b[Math.floor(num / 10)] + (num % 10 ? ' ' + a[num % 10] : ''); if (num < 1000) - return a[Math.floor(num / 100)] + " Hundred" + (num % 100 ? " and " + numberToWords(num % 100) : ""); + return ( + a[Math.floor(num / 100)] + + ' Hundred' + + (num % 100 ? ' and ' + numberToWords(num % 100) : '') + ); if (num < 100000) - return numberToWords(Math.floor(num / 1000)) + " Thousand" + (num % 1000 ? " " + numberToWords(num % 1000) : ""); + return ( + numberToWords(Math.floor(num / 1000)) + + ' Thousand' + + (num % 1000 ? ' ' + numberToWords(num % 1000) : '') + ); - return "Number too large"; + return 'Number too large'; }; return (
Total Invoice Amount in Words:
-+
{numberToWords(amount)}
{GlobaldummyData - ? "BranchAddress, Town- 635XXX City - State" - : (BranchAddress || "") + - (BranchCity - ? (BranchAddress && BranchCity ? "-" : "") + BranchCity - : "") + - (BranchZip - ? (BranchCity && - BranchZip - ? "-" - : "") + BranchZip - : "")}
++ {GlobaldummyData + ? 'BranchAddress, Town- 635XXX City - State' + : (BranchAddress || '') + + (BranchCity + ? (BranchAddress && BranchCity ? '-' : '') + + BranchCity + : '') + + (BranchZip + ? (BranchCity && BranchZip ? '-' : '') + BranchZip + : '')} +
- {BranchDetails?.BrGSTIN &&| S.No | : - SLNO == true &&S.No | } + ? GlobalSlNo && ( ++ S.No + | + ) + : SLNO == true && ( ++ S.No + | + )} {GlobaldummyData - ? GlobalItem &&Item | : - Item == true &&Item | } - + ? GlobalItem && ( ++ Item + | + ) + : Item == true && ( ++ Item + | + )} {/* {GlobaldummyData ? GlobalHsnCode &&HSN | : HsnCode == true &&HSN | } */} {GlobaldummyData - ? GlobalQuantity &&Qty | - : Quantity == true &&Qty | } + ? GlobalQuantity && ( ++ Qty + | + ) + : Quantity == true && ( ++ Qty + | + )} {/*UOM | UOM | */} @@ -901,80 +1204,110 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit {GlobaldummyData ? GlobalAmount &&Amount | : Amount == true &&Amount | } */} -
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - {chunkIndex * chunkSize + idx + 1} - | - ) - : SLNO == true && ( -- {chunkIndex * chunkSize + idx + 1} - | - )} - {GlobaldummyData - ? GlobalItem &&{item?.ProdName} | - : Item == true && ( -
- {item?.ProdName}
-
- ({item?.Size ? item?.Size : "1"}{" "}
- {item?.SinglePc == "Y"
- ? "PCS"
- : item?.Type != "C"
- ? item?.UomName
- : "COMBO"}
- ) {item?.RequestVariantName ? item?.RequestVariantName : ""}
-
- {" "}
- {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
+ {((GlobaldummyData ? products : dataChunk) || []).map(
+ (item, idx) => (
+ ||||||||||||||
| + {chunkIndex * chunkSize + idx + 1} + | + ) + : SLNO == true && ( ++ {chunkIndex * chunkSize + idx + 1} + | + )} + {GlobaldummyData + ? GlobalItem && ( ++ {item?.ProdName} + | + ) + : Item == true && ( +
+ {item?.ProdName}
+
+ ({item?.Size ? item?.Size : '1'}{' '}
+ {item?.SinglePc == 'Y'
+ ? 'PCS'
+ : item?.Type != 'C'
+ ? item?.UomName
+ : 'COMBO'}
+ )
+ {item?.RequestVariantName
+ ? item?.RequestVariantName
+ : ''}
+
+ {' '}
+ {item?.BrandName !== null
+ ? item?.BrandName
+ : ''}
+
+ {item?.ProductIdentifierDtls?.length > 0
+ ? item?.ProductIdentifierDtls?.filter(
+ (items) =>
+ !(
+ items.SerialNumber == '' ||
+ items.SerialNumber == null
+ )
+ )?.map((a) => {
+ return {a.SerialNumber} ;
+ })
+ : ''}{' '}
+ {item?.ProductIdentifierDtls?.length > 0
+ ? item?.ProductIdentifierDtls.filter(
+ (item1) =>
+ item1.IMEI1 !== '' ||
+ item1.IMEI2 !== ''
+ )?.map((item2) => {
+ const imei1 = item2.IMEI1 || '';
+ const imei2 = item2.IMEI2 || '';
+ return (
+
+ {[imei1, imei2]
+ .filter(Boolean)
+ .join(',')}
+
+ );
+ })
+ : ''}
+ |
+ )}
+ {/* {GlobaldummyData
? GlobalHsnCode && (
{item?.HSN} @@ -985,18 +1318,27 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit {item?.HSN} | )} */} - {GlobaldummyData - ? GlobalQuantity && ( -- {item?.SalesQty} - | - ) - : Quantity == true && ( -- {item?.Qty || item?.DispatchedQty} - | - )} - {/* {GlobaldummyData + {GlobaldummyData + ? GlobalQuantity && ( ++ {item?.SalesQty} + | + ) + : Quantity == true && ( ++ {item?.Qty || item?.DispatchedQty} + | + )} + {/* {GlobaldummyData ? GlobalMRP && ({item?.MRP} @@ -1039,11 +1381,9 @@ const DCInvoiceTemplate = ({ BranchName, BranchDetails, BranchAddress, BranchCit {item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} | )} */} -
- Terms & Conditions -
-- Terms & Conditions -
-Certified that the particulars given above are true and correct.
-Company Name
- :"For" {companyName}
} -Authorised Signatory
- {GlobaldummyData ? GlobalSignature && ((Common Seal)
+ ++ Terms & Conditions +
++ Terms & Conditions +
++ Certified that the particulars given above are + true and correct. +
+Company Name
+ ) : ( ++ {' '} + "For" {companyName} +
+ )} ++ Authorised Signatory +
+ + {GlobaldummyData + ? GlobalSignature && ( +(Common Seal)
++ Notes : 10 days Return policy +
+ ++ {Notestext} +
+ + {/*Notes : 10 days Return policy
- -{Notestext}
- - {/*- Terms & Conditions -
-- Terms & Conditions -
-+ Terms & Conditions +
++ Terms & Conditions +
+Certified that the particulars given above are true and correct.
++ Certified that the particulars given above are true + and correct. +
Company Name
- :"For" {companyName}
} + {GlobaldummyData ? ( +Company Name
+ ) : ( +"For" {companyName}
+ )}Authorised Signatory
- {GlobaldummyData ? GlobalSignature && ((Common Seal)
Notes : 10 days Return policy
+ {GlobaldummyData + ? GlobalIsnotes && ( ++ Notes : 10 days Return policy +
-{Notestext}
++ {Notestext} +
- {/*|
{/* Placeholder for the fixed-position header */}
- |
|||||||||||||||||||||||||||||
|
-
-
-
|
+ Notes : 10 days Return policy +
++ {Notestext} +
++ Terms & Conditions +
++ Terms & Conditions +
+Notes : 10 days Return policy
- -{Notestext}
- -- Terms & Conditions -
-- Terms & Conditions -
-Signature
-Signature
-+ Signature +
++ Signature +
++ Notes : 10 days Return policy +
- {GlobaldummyData ? GlobalIsnotes && - (Notes : 10 days Return policy
++ {Notestext} +
-{Notestext}
+- Terms & Conditions -
-- Terms & Conditions -
-Signature
-Signature
-+ Terms & Conditions +
++ Terms & Conditions +
++ Signature +
++ Signature +
+E. & O.E
+E. & O.E
-| S.No | - : SLNO == true &&S.No | } + ? GlobalSlNo && ( ++ S.No + | + ) + : SLNO == true && ( ++ S.No + | + )} {GlobaldummyData ? GlobalItem &&Item | - : Item == true &&Item | } + : Item == true && ( +Item | + )} {/* {GlobaldummyData ? GlobalHsnCode &&HSN | : HsnCode == true && (HSN | )} */} {GlobaldummyData - ? GlobalQuantity &&Qty | + ? GlobalQuantity && ( +Qty | + ) : Quantity == true && ( -Qty | - )} ++ Qty + | + )} {/* {GlobaldummyData ? GlobalMRP &&MRP | : MRP == true &&MRP | } @@ -414,38 +624,58 @@ const DCPrintStyle1 = ({ BranchName, BranchDetails, BranchAddress,
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| + {dataChunk?.map((item, index) => ( + | ||||||||||||||
| {index + 1} | ) - : SLNO == true && ( -+ : SLNO == true && ( + | {chunkIndex * chunkSize + index + 1} | )} - {GlobaldummyData - ? GlobalItem &&{item?.ProdName} | - : Item == true && ( + {GlobaldummyData + ? GlobalItem &&{item?.ProdName} | + : Item == true && (
{item?.ProdName}
- {!(item?.ProdVariantName || item?.RequestVariantName)?.toLowerCase()?.includes(
- 'variant'
- ) && Variant:{item?.ProdVariantName || item?.RequestVariantName} }
- {" "}
-
+ {!(
+ item?.ProdVariantName ||
+ item?.RequestVariantName
+ )
+ ?.toLowerCase()
+ ?.includes('variant') && (
+
+ Variant:
+ {item?.ProdVariantName ||
+ item?.RequestVariantName}{' '}
+
+ )}
+
|
)}
- {/* {GlobaldummyData
+ {/* {GlobaldummyData
? GlobalHsnCode && (
{item?.HSN} @@ -456,18 +686,18 @@ const DCPrintStyle1 = ({ BranchName, BranchDetails, BranchAddress, {item?.HSN} | )} */} - {GlobaldummyData - ? GlobalQuantity && ( -+ {GlobaldummyData + ? GlobalQuantity && ( + | {item?.SalesQty} | ) - : Quantity == true && ( -+ : Quantity == true && ( + | {item?.Qty || item?.DispatchedQty} | )} - {/* {GlobaldummyData + {/* {GlobaldummyData ? GlobalMRP && ({item?.MRP} @@ -511,9 +741,8 @@ const DCPrintStyle1 = ({ BranchName, BranchDetails, BranchAddress, | )} */} -
Extra Charges:{ExtraChargeTotal}
} */} - - - -Notes : 10 days Return policy
+ {GlobaldummyData + ? GlobalIsnotes && ( ++ Notes : 10 days Return policy +
-{Notestext}
++ {Notestext} +
-+ Terms & Conditions +
++ Terms & Conditions +
+- Terms & Conditions -
-- Terms & Conditions -
-Signature
-Signature
-+ Signature +
++ Signature +
+| + S.No + | + ) + : SLNO && ( ++ S.No + | + )} + {GlobaldummyData + ? GlobalItem && ( +Item | + ) + : Item && ( +Item | + )} + {GlobaldummyData + ? GlobalQuantity && ( ++ Qty + | + ) + : Quantity && ( ++ Qty + | + )} +||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| S.No | : SLNO &&S.No | } - {GlobaldummyData ? GlobalItem &&Item | : Item &&Item | } - {/* {GlobaldummyData ? GlobalHsnCode &&HSN | : HsnCode &&HSN | } */} - {GlobaldummyData ? GlobalQuantity &&Qty | : Quantity &&Qty | } - {/* {GlobaldummyData ? GlobalMRP &&MRP | : MRP &&MRP | } - {GlobaldummyData ? GlobalAmount &&Amt | : Amount &&Amt | } - {GlobaldummyData ? GlobalDiscount &&Dis | : Discount &&Dis | } - {GlobaldummyData ? GlobalRate &&Rate | : Rate &&Rate | } */} -||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {index + 1} | : SLNO &&{chunkIndex * chunkSize + index + 1} | } - {GlobaldummyData ? GlobalItem &&{item?.ProdName}({item?.Size + item?.UomName}) | : Item && -
- {item?.ProdName}
- {!(item?.ProdVariantName || item?.RequestVariantName)?.toLowerCase()?.includes('variant') && Variant:{item?.ProdVariantName || item?.RequestVariantName} }
- |
- }
- {/* {GlobaldummyData ? GlobalHsnCode && {item?.HSN} | : HsnCode &&{item?.HSN} | } */} - {GlobaldummyData ? GlobalQuantity &&{item?.SalesQty} | : Quantity &&{item?.Qty || item?.DispatchedQty} | } - {/* {GlobaldummyData ? GlobalMRP &&{item?.MRP} | : MRP &&{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} | } + : {} + } + > + {GlobaldummyData + ? GlobalSlNo && ( ++ {index + 1} + | + ) + : SLNO && ( ++ {chunkIndex * chunkSize + index + 1} + | + )} + {GlobaldummyData + ? GlobalItem && ( ++ {item?.ProdName}( + {item?.Size + item?.UomName}) + | + ) + : Item && ( +
+ {item?.ProdName}
+ {!(
+ item?.ProdVariantName ||
+ item?.RequestVariantName
+ )
+ ?.toLowerCase()
+ ?.includes('variant') && (
+
+ Variant:
+ {item?.ProdVariantName ||
+ item?.RequestVariantName}{' '}
+
+ )}
+ |
+ )}
+ {/* {GlobaldummyData ? GlobalHsnCode && {item?.HSN} | : HsnCode &&{item?.HSN} | } */} + {GlobaldummyData + ? GlobalQuantity && ( ++ {item?.SalesQty} + | + ) + : Quantity && ( ++ {item?.Qty || item?.DispatchedQty} + | + )} + {/* {GlobaldummyData ? GlobalMRP &&{item?.MRP} | : MRP &&{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} | } {GlobaldummyData ? GlobalAmount &&{item?.TotalAmt} | : Amount &&{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} | } {GlobaldummyData ? GlobalDiscount &&{item?.discount} | : Discount &&{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} | } {GlobaldummyData ? GlobalRate &&{item?.Rate} | : Rate &&{item?.Rate} | } */} -
Notes : 10 days Return policy
- -{Notestext}
- -- Terms & Conditions -
-- Terms & Conditions -
-Signature
-Signature
-+ Notes : 10 days Return policy +
- > - ) -} +{Notestext}
-export default DCPrintstyle2 ++ Terms & Conditions +
++ Terms & Conditions +
++ Signature +
++ Signature +
+| S.No | ++ S.No + | ) : SLNO && (S.No | )} {GlobaldummyData ? ( (GlobalItem || GlobalQuantity) && ( -+ | {GlobaldummyData ? GlobalItem && 'ITEM /DES' : 'ITEM /DES'}{' '} | ) ) : ( -+ | {GlobaldummyData ? GlobalItem && 'ITEM /DES' : Item && 'ITEM /DES'}{' '} @@ -500,14 +585,22 @@ const DCPrintstyle6 = ({ {GlobaldummyData ? GlobalQuantity && ( | QTY | ) : Quantity && (QTY | @@ -557,7 +650,20 @@ const DCPrintstyle6 = ({|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {index + 1} | : SLNO && ( @@ -749,6 +855,7 @@ const DCPrintstyle6 = ({ ? 'space-between' : 'flex-end', alignItems: 'center', + ...footerColorStyle, }} > {GlobaldummyData diff --git a/src/Pages/DeliveryChallan/DCPrintTemplates/DCThermalPrinter/DCPrintStyle7.jsx b/src/Pages/DeliveryChallan/DCPrintTemplates/DCThermalPrinter/DCPrintStyle7.jsx index e3eec62..8442e79 100644 --- a/src/Pages/DeliveryChallan/DCPrintTemplates/DCThermalPrinter/DCPrintStyle7.jsx +++ b/src/Pages/DeliveryChallan/DCPrintTemplates/DCThermalPrinter/DCPrintStyle7.jsx @@ -21,6 +21,15 @@ import { Globalnotes, GlobalthemeFormat, GlobalBillName, + GlobalSelectedPrintHeaderColor, + GlobalSelectedPrintHeaderFontColor, + GlobalSelectedTableHeaderColor, + GlobalSelectedTableHeaderFontColor, + GlobalSelectedTableBodyColor, + GlobalSelectedTableBodyFontColor, + GlobalRowType, + GlobalSelectedFooterColor, + GlobalSelectedFooterFontColor, } from '../../../../Features/ThemeChange/ThemeChange'; import { GlobalUpiIDprint } from '../../../../Features/BookingScreen/BookingData/BookingData'; import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.scss'; @@ -246,6 +255,73 @@ const DCPrintStyle7 = ({ : 0; const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10); console.log(BranchName, 'paginatedChunks'); + + // + const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); + const SelectedHeaderFontColor = useSelector( + GlobalSelectedPrintHeaderFontColor + ); + const SelectedTableHeaderColor = useSelector(GlobalSelectedTableHeaderColor); + const SelectedTableHeaderFontColor = useSelector( + GlobalSelectedTableHeaderFontColor + ); + const SelectedTableBodyColor = useSelector(GlobalSelectedTableBodyColor); + const SelectedTableBodyFontColor = useSelector( + GlobalSelectedTableBodyFontColor + ); + const SelectedRowType = useSelector(GlobalRowType); + const SelectedTableFooterColor = useSelector(GlobalSelectedFooterColor); + const SelectedTableFooterFontColor = useSelector( + GlobalSelectedFooterFontColor + ); + + // + let printColors = DCPrintTemplateDtl?.PrintColors; + const headerColor = printColors?.find((obj) => obj.headerColor)?.headerColor; + const tableHeaderColor = printColors?.find( + (obj) => obj.tableHeaderColor + )?.tableHeaderColor; + const tableBodyColor = printColors?.find( + (obj) => obj.tableBodyColor + )?.tableBodyColor; + const footerColor = printColors?.find((obj) => obj.footerColor)?.footerColor; + + // + const headerStyle = { + backgroundColor: GlobaldummyData + ? SelectedHeaderColor + : headerColor?.background, + + color: GlobaldummyData ? SelectedHeaderFontColor : headerColor?.font, + }; + const tableHeaderStyle = { + backgroundColor: GlobaldummyData + ? SelectedTableHeaderColor + : tableHeaderColor?.background, + + color: GlobaldummyData + ? SelectedTableHeaderFontColor + : tableHeaderColor?.font, + }; + + const tableBodyStyle = { + backgroundColor: GlobaldummyData + ? SelectedTableBodyColor + : tableBodyColor?.background, + color: GlobaldummyData ? SelectedTableBodyFontColor : tableBodyColor?.font, + }; + + const rowtypeStyle = GlobaldummyData + ? SelectedRowType + : tableBodyColor?.rowType; + + const footerColorStyle = { + backgroundColor: GlobaldummyData + ? SelectedTableFooterColor + : footerColor?.background, + color: GlobaldummyData ? SelectedTableFooterFontColor : footerColor?.font, + }; + return ( <>|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| S.No | ++ S.No + | ) : SLNO == true && ( -S.No | ++ S.No + | )} {GlobaldummyData - ? GlobalItem &&Item | - : Item == true &&Item | } - {/* {GlobaldummyData ? GlobalHsnCode &&HSN | : HsnCode == true &&HSN | } */} + ? GlobalItem && ( +Item | + ) + : Item == true && ( +Item | + )} {GlobaldummyData ? GlobalQuantity && ( -Qty | ++ Qty + | ) : Quantity == true && ( -Qty | ++ Qty + | )} - {/* {GlobaldummyData ? GlobalMRP &&MRP | : MRP == true &&MRP | } - {GlobaldummyData ? GlobalRate &&Rate | : Rate == true &&Rate | } - {GlobaldummyData ? GlobalDiscount &&Dis | : Discount == true &&Dis | } - {GlobaldummyData ? GlobalAmount &&Amt | : Amount == true &&Amt | } */}||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @@ -598,10 +714,6 @@ const DCPrintStyle7 = ({ {item?.Qty || item?.DispatchedQty} | )} - {/* {GlobaldummyData ? GlobalMRP &&{item?.MRP} | : MRP == true &&{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} | } - {GlobaldummyData ? GlobalRate &&{item?.Rate} | : Rate == true &&{item?.Rate} | } - {GlobaldummyData ? GlobalDiscount &&{item.discount} | : Discount == true &&{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} | } - {GlobaldummyData ? GlobalAmount &&{item?.TotalAmt} | : Amount == true &&{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} | } */}
| S.No | : SLNO &&S.No | } - {GlobaldummyData ? GlobalItem &&Item | : Item &&Item | } - {/* {GlobaldummyData ? GlobalHsnCode &&HSN | : HsnCode &&HSN | } */} - {/* {GlobaldummyData ? GlobalMRP &&MRP | : MRP &&MRP | } - {GlobaldummyData ? GlobalRate &&Rate | : Rate &&Rt | } - {GlobaldummyData ? GlobalDiscount &&(%) | : Discount &&(%) | } */} - {GlobaldummyData ? GlobalQuantity &&Qty | : Quantity &&Qty | } - {/* {GlobaldummyData ? GlobalAmount &&Amt | : Amount &&Amt | } */} -||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {chunkIndex * chunkSize + index + 1} | : SLNO &&{chunkIndex * chunkSize + index + 1} | } - {GlobaldummyData ? GlobalItem &&{item?.ProdName} | : Item &&
- {item?.ProdName}
- ({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"}){item?.RequestVariantName ? `${item?.RequestVariantName}` : ''}
- | }
- {/* {GlobaldummyData ? GlobalHsnCode && {item?.HSN} | : HsnCode &&{item?.HSN} | } */} - {/* {GlobaldummyData ? GlobalMRP &&{item?.MRP} | : MRP &&{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} | } +
| + S.No + | + ) + : SLNO && ( ++ S.No + | + )} + {GlobaldummyData + ? GlobalItem && ( +Item | + ) + : Item && ( ++ Item + | + )} + {GlobaldummyData + ? GlobalQuantity && ( ++ Qty + | + ) + : Quantity && ( ++ Qty + | + )} +||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| + {chunkIndex * chunkSize + index + 1} + | + ) + : SLNO && ( ++ {chunkIndex * chunkSize + index + 1} + | + )} + {GlobaldummyData + ? GlobalItem &&{item?.ProdName} | + : Item && ( +
+ {item?.ProdName}
+
+ ({item?.Size ? item?.Size : '1'}{' '}
+ {item?.SinglePc == 'Y'
+ ? 'PCS'
+ : item?.Type != 'C'
+ ? item?.UomName
+ : 'COMBO'}
+ )
+ {item?.RequestVariantName
+ ? `${item?.RequestVariantName}`
+ : ''}
+
+ |
+ )}
+ {/* {GlobaldummyData ? GlobalHsnCode && {item?.HSN} | : HsnCode &&{item?.HSN} | } */} + {/* {GlobaldummyData ? GlobalMRP &&{item?.MRP} | : MRP &&{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP} | } {GlobaldummyData ? GlobalRate &&{item?.Rate} | : Rate &&{item?.Rate} | } {GlobaldummyData ? GlobalDiscount &&{item?.discount} | : Discount &&{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0} | } */} - {GlobaldummyData ? GlobalQuantity &&{item?.SalesQty} | : Quantity &&{item?.Qty || item?.DispatchedQty} | } - {/* {GlobaldummyData ? GlobalAmount &&{item?.TotalAmt} | : Amount &&{item?.Type != "C" ? item?.TotalAmt - item?.OfferAmt || 0 : item?.TotalAmt - item?.OfferValue || 0} | } */} -
Notes : 10 days Return policy
- -{Notestext}
- -- Terms & Conditions -
-- Terms & Conditions -
-Signature
-Signature
-+ Notes : 10 days Return policy +
+ +{Notestext}
+ ++ Terms & Conditions +
++ Terms & Conditions +
++ Signature +
++ Signature +
+| S.No | : SLNO &&S.No | } - {GlobaldummyData ? GlobalItem &&Item | : Item &&Item | } - {GlobaldummyData ? GlobalQuantity &&Qty | : Quantity &&Qty | } + {GlobaldummyData + ? GlobalSlNo && ( ++ S.No + | + ) + : SLNO && ( ++ S.No + | + )} + {GlobaldummyData + ? GlobalItem && ( ++ Item + | + ) + : Item && ( ++ Item + | + )} + {GlobaldummyData + ? GlobalQuantity && ( ++ Qty + | + ) + : Quantity && ( ++ Qty + | + )} {/* {GlobaldummyData ? GlobalHsnCode &&HSN | : HsnCode &&HSN | } {GlobaldummyData ? GlobalMRP &&MRP | : MRP &&MRP | } {GlobaldummyData ? GlobalDiscount &&Dis | : Discount &&Dis | } @@ -279,151 +616,283 @@ const DCPrintStyle9 = ({ BranchName, BranchDetails, BranchAddress, BranchCity, B {GlobaldummyData ? GlobalAmount &&Amt | : Amount &&Amt | } */}
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - {index + 1} - | - ) ++ {index + 1} + | + ) : SLNO == true && ( -- {chunkIndex * chunkSize + index + 1} - | - )} ++ {chunkIndex * chunkSize + index + 1} + | + )} {GlobaldummyData ? GlobalItem &&{item?.ProdName} | : Item == true && ( -
- {item?.ProdName}
- {!(item?.ProdVariantName || item?.RequestVariantName)?.toLowerCase()?.includes(
- 'variant'
- ) && Variant:{item?.ProdVariantName || item?.RequestVariantName} }
- {" "}
-
-
-
-
- |
- )}
+
+ {item?.ProdName}
+ {!(
+ item?.ProdVariantName ||
+ item?.RequestVariantName
+ )
+ ?.toLowerCase()
+ ?.includes('variant') && (
+
+ Variant:
+ {item?.ProdVariantName ||
+ item?.RequestVariantName}{' '}
+
+ )}
+
+ |
+ )}
{GlobaldummyData
? GlobalQuantity && (
- - {item?.SalesQty} - | - ) ++ {item?.SalesQty} + | + ) : Quantity == true && ( -- {item?.Qty || item?.DispatchedQty} - | - )} ++ {item?.Qty || item?.DispatchedQty} + | + )}
Notes : 10 days Return policy
+ {GlobaldummyData + ? GlobalIsnotes && ( ++ Notes : 10 days Return policy +
-{Notestext}
+{Notestext}
-+ Terms & Conditions +
++ Terms & Conditions +
+- Terms & Conditions -
-- Terms & Conditions -
-Signature
-Signature
-+ Signature +
++ Signature +
+