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} |