From 1c464221a26b3e1bc224e46d7221ec952c0aa365 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Thu, 26 Feb 2026 15:25:43 +0530 Subject: [PATCH 1/8] add Description --- .../BSBillingTable1/BSBillingTable1.jsx | 441 +++++------ .../BSBillingTable2/BsBill2.jsx | 730 +++++++++--------- .../BSBillingTable3/BSBillingTable3.jsx | 15 +- .../BSBillingTable4/BSBillingTable4.jsx | 13 +- .../BSBillingTable5/BsBill.jsx | 715 ++++++++--------- .../BSBillingTable6/BSBillingTable6.jsx | 17 +- .../BSBillingTable7/BSBillingTable7.jsx | 9 +- .../BSImeiDetails/BSImeiDetails.jsx | 141 ++-- .../ComboSalesBillTable.jsx | 24 +- .../StandardTable/StandardTable.jsx | 9 +- src/Pages/Preference/PreferenceList.jsx | 6 + 11 files changed, 1102 insertions(+), 1018 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx index 2a99898..5410597 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx @@ -106,6 +106,11 @@ const BSBillingTable1 = () => { setting?.SettingIdName?.toLowerCase() === 'decimal' && setting?.SettingValue === 'Y' ); + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); const SessionData = useSelector(StoredSessionData); const BranchId = SessionData?.BranchId; const AppId = SessionData?.AppId; @@ -156,8 +161,8 @@ const BSBillingTable1 = () => { OrderType === 'Hold' ? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway') : tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); const OldtableDataDinein = tableData?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId @@ -165,8 +170,8 @@ const BSBillingTable1 = () => { const OldtableDataTakeAway = OrderType != 'Hold' ? tableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false); const [OpenImeiDetail, setOpenImeiDetail] = useState(false); @@ -1115,9 +1120,9 @@ const BSBillingTable1 = () => { )?.map((item, idx) => idx === 0 ? { - ...item, - FreeQty, - } + ...item, + FreeQty, + } : item ), }; @@ -2144,7 +2149,7 @@ const BSBillingTable1 = () => { OpenEditTotalAmount(); } }} - // onClick={tableData?.length>0? OpenEditTotalAmount :""} + // onClick={tableData?.length>0? OpenEditTotalAmount :""} > {!isMobile ? ( Qty @@ -2252,11 +2257,10 @@ const BSBillingTable1 = () => { {OldtableDataTakeAway?.map((item, index) => ( { ? item?.SalesId && OrderType !== 'Hold' ? 'rgb(243, 248, 213)' : triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= - PreviousdataLength + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= + PreviousdataLength ? 'wheat' : triggerAnimation && - index === 0 && - tableDataTakeAway?.length >= - PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + index === 0 && + tableDataTakeAway?.length >= + PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', @@ -2285,18 +2289,18 @@ const BSBillingTable1 = () => { item?.SalesId && OrderType !== 'Hold' ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + + ' ' + + item?.BookingTypeName + ) ? '#b2d1f7' : index % 2 === 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] + 'OverallBackgroundColor' + ] : '#d6d6d6', animation: BillOrderPre === 'Y' && !BookingTypeBoth @@ -2348,8 +2352,9 @@ const BSBillingTable1 = () => { textAlign: 'left', }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } @@ -2400,21 +2405,21 @@ const BSBillingTable1 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( @@ -2509,11 +2514,11 @@ const BSBillingTable1 = () => { > {allowDecimal ? Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2) + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2) : Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - )} + item?.TotalAmt - (item?.Offer || 0) || 0 + )} )} @@ -2548,11 +2553,10 @@ const BSBillingTable1 = () => { {OldtableDataDinein?.map((item, index) => ( { ? item?.SalesId ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength + triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + index === - 0 && - tableDataDinein?.length >= - PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataTakeAway?.length + index === + 0 && + tableDataDinein?.length >= + PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', background: item?.SalesId ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataTakeAway?.length + index) % 2 === 0 ? 'white' @@ -2692,21 +2696,21 @@ const BSBillingTable1 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( @@ -2801,11 +2805,11 @@ const BSBillingTable1 = () => { > {allowDecimal ? Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2) + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2) : Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - )} + item?.TotalAmt - (item?.Offer || 0) || 0 + )} )} @@ -2845,11 +2849,10 @@ const BSBillingTable1 = () => { OldtableDataTakeAway?.length + index } - className={`${ - BookingType === 'Dine In' && item?.SalesId - ? 'Billing-Table1-row-disabled' - : 'Billing-Table1-row' - } + className={`${BookingType === 'Dine In' && item?.SalesId + ? 'Billing-Table1-row-disabled' + : 'Billing-Table1-row' + } `} style={{ @@ -2860,44 +2863,44 @@ const BSBillingTable1 = () => { ? BookingType === 'Dine In' && item?.SalesId ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && - !item?.SalesId && - tableDataTakeAway?.length >= - PreviousdataLength + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + !item?.SalesId && + tableDataTakeAway?.length >= + PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && - tableDataTakeAway?.length >= - PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + tableDataTakeAway?.length >= + PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.[ - 'OverallBackgroundColor' - ] + 'OverallBackgroundColor' + ] ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] + 'OverallBackgroundColor' + ] : '#d6d6d6' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] @@ -2906,30 +2909,30 @@ const BSBillingTable1 = () => { BookingType === 'Dine In' && item?.SalesId ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + + ' ' + + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] + 'OverallBackgroundColor' + ] : '#d6d6d6', animation: BillOrderPre === 'Y' && !BookingTypeBoth ? triggerAnimation && OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && + OldtableDataTakeAway?.length + + index === + 0 && !item?.SalesId && tableDataTakeAway?.length >= PreviousdataLength && !HoldOrderDtl && @@ -2979,8 +2982,9 @@ const BSBillingTable1 = () => { textAlign: 'left', }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } @@ -3001,8 +3005,8 @@ const BSBillingTable1 = () => { {!item?.ProdVariantName?.toLowerCase()?.includes( 'variant' ) && ( - {item?.ProdVariantName} - )} + {item?.ProdVariantName} + )} {item?.Size} {item?.SinglePc == 'Y' ? 'PCS' @@ -3037,21 +3041,21 @@ const BSBillingTable1 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( @@ -3146,11 +3150,11 @@ const BSBillingTable1 = () => { > {allowDecimal ? Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2) + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2) : Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - )} + item?.TotalAmt - (item?.Offer || 0) || 0 + )} )} @@ -3191,11 +3195,10 @@ const BSBillingTable1 = () => { tableDataTakeAway?.length + index } - className={`${ - BookingType === 'Dine In' && item?.SalesId - ? 'Billing-Table1-row-disabled' - : 'Billing-Table1-row' - } + className={`${BookingType === 'Dine In' && item?.SalesId + ? 'Billing-Table1-row-disabled' + : 'Billing-Table1-row' + } `} style={{ @@ -3208,61 +3211,61 @@ const BSBillingTable1 = () => { !BookingTypeBoth ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && - tableDataDinein?.length >= - PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && + tableDataDinein?.length >= + PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', background: BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth + item?.SalesId && + !BookingTypeBoth ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + - ' ' + - item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + + ' ' + + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] + 'OverallBackgroundColor' + ] : '#d6d6d6', animation: BillOrderPre === 'Y' && !BookingTypeBoth ? triggerAnimation && OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && !item?.SalesId && tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && @@ -3364,21 +3367,21 @@ const BSBillingTable1 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( @@ -3473,11 +3476,11 @@ const BSBillingTable1 = () => { > {allowDecimal ? Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - ).toFixed(2) + item?.TotalAmt - (item?.Offer || 0) || 0 + ).toFixed(2) : Number( - item?.TotalAmt - (item?.Offer || 0) || 0 - )} + item?.TotalAmt - (item?.Offer || 0) || 0 + )} )} diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BsBill2.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BsBill2.jsx index 9b77ed9..d66d9f2 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BsBill2.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable2/BsBill2.jsx @@ -91,6 +91,12 @@ const BsBill2 = () => { setting?.SettingIdName?.toLowerCase() === 'shortcutkeys' && setting?.SettingValue === 'Y' ); + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); + console.log(imeiModal, "imeiModalimeiModal") const [count, setCount] = useState(1); const ReorderProductData = useSelector(GlobalReorderProductDetails); const CartOrderDetails = useSelector(GlobalOrderCardDetails); @@ -156,16 +162,16 @@ const BsBill2 = () => { OrderType === 'Hold' ? CartOrderDetails?.filter((a, b) => a.BookingTypeName === 'TakeAway') : CartOrderDetails?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); const OldtableDataDinein = CartOrderDetails?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId ); const OldtableDataTakeAway = OrderType != 'Hold' ? CartOrderDetails?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; useEffect(() => { @@ -359,26 +365,26 @@ const BsBill2 = () => { if (isItemInCart && BookingTypeProd != 'Dine In' && OrderType != 'Hold') { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; @@ -389,26 +395,26 @@ const BsBill2 = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -427,26 +433,26 @@ const BsBill2 = () => { ) { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; @@ -457,26 +463,26 @@ const BsBill2 = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -489,27 +495,27 @@ const BsBill2 = () => { } else if (isItemInCartHold && OrderType === 'Hold') { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty + 1, - TotalAmt: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty + 1, + TotalAmt: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty + 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty + 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ UpdatedCartItem, @@ -523,27 +529,27 @@ const BsBill2 = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty + 1, - TotalAmt: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty + 1, + TotalAmt: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty + 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty + 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ ...OtherorderDataforNormalWithoutSalesId, @@ -708,27 +714,27 @@ const BsBill2 = () => { ) { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; @@ -739,27 +745,27 @@ const BsBill2 = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -778,27 +784,27 @@ const BsBill2 = () => { ) { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; @@ -809,27 +815,27 @@ const BsBill2 = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -842,29 +848,29 @@ const BsBill2 = () => { } else if (isItemInCartHold && OrderType === 'Hold') { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty - 1, - TotalAmt: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty - 1, + TotalAmt: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty - 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ UpdatedCartItem, @@ -878,29 +884,29 @@ const BsBill2 = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty - 1, - TotalAmt: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty - 1, + TotalAmt: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty - 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ ...OtherorderDataforNormalWithoutSalesId, @@ -1303,8 +1309,8 @@ const BsBill2 = () => { > {index === Math.floor((OldtableDataTakeAway.length - 1) / 2) && ( - - )} + + )} )}
{ ? item?.SalesId && OrderType !== 'Hold' ? 'rgb(243, 248, 213)' : triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength ? 'wheat' : triggerAnimation && - index === 0 && - tableDataTakeAway?.length >= - PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + index === 0 && + tableDataTakeAway?.length >= + PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', @@ -1338,9 +1344,9 @@ const BsBill2 = () => { item?.SalesId && OrderType !== 'Hold' ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : index % 2 === 0 ? 'white' @@ -1367,8 +1373,8 @@ const BsBill2 = () => { loading="lazy" src={ item?.ProdLogo && - item?.ProdLogo != null && - item?.ProdLogo != undefined + item?.ProdLogo != null && + item?.ProdLogo != undefined ? item?.ProdLogo : defaultimage } @@ -1379,7 +1385,7 @@ const BsBill2 = () => { style={{ fontFamily: SelectedFont }} onClick={() => (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0) && + item.ProductIdentifierDtls?.length > 0 || imeiModal) && handleImeiDetails(item) } > @@ -1430,21 +1436,21 @@ const BsBill2 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )}

{ > {index == Math.round(OldtableDataDinein?.length / 2 - 0.1) && ( - - )} + + )}

)}
{ ? item?.SalesId ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength + triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', background: item?.SalesId ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataTakeAway?.length + index) % 2 === 0 ? 'white' @@ -1587,8 +1593,8 @@ const BsBill2 = () => { loading="lazy" src={ item?.ProdLogo && - item?.ProdLogo != null && - item?.ProdLogo != undefined + item?.ProdLogo != null && + item?.ProdLogo != undefined ? item?.ProdLogo : defaultimage } @@ -1645,21 +1651,21 @@ const BsBill2 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )}

{ > {index == Math.round(tableDataTakeAway?.length / 2 - 0.1) && ( - - )} + + )}

)}
{ ? BookingType === 'Dine In' && item?.SalesId ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && - tableDataTakeAway?.length >= - PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + tableDataTakeAway?.length >= + PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.[ - 'OverallBackgroundColor' - ] + 'OverallBackgroundColor' + ] : '#d6d6d6' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] @@ -1800,15 +1806,15 @@ const BsBill2 = () => { BookingType === 'Dine In' && item?.SalesId ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] @@ -1817,9 +1823,9 @@ const BsBill2 = () => { BillOrderPre === 'Y' && !BookingTypeBoth ? triggerAnimation && OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && + OldtableDataTakeAway?.length + + index === + 0 && !item?.SalesId && tableDataTakeAway?.length >= PreviousdataLength && !HoldOrderDtl && @@ -1836,8 +1842,8 @@ const BsBill2 = () => { loading="lazy" src={ item?.ProdLogo && - item?.ProdLogo != null && - item?.ProdLogo != undefined + item?.ProdLogo != null && + item?.ProdLogo != undefined ? item?.ProdLogo : defaultimage } @@ -1848,7 +1854,7 @@ const BsBill2 = () => { style={{ fontFamily: SelectedFont }} onClick={() => (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0) && + item.ProductIdentifierDtls?.length > 0 || imeiModal) && handleImeiDetails(item) } > @@ -1892,21 +1898,21 @@ const BsBill2 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )}

{ !BookingTypeBoth ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', background: BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth + item?.SalesId && + !BookingTypeBoth ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] @@ -2070,10 +2076,10 @@ const BsBill2 = () => { BillOrderPre === 'Y' && !BookingTypeBoth ? triggerAnimation && OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && !item?.SalesId && tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && @@ -2090,8 +2096,8 @@ const BsBill2 = () => { loading="lazy" src={ item?.ProdLogo && - item?.ProdLogo != null && - item?.ProdLogo != undefined + item?.ProdLogo != null && + item?.ProdLogo != undefined ? item?.ProdLogo : defaultimage } @@ -2148,21 +2154,21 @@ const BsBill2 = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -

- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )}

{ item.SettingIdName.toLowerCase() === 'shortcutkeys' && item.SettingValue === 'Y' ); + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); console.log(preferenceshortcutkey, 'preferenceshortcutkey'); const tableDataDinein = tableData?.filter( (a, b) => a.BookingTypeName === 'Dine In' && !a?.SalesId @@ -2492,8 +2497,9 @@ const BSBillingTable3 = () => { className="Table3-items for-combo" style={{ fontFamily: 'Poppins' }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } @@ -3086,8 +3092,9 @@ const BSBillingTable3 = () => { className="Table3-items for-combo" style={{ fontFamily: 'Poppins' }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item, index) } diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx index d75bb94..403861e 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.jsx @@ -104,6 +104,11 @@ const BSBillingTable4 = () => { const BillOrderPre = preferenceDatas?.[0]?.SettingDtlDetails?.find( (item) => item.SettingIdName === 'BillItemsOrder' )?.SettingValue; + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); const SessionData = useSelector(StoredSessionData); const BranchId = SessionData?.BranchId; const AppId = SessionData?.AppId; @@ -2484,8 +2489,8 @@ const BSBillingTable4 = () => { className="Table4-items for-combo" style={{ fontFamily: 'Poppins' }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } @@ -3068,8 +3073,8 @@ const BSBillingTable4 = () => { className="Table4-items for-combo" style={{ fontFamily: 'Poppins' }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item, index) } diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BsBill.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BsBill.jsx index de07fcd..63268a0 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BsBill.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable5/BsBill.jsx @@ -109,6 +109,11 @@ const BsBill = () => { setting?.SettingIdName?.toLowerCase() === 'shortcutkeys' && setting?.SettingValue === 'Y' ); + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); const [count, setCount] = useState(1); const [messageType, setMessageType] = useState(null); const [messageData, setMessageData] = useState(null); @@ -174,16 +179,16 @@ const BsBill = () => { OrderType === 'Hold' ? TableData?.filter((a, b) => a.BookingTypeName === 'TakeAway') : TableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId - ); + (a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId + ); const OldtableDataDinein = TableData?.filter( (a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId ); const OldtableDataTakeAway = OrderType != 'Hold' ? TableData?.filter( - (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId - ) + (a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId + ) : []; const BillOrderPre = preferenceDatas?.[0]?.SettingDtlDetails?.find( (item) => item.SettingIdName === 'BillItemsOrder' @@ -838,9 +843,9 @@ const BsBill = () => { )?.map((item, idx) => idx === 0 ? { - ...item, - FreeQty, - } + ...item, + FreeQty, + } : item ), }; @@ -2218,26 +2223,26 @@ const BsBill = () => { if (isItemInCart && BookingTypeProd != 'Dine In' && OrderType != 'Hold') { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; @@ -2248,26 +2253,26 @@ const BsBill = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -2286,26 +2291,26 @@ const BsBill = () => { ) { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; @@ -2316,26 +2321,26 @@ const BsBill = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty + 1, - TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty + 1, + TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty + 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty + 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -2348,27 +2353,27 @@ const BsBill = () => { } else if (isItemInCartHold && OrderType === 'Hold') { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty + 1, - TotalAmt: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty + 1, + TotalAmt: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty + 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty + 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ UpdatedCartItem, @@ -2382,27 +2387,27 @@ const BsBill = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty + 1, - TotalAmt: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty + 1, + TotalAmt: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty + 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty + 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ ...OtherorderDataforNormalWithoutSalesId, @@ -2594,27 +2599,27 @@ const BsBill = () => { ) { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; @@ -2625,27 +2630,27 @@ const BsBill = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -2664,27 +2669,27 @@ const BsBill = () => { ) { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal]; if (OfferCheckedInSetup && preferenceOffer) { @@ -2694,27 +2699,27 @@ const BsBill = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCart, - OrderQty: isItemInCart?.OrderQty - 1, - TotalAmt: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCart, + OrderQty: isItemInCart?.OrderQty - 1, + TotalAmt: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate, + TaxAmt: ( + ((isItemInCart?.OrderQty - 1) * + isItemInCart?.OrderRate * + isItemInCart?.TaxPercentage) / + (100 + isItemInCart?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - + ( ((isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate * isItemInCart?.TaxPercentage) / (100 + isItemInCart?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate - - ( - ((isItemInCart?.OrderQty - 1) * - isItemInCart?.OrderRate * - isItemInCart?.TaxPercentage) / - (100 + isItemInCart?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem]; @@ -2727,29 +2732,29 @@ const BsBill = () => { } else if (isItemInCartHold && OrderType === 'Hold') { if (BillOrderPre === 'Y') { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty - 1, - TotalAmt: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty - 1, + TotalAmt: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty - 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ UpdatedCartItem, @@ -2763,29 +2768,29 @@ const BsBill = () => { } } else { const UpdatedCartItem = - // if the item is already in the cart, increase the quantity of the item - { - ...isItemInCartHold, - OrderQty: isItemInCartHold?.OrderQty - 1, - TotalAmt: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate, - TaxAmt: ( + // if the item is already in the cart, increase the quantity of the item + { + ...isItemInCartHold, + OrderQty: isItemInCartHold?.OrderQty - 1, + TotalAmt: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate, + TaxAmt: ( + ((isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate * + isItemInCartHold?.TaxPercentage) / + (100 + isItemInCartHold?.TaxPercentage) + ).toFixed(2), + WithoutTaxRate: + (isItemInCartHold?.OrderQty - 1) * + isItemInCartHold?.OrderRate - + ( ((isItemInCartHold?.OrderQty - 1) * isItemInCartHold?.OrderRate * isItemInCartHold?.TaxPercentage) / (100 + isItemInCartHold?.TaxPercentage) ).toFixed(2), - WithoutTaxRate: - (isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate - - ( - ((isItemInCartHold?.OrderQty - 1) * - isItemInCartHold?.OrderRate * - isItemInCartHold?.TaxPercentage) / - (100 + isItemInCartHold?.TaxPercentage) - ).toFixed(2), - }; + }; const UpdatedData = [ ...OtherorderDataforNormalWithoutSalesId, @@ -3319,15 +3324,15 @@ const BsBill = () => { ? item?.SalesId && OrderType !== 'Hold' ? 'rgb(243, 248, 213)' : triggerAnimation && - index === 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength + index === 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength ? 'wheat' : triggerAnimation && - index === 0 && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + index === 0 && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', @@ -3335,9 +3340,9 @@ const BsBill = () => { item?.SalesId && OrderType !== 'Hold' ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : index % 2 === 0 ? 'white' @@ -3375,7 +3380,7 @@ const BsBill = () => { { - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } @@ -3454,21 +3459,21 @@ const BsBill = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -

- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( @@ -3639,26 +3644,26 @@ const BsBill = () => { ? item?.SalesId ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength + triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + index === 0 && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataTakeAway?.length + index === 0 && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', background: item?.SalesId ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataTakeAway?.length + index) % 2 === 0 ? 'white' @@ -3696,7 +3701,7 @@ const BsBill = () => { { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( @@ -3956,38 +3961,38 @@ const BsBill = () => { ? BookingType === 'Dine In' && item?.SalesId ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && - !item?.SalesId && - tableDataTakeAway?.length >= PreviousdataLength + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + !item?.SalesId && + tableDataTakeAway?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && - tableDataTakeAway?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataDinein?.length + + OldtableDataTakeAway?.length + + index === + 0 && + tableDataTakeAway?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] : '#d6d6d6' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] @@ -3996,15 +4001,15 @@ const BsBill = () => { BookingType === 'Dine In' && item?.SalesId ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] @@ -4013,9 +4018,9 @@ const BsBill = () => { BillOrderPre === 'Y' && !BookingTypeBoth ? triggerAnimation && OldtableDataDinein?.length + - OldtableDataTakeAway?.length + - index === - 0 && + OldtableDataTakeAway?.length + + index === + 0 && !item?.SalesId && tableDataTakeAway?.length >= PreviousdataLength && !HoldOrderDtl && @@ -4043,7 +4048,7 @@ const BsBill = () => { { - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } @@ -4087,8 +4092,8 @@ const BsBill = () => { {!item?.ProdVariantName?.toLowerCase()?.includes( 'variant' ) && ( - {item?.ProdVariantName} - )} + {item?.ProdVariantName} + )} {item?.Size} {item?.SinglePc == 'Y' ? 'PCS' @@ -4126,21 +4131,21 @@ const BsBill = () => { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( @@ -4325,44 +4330,44 @@ const BsBill = () => { !BookingTypeBoth ? 'rgb(243, 248, 213)' : BookingType === 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && - !item?.SalesId && - tableDataDinein?.length >= PreviousdataLength + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && + !item?.SalesId && + tableDataDinein?.length >= PreviousdataLength ? 'wheat' : BookingType !== 'Dine In' && - triggerAnimation && - OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && - tableDataDinein?.length >= PreviousdataLength && - !HoldOrderDtl && - !UnpaidData + triggerAnimation && + OldtableDataTakeAway?.length + + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && + tableDataDinein?.length >= PreviousdataLength && + !HoldOrderDtl && + !UnpaidData ? 'wheat' : 'inherit' : 'none', background: BookingType === 'Dine In' && - item?.SalesId && - !BookingTypeBoth + item?.SalesId && + !BookingTypeBoth ? 'rgb(243, 248, 213)' : GlobEstBooking === 'ParEst' && - GlobProdwisedata?.includes( - item?.InwardDtlId + ' ' + item?.BookingTypeName - ) + GlobProdwisedata?.includes( + item?.InwardDtlId + ' ' + item?.BookingTypeName + ) ? '#b2d1f7' : (OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index) % - 2 === - 0 + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index) % + 2 === + 0 ? 'white' : SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor'] @@ -4371,10 +4376,10 @@ const BsBill = () => { BillOrderPre === 'Y' && !BookingTypeBoth ? triggerAnimation && OldtableDataTakeAway?.length + - OldtableDataDinein?.length + - tableDataTakeAway?.length + - index === - 0 && + OldtableDataDinein?.length + + tableDataTakeAway?.length + + index === + 0 && !item?.SalesId && tableDataDinein?.length >= PreviousdataLength && !HoldOrderDtl && @@ -4402,7 +4407,7 @@ const BsBill = () => { { {productBasedExtraCharges?.find( (find) => find.ProdId === item.ProdId ) !== undefined && ( -
- Extra Charges :{' '} - { - productBasedExtraCharges?.find( - (find) => find.ProdId === item.ProdId - )?.TotalAmt - } -
- )} +
+ Extra Charges :{' '} + { + productBasedExtraCharges?.find( + (find) => find.ProdId === item.ProdId + )?.TotalAmt + } +
+ )} )} {tableitem.OptionName == 'MRP' && ( diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx index 1223a5b..ba0b56a 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx @@ -137,6 +137,11 @@ const BSBillingTable6 = () => { const BillOrderPre = preferenceDatas?.[0]?.SettingDtlDetails?.find( (item) => item.SettingIdName === 'BillItemsOrder' )?.SettingValue; + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); const BookingTypeBoth = useSelector(GlobalBookingTypeBoth); const OrderType = useSelector(GlobalOrderType); const GlobEstBooking = useSelector(GlobalEstimateBooking); @@ -1485,7 +1490,7 @@ const BSBillingTable6 = () => { CompleteRemove: true, InwardDtlId: isPaidProductAvailableInCart?.InwardDtlId, BuyInwardDtlId: null, - OrderRate:isPaidProductAvailableInCart?.OrderRate, + OrderRate: isPaidProductAvailableInCart?.OrderRate, Offer: 0, }); } else if ( @@ -1570,7 +1575,7 @@ const BSBillingTable6 = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate:item?.OrderRate, + OrderRate: item?.OrderRate, }); await ChangeFreeprodlistFn({ OverAllFreeQty: freeProdList?.OverAllFreeQty, @@ -2304,8 +2309,8 @@ const BSBillingTable6 = () => { className="BillingTable6-table-td for-combo" style={{ fontFamily: 'Poppins', textAlign: 'left' }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } @@ -2855,8 +2860,8 @@ const BSBillingTable6 = () => { className="BillingTable6-table-td for-combo" style={{ fontFamily: 'Poppins', textAlign: 'left' }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx index dd19d42..a019ea4 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable7/BSBillingTable7.jsx @@ -158,6 +158,11 @@ const BSBillingTable7 = () => { setting?.SettingIdName?.toLowerCase() === 'shortcutkeys' && setting?.SettingValue === 'Y' ); + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); useEffect(() => { if (SelectedFont) { WebFont.load({ @@ -2729,8 +2734,8 @@ const BSBillingTable7 = () => { padding: '8px', }} onClick={() => - (item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0) && + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) && handleImeiDetails(item) } > diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx index d26cba8..1f74dc1 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx @@ -14,6 +14,7 @@ import { } from '../../../../../Features/BookingScreen/BookingData/BookingData'; import { useDispatch, useSelector } from 'react-redux'; import { validateSafeInput } from '../../../../../Services/Others'; +import { TextAreaInput } from '../../../../../../ownLib/my-ui-lib'; const BSImeiDetails = (props) => { const formRef = useRef(null); const dispatch = useDispatch(); @@ -26,7 +27,7 @@ const BSImeiDetails = (props) => { const [SerialNumberList, setSerialNumberList] = useState([]); const [IMEINumberList, setIMEINumberList] = useState([]); - console.log(SerialNumberList, IMEINumberList, 'SerialNumberList'); + console.log(props, 'propsprops'); useEffect(() => { let productidentifier = ProductDetail?.ProductIdentifierDtls ? ProductDetail?.ProductIdentifierDtls @@ -47,6 +48,10 @@ const BSImeiDetails = (props) => { return [imei1, imei2].filter(Boolean).join(','); }) ); + + formRef?.current?.setFieldsValue({ + description: productidentifier?.[0]?.Description || "", + }) }, []); const CloseDeviceDetailModal = () => { props.handleDeviceDetailClose(); @@ -65,7 +70,8 @@ const BSImeiDetails = (props) => { } else { setSerialNumberList([...SerialNumberList, e]); } - } else { + } + else { setMessageType('error'); setMessageData('Already Selected '); } @@ -83,7 +89,7 @@ const BSImeiDetails = (props) => { } } else { setMessageType('error'); - setMessageData('Already Selected'); + setMessageData('you cant enter more than Order Qty'); } formRef.current?.resetFields(); @@ -115,7 +121,7 @@ const BSImeiDetails = (props) => { } } else { setMessageType('error'); - setMessageData('Already Selected'); + setMessageData('you cant enter more than Order Qty'); } formRef.current?.resetFields(); }; @@ -131,6 +137,8 @@ const BSImeiDetails = (props) => { setMessageType(null); }, []); const AddDeviceDetails = () => { + + console.log(formRef?.current?.getFieldsValue, "formRef?.current?.getFieldsValue") const maxLength = Math.max(SerialNumberList.length, IMEINumberList.length); // Create the new object array const IdentifyDetails = Array.from({ length: maxLength }, (_, index) => { @@ -143,6 +151,7 @@ const BSImeiDetails = (props) => { IMEI1: imeiPair[0] || '', // First IMEI number IMEI2: imeiPair[1] || '', // Second IMEI number MacId: '', // Default empty macid + Description: formRef.current?.getFieldsValue()?.description || '', }; }); console.log(IdentifyDetails, 'IdentifyDetails'); @@ -154,9 +163,9 @@ const BSImeiDetails = (props) => { cartItem // if the item is already in the cart, increase the quantity of the item ) => cartItem.ProdId === ProductDetail.ProdId && - cartItem.InwardDtlId === ProductDetail.InwardDtlId && - cartItem?.OrderRate === ProductDetail?.OrderRate && - cartItem?.BookingTypeName === ProductDetail?.BookingTypeName + cartItem.InwardDtlId === ProductDetail.InwardDtlId && + cartItem?.OrderRate === ProductDetail?.OrderRate && + cartItem?.BookingTypeName === ProductDetail?.BookingTypeName ? { ...cartItem, ProductIdentifierDtls: IdentifyDetails } : cartItem // otherwise, return the cart item ) @@ -175,7 +184,7 @@ const BSImeiDetails = (props) => { - +
} open={DeviceDetailOpen} @@ -226,26 +235,30 @@ const BSImeiDetails = (props) => { {RadioBtnSelection == 'Serial' && (
- - - !( - item.SerialNumber == '' || - item.SerialNumber == null - ) - )?.map((option) => ({ - value: option.SerialNumber, - label: option.SerialNumber, - disabled: SerialNumberList?.includes( - option.SerialNumber - ), - }))} - label={'Serial Number'} - className="field-DropDown" - onChangeFunction={(e) => SerialNumberOnchange(e)} - /> - + {ProductDetail?.FullProductIdentifierDtls?.length > 0 && + + + !( + item.SerialNumber == '' || + item.SerialNumber == null + ) + )?.map((option) => ({ + value: option.SerialNumber, + label: option.SerialNumber, + disabled: SerialNumberList?.includes( + option.SerialNumber + ), + }))} + label={'Serial Number'} + className="field-DropDown" + onChangeFunction={(e) => SerialNumberOnchange(e)} + /> + + + } + { fieldApi={true} // id="error2" autocomplete="off" - // isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false} + // isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false} /> { >
Serial Number:
+
{SerialNumberList?.map((item, index) => (
@@ -292,32 +306,36 @@ const BSImeiDetails = (props) => {
)} + + {RadioBtnSelection == 'IMEI' && (
- - item.IMEI1 !== '' || item.IMEI2 !== '' - )?.map((option) => { - const imei1 = option.IMEI1 || ''; - const imei2 = option.IMEI2 || ''; - const valueLabel = [imei1, imei2] - ?.filter(Boolean) - ?.join(','); - const normalizedValueLabel = valueLabel?.trim(); - return { - value: valueLabel, - label: valueLabel, - disabled: - IMEINumberList?.includes(normalizedValueLabel), - }; - })} - label={'IMEI Number'} - className="field-DropDown" - onChangeFunction={(e) => IMEINumberOnchange(e)} - /> - + {ProductDetail?.FullProductIdentifierDtls?.length > 0 && + + item.IMEI1 !== '' || item.IMEI2 !== '' + )?.map((option) => { + const imei1 = option.IMEI1 || ''; + const imei2 = option.IMEI2 || ''; + const valueLabel = [imei1, imei2] + ?.filter(Boolean) + ?.join(','); + const normalizedValueLabel = valueLabel?.trim(); + return { + value: valueLabel, + label: valueLabel, + disabled: + IMEINumberList?.includes(normalizedValueLabel), + }; + })} + label={'IMEI Number'} + className="field-DropDown" + onChangeFunction={(e) => IMEINumberOnchange(e)} + /> + } + { fieldApi={true} // id="error2" autocomplete="off" - // OnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false} + // OnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false} /> {
)} + +
+ + Description..} + defaultValue="" + isOnChange={true} + /> + +
+ +
{ icon={} >
-
+ } handleCancel={CloseDeviceDetailModal} /> - + ); }; export default BSImeiDetails; diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx index c419842..e2d3a10 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx @@ -105,6 +105,11 @@ const ComboSalesBillTable = () => { setting?.SettingIdName?.toLowerCase() === 'decimal' && setting?.SettingValue === 'Y' ); + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); const SessionData = useSelector(StoredSessionData); const BranchId = SessionData?.BranchId; const AppId = SessionData?.AppId; @@ -1349,7 +1354,7 @@ const ComboSalesBillTable = () => { InwardDtlId: isPaidproduct?.InwardDtlId, BuyInwardDtlId: null, Offer: 0, - OrderRate:isPaidproduct?.OrderRate + OrderRate: isPaidproduct?.OrderRate }); } else if (isPaidproduct?.OrderQty > item?.OrderQty) { // Just Decrease Paid Qty @@ -1521,7 +1526,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate:item?.OrderRate + OrderRate: item?.OrderRate }); await ChangeFreeprodlistFn({ OverAllFreeQty: isCheckFreeProduct?.OverAllFreeQty, @@ -1600,7 +1605,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate:item?.OrderRate + OrderRate: item?.OrderRate }); await ChangeFreeprodlistFn({ OverAllFreeQty: isCheckFreeProduct?.OverAllFreeQty, @@ -1634,7 +1639,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate:item?.OrderRate + OrderRate: item?.OrderRate }); await ChangeOfferAppliedProdsFn({ inwardDtlId: item?.InwardDtlId, @@ -1666,7 +1671,7 @@ const ComboSalesBillTable = () => { InwardDtlId: isPaidProductAvailableInCart?.InwardDtlId, BuyInwardDtlId: null, Offer: 0, - OrderRate:isPaidProductAvailableInCart?.OrderRate + OrderRate: isPaidProductAvailableInCart?.OrderRate }); } else if ( isPaidProductAvailableInCart?.OrderQty > item?.OrderQty @@ -2540,8 +2545,9 @@ const ComboSalesBillTable = () => { key={`prod-${index}`} className={`productNameTd ${isActiveCell ? 'active-cell' : ''}`} onClick={() => - row.FullProductIdentifierDtls?.length > 0 || - row.ProductIdentifierDtls?.length > 0 + (row.FullProductIdentifierDtls?.length > 0 || + row.ProductIdentifierDtls?.length > 0 || imeiModal) + ? handleImeiDetails(row) : editField && handleEditQuantity(row) } @@ -2601,8 +2607,8 @@ const ComboSalesBillTable = () => { key={`qty-${index}`} tabIndex={0} className={`${EditQtyCombo && row?.localId === Index - ? 'EditQTYcomboTD' - : 'qtyTd' + ? 'EditQTYcomboTD' + : 'qtyTd' } ${isActiveCell ? 'active-cell' : ''}`} onClick={() => editField && handleEditQuantityCombo(row) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx index 4a764cd..87ff635 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/StandardTable/StandardTable.jsx @@ -111,6 +111,11 @@ const StandardTable = () => { setting?.SettingIdName?.toLowerCase() === 'decimal' && setting?.SettingValue === 'Y' ); + const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'imeidetails' && + setting?.SettingValue === 'Y' + ); const SessionData = useSelector(StoredSessionData); const BranchId = SessionData?.BranchId; const AppId = SessionData?.AppId; @@ -3181,8 +3186,8 @@ const StandardTable = () => { "'Inter', ui-sans-serif, system-ui, sans-serif", }} onClick={() => - item.FullProductIdentifierDtls?.length > 0 || - item.ProductIdentifierDtls?.length > 0 + (item.FullProductIdentifierDtls?.length > 0 || + item.ProductIdentifierDtls?.length > 0 || imeiModal) ? handleImeiDetails(item) : editField && handleEditQuantity(item) } diff --git a/src/Pages/Preference/PreferenceList.jsx b/src/Pages/Preference/PreferenceList.jsx index 4cbbe51..09a6fc5 100644 --- a/src/Pages/Preference/PreferenceList.jsx +++ b/src/Pages/Preference/PreferenceList.jsx @@ -108,6 +108,7 @@ const PreferenceList = () => { ], scanlayout: allSettingsMap['scanlayout']?.value === 'Y', verifyproduct: allSettingsMap['verifyproduct']?.value === 'Y', + imeidetails:allSettingsMap['imeidetails']?.value === 'Y', customisedbillnumber: allSettingsMap['customisedbillnumber']?.value === 'Y', upiqr: allSettingsMap['upiqr']?.value === 'Y', lowstockreport: allSettingsMap['lowstockreport']?.value === 'Y', @@ -309,6 +310,7 @@ const PreferenceList = () => { mobilea4: values.mobilea4, scanlayout: values.scanlayout, verifyproduct: values.verifyproduct, + imeidetails:values.imeidetails, customisedbillnumber: values.customisedbillnumber, upiqr: values.upiqr, lowstockreport: values.lowstockreport, @@ -633,6 +635,10 @@ const PreferenceList = () => { 'verifyproduct', 'Do you Want Verify the Product?' )} + {renderCheckbox( + 'imeidetails', + 'Do you want to open the IMEI model without IMEI details?' + )} {renderCheckbox( 'customisedbillnumber', 'Do you Want Customised Bill Number?' From 544e282bd0b762b40ea5b87449f02821a7d7b109 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Thu, 26 Feb 2026 18:21:16 +0530 Subject: [PATCH 2/8] addscss --- .../BSBillingTables/BSImeiDetails/BSImeiDetails.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx index 1f74dc1..5a34d43 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx @@ -15,6 +15,7 @@ import { import { useDispatch, useSelector } from 'react-redux'; import { validateSafeInput } from '../../../../../Services/Others'; import { TextAreaInput } from '../../../../../../ownLib/my-ui-lib'; +import "../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.scss" const BSImeiDetails = (props) => { const formRef = useRef(null); const dispatch = useDispatch(); @@ -70,7 +71,7 @@ const BSImeiDetails = (props) => { } else { setSerialNumberList([...SerialNumberList, e]); } - } + } else { setMessageType('error'); setMessageData('Already Selected '); @@ -89,7 +90,7 @@ const BSImeiDetails = (props) => { } } else { setMessageType('error'); - setMessageData('you cant enter more than Order Qty'); + setMessageData('you cant enter more than Order Qty'); } formRef.current?.resetFields(); @@ -184,7 +185,7 @@ const BSImeiDetails = (props) => { - + } open={DeviceDetailOpen} @@ -385,6 +386,10 @@ const BSImeiDetails = (props) => {
Description..} defaultValue="" From 5786040e3d4ef4f42bd0bf65bd92c5136975d64d Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Mon, 2 Mar 2026 13:45:58 +0530 Subject: [PATCH 3/8] change Design add descriptions --- .../PrintTemplates/A4/TaxInvoice.jsx | 39 +++-- .../ThermalPrinter/PrintStyle1.jsx | 159 +++++++++++------- 2 files changed, 119 insertions(+), 79 deletions(-) diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx index be3057c..6f9dd20 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/TaxInvoice.jsx @@ -23,6 +23,7 @@ const TaxInvoice = ({ ReprintType, printDatas, }) => { + const GlobaldummyData = useSelector(GlobalPritdummyData); const SettingData = useSelector(PreferenceData); const estimatePrintHeader = @@ -833,27 +834,25 @@ const TaxInvoice = ({ {item.BrandName}{' '}
)} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => - items.SerialNumber && items.SerialNumber !== '' - )?.map((a, i) => ( -
{a.SerialNumber}
- )) - : ''} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (id) => id.IMEI1 !== '' || id.IMEI2 !== '' - )?.map((id, i) => { - const imei1 = id.IMEI1 || ''; - const imei2 = id.IMEI2 || ''; - return ( -
- {[imei1, imei2].filter(Boolean).join(',')} +
+ {item?.ProductIdentifierDtls?.map((id, i) => ( +
+
+ {id?.SerialNumber && {id.SerialNumber}} + {(id?.IMEI1 || id?.IMEI2) && ( + {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} + )}
- ); - }) - : ''} + + {id?.Description && ( +
+ {id.Description} +
+ )} +
+ ))} +
+
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */}
)} {table2Data?.OrderType === 'E' ? ( @@ -520,8 +520,8 @@ const PrintStyle1 = ({ ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */} )} @@ -538,8 +538,8 @@ const PrintStyle1 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */} )}
@@ -605,6 +605,12 @@ const PrintStyle1 = ({ {' '} Date : {GlobaldummyData ? formattedDate : Date1}{' '} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} + +
} + @@ -748,10 +754,7 @@ const PrintStyle1 = ({ ? GlobalItem && {item?.ProdName} : Item == true && (
{item?.ProdName}
{PackageDetails?.filter( @@ -789,37 +792,49 @@ const PrintStyle1 = ({ } (${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`}  {' '} {item?.BrandName !== null - ? item?.BrandName - : ''} + ?
{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?.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?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber || items.IMEI1 || items.IMEI2 + )?.map((a, i) => ( + {a.Description} + )) + + : ''} +
+ )} {GlobaldummyData @@ -1026,10 +1041,7 @@ const PrintStyle1 = ({ ? GlobalItem && {item?.ProdName} : Item == true && (
{item?.ProdName}
@@ -3743,8 +3755,8 @@ const PrintStyle1 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */}
)} {table2Data?.OrderType === 'E' ? ( @@ -3785,8 +3797,8 @@ const PrintStyle1 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */} )}
@@ -3958,10 +3970,7 @@ const PrintStyle1 = ({ ? GlobalItem && {item?.ProdName} : Item == true && (
{item?.ProdName}
{PackageDetails?.filter( @@ -3999,9 +4008,10 @@ const PrintStyle1 = ({ } (${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`}  {' '} {item?.BrandName !== null - ? item?.BrandName + ?
{item?.BrandName}
: ''}   + {/* {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( (items) => @@ -4029,7 +4039,41 @@ const PrintStyle1 = ({ ); }) - : ''} + : ''} */} +
+ {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber && + items.SerialNumber !== '' + ).map((a, i) => ( +
{a.SerialNumber}
+ )) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (id) => id.IMEI1 !== '' || id.IMEI2 !== '' + ).map((id, i) => { + const imei1 = id.IMEI1 || ''; + const imei2 = id.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber || items.IMEI1 || items.IMEI2 + )?.map((a, i) => ( + {a.Description} + )) + : ''} +
)} {GlobaldummyData @@ -4217,10 +4261,7 @@ const PrintStyle1 = ({ ? GlobalItem && {item?.ProdName} : Item == true && (
{item?.ProdName}
From c19ba07c4459739221c84f725c0acc5f13aadc68 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Mon, 2 Mar 2026 13:58:40 +0530 Subject: [PATCH 4/8] add description --- .../PrintTemplates/A4/A4Standard.jsx | 201 +++--- .../PrintTemplates/A4/PrintA4Style11.jsx | 219 +++--- .../PrintTemplates/A4/PrintStyleA5.jsx | 209 +++--- .../ThermalPrinter/PrintStyle11.jsx | 224 +++--- .../ThermalPrinter/PrintStyle12.jsx | 83 ++- .../ThermalPrinter/PrintStyle2.jsx | 161 +++-- .../ThermalPrinter/PrintStyle3.jsx | 119 +++- .../ThermalPrinter/PrintStyle4.jsx | 658 +++++++++--------- .../ThermalPrinter/PrintStyle5.jsx | 373 +++++----- .../ThermalPrinter/PrintStyle6.jsx | 318 +++++---- .../ThermalPrinter/PrintStyle7.jsx | 224 +++--- .../ThermalPrinter/PrintStyle8.jsx | 210 +++--- .../ThermalPrinter/PrintStyle9.jsx | 257 +++---- .../paymentpdfPage/PaymentPdfBooking.jsx | 125 ++-- 14 files changed, 1770 insertions(+), 1611 deletions(-) diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx index 252c9c7..058aa16 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx @@ -57,6 +57,7 @@ const InvoiceTemplate = ({ isPdf, sportsAppPreference, MembershipApplied = null, + SalesModePref, }) => { const dispatch = useDispatch(); const GlobalUpiID = useSelector(GlobalUpiIDprint); @@ -944,6 +945,10 @@ const InvoiceTemplate = ({ table2Data?.FYStatus )}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
} )} @@ -1261,76 +1266,66 @@ const InvoiceTemplate = ({ + {/* Product Name */}
{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?.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(',')} -
- ); - }) - : ''} + + {(() => { + const packages = + PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId) || []; + + const identifiers = item?.ProductIdentifierDtls || []; + + return ( + <> + {/* Package OR Size */} + {packages.length > 0 ? ( +
+ {packages.map((pkg, index) => ( + + {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) + + ))} +
+ ) : ( +
+ ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + ) +
+ )} + + {/* Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* Identifiers */} + {identifiers.map((id, i) => ( +
+ {/* Serial + IMEIs in one line */} + {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && ( +
+ {id?.SerialNumber &&
{id.SerialNumber}
} + {(id?.IMEI1 || id?.IMEI2) && ( +
{[id.IMEI1, id.IMEI2].filter(Boolean).join(", ")}
+ )} +
+ )} + + {/* Description on new line */} + {id?.Description &&
{id.Description}
} +
+ ))} + + ); + })()} )} {GlobaldummyData @@ -2994,54 +2989,44 @@ const InvoiceTemplate = ({ : Item == true && ( + {/* Product Name */}
{item?.ProdName}
+ + {/* Size + UOM */}
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" ? item?.UomName - : 'COMBO'} + : "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(',')} + + {/* Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* Identifiers */} + {item?.ProductIdentifierDtls?.map((id, index) => ( +
+ + {/* Serial + IMEIs in one row */} + {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && ( +
+ {id?.SerialNumber &&
{id.SerialNumber}
} + {(id?.IMEI1 || id?.IMEI2) && ( +
{[id.IMEI1, id.IMEI2].filter(Boolean).join(", ")}
+ )}
- ); - }) - : ''} + )} + + {/* Description on new line */} + {id?.Description &&
{id.Description}
} + +
+ ))} )} {GlobaldummyData diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx index a4b1057..e88680c 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx @@ -60,6 +60,7 @@ const PrintA4Style11 = ({ printDatas, sportsAppPreference, MembershipApplied = null, + SalesModePref, }) => { const GlobalthemeFormatr = useSelector(GlobalthemeFormat); const GlobalSignature = useSelector(GlobalprintSignature); @@ -426,6 +427,10 @@ const PrintA4Style11 = ({ table2Data?.OrderId, table2Data?.FYStatus )} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
} {GlobaldummyData && '685'}
@@ -445,10 +450,16 @@ const PrintA4Style11 = ({ justifyContent: 'space-between', padding: '0rem 1rem', fontSize: 'clamp(0.7rem, 2.5vw, 0.8rem)', + flexDirection: 'column', + textAlign: 'left' }} > {' '}
{Date1}
{' '} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
@@ -689,88 +700,78 @@ const PrintA4Style11 = ({ {chunkIndex * chunkSize + index + 1} )} - {GlobaldummyData - ? GlobalItem && {item?.name} - : Item == true && ( + {GlobaldummyData ? ( + GlobalItem && {item?.name} + ) : ( + Item && (
{item?.ProdName}
+ {PackageDetails?.filter( - (pkg) => - pkg.ProdId === item.ProdId + (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}) - - ))} + {PackageDetails + ?.filter((pkg) => pkg.ProdId === item.ProdId) + ?.map((pkg, index) => ( + + {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) + + ))}
) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" ? item?.UomName - : 'COMBO'} + : "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?.BrandName &&
{item.BrandName}
} + + {/* Serial Numbers */} + {item?.ProductIdentifierDtls?.map((id, index) => ( +
+ {id?.SerialNumber &&
{id.SerialNumber}
} +
+ ))} + + {/* IMEI */} + {item?.ProductIdentifierDtls?.map((id, index) => { + const imei1 = id?.IMEI1 || ""; + const imei2 = id?.IMEI2 || ""; + + return ( + (imei1 || imei2) && ( +
+ {[imei1, imei2].filter(Boolean).join(",")}
- ); - }) - : ''} + ) + ); + })} + + {/* Description */} + {item?.ProductIdentifierDtls?.map((id, index) => ( + (id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && + id?.Description && ( +
+ {id.Description} +
+ ) + ))} + - )} + ) + )} {GlobaldummyData ? GlobalHsnCode && ( @@ -1755,67 +1756,57 @@ const PrintA4Style11 = ({ {chunkIndex * chunkSize + index + 1} )} - {GlobaldummyData - ? GlobalItem && {item?.ProdName} - : Item == true && ( + {GlobaldummyData ? ( + GlobalItem && {item?.ProdName} + ) : ( + Item && ( + {/* Product Name */}
{item?.ProdName}
+ + {/* Size + UOM */}
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" ? item?.UomName - : 'COMBO'} + : "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 ( + + {/* Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* Identifiers */} + {item?.ProductIdentifierDtls?.map((id, index) => ( +
+ + {/* Serial Number */} + {id?.SerialNumber &&
{id.SerialNumber}
} + + {/* IMEI */} + {(id?.IMEI1 || id?.IMEI2) && (
- {[imei1, imei2] - .filter(Boolean) - .join(',')} + {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
- ); - }) - : ''} + )} + + {/* Description */} + {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && id?.Description && ( +
{id.Description}
+ )} + +
+ ))} - )} + ) + )} {GlobaldummyData ? GlobalHsnCode && ( diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/PrintStyleA5.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/PrintStyleA5.jsx index dddd6a9..45b20ac 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/PrintStyleA5.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/PrintStyleA5.jsx @@ -60,6 +60,7 @@ const PrintA5Style11 = ({ printDatas, sportsAppPreference, MembershipApplied = null, + SalesModePref, }) => { const GlobalthemeFormatr = useSelector(GlobalthemeFormat); const GlobalSignature = useSelector(GlobalprintSignature); @@ -427,6 +428,8 @@ const PrintA5Style11 = ({ table2Data?.OrderId, table2Data?.FYStatus )} + + {GlobaldummyData && '685'}
@@ -446,10 +449,16 @@ const PrintA5Style11 = ({ justifyContent: 'space-between', padding: '0rem 1rem', fontSize: 'clamp(0.7rem, 2.5vw, 0.8rem)', + flexDirection: 'column', + textAlign:'left' }} > {' '}
{Date1}
{' '} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
@@ -691,88 +700,71 @@ const PrintA5Style11 = ({ {chunkIndex * chunkSize + index + 1} )} - {GlobaldummyData - ? GlobalItem && {item?.name} - : Item == true && ( + {GlobaldummyData ? ( + GlobalItem && {item?.name} + ) : ( + Item && (
{item?.ProdName}
+ {PackageDetails?.filter( - (pkg) => - pkg.ProdId === item.ProdId + (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}) - - ))} + {PackageDetails + ?.filter((pkg) => pkg.ProdId === item.ProdId) + ?.map((pkg, index) => ( + + {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) + + ))}
) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" ? item?.UomName - : 'COMBO'} + : "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?.BrandName &&
{item.BrandName}
} + + {/* Identifiers */} + {item?.ProductIdentifierDtls?.length > 0 + ? item.ProductIdentifierDtls.map((id, index) => ( +
+ + {/* Serial */} + {id?.SerialNumber &&
{id.SerialNumber}
} + + {/* IMEI */} + {(id?.IMEI1 || id?.IMEI2) && ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ )} + + {/* Description */} + {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && + id?.Description && ( +
{id.Description}
+ )} + +
+ )) + : null} - )} + ) + )} {GlobaldummyData ? GlobalHsnCode && ( @@ -1694,67 +1686,54 @@ const PrintA5Style11 = ({ {chunkIndex * chunkSize + index + 1} )} - {GlobaldummyData - ? GlobalItem && {item?.ProdName} - : Item == true && ( + {GlobaldummyData ? ( + GlobalItem && {item?.ProdName} + ) : ( + Item && (
{item?.ProdName}
+
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" ? item?.UomName - : 'COMBO'} + : "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 ( + + {item?.BrandName &&
{item.BrandName}
} + + {item?.ProductIdentifierDtls?.map((id, index) => ( +
+ + {/* Serial Number */} + {id?.SerialNumber &&
{id.SerialNumber}
} + + {/* IMEI */} + {(id?.IMEI1 || id?.IMEI2) && (
- {[imei1, imei2] - .filter(Boolean) - .join(',')} + {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
- ); - }) - : ''} + )} + + {/* Description */} + {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && + id?.Description && ( +
{id.Description}
+ )} + +
+ ))} - )} + ) + )} {GlobaldummyData ? GlobalHsnCode && ( diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx index 91e6fba..c8ff9ef 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx @@ -464,8 +464,8 @@ const PrintStyle11 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
)} {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && ( @@ -491,8 +495,8 @@ const PrintStyle11 = ({ style={{ textTransform: 'uppercase', textAlign: 'center' }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */} )}
@@ -682,38 +686,30 @@ const PrintStyle11 = ({ ? item?.BrandName : ''}   - {item?.ProductIdentifierDtls?.length > - 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { +
+ {item?.ProductIdentifierDtls?.map((detail, index) => { + const serial = detail.SerialNumber?.trim(); + const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', '); + const description = detail.Description?.trim(); + + // Skip if nothing exists + if (!serial && !imeis && !description) return null; + 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(',')} +
+ {/* Serial + IMEI in one line */} + {(serial || imeis) && ( +
+ {serial &&
{serial}
} + {imei &&
{imeis}
} +
+ )} + {/* Description on new line */} + {description &&
{description}
}
); - }) - : ''} + })} +
) : (
@@ -728,38 +724,27 @@ const PrintStyle11 = ({ ? item?.BrandName : ''}   - {item?.ProductIdentifierDtls?.length > - 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == '' || - items.SerialNumber == null - ) - )?.map((a) => { +
+ {item?.ProductIdentifierDtls?.map((detail, index) => { + const serial = detail.SerialNumber; + const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(','); + const description = detail.Description; + + // Only render if at least one value exists + if (!serial && !imeis && !description) return null; + 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(',')} +
+
+ {serial &&
{serial}
} + {imeis &&
{imeis}
} +
+ {description &&
{description}
}
); - }) - : ''} + })} +
+
)} @@ -3115,8 +3100,8 @@ const PrintStyle11 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
)} {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode})`} */}
)} @@ -3279,52 +3268,39 @@ const PrintStyle11 = ({ (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}) + {/* Package Details */} + {PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId)?.map((pkg, idx) => ( + + {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.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 > 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(',')} -
- ); - }) - : ''} + + {/* Brand Name */} + {item?.BrandName && {item.BrandName}} + + {/* Product Identifiers */} + {item?.ProductIdentifierDtls?.map((detail, idx) => { + const serial = detail.SerialNumber?.trim(); + const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', '); + const description = detail.Description?.trim(); + + // Skip if nothing exists + if (!serial && !imeis && !description) return null; + + return ( +
+ {/* Serial + IMEIs on one line */} + {(serial || imeis) && ( +
+ {serial &&
{serial}
} + {imeis &&
{imeis}
} +
+ )} + {/* Description on new line */} + {description &&
{description}
} +
+ ); + })}
) : (
@@ -3339,7 +3315,7 @@ const PrintStyle11 = ({ ? item?.BrandName : ''}   - {item?.ProductIdentifierDtls?.length > 0 + {/* {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( (items) => !( @@ -3368,7 +3344,31 @@ const PrintStyle11 = ({
); }) - : ''} + : ''} */} +
+ {item?.ProductIdentifierDtls?.map((detail, index) => { + const serial = detail.SerialNumber?.trim(); + const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', '); + const description = detail.Description?.trim(); + + // Skip if nothing exists + if (!serial && !imeis && !description) return null; + + return ( +
+ {/* Serial + IMEIs on one line */} + {(serial || imeis) && ( +
+ {serial &&
{serial}
} + {imeis &&
{imeis}
} +
+ )} + {/* Description on new line */} + {description &&
{description}
} +
+ ); + })} +
)} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx index 5b9df75..235bebc 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx @@ -842,41 +842,31 @@ const Printstyle12 = ({ ? item?.BrandName : ''}   - {item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls?.filter( - (items) => - !( - items.SerialNumber == - '' || - items.SerialNumber == null - ) - )?.map((a) => { +
+ {item?.ProductIdentifierDtls?.map((detail, index) => { + const serial = detail.SerialNumber?.trim(); + const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', '); + const description = detail.Description?.trim(); + + // Skip if all are empty + if (!serial && !imeis && !description) return null; + 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(',')} +
+ {/* Serial + IMEIs on the same row */} + {(serial || imeis) && ( +
+ {serial &&
{serial}
} + {imeis &&
{imeis}
} +
+ )} + + {/* Description on new line */} + {description &&
{description}
}
); - }) - : ''} + })} +
) : (
@@ -3521,7 +3511,7 @@ const Printstyle12 = ({ ? item?.BrandName : ''}   - {item?.ProductIdentifierDtls?.length > 0 + {/* {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( (items) => !( @@ -3550,7 +3540,32 @@ const Printstyle12 = ({
); }) - : ''} + : ''} */} +
+ {item?.ProductIdentifierDtls?.map((detail, index) => { + const serial = detail.SerialNumber?.trim(); + const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', '); + const description = detail.Description?.trim(); + + // Skip empty entries + if (!serial && !imeis && !description) return null; + + return ( +
+ {/* Serial + IMEIs in one row */} + {(serial || imeis) && ( +
+ {serial &&
{serial}
} + {imeis &&
{imeis}
} +
+ )} + + {/* Description on new line */} + {description &&
{description}
} +
+ ); + })} +
)} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx index 9ca5fa0..1ae85a3 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx @@ -466,8 +466,8 @@ const Printstyle2 = ({ }} > Estimate Bill{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )} {table2Data?.OrderType === 'E' ? ( @@ -490,8 +490,8 @@ const Printstyle2 = ({ ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '}   Bill{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */} )} @@ -510,7 +510,13 @@ const Printstyle2 = ({
{GlobaldummyData ? formattedDate : Date1} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} + +
}
+
@@ -722,38 +728,50 @@ const Printstyle2 = ({ ? 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?.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?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber || items.IMEI1 || items.IMEI2 + )?.map((a, i) => ( + {a.Description} + )) + + : ''} +
+ )} @@ -3092,8 +3110,8 @@ const Printstyle2 = ({ }} > Estimate Bill{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )} {table2Data?.OrderType === 'E' ? ( @@ -3117,8 +3135,8 @@ const Printstyle2 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */} )} @@ -3308,34 +3326,41 @@ const Printstyle2 = ({ ? 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?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber && + items.SerialNumber !== '' + ).map((a, i) => ( +
{a.SerialNumber}
+ )) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (id) => id.IMEI1 !== '' || id.IMEI2 !== '' + ).map((id, i) => { + const imei1 = id.IMEI1 || ''; + const imei2 = id.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber || items.IMEI1 || items.IMEI2 + )?.map((a, i) => ( + {a.Description} + )) + + : ''} +
)} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx index 63321b5..acba1e3 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx @@ -228,18 +228,28 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan {table2Data?.BrGSTIN &&
GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},
}
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
- {table2Data?.OrderType === "E" && estimateTitle &&
Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} - {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} + {table2Data?.OrderType === "E" && estimateTitle &&
Estimate Bill + {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} +
} + {table2Data?.OrderType === "E" ? "" :
{GlobaldummyData ? 'Cash Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""} + {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} +
} )} - {(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) &&
Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} + {(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) &&
Estimate Bill + {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} +
}
BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
{GlobaldummyData ? formattedDate : Date1}
@@ -289,14 +299,41 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan ) )}   {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?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber && + items.SerialNumber !== '' + ).map((a, i) => ( +
{a.SerialNumber}
+ )) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (id) => id.IMEI1 !== '' || id.IMEI2 !== '' + ).map((id, i) => { + const imei1 = id.IMEI1 || ''; + const imei2 = id.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber || items.IMEI1 || items.IMEI2 + )?.map((a, i) => ( + {a.Description} + )) + + : ''} +
} {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} @@ -1155,16 +1192,27 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan {table2Data?.BrGSTIN &&
GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},
}
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}
- {table2Data?.OrderType === "E" && estimateTitle &&
Estimate Bill {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'})`}
} + {table2Data?.OrderType === "E" && estimateTitle &&
Estimate Bill + {/* {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" && estimateTitle) &&
Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
} + {(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) &&
Estimate Bill + {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} +
}
BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} + +
}
{GlobaldummyData ? formattedDate : Date1}
@@ -1210,14 +1258,41 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan ) )}   {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?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber && + items.SerialNumber !== '' + ).map((a, i) => ( +
{a.SerialNumber}
+ )) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (id) => id.IMEI1 !== '' || id.IMEI2 !== '' + ).map((id, i) => { + const imei1 = id.IMEI1 || ''; + const imei2 = id.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber || items.IMEI1 || items.IMEI2 + )?.map((a, i) => ( + {a.Description} + )) + + : ''} +
} {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx index 435e7ae..4f302dd 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx @@ -90,6 +90,7 @@ const Printstyle4 = ({ const GlobalHsnCode = useSelector(GlobalprintHsnCode); const GlobalQrcodet = useSelector(GlobalprintQrcodet); const GlobaldummyData = useSelector(GlobalPritdummyData); + console.log(GlobaldummyData, "GlobaldummyData") const GlobalSignature = useSelector(GlobalprintSignature); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobalSignatureImages = useSelector(GlobalSignatureImage); @@ -113,7 +114,7 @@ const Printstyle4 = ({ {} ), ]; - console.log(table2Data, 'table2Data'); + console.log(table2Data, 'eeeeeeeeeeeeeeee'); const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -196,6 +197,7 @@ const Printstyle4 = ({ const TakeawayData = table2Data?.productDetails?.filter( (item) => item.BookingTypeName?.toLowerCase() === 'takeaway' ); + console.log(TakeawayData, "TakeawayData") const DineInData = table2Data?.productDetails?.filter( (item) => item.BookingTypeName?.toLowerCase() === 'dine in' ); @@ -342,6 +344,8 @@ const Printstyle4 = ({ ? paginatedChunks[paginatedChunks.length - 1].length : 0; const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10); + + console.log(paginatedChunks, 'paginatedChunks') return ( <> {FormatTheme ? ( @@ -486,7 +490,14 @@ const Printstyle4 = ({ >
Dt: {GlobaldummyData ? formattedDate : Date1} + + {SalesModePref?.SettingValue == 'Y' && +
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
+
Bill No : {GlobaldummyData @@ -506,8 +517,8 @@ const Printstyle4 = ({ style={{ textTransform: 'uppercase', fontSize: '12px' }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -525,8 +536,8 @@ const Printstyle4 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )}
@@ -695,192 +706,135 @@ const Printstyle4 = ({ {dataChunk?.map((item, index) => { + + const identifiers = item?.ProductIdentifierDtls ?? []; + + const serials = identifiers + .filter(d => d.SerialNumber) + .map(d => d.SerialNumber); + + const imeis = identifiers + .filter(d => d.IMEI1 || d.IMEI2) + .map(d => [d.IMEI1, d.IMEI2].filter(Boolean).join(", ")); + + const descriptions = identifiers + .filter(d => d.Description) + .map(d => d.Description); + + const packageList = PackageDetails?.filter( + pkg => pkg.ProdId === item.ProdId + ) ?? []; + return ( + + {/* SL NO */} {GlobaldummyData ? GlobalSlNo && {index + 1} - : SLNO && ( - - {chunkIndex * chunkSize + index + 1} - - )} + : SLNO && {chunkIndex * chunkSize + index + 1} + } + + {/* ITEM COLUMN */} {GlobaldummyData ? GlobalItem && {item?.ProdName} : Item && ( + {/* Product Name */}
{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?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => - items.SerialNumber - ) - .map( - (a, index) => - ` ${a.SerialNumber}` - ) - .join('') - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 || item1.IMEI2 - ) - .map((item2, index) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ` ${[imei1, imei2].filter(Boolean).join(',')}`; - }) - .join('') - : '') - ).trim()} + {/* Package OR Size */} + {packageList.length > 0 ? ( +
+ {packageList.map((pkg, i) => ( +
+ {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) +
+ ))}
) : (
- {( - (item?.Size || '1') + - (item?.SinglePc === 'Y' - ? ' PCS' - : item?.Type !== 'C' - ? ` ${item?.UomName}` - : ' COMBO') + - (item?.BrandName - ? ` ${item?.BrandName}` - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => - items.SerialNumber - ) - .map( - (a, index) => - ` ${a.SerialNumber}` - ) - .join('') - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 || item1.IMEI2 - ) - .map((item2, index) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ` ${[imei1, imei2].filter(Boolean).join(',')}`; - }) - .join('') - : '') - ).trim()} + {(item?.Size || "1")}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"}{" "} + {item?.BrandName || ""}
)} - - )} - {GlobaldummyData - ? GlobalQuantity && ( - - {item?.SalesQty} - - ) - : Quantity && ( - - {item?.SalesQty} - - )} - {GlobaldummyData - ? GlobalHsnCode && ( - - {item?.HSN} - - ) - : HsnCode && ( - - {item?.HSN} - - )} - {GlobaldummyData - ? GlobalMRP && ( - - {item?.MRP} - - ) - : MRP && ( - - {item?.SinglePc === 'Y' - ? item?.Rate - : item?.MRP} - - )} - {GlobaldummyData - ? GlobalDiscount && ( - - {item.discount} - - ) - : Discount && ( - - {item?.Type != 'C' - ? item?.OfferAmt || 0 - : item?.OfferValue || 0} - - )} - {GlobaldummyData - ? GlobalRate && ( - - {item?.Rate} + {/* Serials */} + {serials.map((s, i) => ( +
{s}
+ ))} + + {/* IMEIs */} + {imeis.map((iVal, i) => ( +
{iVal}
+ ))} + + {/* Description - Always New Line */} + + + {descriptions.map((d, i) => ( +
{d}
+ ))} ) - : Rate && ( - - {item?.Rate} - - )} - {GlobaldummyData - ? GlobalAmount && ( - - {item?.TotalAmt} - - ) - : Amount && ( - - {' '} - {item?.Type != 'C' - ? item?.TotalAmt - item?.OfferAmt || 0 - : item?.TotalAmt - item?.OfferValue || - 0} - - )} + } + + {/* Quantity */} + {(GlobaldummyData ? GlobalQuantity : Quantity) && ( + + {item?.SalesQty} + + )} + + {/* HSN */} + {(GlobaldummyData ? GlobalHsnCode : HsnCode) && ( + + {item?.HSN} + + )} + + {/* MRP */} + {(GlobaldummyData ? GlobalMRP : MRP) && ( + + {item?.SinglePc === "Y" ? item?.Rate : item?.MRP} + + )} + + {/* Discount */} + {(GlobaldummyData ? GlobalDiscount : Discount) && ( + + {item?.Type !== "C" + ? item?.OfferAmt || 0 + : item?.OfferValue || 0} + + )} + + {/* Rate */} + {(GlobaldummyData ? GlobalRate : Rate) && ( + + {item?.Rate} + + )} + + {/* Amount */} + {(GlobaldummyData ? GlobalAmount : Amount) && ( + + {item?.Type !== "C" + ? (item?.TotalAmt || 0) - (item?.OfferAmt || 0) + : (item?.TotalAmt || 0) - (item?.OfferValue || 0)} + + )} + ); })} @@ -3188,7 +3142,16 @@ const Printstyle4 = ({ justifyContent: 'space-between', }} > -
Dt: {GlobaldummyData ? formattedDate : Date1}
+
+ Dt: {GlobaldummyData ? formattedDate : Date1} + + {SalesModePref?.SettingValue == 'Y' && +
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
} +
+
Bill No : {GlobaldummyData @@ -3207,8 +3170,8 @@ const Printstyle4 = ({ style={{ textTransform: 'uppercase', fontSize: '12px' }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -3228,8 +3191,8 @@ const Printstyle4 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
@@ -3363,200 +3326,104 @@ const Printstyle4 = ({ : Item && (
{item?.ProdName}
+ + {/* 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 ALWAYS NEW LINE */} + {item?.ProductIdentifierDtls + ?.filter(d => d.Description) + ?.map((d, i) => ( +
+ {d.Description} +
+ ))} )} {GlobaldummyData ? GlobalQuantity && ( {item?.SalesQty} -
- {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?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => items.SerialNumber - ) - .map( - (a, index) => - ` ${a.SerialNumber}` - ) - .join('') - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 || item1.IMEI2 - ) - .map((item2, index) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ` ${[imei1, imei2].filter(Boolean).join(',')}`; - }) - .join('') - : '') - ).trim()} +
+ + {/* 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 NEW LINE */} + {item?.ProductIdentifierDtls + ?.filter(d => d.Description) + ?.map((d, i) => ( +
+ {d.Description} +
+ ))} +
) : (
- {( - (item?.Size || '1') + - (item?.SinglePc === 'Y' - ? ' PCS' - : item?.Type !== 'C' - ? ` ${item?.UomName}` - : ' COMBO') + - (item?.BrandName - ? ` ${item?.BrandName}` - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => items.SerialNumber - ) - .map( - (a, index) => - ` ${a.SerialNumber}` - ) - .join('') - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 || item1.IMEI2 - ) - .map((item2, index) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ` ${[imei1, imei2].filter(Boolean).join(',')}`; - }) - .join('') - : '') - ).trim()} + {(item?.Size || '1')}{" "} + {item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO'}{" "} + {item?.BrandName || ""}
)} +
) : Quantity && ( {item?.SalesQty} - {/*
- {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?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => items.SerialNumber - ) - .map( - (a, index) => - ` ${a.SerialNumber}` - ) - .join('') - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 || item1.IMEI2 - ) - .map((item2, index) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ` ${[imei1, imei2].filter(Boolean).join(',')}`; - }) - .join('') - : '') - ).trim()} -
- ) : ( -
- {( - (item?.Size || '1') + - (item?.SinglePc === 'Y' - ? ' PCS' - : item?.Type !== 'C' - ? ` ${item?.UomName}` - : ' COMBO') + - (item?.BrandName - ? ` ${item?.BrandName}` - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (items) => items.SerialNumber - ) - .map( - (a, index) => - ` ${a.SerialNumber}` - ) - .join('') - : '') + - (item?.ProductIdentifierDtls - ?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (item1) => - item1.IMEI1 || item1.IMEI2 - ) - .map((item2, index) => { - const imei1 = - item2.IMEI1 || ''; - const imei2 = - item2.IMEI2 || ''; - return ` ${[imei1, imei2].filter(Boolean).join(',')}`; - }) - .join('') - : '') - ).trim()} -
- )} -
*/} )} {GlobaldummyData @@ -3679,6 +3546,7 @@ const Printstyle4 = ({
)} + {DineInData?.length > 0 && ( <>
{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.filter( + (item1) => + item1.IMEI1 || item1.IMEI2 || item1.SerialNumber + ) + .map((item2) => { + return ` ${item2?.Description}`; + }) + .join('') + : '') + ).trim()} )} {GlobaldummyData @@ -3934,6 +3842,7 @@ const Printstyle4 = ({ )}
+
+ {/*
+
OVER ALL QTY
+
+ {GlobaldummyData + ? '1,066' + : Number(productsData?.reduce((a, b) => a + b.SalesQty, 0))} +
+
*/} +
+
+
ITEM :
+
+ {GlobaldummyData + ? '1,066' + : productsData?.length} +
+
+
+
QTY :
+
+ {GlobaldummyData + ? '1,066' + : Number(productsData?.reduce((a, b) => a + b.SalesQty, 0))} +
+
+ +
{/*
diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx index 52d8ee5..23f9ed6 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx @@ -437,8 +437,8 @@ const PrintStyle5 = ({ {table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} {table2Data?.OrderType === 'E' ? ( @@ -452,8 +452,8 @@ const PrintStyle5 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -465,8 +465,8 @@ const PrintStyle5 = ({ style={{ textTransform: 'uppercase', textAlign: 'center' }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -479,7 +479,13 @@ const PrintStyle5 = ({ }} > {' '} -
{GlobaldummyData ? formattedDate : Date1}
{' '} +
{GlobaldummyData ? formattedDate : Date1} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
} + +
{' '}
{' '} Bill No : @@ -696,85 +702,103 @@ const PrintStyle5 = ({ ) ) : ( <> -
{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?.ProductIdentifierDtls?.filter( - (items) => - items.SerialNumber && - items.SerialNumber !== '' - )?.map((a, index) => ( -
- {a.SerialNumber} -
- )) || '') + - (item?.ProductIdentifierDtls?.filter( - (item1) => item1.IMEI1 || item1.IMEI2 - )?.map((item2, index) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
- {[imei1, imei2] - .filter(Boolean) - .join(',')} + {(() => { + const identifiers = item?.ProductIdentifierDtls ?? []; + + const packageList = (PackageDetails ?? []).filter( + pkg => pkg.ProdId === item.ProdId + ); + + return ( + <> + {/* 🏷 Product Name */} +
{item?.ProdName}
+ + {packageList.length > 0 ? ( + // ================= PACKAGE EXISTS ================= +
+ + {/* 📦 Package Details */} + {packageList.map((pkg, index) => ( +
+ {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) +
+ ))} + + {/* 🔢 Identifiers (Serial / IMEI / Description) */} + {identifiers.map((d, i) => { + const serial = d.SerialNumber; + const imei = [d.IMEI1, d.IMEI2].filter(Boolean).join(", "); + const description = d.Description; + + if (!serial && !imei && !description) return null; + + return ( +
+ {serial &&
{serial}
} + {imei &&
{imei}
} + {description &&
{description}
} +
+ ); + })} + + {/* 🔢 Quantity */} +
+ {GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty}
- ); - }) || '') + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
- ) : ( -
- {(item?.Size || '1') + - (item?.SinglePc === 'Y' - ? 'PCS' - : item?.Type !== 'C' - ? item?.UomName - : 'COMBO') + - (item?.BrandName || '') + - (item?.ProductIdentifierDtls?.filter( - (items) => - items.SerialNumber && - items.SerialNumber !== '' - )?.map((a, index) => ( -
- {a.SerialNumber} +
- )) || '') + - (item?.ProductIdentifierDtls?.filter( - (item1) => item1.IMEI1 || item1.IMEI2 - )?.map((item2, index) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; - return ( -
- {[imei1, imei2] - .filter(Boolean) - .join(',')} + ) : ( + // ================= NO PACKAGE ================= +
+ + {/* 📏 Size + UOM */} +
+ {(item?.Size || "1")}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"}
- ); - }) || '') + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
- )} + + {/* 🏷 Brand */} + {item?.BrandName && ( +
{item.BrandName}
+ )} + + {/* 🔢 Identifiers (Serial / IMEI / Description) */} + {identifiers.map((d, i) => { + const serial = d.SerialNumber; + const imei = [d.IMEI1, d.IMEI2].filter(Boolean).join(", "); + const description = d.Description; + + if (!serial && !imei && !description) return null; + + return ( +
+ {serial &&
{serial}
} + {imei &&
{imei}
} + {description &&
{description}
} +
+ ); + })} + + {/* 🔢 Quantity */} +
+ - + {GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty} +
+ +
+ )} + + ); + })()} )}
@@ -2729,8 +2753,8 @@ const PrintStyle5 = ({ {table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} {table2Data?.OrderType === 'E' ? ( @@ -2746,8 +2770,8 @@ const PrintStyle5 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -2757,8 +2781,8 @@ const PrintStyle5 = ({ {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -2772,7 +2796,12 @@ const PrintStyle5 = ({ }} > {' '} -
{GlobaldummyData ? formattedDate : Date1}
{' '} +
{GlobaldummyData ? formattedDate : Date1} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
} +
{' '}
{' '} Bill No : @@ -2978,88 +3007,104 @@ const PrintStyle5 = ({ ) ) : ( <> + {/* 🏷 Product Name */}
{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 || '') + - (item?.ProductIdentifierDtls?.filter( - (items) => - items.SerialNumber && - items.SerialNumber !== '' - )?.map((a, index) => ( -
- {a.SerialNumber} -
- )) || '') + - (item?.ProductIdentifierDtls?.filter( - (item1) => item1.IMEI1 || item1.IMEI2 - )?.map((item2, index) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; + {(() => { + const packages = + (PackageDetails ?? []).filter(pkg => pkg.ProdId === item.ProdId); + + const identifiers = item?.ProductIdentifierDtls ?? []; + + return packages.length > 0 ? ( + // ================= PACKAGE EXISTS ================= +
+ {/* 📦 Package Details */} + {packages.map((pkg, index) => ( + + {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) + + ))} + + {/* 🏷 Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* 🔢 Serial / IMEI / Description */} + {identifiers.map((d, i) => { + const values = [ + d.SerialNumber, + d.IMEI1, + d.IMEI2, + d.Description + ].filter(Boolean); + + if (values.length === 0) return null; + return ( -
- {[imei1, imei2] - .filter(Boolean) - .join(',')} +
+ {values.join(", ")}
); - }) || '') + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
- ) : ( -
- {(item?.Size || '1') + - (item?.SinglePc === 'Y' - ? 'PCS' - : item?.Type !== 'C' - ? item?.UomName - : 'COMBO') + - (item?.BrandName || '') + - (item?.ProductIdentifierDtls?.filter( - (items) => - items.SerialNumber && - items.SerialNumber !== '' - )?.map((a, index) => ( -
- {a.SerialNumber} -
- )) || '') + - (item?.ProductIdentifierDtls?.filter( - (item1) => item1.IMEI1 || item1.IMEI2 - )?.map((item2, index) => { - const imei1 = item2.IMEI1 || ''; - const imei2 = item2.IMEI2 || ''; + })} + + {/* 🧪 Debug / Extra Text */} +
ssd3
+ + {/* 🔢 Quantity */} +
+ - + {GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty} +
+
+ ) : ( + // ================= NO PACKAGE ================= +
+ {/* 📏 Size + UOM */} +
+ {(item?.Size || "1")} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} +
+ + {/* 🏷 Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* 🔢 Serial / IMEI / Description */} + {identifiers.map((d, i) => { + const values = [ + d.SerialNumber, + d.IMEI1, + d.IMEI2, + d.Description + ].filter(Boolean); + + if (values.length === 0) return null; + return ( -
- {[imei1, imei2] - .filter(Boolean) - .join(',')} +
+ {values.join(", ")}
); - }) || '') + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
- )} + })} + + {/* 🧪 Debug / Extra Text */} +
ssd4
+ + {/* 🔢 Quantity */} +
+ - + {GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty} +
+
+ ); + })()} )}
diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx index edb1308..16d0ed3 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx @@ -63,7 +63,7 @@ const Printstyle6 = ({ sportsAppPreference, MembershipApplied = null, }) => { - console.log(table2Data, 'table2Data'); + console.log(table2Data, 'table2Data22222222222222'); const dispatch = useDispatch(); const GlobalUpiID = useSelector(GlobalUpiIDprint); const FieldDetails = useSelector(GloabalFieldDetails); @@ -455,8 +455,8 @@ const Printstyle6 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -477,8 +477,8 @@ const Printstyle6 = ({ : PaymentStatus?.length === 1 ? PaymentStatus?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */}
)}
@@ -493,8 +493,8 @@ const Printstyle6 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
{Date1}

@@ -763,34 +767,67 @@ const Printstyle6 = ({ <> {Item && ( <> - {item?.ProdName} - {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}) + {/* 🏷 Product Name */} +
{item?.ProdName}
+ + {/* 📦 Package OR Size */} + {(() => { + const packageList = (PackageDetails ?? []).filter( + pkg => pkg.ProdId === item.ProdId + ); + + if (packageList.length > 0) { + return packageList.map((pkg, index) => ( +
+ {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) +
+ )); + } + + return ( +
+ ({item?.Size || "1"} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + )
- )) - ) : ( - - ({item?.Size ? item?.Size : '1'} - {item?.SinglePc === 'Y' - ? 'PCS' - : item?.Type !== 'C' - ? item?.UomName - : 'COMBO'} - ) - - )} - {' - '} - {Quantity && item?.SalesQty} + ); + })()} + + {/* 🔢 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 (Always New Line) */} + {(item?.ProductIdentifierDtls ?? []) + .filter(d => d.SerialNumber || d.IMEI1 || d.IMEI2 || d.Description) + .map((d, i) => ( +
+ {d.Description} +
+ ))} + + {/* 🔢 Quantity */} +
+ - {Quantity && item?.SalesQty} +
)} @@ -1111,55 +1148,53 @@ const Printstyle6 = ({ ) : ( - {(GlobaldummyData - ? GlobalItem && - item?.ProdName + - `(${item?.Size + item?.UomName})` - : Item && - item?.ProdName + - `(${item?.Size ? item?.Size : '1'}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`) + - item?.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 - : Quantity && item?.SalesQty)} + {/* 🏷 Product Name + Size */} +
+ {GlobaldummyData + ? GlobalItem && + `${item?.ProdName} (${item?.Size}${item?.UomName})` + : Item && + `${item?.ProdName} (${item?.Size ? item.Size : "1"}${item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO" + })`} +
+ + {/* 🏷 Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* 🔢 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(", ")} +
+ ))} + {(item?.ProductIdentifierDtls ?? []) + .filter(d => d.IMEI1 || d.IMEI2 || d.SerialNumber) + .map((d, i) => ( +
{d.Description}
+ ))} + + {/* 🔢 Quantity */} +
+ - + {GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : Quantity && item?.SalesQty} +
)} {GlobaldummyData @@ -3311,8 +3346,8 @@ const Printstyle6 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -3335,8 +3370,8 @@ const Printstyle6 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
@@ -3352,8 +3387,8 @@ const Printstyle6 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
{Date1}

@@ -3822,50 +3861,69 @@ const Printstyle6 = ({ ) : ( - {(GlobaldummyData - ? GlobalItem && - item?.ProdName + - `(${item?.Size + item?.UomName})` - : Item && - item?.ProdName + - `(${item?.Size ? item?.Size : '1'}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`) + - item?.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(',')} + {(() => { + const identifiers = item?.ProductIdentifierDtls ?? []; + + const sizeText = GlobaldummyData + ? GlobalItem && + `${item?.ProdName} (${item?.Size}${item?.UomName})` + : Item && + `${item?.ProdName} (${item?.Size || "1"}${item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO" + })`; + + return ( + <> + {/* 🏷 Product Name + Size */} +
{sizeText}
+ + {/* 🏷 Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* 🔢 Serial Numbers */} + {identifiers + .filter(d => d.SerialNumber) + .map((d, i) => ( +
+ {d.SerialNumber}
- ); - }) - : '' + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : Quantity && item?.SalesQty)} + ))} + + {/* 📱 IMEI Numbers */} + {identifiers + .filter(d => d.IMEI1 || d.IMEI2) + .map((d, i) => ( +
+ {[d.IMEI1, d.IMEI2].filter(Boolean).join(", ")} +
+ ))} + + {/* 📝 Description (only if Serial or IMEI exists) */} + {identifiers + .filter(d => d.SerialNumber || d.IMEI1 || d.IMEI2 || d.Description) + .map((d, i) => + d.Description ? ( +
+ {d.Description} +
+ ) : null + )} + + {/* 🔢 Quantity */} +
+ - + {GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : Quantity && item?.SalesQty} +
+ + ); + })()} )} {GlobaldummyData diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx index a579908..73bb4a4 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx @@ -468,8 +468,8 @@ const PrintStyle7 = ({ > {' '} Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} {table2Data?.OrderType === 'E' ? ( @@ -489,8 +489,8 @@ const PrintStyle7 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
@@ -506,8 +506,8 @@ const PrintStyle7 = ({ > {' '} Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )}
@@ -527,6 +527,10 @@ const PrintStyle7 = ({ table2Data?.FYStatus )} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
)} +
+ {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber) + .map((a, i) => ( +
+ {a.SerialNumber} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(id => id.IMEI1 || id.IMEI2) + .map((id, i) => ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) + .map((a, i) => + a.Description ? ( +
+ {a.Description} +
+ ) : null + )} +
)} {GlobaldummyData @@ -898,63 +929,59 @@ const PrintStyle7 = ({ {chunkIndex * chunkSize + index + 1} )} - {GlobaldummyData - ? GlobalItem && {item?.ProdName} - : Item == true && ( + {GlobaldummyData ? ( + GlobalItem && {item?.ProdName} + ) : ( + Item === true && ( + {/* 🏷 Product Name */}
{item?.ProdName}
+ + {/* 📦 Size + Brand */}
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" ? item?.UomName - : 'COMBO'} + : "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?.BrandName ? ` ${item.BrandName}` : ""} +
+ + {/* 🔢 Identifiers */} +
+ {(item?.ProductIdentifierDtls ?? []).map((data, i) => { + const hasSerial = data.SerialNumber; + const hasIMEI = data.IMEI1 || data.IMEI2; + + return ( +
+ {hasSerial &&
{data.SerialNumber}
} + + {hasIMEI && ( +
+ {[data.IMEI1, data.IMEI2] + .filter(Boolean) + .join(",")} +
+ )} + + {(hasSerial || hasIMEI) && data.Description && ( +
{data.Description}
+ )} +
+ ); + })}
- )} + ) + )} {GlobaldummyData ? GlobalHsnCode && ( @@ -2923,8 +2950,8 @@ const PrintStyle7 = ({ > {' '} Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} {table2Data?.OrderType === 'E' ? ( @@ -2946,8 +2973,8 @@ const PrintStyle7 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -2963,8 +2990,8 @@ const PrintStyle7 = ({ > {' '} Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )}
@@ -2983,7 +3010,12 @@ const PrintStyle7 = ({ table2Data?.OrderId, table2Data?.FYStatus )} + + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
)} +
+ {(item?.ProductIdentifierDtls ?? []).filter( + items => items.SerialNumber && items.SerialNumber !== "" + ).map((a, i) => ( +
{a.SerialNumber}
+ ))} + + {(item?.ProductIdentifierDtls ?? []).filter( + id => id.IMEI1 || id.IMEI2 + ).map((id, i) => ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []).filter( + items => items.SerialNumber || items.IMEI1 || items.IMEI2 + ).map((a, i) => ( + a.Description && ( +
+ {a.Description} +
+ ) + ))} +
)} {GlobaldummyData @@ -3342,34 +3399,29 @@ const PrintStyle7 = ({ ? 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?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber) + .map((a, i) => ( +
{a.SerialNumber}
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(id => id.IMEI1 || id.IMEI2) + .map((id, i) => ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
- ); - }) - : ''} + ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) + .map((a, i) => + a.Description ? ( +
{a.Description}
+ ) : null + )} +
)} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx index c188e0f..408daaa 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx @@ -484,8 +484,8 @@ const Printstyle8 = ({ style={{ textTransform: 'uppercase', fontWeight: '600' }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -503,8 +503,8 @@ const Printstyle8 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -519,7 +519,11 @@ const Printstyle8 = ({ table2Data?.FYStatus )} -
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
} +
{GlobaldummyData ? formattedDate : Date1}
@@ -779,6 +783,41 @@ const Printstyle8 = ({ ) )} +
+ {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber && + items.SerialNumber !== '' + ).map((a, i) => ( +
{a.SerialNumber}
+ )) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (id) => id.IMEI1 !== '' || id.IMEI2 !== '' + ).map((id, i) => { + const imei1 = id.IMEI1 || ''; + const imei2 = id.IMEI2 || ''; + return ( +
+ {[imei1, imei2] + .filter(Boolean) + .join(',')} +
+ ); + }) + : ''} + {item?.ProductIdentifierDtls?.length > 0 + ? item?.ProductIdentifierDtls.filter( + (items) => + items.SerialNumber || items.IMEI1 || id.IMEI2 + )?.map((a, i) => ( + {a.Description} + )) + + : ''} +
)} {GlobaldummyData @@ -1106,38 +1145,33 @@ const Printstyle8 = ({ ? 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?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber) + .map((a, i) => ( +
+ {a.SerialNumber}
- ); - }) - : ''} + ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(id => id.IMEI1 || id.IMEI2) + .map((id, i) => ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) + .map((a, i) => + a.Description ? ( +
+ {a.Description} +
+ ) : null + )} +
)} @@ -3287,8 +3321,8 @@ const Printstyle8 = ({ style={{ textTransform: 'uppercase', fontWeight: '600' }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )} @@ -3308,8 +3342,8 @@ const Printstyle8 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )} @@ -3324,7 +3358,11 @@ const Printstyle8 = ({ table2Data?.FYStatus )} -
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
} +
{GlobaldummyData ? formattedDate : Date1}
@@ -3727,59 +3765,63 @@ const Printstyle8 = ({ {index + 1} )} - {GlobaldummyData - ? GlobalItem && {item?.ProdName} - : Item && ( + {GlobaldummyData ? ( + GlobalItem && {item?.ProdName} + ) : ( + Item && ( + {/* 🏷 Product Name */}
{item?.ProdName}
+ + {/* 📦 Size */}
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" ? item?.UomName - : 'COMBO'} + : "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(',')} -
- ); - }) - : ''} +
+ + {/* 🏷 Brand */} + {item?.BrandName && ( +
{item.BrandName}
+ )} + + {/* 🔢 Identifiers */} +
+ {(item?.ProductIdentifierDtls ?? []).map((data, i) => { + const hasSerial = data.SerialNumber; + const hasIMEI = data.IMEI1 || data.IMEI2; + + return ( +
+ {hasSerial &&
{data.SerialNumber}
} + + {hasIMEI && ( +
+ {[data.IMEI1, data.IMEI2] + .filter(Boolean) + .join(",")} +
+ )} + + {(hasSerial || hasIMEI) && data.Description && ( +
{data.Description}
+ )} +
+ ); + })}
- )} + ) + )} {GlobaldummyData ? GlobalHsnCode && {item?.HSN} : HsnCode && {item?.HSN}} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx index c2360d1..d0c58bf 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx @@ -485,8 +485,8 @@ const PrintStyle9 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )} @@ -508,8 +508,8 @@ const PrintStyle9 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )}
@@ -524,6 +524,10 @@ const PrintStyle9 = ({ table2Data?.FYStatus )}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
{' '} {GlobaldummyData ? formattedDate : Date1}{' '} @@ -543,8 +547,8 @@ const PrintStyle9 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
@@ -705,113 +709,75 @@ const PrintStyle9 = ({ {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 > - 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(',')} + + {(() => { + const packages = + PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId) || []; + + const identifiers = item?.ProductIdentifierDtls || []; + + return packages.length > 0 ? ( +
+ {/* Package Details */} + {packages.map((pkg, i) => ( + + {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) + + ))} + + {item?.BrandName || ""} + + {/* Identifiers */} +
+ {identifiers.map((id, i) => ( +
+ {id.SerialNumber &&
{id.SerialNumber}
} + {(id.IMEI1 || id.IMEI2) && ( +
{[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
+ )} + {(id.SerialNumber || id.IMEI1 || id.IMEI2) && id.Description && ( +
{id.Description}
+ )}
- ); - }) - : ''} -
- ) : ( -
- ({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(',')} -
- ); - }) - : ''} -
- )} + ))} +
+
+ ) : ( +
+ {/* Size + UOM */} + ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + ) + + {item?.BrandName || ""} + + {/* Identifiers */} + {identifiers.map((id, i) => ( +
+ {id.SerialNumber &&
{id.SerialNumber}
} + + {(id.IMEI1 || id.IMEI2) && ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ )} + + {(id.SerialNumber || id.IMEI1 || id.IMEI2) && + id.Description && ( +
{id.Description}
+ )} +
+ ))} +
+ ); + })()} )} {GlobaldummyData @@ -3226,8 +3192,8 @@ const PrintStyle9 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -3251,8 +3217,8 @@ const PrintStyle9 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )} @@ -3273,6 +3239,10 @@ const PrintStyle9 = ({ table2Data?.FYStatus )} + {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
{' '} {GlobaldummyData ? formattedDate : Date1}{' '} @@ -3292,8 +3262,8 @@ const PrintStyle9 = ({ }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
@@ -3438,34 +3408,33 @@ const PrintStyle9 = ({ ? 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?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber) + .map((a, i) => ( +
+ {a.SerialNumber}
- ); - }) - : ''} + ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(id => id.IMEI1 || id.IMEI2) + .map((id, i) => ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) + .map((a, i) => + a.Description ? ( +
+ {a.Description} +
+ ) : null + )} +
)} diff --git a/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx b/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx index c60e4a2..02c3ce5 100644 --- a/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx +++ b/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx @@ -125,7 +125,7 @@ const PaymentPdfBooking = ({ const [BranchZip, setBranchZip] = useState(); const CashierName = getSession('userName'); const printerTemplateStyle = useSelector(SelectedPrintTemplate); - console.log(printerTemplateStyle, 'printerTemplateStyle'); + console.log(printerTemplateStyle, "printerTemplateStyle") const appPreferences = useSelector(ApplicationPreferences); const SettingData = useSelector(PreferenceData); const estimatePrintHeader = @@ -562,92 +562,53 @@ const PaymentPdfBooking = ({ {item?.ProdName} - {PackageDetails?.filter( - (pkg) => pkg.ProdId === item.ProdId - ).length > 0 ? ( + {/* 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}) - - ))} - - ( - {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 !== '' - ).map((a, i) => ( -
{a.SerialNumber}
- )) - : ''} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (id) => id.IMEI1 !== '' || id.IMEI2 !== '' - ).map((id, i) => { - const imei1 = id.IMEI1 || ''; - const imei2 = id.IMEI2 || ''; - return ( -
- {[imei1, imei2] - .filter(Boolean) - .join(',')} -
- ); - }) - : ''} -
+ {PackageDetails + ?.filter(pkg => pkg.ProdId === item.ProdId) + ?.map((pkg, index) => ( + + {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) + + ))}
- ) : ( - - ({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 !== '' - ).map((a, i) => ( -
{a.SerialNumber}
- )) - : ''} - {item?.ProductIdentifierDtls?.length > 0 - ? item?.ProductIdentifierDtls.filter( - (id) => id.IMEI1 !== '' || id.IMEI2 !== '' - ).map((id, i) => { - const imei1 = id.IMEI1 || ''; - const imei2 = id.IMEI2 || ''; - return ( -
- {[imei1, imei2].filter(Boolean).join(',')} -
- ); - }) - : ''} -
)} + {/* Size, UOM, Brand */} +
+ ({item?.Size ?? '1'}{" "} + {item?.SinglePc === 'Y' ? "PCS" : item?.Type !== 'C' ? item?.UomName : "COMBO"} + ) {item?.BrandName || ""} +
+ + {/* Product Identifiers */} + {item?.ProductIdentifierDtls?.map((detail, index) => { + const serial = detail.SerialNumber?.trim(); + const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(", "); + const description = detail.Description?.trim(); + + if (!serial && !imeis && !description) return null; + + return ( +
+ {/* Serial + IMEIs */} + {(serial || imeis) && ( +
+ {serial &&
{serial}
} + {imeis &&
{imeis}
} +
+ )} + + {/* Description */} + {description &&
{description}
} +
+ ); + })} + + {/* Available Time */} {sportsAppPreference && - `(${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`} + `(${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`} {item?.SalesQty} {item?.Rate} From e7bda2a80fab5d1ee870f7f4e42d554e4d816898 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Mon, 2 Mar 2026 13:59:59 +0530 Subject: [PATCH 5/8] add description --- .../ThermalPrinter/PrintStyle10.jsx | 218 +++++++----------- 1 file changed, 82 insertions(+), 136 deletions(-) diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx index 59dae4a..e7b76a2 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx @@ -461,8 +461,8 @@ const PrintStyle10 = ({ {table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -477,8 +477,8 @@ const PrintStyle10 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )} @@ -491,8 +491,8 @@ const PrintStyle10 = ({ style={{ textTransform: 'uppercase', textAlign: 'center' }} > Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */} )}
+ {SalesModePref?.SettingValue == 'Y' &&
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
@@ -715,84 +719,41 @@ const PrintStyle10 = ({ ? 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?.ProductIdentifierDtls?.map((id, i) => ( +
+ {id.SerialNumber &&
{id.SerialNumber}
} + {(id.IMEI1 || id.IMEI2) && ( +
{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}
+ )} + {id.Description &&
{id.Description}
} +
+ ))} +
) : ( -
- ({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(',')} -
- ); - }) - : ''} +
+ {/* Product size + brand */} +
+ ({item?.Size || '1'}{' '} + {item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO'} + ) {item?.BrandName || ''} +
+ + {/* Product identifiers */} + {item?.ProductIdentifierDtls?.map((id, i) => ( +
+ {id.SerialNumber &&
{id.SerialNumber}
} + {(id.IMEI1 || id.IMEI2) && ( +
{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}
+ )} + {id.Description &&
{id.Description}
} +
+ ))}
)} @@ -3121,8 +3082,8 @@ const PrintStyle10 = ({ {table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -3137,8 +3098,8 @@ const PrintStyle10 = ({ : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ''}{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)} @@ -3148,8 +3109,8 @@ const PrintStyle10 = ({ {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '} - {SalesModePref?.SettingValue == 'Y' && - `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} + {/* {SalesModePref?.SettingValue == 'Y' && + `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
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 > 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(',')} -
- ); - }) - : ''} -
+
+ {/* Package Details */} + {PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId).map((pkg, index) => ( +
+ {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) +
+ ))} + + {/* Brand */} + {item?.BrandName &&
{item.BrandName}
} + + {/* Product Identifiers */} + {item?.ProductIdentifierDtls?.map((id, i) => ( +
+ {id.SerialNumber &&
{id.SerialNumber}
} + {(id.IMEI1 || id.IMEI2) &&
{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}
} + {id.Description &&
{id.Description}
} +
+ ))} +
) : (
({item?.Size ? item?.Size : '1'}{' '} @@ -3370,7 +3305,7 @@ const PrintStyle10 = ({ ? item?.BrandName : ''}   - {item?.ProductIdentifierDtls?.length > 0 + {/* {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( (items) => !( @@ -3397,7 +3332,18 @@ const PrintStyle10 = ({
); }) - : ''} + : ''} */} +
+ {item?.ProductIdentifierDtls?.map((id, i) => ( +
+ {id.SerialNumber &&
{id.SerialNumber}
} + {(id.IMEI1 || id.IMEI2) && ( +
{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}
+ )} + {id.Description &&
{id.Description}
} +
+ ))} +
)} From b173fbc823899a354e5146c2b794c77b8d9d49c8 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Mon, 2 Mar 2026 18:28:33 +0530 Subject: [PATCH 6/8] Resolved merge conflicts --- .../ComboSalesBillTable.jsx | 44 +++--- .../PrintTemplates/A4/A4Standard.jsx | 43 ++--- .../PrintTemplates/A4/PrintA4Style11.jsx | 43 ++--- .../ThermalPrinter/PrintStyle1.jsx | 49 ++---- .../ThermalPrinter/PrintStyle11.jsx | 48 +++--- .../ThermalPrinter/PrintStyle12.jsx | 92 ++++++----- .../ThermalPrinter/PrintStyle2.jsx | 14 +- .../ThermalPrinter/PrintStyle3.jsx | 13 +- .../ThermalPrinter/PrintStyle4.jsx | 32 ++-- .../ThermalPrinter/PrintStyle5.jsx | 148 ++++++++++-------- .../ThermalPrinter/PrintStyle6.jsx | 140 +++++++++-------- .../ThermalPrinter/PrintStyle7.jsx | 43 ++--- .../ThermalPrinter/PrintStyle8.jsx | 114 ++++++-------- .../ThermalPrinter/PrintStyle9.jsx | 118 +++++++------- .../paymentpdfPage/PaymentPdfBooking.jsx | 13 +- 15 files changed, 489 insertions(+), 465 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx index e2d3a10..b2a4850 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx @@ -59,6 +59,7 @@ import { changePreviousOrderPayment, changePreviousOrderOfferDetail, GlobalSalesBillEdit, + changeCombofocus, } from '../../../../../Features/BookingScreen/BookingData/BookingData'; import { ChangeFullFreeProductList, @@ -93,6 +94,9 @@ const ComboSalesBillTable = () => { const removeProducts = useRemoveProducts(); const applyOffer = useApplyOfferto_CardDetail(); const preferenceDatas = useSelector(PreferenceData); + const UomPrint = preferenceDatas?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const preferenceDetails = preferenceDatas?.[0]?.SettingDtlDetails; const preferenceOffer = preferenceDetails?.find((item) => item.SettingIdName === 'Offer') @@ -1354,7 +1358,7 @@ const ComboSalesBillTable = () => { InwardDtlId: isPaidproduct?.InwardDtlId, BuyInwardDtlId: null, Offer: 0, - OrderRate: isPaidproduct?.OrderRate + OrderRate: isPaidproduct?.OrderRate, }); } else if (isPaidproduct?.OrderQty > item?.OrderQty) { // Just Decrease Paid Qty @@ -1526,7 +1530,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate: item?.OrderRate + OrderRate: item?.OrderRate, }); await ChangeFreeprodlistFn({ OverAllFreeQty: isCheckFreeProduct?.OverAllFreeQty, @@ -1605,7 +1609,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate: item?.OrderRate + OrderRate: item?.OrderRate, }); await ChangeFreeprodlistFn({ OverAllFreeQty: isCheckFreeProduct?.OverAllFreeQty, @@ -1639,7 +1643,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate: item?.OrderRate + OrderRate: item?.OrderRate, }); await ChangeOfferAppliedProdsFn({ inwardDtlId: item?.InwardDtlId, @@ -1671,7 +1675,7 @@ const ComboSalesBillTable = () => { InwardDtlId: isPaidProductAvailableInCart?.InwardDtlId, BuyInwardDtlId: null, Offer: 0, - OrderRate: isPaidProductAvailableInCart?.OrderRate + OrderRate: isPaidProductAvailableInCart?.OrderRate, }); } else if ( isPaidProductAvailableInCart?.OrderQty > item?.OrderQty @@ -1755,7 +1759,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate: item?.OrderRate + OrderRate: item?.OrderRate, }); await ChangeFreeprodlistFn({ OverAllFreeQty: freeProdList?.OverAllFreeQty, @@ -1782,7 +1786,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: null, Offer: item?.Offer, - OrderRate: item?.OrderRate + OrderRate: item?.OrderRate, }); await ChangeFreeprodlistFn({ OverAllFreeQty: freeProdList?.OverAllFreeQty, @@ -2119,7 +2123,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: item?.InwardDtlId, Offer: item?.Offer, - OrderRate: item?.OrderRate + OrderRate: item?.OrderRate, }); await ChangeFreeprodlistFn({ OverAllFreeQty: FreeProd?.OverAllFreeQty - item?.OrderQty, @@ -2138,7 +2142,7 @@ const ComboSalesBillTable = () => { InwardDtlId: item?.InwardDtlId, BuyInwardDtlId: item?.InwardDtlId, Offer: item?.Offer, - OrderRate: item?.OrderRate + OrderRate: item?.OrderRate, }); await ChangeFreeprodlistFn({ OverAllFreeQty: item?.OrderQty, @@ -2544,13 +2548,13 @@ const ComboSalesBillTable = () => { - (row.FullProductIdentifierDtls?.length > 0 || - row.ProductIdentifierDtls?.length > 0 || imeiModal) - + onClick={() => { + dispatch(changeCombofocus(true)); + row.FullProductIdentifierDtls?.length > 0 || + row.ProductIdentifierDtls?.length > 0 ? handleImeiDetails(row) - : editField && handleEditQuantity(row) - } + : editField && handleEditQuantity(row); + }} > {row?.Type !== 'OS' ? row.ProdName : row.ServiceName} {row?.BrandName ? ` ${row.BrandName}` : ''} @@ -2606,13 +2610,15 @@ const ComboSalesBillTable = () => { }} key={`qty-${index}`} tabIndex={0} - className={`${EditQtyCombo && row?.localId === Index + className={`${ + EditQtyCombo && row?.localId === Index ? 'EditQTYcomboTD' : 'qtyTd' } ${isActiveCell ? 'active-cell' : ''}`} - onClick={() => - editField && handleEditQuantityCombo(row) - } + onClick={() => { + dispatch(changeCombofocus(true)); + editField && handleEditQuantityCombo(row); + }} > {(!EditQtyCombo || row?.localId !== Index) && ( <>{row.OrderQty} diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx index 058aa16..a1c225b 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/A4Standard.jsx @@ -95,6 +95,9 @@ const InvoiceTemplate = ({ const GlobalBilltext = useSelector(GlobalBillName); const GlobalLogo = useSelector(GlobalprintLogo); const SettingData = useSelector(PreferenceData); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -1292,15 +1295,17 @@ const InvoiceTemplate = ({ ))} ) : ( -
- ({item?.Size || "1"}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) -
+ UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + ) +
+ ) )} {/* Brand */} @@ -2995,15 +3000,17 @@ const InvoiceTemplate = ({
{item?.ProdName}
{/* Size + UOM */} -
- ({item?.Size || "1"}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + ) +
+ )} {/* Brand */} {item?.BrandName &&
{item.BrandName}
} diff --git a/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx b/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx index e88680c..074d7ae 100644 --- a/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/A4/PrintA4Style11.jsx @@ -102,6 +102,9 @@ const PrintA4Style11 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -725,15 +728,17 @@ const PrintA4Style11 = ({ ))} ) : ( -
- ({item?.Size || "1"}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) -
+ UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + ) +
+ ) )} {item?.BrandName &&
{item.BrandName}
} @@ -1770,15 +1775,17 @@ const PrintA4Style11 = ({
{item?.ProdName}
{/* Size + UOM */} -
- ({item?.Size || "1"}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + ) +
+ )} {/* Brand */} {item?.BrandName &&
{item.BrandName}
} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.jsx index fb7d6e4..68e36ad 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.jsx @@ -128,6 +128,10 @@ const PrintStyle1 = ({ (setting) => setting?.SettingIdName?.toLowerCase() === 'estimatetitle' )?.SettingValue === 'Y'; + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; + const keysLength = Object.keys(table2Data ?? {}).length; const paymentTypeUPI = PaymentStatus?.find( @@ -775,6 +779,7 @@ const PrintStyle1 = ({ ))} ) : ( + UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -792,7 +797,7 @@ const PrintStyle1 = ({ } (${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`}  {' '} {item?.BrandName !== null - ?
{item?.BrandName}
+ ?
{item?.BrandName}
: ''}  
@@ -829,7 +834,7 @@ const PrintStyle1 = ({ (items) => items.SerialNumber || items.IMEI1 || items.IMEI2 )?.map((a, i) => ( - {a.Description} +
{a.Description}
)) : ''} @@ -1044,6 +1049,7 @@ const PrintStyle1 = ({ >
{item?.ProdName}
+ {UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -1053,6 +1059,7 @@ const PrintStyle1 = ({ : 'COMBO'} )
+} {sportsAppPreference && `${item?.BookingDate?.trim() ? `(${dateFormatChange(item.BookingDate)})` @@ -3991,6 +3998,7 @@ const PrintStyle1 = ({ ))}
) : ( + UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -4008,38 +4016,9 @@ const PrintStyle1 = ({ } (${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`}  {' '} {item?.BrandName !== null - ?
{item?.BrandName}
+ ? 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?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter( @@ -4070,7 +4049,7 @@ const PrintStyle1 = ({ (items) => items.SerialNumber || items.IMEI1 || items.IMEI2 )?.map((a, i) => ( - {a.Description} +
{a.Description}
)) : ''}
@@ -4264,6 +4243,7 @@ const PrintStyle1 = ({ >
{item?.ProdName}
+ {UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -4273,6 +4253,7 @@ const PrintStyle1 = ({ : 'COMBO'} )
+ } {sportsAppPreference && `${item?.BookingDate?.trim() ? `(${dateFormatChange(item.BookingDate)})` diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx index c8ff9ef..1d5a721 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle11.jsx @@ -105,6 +105,9 @@ const PrintStyle11 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -3275,8 +3278,7 @@ const PrintStyle11 = ({ ))} - {/* Brand Name */} - {item?.BrandName && {item.BrandName}} + {item?.BrandName &&
{item.BrandName}
} {/* Product Identifiers */} {item?.ProductIdentifierDtls?.map((detail, idx) => { @@ -3304,17 +3306,17 @@ const PrintStyle11 = ({
) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   + {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'}) +
+ )} + {item?.BrandName &&
{item.BrandName}
} {/* {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( (items) => @@ -3588,15 +3590,17 @@ const PrintStyle11 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'}) +
+ )} + {item?.BrandName &&
{item.BrandName}
} )} {GlobaldummyData diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx index 235bebc..70edad0 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx @@ -838,10 +838,7 @@ const Printstyle12 = ({ {item.ParcelType}) ))} - {item?.BrandName !== null - ? item?.BrandName - : ''} -   + {item?.BrandName &&
{item.BrandName}
}
{item?.ProductIdentifierDtls?.map((detail, index) => { const serial = detail.SerialNumber?.trim(); @@ -870,17 +867,17 @@ const Printstyle12 = ({
) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   + {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || '1'}){' '} + {item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO'} +
+ )} + {item?.BrandName &&
{item.BrandName}
} {item?.ProductIdentifierDtls ?.length > 0 ? item?.ProductIdentifierDtls?.filter( @@ -1117,15 +1114,16 @@ const Printstyle12 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || '1'}){' '} + {item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO'} +
+ )} )} {GlobaldummyData @@ -3463,10 +3461,7 @@ const Printstyle12 = ({ {item.ParcelType}) ))} - {item?.BrandName !== null - ? item?.BrandName - : ''} -   + {item?.BrandName &&
{item.BrandName}
} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( (items) => @@ -3500,17 +3495,17 @@ const Printstyle12 = ({
) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   + {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || '1'}){' '} + {item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO'} +
+ )} + {item?.BrandName &&
{item.BrandName}
} {/* {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( (items) => @@ -3754,15 +3749,16 @@ const Printstyle12 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || '1'}){' '} + {item?.SinglePc === 'Y' + ? 'PCS' + : item?.Type !== 'C' + ? item?.UomName + : 'COMBO'} +
+ )} )} {GlobaldummyData diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx index 1ae85a3..9d65fc1 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle2.jsx @@ -107,6 +107,9 @@ const Printstyle2 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -712,7 +715,8 @@ const Printstyle2 = ({ ))}
- ) : ( + ) : UomPrint?.SettingValue === 'Y' && ( +
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -766,7 +770,7 @@ const Printstyle2 = ({ (items) => items.SerialNumber || items.IMEI1 || items.IMEI2 )?.map((a, i) => ( - {a.Description} +
{a.Description}
)) : ''} @@ -1063,6 +1067,7 @@ const Printstyle2 = ({ }} >
{item?.ProdName}
+ {UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -1072,6 +1077,7 @@ const Printstyle2 = ({ : 'COMBO'} )
+ } )} {GlobaldummyData @@ -3356,7 +3362,7 @@ const Printstyle2 = ({ (items) => items.SerialNumber || items.IMEI1 || items.IMEI2 )?.map((a, i) => ( - {a.Description} +
{a.Description}
)) : ''} @@ -3617,6 +3623,7 @@ const Printstyle2 = ({ }} >
{item?.ProdName}
+ {UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -3626,6 +3633,7 @@ const Printstyle2 = ({ : 'COMBO'} )
+ } )} {GlobaldummyData diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx index acba1e3..6d4f91d 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle3.jsx @@ -80,6 +80,9 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find(setting => setting?.SettingIdName?.toLowerCase() === 'estimateprintheader')?.SettingValue === 'Y'; const estimateTitle = SettingData?.[0]?.SettingDtlDetails?.find( @@ -289,7 +292,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan ))}
- :
+ : UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : "1"}{" "} {item?.SinglePc == "Y" ? "PCS" @@ -329,7 +332,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan (items) => items.SerialNumber || items.IMEI1 || items.IMEI2 )?.map((a, i) => ( - {a.Description} +
{a.Description}
)) : ''} @@ -370,7 +373,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan {GlobaldummyData ? GlobalItem &&
{item?.ProdName}
: Item &&
{item?.ProdName}
-
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
+ {UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
}
} {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} {GlobaldummyData ? GlobalMRP &&
{item?.MRP}
: MRP &&
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
} @@ -1248,7 +1251,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan ))}
- :
+ : UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : "1"}{" "} {item?.SinglePc == "Y" ? "PCS" @@ -1329,7 +1332,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan {GlobaldummyData ? GlobalItem &&
{item?.ProdName}
: Item &&
{item?.ProdName}
-
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
+ { UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})
}
} {GlobaldummyData ? GlobalHsnCode &&
{item?.HSN}
: HsnCode &&
{item?.HSN}
} {GlobaldummyData ? GlobalMRP &&
{item?.MRP}
: MRP &&
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx index 4f302dd..8f98179 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx @@ -114,7 +114,10 @@ const Printstyle4 = ({ {} ), ]; - console.log(table2Data, 'eeeeeeeeeeeeeeee'); + console.log(table2Data, 'table2Data'); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -759,12 +762,14 @@ const Printstyle4 = ({
) : (
- {(item?.Size || "1")}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"}{" "} + {(UomPrint?.SettingValue === 'Y' + ? (item?.Size || '1') + + (item?.SinglePc === 'Y' + ? ' PCS' + : item?.Type !== 'C' + ? ` ${item?.UomName}` + : ' COMBO') + : '')} {item?.BrandName || ""}
)} @@ -1016,6 +1021,7 @@ const Printstyle4 = ({ }} >
{item?.ProdName}
+ {UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -1025,6 +1031,7 @@ const Printstyle4 = ({ : 'COMBO'} )
+ } )} {GlobaldummyData @@ -3408,12 +3415,9 @@ const Printstyle4 = ({
) : (
- {(item?.Size || '1')}{" "} - {item?.SinglePc === 'Y' - ? 'PCS' - : item?.Type !== 'C' - ? item?.UomName - : 'COMBO'}{" "} + {UomPrint?.SettingValue === 'Y' && ( + <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} + )} {item?.BrandName || ""}
)} @@ -3737,6 +3741,7 @@ const Printstyle4 = ({ : Quantity && ( {item?.SalesQty} + {UomPrint?.SettingValue === 'Y' &&
({item?.Size ? item?.Size : '1'}{' '} {item?.SinglePc == 'Y' @@ -3746,6 +3751,7 @@ const Printstyle4 = ({ : 'COMBO'} )
+ } )} {GlobaldummyData diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx index 23f9ed6..352007d 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.jsx @@ -103,6 +103,9 @@ const PrintStyle5 = ({ const GlobalCashierName = useSelector(GlobalprintCashierName); const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -679,14 +682,15 @@ const PrintStyle5 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {item?.Size + + item?.UomName + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
} )}
@@ -756,12 +760,16 @@ const PrintStyle5 = ({ {/* 📏 Size + UOM */}
- {(item?.Size || "1")}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} + {UomPrint?.SettingValue === 'Y' && ( + <> + {(item?.Size || "1")}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + + )}
{/* 🏷 Brand */} @@ -1076,14 +1084,16 @@ const PrintStyle5 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {item?.Size + + item?.UomName + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
+ } )}
@@ -1100,18 +1110,20 @@ const PrintStyle5 = ({ ) : ( <>
{item?.ProdName}
-
- {(item?.Size ? item?.Size : '1') + - (item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO') + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {(item?.Size ? item?.Size : '1') + + (item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO') + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
+ } )}
@@ -2984,14 +2996,16 @@ const PrintStyle5 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ {item?.Size + + item?.UomName + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
+ )} )} @@ -3063,13 +3077,19 @@ const PrintStyle5 = ({
{/* 📏 Size + UOM */}
- {(item?.Size || "1")} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} -
+ + {UomPrint?.SettingValue === 'Y' && ( + <> + {item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"} + + )} +
+ {/* 🏷 Brand */} {item?.BrandName &&
{item.BrandName}
} @@ -3352,14 +3372,16 @@ const PrintStyle5 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {item?.Size + + item?.UomName + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)} +
+ } )} @@ -3377,16 +3399,16 @@ const PrintStyle5 = ({ <>
{item?.ProdName}
- {(item?.Size ? item?.Size : '1') + + {UomPrint?.SettingValue === 'Y' ? ((item?.Size ? item?.Size : '1') + (item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName - : 'COMBO') + - '-' + - (GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty)} + : 'COMBO')) : "" + + '-' + + (GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty)}
)} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx index 16d0ed3..987a176 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle6.jsx @@ -105,6 +105,9 @@ const Printstyle6 = ({ const SettingData = useSelector(PreferenceData); const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); console.log(CashierNameField, "GlobaldummyData") + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -734,14 +737,16 @@ const Printstyle6 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {item?.Size + + item?.UomName + + '-' + + GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty} +
+ } )} @@ -785,15 +790,11 @@ const Printstyle6 = ({ } return ( -
- ({item?.Size || "1"} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) -
+ UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}) {item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO"} +
+ ) ); })()} @@ -1133,14 +1134,16 @@ const Printstyle6 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {item?.Size + + item?.UomName + + '-' + + GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty} +
+ } )} @@ -1153,16 +1156,15 @@ const Printstyle6 = ({ {/* 🏷 Product Name + Size */}
{GlobaldummyData - ? GlobalItem && - `${item?.ProdName} (${item?.Size}${item?.UomName})` - : Item && - `${item?.ProdName} (${item?.Size ? item.Size : "1"}${item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO" - })`} + ? GlobalItem && item?.ProdName + : Item && item?.ProdName + }
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}) {item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO"} +
+ )} {/* 🏷 Brand */} {item?.BrandName &&
{item.BrandName}
} @@ -3553,14 +3555,16 @@ const Printstyle6 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {item?.Size + + item?.UomName + + '-' + + GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty} +
+ } )} @@ -3598,15 +3602,11 @@ const Printstyle6 = ({ )) ) : ( - - ({item?.Size ? item?.Size : '1'} - {item?.SinglePc === 'Y' - ? 'PCS' - : item?.Type !== 'C' - ? item?.UomName - : 'COMBO'} - ) - + UomPrint?.SettingValue === 'Y' && ( + + ({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} + + ) )} {' - '} {Quantity && item?.SalesQty} @@ -3846,14 +3846,16 @@ const Printstyle6 = ({ ) : ( <>
{item?.ProdName}
-
- {item?.Size + - item?.UomName + - '-' + - GlobaldummyData - ? GlobalQuantity && item?.SalesQty - : item?.SalesQty} -
+ {UomPrint?.SettingValue === 'Y' && +
+ {item?.Size + + item?.UomName + + '-' + + GlobaldummyData + ? GlobalQuantity && item?.SalesQty + : item?.SalesQty} +
+ } )} @@ -3867,21 +3869,21 @@ const Printstyle6 = ({ const identifiers = item?.ProductIdentifierDtls ?? []; const sizeText = GlobaldummyData - ? GlobalItem && - `${item?.ProdName} (${item?.Size}${item?.UomName})` - : Item && - `${item?.ProdName} (${item?.Size || "1"}${item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO" - })`; + ? GlobalItem && item?.ProdName + : Item && item?.ProdName; return ( <> - {/* 🏷 Product Name + Size */} + {/* 🏷 Product Name */}
{sizeText}
+ {/* 📦 Size + UOM */} + {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}) {item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO"} +
+ )} + {/* 🏷 Brand */} {item?.BrandName &&
{item.BrandName}
} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx index 73bb4a4..3afc539 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx @@ -100,6 +100,9 @@ const PrintStyle7 = ({ const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -692,13 +695,9 @@ const PrintStyle7 = ({ ) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) + {UomPrint?.SettingValue === 'Y' && ( + <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} + )}
)}
@@ -944,13 +943,9 @@ const PrintStyle7 = ({ {/* 📦 Size + Brand */}
- ({item?.Size || "1"}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) + {UomPrint?.SettingValue === 'Y' && ( + <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} + )} {item?.BrandName ? ` ${item.BrandName}` : ""}
@@ -3155,13 +3150,9 @@ const PrintStyle7 = ({
) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) + {UomPrint?.SettingValue === 'Y' && ( + <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} + )}
)}
@@ -3388,13 +3379,9 @@ const PrintStyle7 = ({ >
{item?.ProdName}
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) + {UomPrint?.SettingValue === 'Y' && ( + <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} + )} {item?.BrandName !== null ? item?.BrandName : ''} diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx index 408daaa..0d62bd5 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx @@ -105,6 +105,9 @@ const Printstyle8 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -773,15 +776,11 @@ const Printstyle8 = ({ ))}
) : ( -
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} +
+ ) )}
{item?.ProductIdentifierDtls?.length > 0 @@ -1133,45 +1132,38 @@ const Printstyle8 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   -
- {(item?.ProductIdentifierDtls ?? []) - .filter(items => items.SerialNumber) - .map((a, i) => ( -
- {a.SerialNumber} -
- ))} - - {(item?.ProductIdentifierDtls ?? []) - .filter(id => id.IMEI1 || id.IMEI2) - .map((id, i) => ( -
- {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} -
- ))} - - {(item?.ProductIdentifierDtls ?? []) - .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) - .map((a, i) => - a.Description ? ( -
- {a.Description} -
- ) : null - )} + {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'}
+ )} + {item?.BrandName !== null &&
{item?.BrandName}
} +
+ {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber) + .map((a, i) => ( +
+ {a.SerialNumber} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(id => id.IMEI1 || id.IMEI2) + .map((id, i) => ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) + .map((a, i) => + a.Description ? ( +
+ {a.Description} +
+ ) : null + )}
)} @@ -3529,15 +3521,11 @@ const Printstyle8 = ({ ))}
) : ( -
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} +
+ ) )} )} @@ -3779,15 +3767,11 @@ const Printstyle8 = ({
{item?.ProdName}
{/* 📦 Size */} -
- ({item?.Size || "1"}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}) {item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO"} +
+ )} {/* 🏷 Brand */} {item?.BrandName && ( diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx index d0c58bf..9b88c16 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle9.jsx @@ -102,6 +102,9 @@ const PrintStyle9 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -728,7 +731,7 @@ const PrintStyle9 = ({ ))} - {item?.BrandName || ""} + {item?.BrandName &&
{item.BrandName}
} {/* Identifiers */}
@@ -748,15 +751,18 @@ const PrintStyle9 = ({ ) : (
{/* Size + UOM */} - ({item?.Size || "1"}{" "} - {item?.SinglePc === "Y" - ? "PCS" - : item?.Type !== "C" - ? item?.UomName - : "COMBO"} - ) + {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size || "1"}{" "} + {item?.SinglePc === "Y" + ? "PCS" + : item?.Type !== "C" + ? item?.UomName + : "COMBO"}) +
+ )} - {item?.BrandName || ""} + {item?.BrandName &&
{item.BrandName}
} {/* Identifiers */} {identifiers.map((id, i) => ( @@ -1028,15 +1034,17 @@ const PrintStyle9 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'}) +
+ )} + {item?.BrandName &&
{item.BrandName}
} )} {GlobaldummyData @@ -3396,45 +3404,43 @@ const PrintStyle9 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} -   -
- {(item?.ProductIdentifierDtls ?? []) - .filter(items => items.SerialNumber) - .map((a, i) => ( -
- {a.SerialNumber} -
- ))} - - {(item?.ProductIdentifierDtls ?? []) - .filter(id => id.IMEI1 || id.IMEI2) - .map((id, i) => ( -
- {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} -
- ))} - - {(item?.ProductIdentifierDtls ?? []) - .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) - .map((a, i) => - a.Description ? ( -
- {a.Description} -
- ) : null - )} + {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'})
+ )} + {item?.BrandName &&
{item.BrandName}
} +
+ {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber) + .map((a, i) => ( +
+ {a.SerialNumber} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(id => id.IMEI1 || id.IMEI2) + .map((id, i) => ( +
+ {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")} +
+ ))} + + {(item?.ProductIdentifierDtls ?? []) + .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2) + .map((a, i) => + a.Description ? ( +
+ {a.Description} +
+ ) : null + )}
)} diff --git a/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx b/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx index 02c3ce5..f686a0b 100644 --- a/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx +++ b/src/Pages/paymentpdfPage/PaymentPdfBooking.jsx @@ -456,7 +456,7 @@ const PaymentPdfBooking = ({ > Estimate

-

{SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} -

+

*/}
) : (
-

{SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} -

+

*/}
)}
@@ -516,6 +516,11 @@ const PaymentPdfBooking = ({ table2Data?.FYStatus )}
+ {SalesModePref?.SettingValue == 'Y' && +
+ {' '} + Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '} +
}
Date:{Date1}
{TakeawayData?.length > 0 && ( From 82bfccfe8b5b405d3156497e5384d116fe64e624 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Mon, 2 Mar 2026 18:45:47 +0530 Subject: [PATCH 7/8] imeidetail --- .../BSImeiDetails/BSImeiDetails.jsx | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx index 5a34d43..dd93d42 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSImeiDetails/BSImeiDetails.jsx @@ -59,6 +59,7 @@ const BSImeiDetails = (props) => { }; const ChangeRadioOption = (data) => { setRadioBtnSelection(data); + formRef.current?.resetFields(['SerialNumber', 'SerialNumbertext', 'IMEINumber', 'IMEINumbertext']); }; const SerialNumberOnchange = (e) => { console.log(e, SerialNumberList, 'SerialNumberOnchange'); @@ -265,7 +266,10 @@ const BSImeiDetails = (props) => { rules={[ { validator: async (_, value) => { - await validateSafeInput(value); // To block HTML tags & SQL keywords + if (value && !/^\d+$/.test(value)) { + return Promise.reject('Please enter only numbers'); + } + await validateSafeInput(value); return Promise.resolve(); }, }, @@ -274,13 +278,16 @@ const BSImeiDetails = (props) => { { + if (['e', 'E', '+', '-', '.'].includes(e.key)) { + e.preventDefault(); + } + }} /> { rules={[ { validator: async (_, value) => { - await validateSafeInput(value); // To block HTML tags & SQL keywords + if (value && !/^\d+$/.test(value)) { + return Promise.reject('Please enter only numbers'); + } + await validateSafeInput(value); return Promise.resolve(); }, }, @@ -354,9 +364,13 @@ const BSImeiDetails = (props) => { label="IMEI Number" fieldState={true} fieldApi={true} - // id="error2" autocomplete="off" - // OnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false} + type="number" + onKeyDown={(e) => { + if (['e', 'E', '+', '-', '.'].includes(e.key)) { + e.preventDefault(); + } + }} /> Date: Tue, 3 Mar 2026 10:13:09 +0530 Subject: [PATCH 8/8] add Desciption --- .../ThermalPrinter/PrintStyle10.jsx | 112 +++++++++--------- 1 file changed, 54 insertions(+), 58 deletions(-) diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx index e7b76a2..aab8f22 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle10.jsx @@ -101,6 +101,9 @@ const PrintStyle10 = ({ const GlobalLogo = useSelector(GlobalprintLogo); const GlobalCredit = useSelector(GlobalprintCredit); const SettingData = useSelector(PreferenceData); + const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( + (i) => i.SettingIdName === 'PrintUom' + )?.[0]; const estimatePrintHeader = SettingData?.[0]?.SettingDtlDetails?.find( (setting) => @@ -687,8 +690,8 @@ const PrintStyle10 = ({ textAlign: 'left', }} > - {item?.ProdName}( - {item?.Size + item?.UomName}) + {item?.ProdName} + {UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`} ) : Item && ( @@ -735,13 +738,8 @@ const PrintStyle10 = ({
{/* Product size + brand */}
- ({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 && ` ${item?.BrandName}`}
{/* Product identifiers */} @@ -1019,8 +1017,8 @@ const PrintStyle10 = ({ textAlign: 'left', }} > - {item?.ProdName}( - {item?.Size + item?.UomName}) + {item?.ProdName} + {UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`} ) : Item && ( @@ -1031,15 +1029,17 @@ const PrintStyle10 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+ )} )} {GlobaldummyData @@ -3258,7 +3258,8 @@ const PrintStyle10 = ({ - {item?.ProdName}({item?.Size + item?.UomName}) + {item?.ProdName} + {UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`} ) : Item && ( @@ -3273,37 +3274,29 @@ const PrintStyle10 = ({ (pkg) => pkg.ProdId === item.ProdId ).length > 0 ? (
- {/* Package Details */} - {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).map((pkg, index) => ( +
+ {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType}) +
+ ))} - {/* Brand */} - {item?.BrandName &&
{item.BrandName}
} + {/* Brand */} + {item?.BrandName &&
{item.BrandName}
} - {/* Product Identifiers */} - {item?.ProductIdentifierDtls?.map((id, i) => ( -
- {id.SerialNumber &&
{id.SerialNumber}
} - {(id.IMEI1 || id.IMEI2) &&
{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}
} - {id.Description &&
{id.Description}
} -
- ))} -
+ {/* Product Identifiers */} + {item?.ProductIdentifierDtls?.map((id, i) => ( +
+ {id.SerialNumber &&
{id.SerialNumber}
} + {(id.IMEI1 || id.IMEI2) &&
{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}
} + {id.Description &&
{id.Description}
} +
+ ))} +
) : (
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) - {item?.BrandName !== null - ? item?.BrandName - : ''} + {UomPrint?.SettingValue === 'Y' && `(${item?.Size ? item?.Size : '1'} ${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`} + {item?.BrandName && ` ${item?.BrandName}`}   {/* {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls?.filter( @@ -3569,7 +3562,8 @@ const PrintStyle10 = ({ - {item?.ProdName}({item?.Size + item?.UomName}) + {item?.ProdName} + {UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`} ) : Item && ( @@ -3580,15 +3574,17 @@ const PrintStyle10 = ({ }} >
{item?.ProdName}
-
- ({item?.Size ? item?.Size : '1'}{' '} - {item?.SinglePc == 'Y' - ? 'PCS' - : item?.Type != 'C' - ? item?.UomName - : 'COMBO'} - ) -
+ {UomPrint?.SettingValue === 'Y' && ( +
+ ({item?.Size ? item?.Size : '1'}{' '} + {item?.SinglePc == 'Y' + ? 'PCS' + : item?.Type != 'C' + ? item?.UomName + : 'COMBO'} + ) +
+ )} )} {GlobaldummyData