From 429bc412851baee72e4e4fda6755d46ba0923f31 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Wed, 11 Mar 2026 17:13:53 +0530 Subject: [PATCH] total_label_and_billnolabel --- src/Features/ThemeChange/ThemeChange.js | 168 +- .../PrintMainPage/SelectionComponent.jsx | 123 +- .../ThermalPrinter/PrintStyle4.jsx | 3754 +++++++++-------- 3 files changed, 2064 insertions(+), 1981 deletions(-) diff --git a/src/Features/ThemeChange/ThemeChange.js b/src/Features/ThemeChange/ThemeChange.js index 0cf576b..b10bf45 100644 --- a/src/Features/ThemeChange/ThemeChange.js +++ b/src/Features/ThemeChange/ThemeChange.js @@ -471,6 +471,8 @@ const initialState = { notes: false, SignatureImage: '', BillName: '', + BillNolabel: '', + Totallabel: '', SelectedHeaderColour: false, SelectedTableHeaderColour: false, SelectedTableBodyColour: false, @@ -2165,45 +2167,52 @@ const ThemeSlice = createSlice({ changeBillName: (state, action) => { state.BillName = action?.payload; }, - changeSelectedHeaderColor: (state, action) => { - state.SelectedHeaderColor = action?.payload?.background; - state.SelectedHeaderFontColor = action?.payload?.font; - }, - changeSelectedTableHeaderColor: (state, action) => { - state.SelectedTableHeaderColor = action?.payload?.background; - state.SelectedTableHeaderFontColor = action?.payload?.font; - }, - changeSelectedTableBodyColor: (state, action) => { - state.SelectedTableBodyColor = action?.payload?.background; - state.SelectedTableBodyFontColor = action?.payload?.font; - }, - changeSelectedFooterColor: (state, action) => { - state.SelectedFooterColor = action?.payload?.background; - state.SelectedFooterFontColor = action?.payload?.font; - }, - // toggles indicating whether each colour option should actually be applied in print - changeSelectedHeaderColour: (state, action) => { - state.SelectedHeaderColour = action?.payload; - }, - changeSelectedTableHeaderColour: (state, action) => { - state.SelectedTableHeaderColour = action?.payload; - }, - changeSelectedTableBodyColour: (state, action) => { - state.SelectedTableBodyColour = action?.payload; - }, - changeSelectedFooterColour: (state, action) => { - state.SelectedFooterColour = action?.payload; - }, - changeSelectedNetAmountColour: (state, action) => { - state.SelectedNetAmountColour = action?.payload; - }, - changeRowType: (state, action) => { - state.rowType = action?.payload; - }, - changeSelectedNetAmountColor: (state, action) => { - state.SelectedNetAmountColor = action?.payload?.background; - state.SelectedNetAmountFontColor = action?.payload?.font; - }, + changeBillNolabel: (state, action) => { + state.BillNolabel = action?.payload; + }, + changetotallabel: (state, action) => { + state.Totallabel = action?.payload; + }, + + changeSelectedHeaderColor: (state, action) => { + state.SelectedHeaderColor = action?.payload?.background; + state.SelectedHeaderFontColor = action?.payload?.font; + }, + changeSelectedTableHeaderColor: (state, action) => { + state.SelectedTableHeaderColor = action?.payload?.background; + state.SelectedTableHeaderFontColor = action?.payload?.font; + }, + changeSelectedTableBodyColor: (state, action) => { + state.SelectedTableBodyColor = action?.payload?.background; + state.SelectedTableBodyFontColor = action?.payload?.font; + }, + changeSelectedFooterColor: (state, action) => { + state.SelectedFooterColor = action?.payload?.background; + state.SelectedFooterFontColor = action?.payload?.font; + }, + // toggles indicating whether each colour option should actually be applied in print + changeSelectedHeaderColour: (state, action) => { + state.SelectedHeaderColour = action?.payload; + }, + changeSelectedTableHeaderColour: (state, action) => { + state.SelectedTableHeaderColour = action?.payload; + }, + changeSelectedTableBodyColour: (state, action) => { + state.SelectedTableBodyColour = action?.payload; + }, + changeSelectedFooterColour: (state, action) => { + state.SelectedFooterColour = action?.payload; + }, + changeSelectedNetAmountColour: (state, action) => { + state.SelectedNetAmountColour = action?.payload; + }, + changeRowType: (state, action) => { + state.rowType = action?.payload; + }, + changeSelectedNetAmountColor: (state, action) => { + state.SelectedNetAmountColor = action?.payload?.background; + state.SelectedNetAmountFontColor = action?.payload?.font; + }, changeCurrentColor: (state, action) => { const { color } = action?.payload; state.CurrentColor = color; @@ -2397,45 +2406,44 @@ const ThemeSlice = createSlice({ getPrintSelectionComponentData.fulfilled, (state, action) => { if (action?.payload?.data?.statusCode === 1) { - - state.PrintTemplate = - action?.payload?.data?.data?.[0]?.ComponentDetails?.find( - (item) => - item.SetasDefault == 'Y' && item.PrintTypeName === 'Sales' - )?.StyleName; - state.DCPrintTemplate = - action?.payload?.data?.data?.[0]?.ComponentDetails?.find( - (item) => - item.SetasDefault == 'Y' && - item.PrintTypeName === 'Delivery Chalan' - )?.StyleName; - state.printDatas = - action?.payload?.data?.data?.[0]?.ComponentDetails.find( - (item) => - item.SetasDefault == 'Y' && item.PrintTypeName === 'Sales' - ); - state.DCtoInvoice = - action?.payload?.data?.data?.[0]?.ComponentDetails.find( - (item) => - item.SetasDefault == 'Y' && item.PrintTypeName === 'DC to Invoice' - ); - state.PrintFieldDetails = - action?.payload?.data?.data?.[0]?.ComponentDetails?.find( - (item) => - item.SetasDefault == 'Y' && item.PrintTypeName === 'Sales' - )?.FieldDetails?.reduce((acc, item) => { - acc[item.ConfigName] = true; - return acc; - }, {}); - state.DCtoInvoicePrintFieldDetails = - action?.payload?.data?.data?.[0]?.ComponentDetails?.find( - (item) => - item.SetasDefault == 'Y' && item.PrintTypeName === 'DC to Invoice' - )?.FieldDetails?.reduce((acc, item) => { - acc[item.ConfigName] = true; - return acc; - }, {}); - + state.PrintTemplate = + action?.payload?.data?.data?.[0]?.ComponentDetails?.find( + (item) => + item.SetasDefault == 'Y' && item.PrintTypeName === 'Sales' + )?.StyleName; + state.DCPrintTemplate = + action?.payload?.data?.data?.[0]?.ComponentDetails?.find( + (item) => + item.SetasDefault == 'Y' && + item.PrintTypeName === 'Delivery Chalan' + )?.StyleName; + state.printDatas = + action?.payload?.data?.data?.[0]?.ComponentDetails.find( + (item) => + item.SetasDefault == 'Y' && item.PrintTypeName === 'Sales' + ); + state.DCtoInvoice = + action?.payload?.data?.data?.[0]?.ComponentDetails.find( + (item) => + item.SetasDefault == 'Y' && item.PrintTypeName === 'DC to Invoice' + ); + state.PrintFieldDetails = + action?.payload?.data?.data?.[0]?.ComponentDetails?.find( + (item) => + item.SetasDefault == 'Y' && item.PrintTypeName === 'Sales' + )?.FieldDetails?.reduce((acc, item) => { + acc[item.ConfigName] = true; + return acc; + }, {}); + state.DCtoInvoicePrintFieldDetails = + action?.payload?.data?.data?.[0]?.ComponentDetails?.find( + (item) => + item.SetasDefault == 'Y' && item.PrintTypeName === 'DC to Invoice' + )?.FieldDetails?.reduce((acc, item) => { + acc[item.ConfigName] = true; + return acc; + }, {}); + } else if (action?.payload?.data?.statusCode == 0) { state.PrintTemplate = undefined; } @@ -2744,6 +2752,8 @@ export const { changeReprintDataFound, changePricingAppPricingName, changeBillName, + changeBillNolabel, + changetotallabel, changetemplateData, changeSessionData, changeThemeCreation, @@ -2799,6 +2809,8 @@ export const GlobalSelectedNetAmountColour = (state) => state.theme?.SelectedNet export const Globalnotes = (state) => state.theme?.notes; export const GlobalSignatureImage = (state) => state.theme?.SignatureImage; export const GlobalBillName = (state) => state.theme?.BillName; +export const GlobalBillNolabel = (state) => state.theme?.BillNolabel; +export const GlobalTotallabel = (state) => state.theme?.Totallabel; export const GlobalSelectedPrintHeaderColor = (state) => state.theme?.SelectedHeaderColor; export const GlobalSelectedPrintHeaderFontColor = (state) => diff --git a/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx b/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx index 79ce36b..b6f36dd 100644 --- a/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx +++ b/src/Pages/BookingScreen/Components/PrintMainPage/SelectionComponent.jsx @@ -90,6 +90,8 @@ import { changeSelectedTableBodyColour, changeSelectedFooterColour, changeSelectedNetAmountColour, + changeBillNolabel, + changetotallabel, } from '../../../../Features/ThemeChange/ThemeChange'; import '../../../../Styles/BookingScreen/Components/SelectionComponent/SelectionComponent.scss'; import { useAuth } from '../../../../AuthContext.jsx'; @@ -152,6 +154,7 @@ const SelectionComponent = forwardRef((props, ref) => { const [selectedSizeCheckList, setSelectedSizeCheckList] = useState([]); const [sizeOptionData, setSizeOptionData] = useState([]); + console.log(sizeOptionData, "sizeOptionData") const [styleData, setStyleData] = useState([]); const [checkedList, setCheckedList] = useState([]); @@ -163,6 +166,9 @@ const SelectionComponent = forwardRef((props, ref) => { const [PrintType, setPrintType] = useState(true); const [PageSize, setPageSize] = useState('3inch'); const [isFooterChecking, setisFooterChecking] = useState(false); + const [isbillnoLabel, setisbillnoLabel] = useState(false); + const [istotalLabel, setistotalLabel] = useState(false); + const [isBillName, setisBillName] = useState(false); const [isTermscondChecking, setisTermscondChecking] = useState(false); const [isSignatureChecking, setisSignatureChecking] = useState(false); @@ -183,6 +189,8 @@ const SelectionComponent = forwardRef((props, ref) => { const [previewTitle, setPreviewTitle] = useState(''); const [Notes, setNote] = useState(''); const [BillName, setBillName] = useState(''); + const [BillNolabel, setBillNolabel] = useState(''); + const [totalLabel, settotalLabel] = useState(''); const [openColorModal, setOpenColorModal] = useState(false); const [bgColor, setBgColor] = useState('#ffffff'); const [fontColor, setFontColor] = useState('#000000'); @@ -280,10 +288,10 @@ const SelectionComponent = forwardRef((props, ref) => { style={{ color: '#1292EE' }} onClick={() => UserType === 'Super Admin' || - (UserType === 'Super Admin User' && - SAAccessCommonMaster?.UpdateAccess === 'Y') || - (UserType === 'Employee' && empData?.UpdateAccess === 'Y') || - UserType === 'Admin' + (UserType === 'Super Admin User' && + SAAccessCommonMaster?.UpdateAccess === 'Y') || + (UserType === 'Employee' && empData?.UpdateAccess === 'Y') || + UserType === 'Admin' ? actionsFormatter(record, index) : null } @@ -292,11 +300,11 @@ const SelectionComponent = forwardRef((props, ref) => { !edit && - (UserType === 'Super Admin' || - (UserType === 'Super Admin User' && - SAAccessCommonMaster?.DeleteAccess === 'Y') || - (UserType === 'Employee' && empData?.DeleteAccess === 'Y') || - UserType === 'Admin') + (UserType === 'Super Admin' || + (UserType === 'Super Admin User' && + SAAccessCommonMaster?.DeleteAccess === 'Y') || + (UserType === 'Employee' && empData?.DeleteAccess === 'Y') || + UserType === 'Admin') ? statusFormatter(index) : '' } @@ -394,6 +402,12 @@ const SelectionComponent = forwardRef((props, ref) => { let CheckBillnamename = sizeCheckList?.find( (item) => item.ConfigName?.toLowerCase() == 'billname' ); + let CheckBillnolable = sizeCheckList?.find( + (item) => item.ConfigName?.toLowerCase() == 'billnolabel' + ); + let CheckTotallable = sizeCheckList?.find( + (item) => item.ConfigName?.toLowerCase() == 'total label' + ); let Checktermdcondition = sizeCheckList?.find( (item) => item.ConfigName?.toLowerCase() == 'terms&conditions' ); @@ -403,6 +417,8 @@ const SelectionComponent = forwardRef((props, ref) => { let headerColour = sizeCheckList?.find( (item) => item.ConfigName?.toLowerCase() == 'header colour' ); + setistotalLabel(checkedList?.includes(CheckTotallable?.ConfigId)) + setisbillnoLabel(checkedList?.includes(CheckBillnolable?.ConfigId)) setisFooterChecking(checkedList?.includes(Checkfootername?.ConfigId)); setisBillName(checkedList?.includes(CheckBillnamename?.ConfigId)); setisTermscondChecking( @@ -544,6 +560,8 @@ const SelectionComponent = forwardRef((props, ref) => { Signature: item.Signature, PrintType: item.PrintType, PrintHdrName: item.PrintHdrName, + PrintDocLabel: item.PrintDocLabel, + PrintTotalLabel:item.PrintTotalLabel, // legacy fields are filled from the array so older code still works PrintHdrColor: item.PrintHdrColor || @@ -632,6 +650,8 @@ const SelectionComponent = forwardRef((props, ref) => { PrintTypeId, PrintHdrColor, PrintColors, + PrintDocLabel, + PrintTotalLabel } = row; if (index >= 4) setShowMore(true); if (index <= 4) setShowMore(false); @@ -644,12 +664,14 @@ const SelectionComponent = forwardRef((props, ref) => { setPageSize(PageSize); setNote(Notes); setBillName(PrintHdrName); + setBillNolabel(PrintDocLabel); + settotalLabel(PrintTotalLabel); setEdit(true); // load existing header color, falling back to array setSelectedColour( PrintHdrColor || - getColor(PrintColors, 'headerColor')?.background || - '#000000' + getColor(PrintColors, 'headerColor')?.background || + '#000000' ); // setSelectedHeaderFontColor(PrintHdrFontColor); setSelectedStyleId(StyleId); @@ -702,6 +724,9 @@ const SelectionComponent = forwardRef((props, ref) => { dispatch(changeNotes(helperFunction('Notes'))); dispatch(changeSignatureImage(Signature)); dispatch(changeBillName(PrintHdrName)); + dispatch(changeBillNolabel(PrintDocLabel)); + dispatch(changetotallabel(PrintTotalLabel)); + // derive color objects; prefer the legacy fields but fall back to the PrintColors array const hdr = getColor(PrintColors, 'headerColor'); const tblHdr = getColor(PrintColors, 'tableHeaderColor'); @@ -1033,6 +1058,8 @@ const SelectionComponent = forwardRef((props, ref) => { Notes: Notes, PageSize: PageSize, PrintHdrName: BillName, + PrintDocLabel: BillNolabel, + PrintTotalLabel:totalLabel, PrintType: PrintType ? 'S' : 'C', PrintTypeId: segmentValue, // Header color (background) and font @@ -1113,6 +1140,7 @@ const SelectionComponent = forwardRef((props, ref) => { }; const onfinish = async (values) => { + if (!templateEdit && sizeOptionData?.length == 0) { setMessageType('error'); setMessageData('Please Setup the Screen'); @@ -1164,19 +1192,22 @@ const SelectionComponent = forwardRef((props, ref) => { })), ...(item?.TermsandConditions?.length > 0 ? { - PrintTermsandConditions: (item?.TermsandConditions - ? item?.TermsandConditions - : [] - )?.map((item) => { - return { - TermsandConditions: item, - }; - }), - } + PrintTermsandConditions: (item?.TermsandConditions + ? item?.TermsandConditions + : [] + )?.map((item) => { + return { + TermsandConditions: item, + }; + }), + } : {}), ...(item?.Notes ? { Notes: item.Notes } : {}), ...(item?.PageSize ? { PageSize: item.PageSize } : {}), ...(item?.PrintHdrName ? { PrintHdrName: item.PrintHdrName } : {}), + ...(item?.PrintDocLabel ? { PrintDocLabel: item.PrintDocLabel } : {}), + ...(item?.PrintTotalLabel ? { PrintTotalLabel: item.PrintTotalLabel } : {}), + ...(item?.Signature ? { Signature: item?.Signature } : {}), PrintType: item?.PrintType, }) @@ -1654,7 +1685,7 @@ const SelectionComponent = forwardRef((props, ref) => {
-
+
{isFooterChecking && (
@@ -1669,10 +1700,8 @@ const SelectionComponent = forwardRef((props, ref) => { }} /> </div> - )} - - { - <div style={{ marginTop: '1rem' }}> + )} + <div style={{ marginTop: '1rem' }}> <Title level={5} style={{ marginBottom: 12 }}> BillName @@ -1686,6 +1715,38 @@ const SelectionComponent = forwardRef((props, ref) => { }} />
+ + {isbillnoLabel && +
+ + BillNo Label + + Bill No Label} + value={BillNolabel} + onChange={(e) => { + setBillNolabel(e.target.value); + dispatch(changeBillNolabel(e.target.value)); + }} + /> +
+ } + {istotalLabel && +
+ + Total Label + + Total Label} + value={totalLabel} + onChange={(e) => { + settotalLabel(e.target.value); + dispatch(changetotallabel(e.target.value)); + }} + /> +
} {isTermscondChecking && ( @@ -2043,12 +2104,12 @@ const SelectionComponent = forwardRef((props, ref) => { UserType === 'Super Admin' || UserType === 'Admin' ? false : !( - empData?.AddAccess === 'Y' || - SAAccessCommonMaster?.AddAccess === 'Y' || - ((empData?.UpdateAccess === 'Y' || - SAAccessCommonMaster?.UpdateAccess === 'Y') && - templateEdit) - ) + empData?.AddAccess === 'Y' || + SAAccessCommonMaster?.AddAccess === 'Y' || + ((empData?.UpdateAccess === 'Y' || + SAAccessCommonMaster?.UpdateAccess === 'Y') && + templateEdit) + ) } />
diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx index efe3d1d..66a0564 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx @@ -72,6 +72,7 @@ const Printstyle4 = ({ SalesModePref, MembershipApplied = null, }) => { + console.log(printDatas, 'printDatas') const dispatch = useDispatch(); const GlobalUpiID = useSelector(GlobalUpiIDprint); const FieldDetails = useSelector(GloabalFieldDetails); @@ -88,7 +89,13 @@ const Printstyle4 = ({ const CashierNameField = FieldDetails?.['CashierName']; const LogoField = FieldDetails?.['Logo']; const CreditDetails = FieldDetails?.['Credit details']; + const orderNo = FieldDetails?.['Order No']; + const paymentTypelabel = FieldDetails?.['Payment Type Label']; const WeightasKg = FieldDetails?.['Weight']; + const BillLabel=FieldDetails?.['BillNoLabel'] + const Total_Label=FieldDetails?.['Total Label'] + const BillNoLabel = (printDatas?.PrintDocLabel && BillLabel) ? printDatas?.PrintDocLabel : "Bill No"; + const TotalLabel = (printDatas?.PrintTotalLabel && Total_Label) ? printDatas?.PrintTotalLabel : "SUB TOTAL"; const GlobalSlNo = useSelector(GlobalprintSlNo); const GlobalItem = useSelector(GlobalprintItem); const GlobalMRP = useSelector(GlobalprintMRP); @@ -458,8 +465,8 @@ const Printstyle4 = ({ flexDirection: 'column', justifyContent: chunkIndex === paginatedChunks.length - 1 && - !shouldFooterBeOnNewPage && - FormatTheme + !shouldFooterBeOnNewPage && + FormatTheme ? 'space-between' : '', height: isMobile @@ -509,7 +516,7 @@ const Printstyle4 = ({ /> ) : null} {base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + (PrintLogo?.SettingValue === 'Y' || LogoField) ? (
{' '} @@ -587,14 +594,14 @@ const Printstyle4 = ({
- Bill No : + {BillNoLabel}: {GlobaldummyData ? '51' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
{/*
{GlobaldummyData ? formattedDate : Date1}
*/}
@@ -620,9 +627,9 @@ const Printstyle4 = ({ {GlobaldummyData ? 'Cash Bill' : BillName || - (PaymentStatusSuccess?.length === 1 - ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' - : ' Bill')}{' '} + (PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ' Bill')}{' '} {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
@@ -657,172 +664,172 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalSlNo && ( - - # - - ) + + # + + ) : SLNO && ( - - # - - )} + + # + + )} {GlobaldummyData ? GlobalItem && ( - Item - ) + 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{' '} - - )} + + Dis{' '} + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -859,12 +866,12 @@ const Printstyle4 = ({ style={ index % 2 !== 1 && rowtypeStyle === 'even' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : index % 2 === 1 && rowtypeStyle === 'odd' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : {} } > @@ -872,84 +879,84 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {/* ITEM COLUMN */} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - - {/* Product Name */} -
{item?.ProdName}
+ + {/* Product Name */} +
{item?.ProdName}
- {/* Package OR Size */} - {packageList.length > 0 ? ( -
- {packageList.map((pkg, i) => ( -
- {pkg.ParcelCount} PCS{' '} - {pkg.ParcelQty} PACK ( - {pkg.ParcelType}) -
- ))} -
- ) : ( -
- {UomPrint?.SettingValue === 'Y' - ? (item?.Size || '1') + - (item?.SinglePc === 'Y' - ? ' PCS' - : item?.Type !== 'C' - ? ` ${item?.UomName}` - : ' COMBO') - : ''} - {item?.BrandName || ''} -
- )} + {/* Package OR Size */} + {packageList.length > 0 ? ( +
+ {packageList.map((pkg, i) => ( +
+ {pkg.ParcelCount} PCS{' '} + {pkg.ParcelQty} PACK ( + {pkg.ParcelType}) +
+ ))} +
+ ) : ( +
+ {UomPrint?.SettingValue === 'Y' + ? (item?.Size || '1') + + (item?.SinglePc === 'Y' + ? ' PCS' + : item?.Type !== 'C' + ? ` ${item?.UomName}` + : ' COMBO') + : ''} + {item?.BrandName || ''} +
+ )} - {/* Serials */} - {serials.map((s, i) => ( -
{s}
- ))} + {/* Serials */} + {serials.map((s, i) => ( +
{s}
+ ))} - {/* IMEIs */} - {imeis.map((iVal, i) => ( -
{iVal}
- ))} + {/* IMEIs */} + {imeis.map((iVal, i) => ( +
{iVal}
+ ))} - {/* Description from first identifier */} - {descriptions[0] && ( -
{descriptions[0]}
- )} - - )} + {/* Description from first identifier */} + {descriptions[0] && ( +
{descriptions[0]}
+ )} + + )} {/* Quantity */} {(GlobaldummyData ? GlobalQuantity : Quantity) && ( - - {item?.SalesQty} - - )} + + {item?.SalesQty} + + )} {/* HSN */} {(GlobaldummyData ? GlobalHsnCode : HsnCode) && ( - - {item?.HSN} - - )} + + {item?.HSN} + + )} {/* MRP */} {(GlobaldummyData ? GlobalMRP : MRP) && ( @@ -964,14 +971,14 @@ const Printstyle4 = ({ {(GlobaldummyData ? GlobalDiscount : Discount) && ( - - {item?.Type !== 'C' - ? item?.OfferAmt || (item?.DiscountAmt / item?.SalesQty) || 0 - : item?.OfferValue || - (item?.DiscountAmt / item?.SalesQty) || + + {item?.Type !== 'C' + ? item?.OfferAmt || (item?.DiscountAmt / item?.SalesQty) || 0 + : item?.OfferValue || + (item?.DiscountAmt / item?.SalesQty) || 0} - - )} + + )} {/* Rate */} {(GlobaldummyData ? GlobalRate : Rate) && ( @@ -985,9 +992,9 @@ const Printstyle4 = ({ {item?.Type !== 'C' ? (item?.TotalAmt || 0) - - (item?.OfferAmt || 0) + (item?.OfferAmt || 0) : (item?.TotalAmt || 0) - - (item?.OfferValue || 0)} + (item?.OfferValue || 0)} )} @@ -1016,170 +1023,170 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalSlNo && ( - - # - - ) + + # + + ) : SLNO && ( - - # - - )} + + # + + )} {GlobaldummyData ? GlobalItem && ( - Item - ) + Item + ) : Item && ( - Item - )} + Item + )} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - Qty - - )} + + Qty + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} + + Dis{' '} + + )} {GlobaldummyData ? GlobalRate && ( - - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -1190,136 +1197,136 @@ const Printstyle4 = ({ style={ index % 2 !== 1 && rowtypeStyle === 'even' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : index % 2 === 1 && rowtypeStyle === 'odd' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : {} } > {GlobaldummyData ? GlobalSlNo && {index + 1} : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + + {chunkIndex * chunkSize + index + 1} + + )} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
{item?.ProdName}
- {UomPrint?.SettingValue === 'Y' && ( -
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
- )} - - )} + +
{item?.ProdName}
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({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 || - (item?.DiscountAmt / item?.SalesQty) || - 0 - : item?.OfferValue || - (item?.DiscountAmt / item?.SalesQty) || - 0} - - )} + + {item?.Type !== 'C' + ? item?.OfferAmt || + (item?.DiscountAmt / item?.SalesQty) || + 0 + : item?.OfferValue || + (item?.DiscountAmt / item?.SalesQty) || + 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage || 0} - - ) + + {item?.ProdTaxPercentage || 0} + + ) : Tax && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + 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)} + + )} ); })} @@ -1347,29 +1354,6 @@ const Printstyle4 = ({ )}
-
- {' '} -
Sub Total
-
- {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
-
a + b.SalesQty, - 0 - ) - )} + productsData?.reduce( + (a, b) => a + b.SalesQty, + 0 + ) + )}
+
+ {' '} +
{TotalLabel}
+
+ {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( @@ -1564,17 +1572,17 @@ const Printstyle4 = ({ ' hundred' + (num % 100 ? ' ' + - (num % 100 < 20 - ? ones[num % 100] - : tens[ - Math.floor( - (num % 100) / 10 - ) - ] + - (num % 10 - ? ' ' + - ones[num % 10] - : '')) + (num % 100 < 20 + ? ones[num % 100] + : tens[ + Math.floor( + (num % 100) / 10 + ) + ] + + (num % 10 + ? ' ' + + ones[num % 10] + : '')) : '') ); return num.toString(); @@ -1765,7 +1773,7 @@ const Printstyle4 = ({ )} -
-
+ } {isEditedBill && lastTransaction && (
@@ -1871,83 +1879,83 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) +
+
Advance Amount:
+
Opening Balance:
+
+ ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- {(() => { - const c = table2Data.CustomerDetails[0]; - const items = []; + table2Data?.CustomerDetails?.length > 0 && ( +
+ {(() => { + const c = table2Data.CustomerDetails[0]; + const items = []; - if ( - PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' - ) { - if (c.OldCreditBal !== 0) { - items.push({ - label: - c.OldCreditBal > 0 - ? 'Advance Amount' - : 'Opening Balance', - value: Math.abs(c.OldCreditBal).toFixed(2), - }); - } - } - - if (c.CurrentCreditBal !== 0) { + if ( + PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' + ) { + if (c.OldCreditBal !== 0) { items.push({ label: - c.CurrentCreditBal > 0 - ? 'Current Advance Amount' - : 'Current Balance Amount', - value: Math.abs(c.CurrentCreditBal).toFixed( - 2 - ), + c.OldCreditBal > 0 + ? 'Advance Amount' + : 'Opening Balance', + value: Math.abs(c.OldCreditBal).toFixed(2), }); } + } - return items.map((i, idx) => ( -

- - {i.label} - - : - - {i.value} - -

- )); - })()} -
- )} + if (c.CurrentCreditBal !== 0) { + items.push({ + label: + c.CurrentCreditBal > 0 + ? 'Current Advance Amount' + : 'Current Balance Amount', + value: Math.abs(c.CurrentCreditBal).toFixed( + 2 + ), + }); + } + + return items.map((i, idx) => ( +

+ + {i.label} + + : + + {i.value} + +

+ )); + })()} +
+ )} {/*
*/}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( @@ -1956,69 +1964,69 @@ const Printstyle4 = ({
{GlobaldummyData ? GlobalQrcodet && ( -
- image -
- Scan to Pay{' '} -
-
- ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed( - 2 - )} -
+
+ 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 - )} -
+ paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '}
- )} +
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed( + 2 + )} +
+
+ )}
)}
{/*
Scan to Pay
*/} -
+ {orderNo &&
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)} -
+
}
{PaymentStatusSuccess?.length > 1 && !isEditedBill && ( @@ -2118,28 +2126,28 @@ const Printstyle4 = ({
{GlobaldummyData ? GlobalIsnotes && ( -
-

- Notes : 10 days Return policy -

+
+

+ Notes : 10 days Return policy +

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

- {Notestext} -

+
+

+ {Notestext} +

-
-
- )} +
+
+ )}
)} @@ -2159,137 +2167,137 @@ const Printstyle4 = ({ > {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. -
-
- ) + 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 && ( -
0 && ( +
+

-

- Terms & Conditions -

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

+ +
+ )}
)}
@@ -2338,28 +2346,6 @@ const Printstyle4 = ({ )}
-
-
Sub Total
-
- {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
-
a + b.SalesQty, - 0 - ) - )} + productsData?.reduce( + (a, b) => a + b.SalesQty, + 0 + ) + )}
+
+
{TotalLabel}
+
+ {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ {!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( @@ -2555,16 +2564,16 @@ const Printstyle4 = ({ ' hundred' + (num % 100 ? ' ' + - (num % 100 < 20 - ? ones[num % 100] - : tens[ - Math.floor( - (num % 100) / 10 - ) - ] + - (num % 10 - ? ' ' + ones[num % 10] - : '')) + (num % 100 < 20 + ? ones[num % 100] + : tens[ + Math.floor( + (num % 100) / 10 + ) + ] + + (num % 10 + ? ' ' + ones[num % 10] + : '')) : '') ); return num.toString(); @@ -2755,7 +2764,7 @@ const Printstyle4 = ({ )} -
-
+ } {isEditedBill && lastTransaction && (
@@ -2859,81 +2868,81 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) +
+
Advance Amount:
+
Opening Balance:
+
+ ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- {(() => { - const c = table2Data.CustomerDetails[0]; - const items = []; + table2Data?.CustomerDetails?.length > 0 && ( +
+ {(() => { + const c = table2Data.CustomerDetails[0]; + const items = []; - if ( - PaymentStatusSuccess?.[0]?.PaymentTypeName === - 'Credit' - ) { - if (c.OldCreditBal !== 0) { - items.push({ - label: - c.OldCreditBal > 0 - ? 'Advance Amount' - : 'Opening Balance', - value: Math.abs(c.OldCreditBal).toFixed(2), - }); - } - } - - if (c.CurrentCreditBal !== 0) { + if ( + PaymentStatusSuccess?.[0]?.PaymentTypeName === + 'Credit' + ) { + if (c.OldCreditBal !== 0) { items.push({ label: - c.CurrentCreditBal > 0 - ? 'Current Advance Amount' - : 'Current Balance Amount', - value: Math.abs(c.CurrentCreditBal).toFixed(2), + c.OldCreditBal > 0 + ? 'Advance Amount' + : 'Opening Balance', + value: Math.abs(c.OldCreditBal).toFixed(2), }); } + } - return items.map((i, idx) => ( -

- - {i.label} - - : - - {i.value} - -

- )); - })()} -
- )} + if (c.CurrentCreditBal !== 0) { + items.push({ + label: + c.CurrentCreditBal > 0 + ? 'Current Advance Amount' + : 'Current Balance Amount', + value: Math.abs(c.CurrentCreditBal).toFixed(2), + }); + } + + return items.map((i, idx) => ( +

+ + {i.label} + + : + + {i.value} + +

+ )); + })()} +
+ )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( @@ -2942,64 +2951,64 @@ const Printstyle4 = ({
{GlobaldummyData ? GlobalQrcodet && ( -
- image -
- Scan to Pay{' '} -
-
- ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
+
+ 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)} -
+ paymentTypeUPI && ( +
+ +
+ Scan to Pay{' '}
- )} +
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ )}
)}
{/*
Scan to Pay
*/} -
+ {orderNo &&
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)} -
+
}
{PaymentStatusSuccess?.length > 1 && !isEditedBill && ( <> @@ -3095,28 +3104,28 @@ const Printstyle4 = ({
{GlobaldummyData ? GlobalIsnotes && ( -
-

- Notes : 10 days Return policy -

+
+

+ Notes : 10 days Return policy +

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

- {Notestext} -

+
+

+ {Notestext} +

-
-
- )} +
+
+ )}
)} @@ -3136,137 +3145,137 @@ const Printstyle4 = ({ > {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. -
-
- ) + 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 && ( -
0 && ( +
+

-

- Terms & Conditions -

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

+ +
+ )}
)}
@@ -3313,7 +3322,7 @@ const Printstyle4 = ({ /> ) : null} {base64Image && - (PrintLogo?.SettingValue === 'Y' || LogoField) ? ( + (PrintLogo?.SettingValue === 'Y' || LogoField) ? (
{' '} @@ -3399,14 +3408,14 @@ const Printstyle4 = ({
- Bill No : + {BillNoLabel}: {GlobaldummyData ? '51' : table2Data?.OrderId && - extractLastNumberOrderId( - table2Data?.OrderId, - table2Data?.FYStatus - )} + extractLastNumberOrderId( + table2Data?.OrderId, + table2Data?.FYStatus + )}
@@ -3433,9 +3442,9 @@ const Printstyle4 = ({ ? GlobalBilltext : 'Cash' + ' Bill' : BillName || - (PaymentStatusSuccess?.length === 1 - ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' - : ' Bill')}{' '} + (PaymentStatusSuccess?.length === 1 + ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' + : ' Bill')}{' '} {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} @@ -3464,112 +3473,112 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalSlNo && ( - - # - - ) + + # + + ) : SLNO && ( - - # - - )} + + # + + )} {GlobaldummyData ? GlobalItem && ( - Item - ) + Item + ) : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - Qty - - )} + + Qty + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} + + Dis{' '} + + )} {/* {GlobaldummyData ? GlobalTax && ( - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -3651,12 +3660,12 @@ const Printstyle4 = ({ style={ index % 2 !== 1 && rowtypeStyle === 'even' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : index % 2 === 1 && rowtypeStyle === 'odd' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : {} } > @@ -3666,238 +3675,238 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
{item?.ProdName}
+ +
{item?.ProdName}
- {/* Serial Numbers */} - {item?.ProductIdentifierDtls?.filter( - (d) => d.SerialNumber - )?.map((d, i) => ( -
- {d.SerialNumber} + {/* Serial Numbers */} + {item?.ProductIdentifierDtls?.filter( + (d) => d.SerialNumber + )?.map((d, i) => ( +
+ {d.SerialNumber} +
+ ))} + + {/* IMEI Numbers */} + {item?.ProductIdentifierDtls?.filter( + (d) => d.IMEI1 || d.IMEI2 + )?.map((d, i) => ( +
+ {[d.IMEI1, d.IMEI2] + .filter(Boolean) + .join(', ')} +
+ ))} + + {/* Description from first identifier */} + {item?.ProductIdentifierDtls?.length > 0 && + item.ProductIdentifierDtls?.[0] + ?.Description && ( +
+ { + item.ProductIdentifierDtls?.[0] + ?.Description + }
- ))} - - {/* IMEI Numbers */} - {item?.ProductIdentifierDtls?.filter( - (d) => d.IMEI1 || d.IMEI2 - )?.map((d, i) => ( -
- {[d.IMEI1, d.IMEI2] - .filter(Boolean) - .join(', ')} -
- ))} - - {/* Description from first identifier */} - {item?.ProductIdentifierDtls?.length > 0 && - item.ProductIdentifierDtls?.[0] - ?.Description && ( -
- { - item.ProductIdentifierDtls?.[0] - ?.Description - } -
- )} - - )} + )} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} + + {item?.SalesQty} -
- {/* Package Details */} - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( -
- {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - )?.map((pkg, index) => ( -
- {pkg.ParcelCount} PCS{' '} - {pkg.ParcelQty} PACK ( - {pkg.ParcelType}) +
+ {/* Package Details */} + {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + ).length > 0 ? ( +
+ {PackageDetails?.filter( + (pkg) => pkg.ProdId === item.ProdId + )?.map((pkg, index) => ( +
+ {pkg.ParcelCount} PCS{' '} + {pkg.ParcelQty} PACK ( + {pkg.ParcelType}) +
+ ))} + + {/* Serial */} + {item?.ProductIdentifierDtls?.filter( + (d) => d.SerialNumber + )?.map((d, i) => ( +
+ {d.SerialNumber} +
+ ))} + + {/* IMEI */} + {item?.ProductIdentifierDtls?.filter( + (d) => d.IMEI1 || d.IMEI2 + )?.map((d, i) => ( +
+ {[d.IMEI1, d.IMEI2] + .filter(Boolean) + .join(', ')} +
+ ))} + + {/* Description from first identifier */} + {item?.ProductIdentifierDtls?.length > + 0 && + item.ProductIdentifierDtls?.[0] + ?.Description && ( +
+ { + item + .ProductIdentifierDtls?.[0] + ?.Description + }
- ))} - - {/* Serial */} - {item?.ProductIdentifierDtls?.filter( - (d) => d.SerialNumber - )?.map((d, i) => ( -
- {d.SerialNumber} -
- ))} - - {/* IMEI */} - {item?.ProductIdentifierDtls?.filter( - (d) => d.IMEI1 || d.IMEI2 - )?.map((d, i) => ( -
- {[d.IMEI1, d.IMEI2] - .filter(Boolean) - .join(', ')} -
- ))} - - {/* Description from first identifier */} - {item?.ProductIdentifierDtls?.length > - 0 && - item.ProductIdentifierDtls?.[0] - ?.Description && ( -
- { - item - .ProductIdentifierDtls?.[0] - ?.Description - } -
- )} -
- ) : ( -
- {UomPrint?.SettingValue === 'Y' && ( - <> - ({item?.Size || '1'}){' '} - {item?.SinglePc === 'Y' - ? 'PCS' - : item?.Type !== 'C' - ? item?.UomName - : 'COMBO'}{' '} - )} - {item?.BrandName || ''} -
- )} -
- - ) +
+ ) : ( +
+ {UomPrint?.SettingValue === 'Y' && ( + <> + ({item?.Size || '1'}){' '} + {item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO'}{' '} + + )} + {item?.BrandName || ''} +
+ )} +
+ + ) : 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} - {GlobaldummyData - ? GlobalTax && ( - - - GST:{' '} - {' '} - {item?.ProdTaxPercentage || 0} - - ) - : Tax == true && - table2Data?.OrderType !== 'E' && ( - - {/* */} - - GST:{' '} - {' '} - {item?.ProdTaxPercentage || 0} - - )} - - )} + + {item?.SinglePc === 'Y' + ? item?.Rate + : item?.MRP} + {GlobaldummyData + ? GlobalTax && ( + + + GST:{' '} + {' '} + {item?.ProdTaxPercentage || 0} + + ) + : Tax == true && + table2Data?.OrderType !== 'E' && ( + + {/* */} + + GST:{' '} + {' '} + {item?.ProdTaxPercentage || 0} + + )} + + )} {GlobaldummyData ? GlobalDiscount && ( - - {item.discount} - - ) + + {item.discount} + + ) : Discount && ( - - {item?.Type !== 'C' - ? item?.OfferAmt || (item?.DiscountAmt / item?.SalesQty) || 0 - : item?.OfferValue || - (item?.DiscountAmt / item?.SalesQty) || - 0} - - )} + + {item?.Type !== 'C' + ? item?.OfferAmt || (item?.DiscountAmt / item?.SalesQty) || 0 + : item?.OfferValue || + (item?.DiscountAmt / item?.SalesQty) || + 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)} + + )} ); } @@ -3932,48 +3941,48 @@ const Printstyle4 = ({ : Item && Item} {GlobaldummyData ? GlobalQuantity && ( - - Qty - - ) + + Qty + + ) : Quantity && ( - - Qty - - )} + + Qty + + )} {GlobaldummyData ? GlobalHsnCode && ( - - HSN - - ) + + HSN + + ) : HsnCode && ( - - HSN - - )} + + HSN + + )} {GlobaldummyData ? GlobalMRP && ( - - MRP - - ) + + MRP + + ) : MRP && ( - - MRP - - )} + + MRP + + )} {GlobaldummyData ? GlobalDiscount && ( - - Dis{' '} - - ) + + Dis{' '} + + ) : Discount && ( - - Dis{' '} - - )} + + Dis{' '} + + )} {/* {GlobaldummyData ? GlobalTax && ( - Rate - - ) + + Rate + + ) : Rate && ( - - Rate - - )} + + Rate + + )} {GlobaldummyData ? GlobalAmount && ( - - Amt - - ) + + Amt + + ) : Amount && ( - - Amt - - )} + + Amt + + )} @@ -4029,12 +4038,12 @@ const Printstyle4 = ({ style={ index % 2 !== 1 && rowtypeStyle === 'even' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : index % 2 === 1 && rowtypeStyle === 'odd' ? { - ...tableBodyStyle, - } + ...tableBodyStyle, + } : {} } > @@ -4044,53 +4053,68 @@ const Printstyle4 = ({ {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( - -
{item?.ProdName}
- {( - (item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => items.SerialNumber - ) - .map( - (a, index) => ` ${a.SerialNumber}` - ) - .join('') - : '') + - (item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 || item1.IMEI2 - ) - .map((item2) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ` ${[imei1, imei2].filter(Boolean).join(',')}`; - }) - .join('') - : '') + - (item?.ProductIdentifierDtls?.length > - 0 && - item.ProductIdentifierDtls?.[0] - ?.Description) && ( -
- { - item.ProductIdentifierDtls?.[0] - ?.Description - } -
+ +
{item?.ProdName}
+ {( + (item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => items.SerialNumber ) - ).trim()} - - )} + .map( + (a, index) => ` ${a.SerialNumber}` + ) + .join('') + : '') + + (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(',')}`; + }) + .join('') + : '') + + (item?.ProductIdentifierDtls?.length > + 0 && + item.ProductIdentifierDtls?.[0] + ?.Description) && ( +
+ { + item.ProductIdentifierDtls?.[0] + ?.Description + } +
+ ) + ).trim()} + + )} {GlobaldummyData ? GlobalQuantity && ( - - {item?.SalesQty} + + {item?.SalesQty} +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+ + ) + : Quantity && ( + + {item?.SalesQty} + {UomPrint?.SettingValue === 'Y' && (
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -4100,101 +4124,86 @@ const Printstyle4 = ({ : 'COMBO'} )
- - ) - : Quantity && ( - - {item?.SalesQty} - {UomPrint?.SettingValue === 'Y' && ( -
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
- )} - - )} + )} + + )} {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 || (item?.DiscountAmt / item?.SalesQty) || 0 - : item?.OfferValue || - (item?.DiscountAmt / item?.SalesQty) || - 0} - - )} + + {item?.Type !== 'C' + ? item?.OfferAmt || (item?.DiscountAmt / item?.SalesQty) || 0 + : item?.OfferValue || + (item?.DiscountAmt / item?.SalesQty) || + 0} + + )} {GlobaldummyData ? GlobalTax && ( - - {item?.ProdTaxPercentage || 0} - - ) + + {item?.ProdTaxPercentage || 0} + + ) : Tax == true && - table2Data?.OrderType !== 'E' && ( - - {item?.ProdTaxPercentage || 0} - - )} + 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)} + + )} ); } @@ -4215,29 +4224,6 @@ const Printstyle4 = ({ )}
-
-
Sub Total
-
- {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
-
-
+
+
{TotalLabel}
+
+ {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)} +
+
+ +
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( @@ -4416,14 +4426,14 @@ const Printstyle4 = ({ ' hundred' + (num % 100 ? ' ' + - (num % 100 < 20 - ? ones[num % 100] - : tens[ - Math.floor((num % 100) / 10) - ] + - (num % 10 - ? ' ' + ones[num % 10] - : '')) + (num % 100 < 20 + ? ones[num % 100] + : tens[ + Math.floor((num % 100) / 10) + ] + + (num % 10 + ? ' ' + ones[num % 10] + : '')) : '') ); return num.toString(); @@ -4610,7 +4620,7 @@ const Printstyle4 = ({
)} -
-
+ } {isEditedBill && lastTransaction && (
@@ -4706,79 +4716,79 @@ const Printstyle4 = ({ )} {GlobaldummyData ? GlobalCredit && ( -
-
Advance Amount:
-
Opening Balance:
-
- ) +
+
Advance Amount:
+
Opening Balance:
+
+ ) : CreditDetails && - table2Data?.CustomerDetails?.length > 0 && ( -
- {(() => { - const c = table2Data.CustomerDetails[0]; - const items = []; + table2Data?.CustomerDetails?.length > 0 && ( +
+ {(() => { + const c = table2Data.CustomerDetails[0]; + const items = []; - if ( - PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' - ) { - if (c.OldCreditBal !== 0) { - items.push({ - label: - c.OldCreditBal > 0 - ? 'Advance Amount' - : 'Opening Balance', - value: Math.abs(c.OldCreditBal).toFixed(2), - }); - } - } - - if (c.CurrentCreditBal !== 0) { + if ( + PaymentStatusSuccess?.[0]?.PaymentTypeName === 'Credit' + ) { + if (c.OldCreditBal !== 0) { items.push({ label: - c.CurrentCreditBal > 0 - ? 'Current Advance Amount' - : 'Current Balance Amount', - value: Math.abs(c.CurrentCreditBal).toFixed(2), + c.OldCreditBal > 0 + ? 'Advance Amount' + : 'Opening Balance', + value: Math.abs(c.OldCreditBal).toFixed(2), }); } + } - return items.map((i, idx) => ( -

- {i.label} - : - {i.value} -

- )); - })()} -
- )} + if (c.CurrentCreditBal !== 0) { + items.push({ + label: + c.CurrentCreditBal > 0 + ? 'Current Advance Amount' + : 'Current Balance Amount', + value: Math.abs(c.CurrentCreditBal).toFixed(2), + }); + } + + return items.map((i, idx) => ( +

+ {i.label} + : + {i.value} +

+ )); + })()} +
+ )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( @@ -4787,59 +4797,59 @@ const Printstyle4 = ({
{GlobaldummyData ? GlobalQrcodet && ( -
- image -
Scan to Pay
-
- ₹ - {GlobaldummyData - ? '1,066' - : Number(table2Data?.NetAmount).toFixed(2)} -
+
+ 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)} -
+ paymentTypeUPI && ( +
+ +
Scan to Pay
+
+ ₹ + {GlobaldummyData + ? '1,066' + : Number(table2Data?.NetAmount).toFixed(2)}
- )} +
+ )}
)}
{/*
Scan to Pay
*/} -
+ {orderNo &&
YOUR ORDER NO: {table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)} -
+
}
{PaymentStatusSuccess?.length > 1 && !isEditedBill && ( <> @@ -4926,21 +4936,21 @@ const Printstyle4 = ({
{GlobaldummyData ? GlobalIsnotes && ( -
-

- Notes : 10 days Return policy -

+
+

+ Notes : 10 days Return policy +

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

{Notestext}

+
+

{Notestext}

-
-
- )} +
+
+ )}
)} @@ -4960,136 +4970,136 @@ const Printstyle4 = ({ > {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. -
-
- ) + 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 && ( -
0 && ( +
+

-

- Terms & Conditions -

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

+ +
+ )}
)}