add description

This commit is contained in:
Tamilselvan 2026-03-02 13:58:40 +05:30
parent 5786040e3d
commit c19ba07c44
14 changed files with 1770 additions and 1611 deletions

View File

@ -57,6 +57,7 @@ const InvoiceTemplate = ({
isPdf, isPdf,
sportsAppPreference, sportsAppPreference,
MembershipApplied = null, MembershipApplied = null,
SalesModePref,
}) => { }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const GlobalUpiID = useSelector(GlobalUpiIDprint); const GlobalUpiID = useSelector(GlobalUpiIDprint);
@ -944,6 +945,10 @@ const InvoiceTemplate = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0rem', fontWeight: '600' }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
)} )}
@ -1261,76 +1266,66 @@ const InvoiceTemplate = ({
<td <td
className="table-header-cell" className="table-header-cell"
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
fontFamily: 'sans-serif', fontFamily: "sans-serif",
}} }}
> >
{/* Product Name */}
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId {(() => {
).length > 0 ? ( const packages =
PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId) || [];
const identifiers = item?.ProductIdentifierDtls || [];
return (
<>
{/* Package OR Size */}
{packages.length > 0 ? (
<div> <div>
{PackageDetails?.filter( {packages.map((pkg, index) => (
(pkg) => <span key={index} style={{ display: "block" }}>
pkg.ProdId === item.ProdId {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
)?.map((item, index) => (
<span
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</span> </span>
))} ))}
</div> </div>
) : ( ) : (
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
</div> </div>
)} )}
&nbsp;{' '}
{item?.BrandName !== null {/* Brand */}
? item?.BrandName {item?.BrandName && <div>{item.BrandName}</div>}
: ''}
&nbsp; {/* Identifiers */}
{item?.ProductIdentifierDtls?.length > 0 {identifiers.map((id, i) => (
? item?.ProductIdentifierDtls?.filter( <div key={i} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
(items) => {/* Serial + IMEIs in one line */}
!( {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && (
items.SerialNumber == '' || <div style={{ display: 'flex', gap: '3px' }}>
items.SerialNumber == null {id?.SerialNumber && <div>{id.SerialNumber}</div>}
) {(id?.IMEI1 || id?.IMEI2) && (
)?.map((a) => { <div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(", ")}</div>
return ( )}
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
)}
{/* Description on new line */}
{id?.Description && <div>{id.Description}</div>}
</div>
))}
</>
); );
}) })()}
: ''}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -2994,54 +2989,44 @@ const InvoiceTemplate = ({
: Item == true && ( : Item == true && (
<td <td
className="table-header-cell" className="table-header-cell"
style={{ style={{ display: "flex", flexDirection: "column" }}
display: 'flex',
flexDirection: 'column',
}}
> >
{/* Product Name */}
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{/* Size + UOM */}
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
</div> </div>
&nbsp;{' '}
{item?.BrandName !== null {/* Brand */}
? item?.BrandName {item?.BrandName && <div>{item.BrandName}</div>}
: ''}
&nbsp; {/* Identifiers */}
{item?.ProductIdentifierDtls?.length > 0 {item?.ProductIdentifierDtls?.map((id, index) => (
? item?.ProductIdentifierDtls?.filter( <div key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
(items) =>
!( {/* Serial + IMEIs in one row */}
items.SerialNumber == '' || {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && (
items.SerialNumber == null <div style={{ display: 'flex', gap: '4px' }}>
), {id?.SerialNumber && <div>{id.SerialNumber}</div>}
)?.map((a) => { {(id?.IMEI1 || id?.IMEI2) && (
return <div>{a.SerialNumber}</div>; <div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(", ")}</div>
}) )}
: ''}{' '}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== '',
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
); )}
})
: ''} {/* Description on new line */}
{id?.Description && <div>{id.Description}</div>}
</div>
))}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData

View File

@ -60,6 +60,7 @@ const PrintA4Style11 = ({
printDatas, printDatas,
sportsAppPreference, sportsAppPreference,
MembershipApplied = null, MembershipApplied = null,
SalesModePref,
}) => { }) => {
const GlobalthemeFormatr = useSelector(GlobalthemeFormat); const GlobalthemeFormatr = useSelector(GlobalthemeFormat);
const GlobalSignature = useSelector(GlobalprintSignature); const GlobalSignature = useSelector(GlobalprintSignature);
@ -426,6 +427,10 @@ const PrintA4Style11 = ({
table2Data?.OrderId, table2Data?.OrderId,
table2Data?.FYStatus table2Data?.FYStatus
)} )}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0.5rem', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
{GlobaldummyData && '685'} {GlobaldummyData && '685'}
</div> </div>
<div style={{ textAlign: 'center', width: '24vw' }}> <div style={{ textAlign: 'center', width: '24vw' }}>
@ -445,10 +450,16 @@ const PrintA4Style11 = ({
justifyContent: 'space-between', justifyContent: 'space-between',
padding: '0rem 1rem', padding: '0rem 1rem',
fontSize: 'clamp(0.7rem, 2.5vw, 0.8rem)', fontSize: 'clamp(0.7rem, 2.5vw, 0.8rem)',
flexDirection: 'column',
textAlign: 'left'
}} }}
> >
{' '} {' '}
<div>{Date1}</div>{' '} <div>{Date1}</div>{' '}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0.5rem', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
</div> </div>
@ -689,87 +700,77 @@ const PrintA4Style11 = ({
{chunkIndex * chunkSize + index + 1} {chunkIndex * chunkSize + index + 1}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData ? (
? GlobalItem && <td>{item?.name}</td> GlobalItem && <td>{item?.name}</td>
: Item == true && ( ) : (
Item && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
}} }}
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{PackageDetails?.filter( {PackageDetails?.filter(
(pkg) => (pkg) => pkg.ProdId === item.ProdId
pkg.ProdId === item.ProdId
).length > 0 ? ( ).length > 0 ? (
<div> <div>
{PackageDetails?.filter( {PackageDetails
(pkg) => ?.filter((pkg) => pkg.ProdId === item.ProdId)
pkg.ProdId === item.ProdId ?.map((pkg, index) => (
)?.map((item, index) => ( <span key={index} style={{ display: "block" }}>
<span {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</span> </span>
))} ))}
</div> </div>
) : ( ) : (
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
</div> </div>
)} )}
&nbsp;{' '}
{item?.BrandName !== null {item?.BrandName && <div>{item.BrandName}</div>}
? item?.BrandName
: ''} {/* Serial Numbers */}
&nbsp; {item?.ProductIdentifierDtls?.map((id, index) => (
{item?.ProductIdentifierDtls <div key={`serial-${index}`}>
?.length > 0 {id?.SerialNumber && <div>{id.SerialNumber}</div>}
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
items.SerialNumber ==
'' ||
items.SerialNumber == null
)
)?.map((a) => {
return (
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls
?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 =
item2.IMEI1 || '';
const imei2 =
item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
))}
{/* IMEI */}
{item?.ProductIdentifierDtls?.map((id, index) => {
const imei1 = id?.IMEI1 || "";
const imei2 = id?.IMEI2 || "";
return (
(imei1 || imei2) && (
<div key={`imei-${index}`}>
{[imei1, imei2].filter(Boolean).join(",")}
</div>
)
); );
}) })}
: ''}
{/* Description */}
{item?.ProductIdentifierDtls?.map((id, index) => (
(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) &&
id?.Description && (
<div key={`desc-${index}`}>
{id.Description}
</div>
)
))}
</td> </td>
)
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
@ -1755,66 +1756,56 @@ const PrintA4Style11 = ({
{chunkIndex * chunkSize + index + 1} {chunkIndex * chunkSize + index + 1}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData ? (
? GlobalItem && <td>{item?.ProdName}</td> GlobalItem && <td>{item?.ProdName}</td>
: Item == true && ( ) : (
Item && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
}} }}
> >
{/* Product Name */}
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{/* Size + UOM */}
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
</div> </div>
&nbsp;{' '}
{item?.BrandName !== null {/* Brand */}
? item?.BrandName {item?.BrandName && <div>{item.BrandName}</div>}
: ''}
&nbsp; {/* Identifiers */}
{item?.ProductIdentifierDtls {item?.ProductIdentifierDtls?.map((id, index) => (
?.length > 0 <div key={index}>
? item?.ProductIdentifierDtls?.filter(
(items) => {/* Serial Number */}
!( {id?.SerialNumber && <div>{id.SerialNumber}</div>}
items.SerialNumber ==
'' || {/* IMEI */}
items.SerialNumber == null {(id?.IMEI1 || id?.IMEI2) && (
)
)?.map((a) => {
return (
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls
?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 =
item2.IMEI1 || '';
const imei2 =
item2.IMEI2 || '';
return (
<div> <div>
{[imei1, imei2] {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
.filter(Boolean)
.join(',')}
</div> </div>
); )}
})
: ''} {/* Description */}
{(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) && id?.Description && (
<div>{id.Description}</div>
)}
</div>
))}
</td> </td>
)
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (

View File

@ -60,6 +60,7 @@ const PrintA5Style11 = ({
printDatas, printDatas,
sportsAppPreference, sportsAppPreference,
MembershipApplied = null, MembershipApplied = null,
SalesModePref,
}) => { }) => {
const GlobalthemeFormatr = useSelector(GlobalthemeFormat); const GlobalthemeFormatr = useSelector(GlobalthemeFormat);
const GlobalSignature = useSelector(GlobalprintSignature); const GlobalSignature = useSelector(GlobalprintSignature);
@ -427,6 +428,8 @@ const PrintA5Style11 = ({
table2Data?.OrderId, table2Data?.OrderId,
table2Data?.FYStatus table2Data?.FYStatus
)} )}
{GlobaldummyData && '685'} {GlobaldummyData && '685'}
</div> </div>
<div style={{ textAlign: 'center', width: '24vw' }}> <div style={{ textAlign: 'center', width: '24vw' }}>
@ -446,10 +449,16 @@ const PrintA5Style11 = ({
justifyContent: 'space-between', justifyContent: 'space-between',
padding: '0rem 1rem', padding: '0rem 1rem',
fontSize: 'clamp(0.7rem, 2.5vw, 0.8rem)', fontSize: 'clamp(0.7rem, 2.5vw, 0.8rem)',
flexDirection: 'column',
textAlign:'left'
}} }}
> >
{' '} {' '}
<div>{Date1}</div>{' '} <div>{Date1}</div>{' '}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0.5rem', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
</div> </div>
@ -691,87 +700,70 @@ const PrintA5Style11 = ({
{chunkIndex * chunkSize + index + 1} {chunkIndex * chunkSize + index + 1}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData ? (
? GlobalItem && <td>{item?.name}</td> GlobalItem && <td>{item?.name}</td>
: Item == true && ( ) : (
Item && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
}} }}
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{PackageDetails?.filter( {PackageDetails?.filter(
(pkg) => (pkg) => pkg.ProdId === item.ProdId
pkg.ProdId === item.ProdId
).length > 0 ? ( ).length > 0 ? (
<div> <div>
{PackageDetails?.filter( {PackageDetails
(pkg) => ?.filter((pkg) => pkg.ProdId === item.ProdId)
pkg.ProdId === item.ProdId ?.map((pkg, index) => (
)?.map((item, index) => ( <span key={index} style={{ display: "block" }}>
<span {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</span> </span>
))} ))}
</div> </div>
) : ( ) : (
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
</div> </div>
)} )}
&nbsp;{' '}
{item?.BrandName !== null {item?.BrandName && <div>{item.BrandName}</div>}
? item?.BrandName
: ''} {/* Identifiers */}
&nbsp; {item?.ProductIdentifierDtls?.length > 0
{item?.ProductIdentifierDtls ? item.ProductIdentifierDtls.map((id, index) => (
?.length > 0 <div key={index}>
? item?.ProductIdentifierDtls?.filter(
(items) => {/* Serial */}
!( {id?.SerialNumber && <div>{id.SerialNumber}</div>}
items.SerialNumber ==
'' || {/* IMEI */}
items.SerialNumber == null {(id?.IMEI1 || id?.IMEI2) && (
)
)?.map((a) => {
return (
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls
?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 =
item2.IMEI1 || '';
const imei2 =
item2.IMEI2 || '';
return (
<div> <div>
{[imei1, imei2] {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
.filter(Boolean)
.join(',')}
</div> </div>
); )}
})
: ''} {/* Description */}
{(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) &&
id?.Description && (
<div>{id.Description}</div>
)}
</div>
))
: null}
</td> </td>
)
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
@ -1694,66 +1686,53 @@ const PrintA5Style11 = ({
{chunkIndex * chunkSize + index + 1} {chunkIndex * chunkSize + index + 1}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData ? (
? GlobalItem && <td>{item?.ProdName}</td> GlobalItem && <td>{item?.ProdName}</td>
: Item == true && ( ) : (
Item && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
}} }}
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
</div> </div>
&nbsp;{' '}
{item?.BrandName !== null {item?.BrandName && <div>{item.BrandName}</div>}
? item?.BrandName
: ''} {item?.ProductIdentifierDtls?.map((id, index) => (
&nbsp; <div key={index}>
{item?.ProductIdentifierDtls
?.length > 0 {/* Serial Number */}
? item?.ProductIdentifierDtls?.filter( {id?.SerialNumber && <div>{id.SerialNumber}</div>}
(items) =>
!( {/* IMEI */}
items.SerialNumber == {(id?.IMEI1 || id?.IMEI2) && (
'' ||
items.SerialNumber == null
)
)?.map((a) => {
return (
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls
?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 =
item2.IMEI1 || '';
const imei2 =
item2.IMEI2 || '';
return (
<div> <div>
{[imei1, imei2] {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
.filter(Boolean)
.join(',')}
</div> </div>
); )}
})
: ''} {/* Description */}
{(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) &&
id?.Description && (
<div>{id.Description}</div>
)}
</div>
))}
</td> </td>
)
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (

View File

@ -464,8 +464,8 @@ const PrintStyle11 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName ? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} `(${table2Data?.SalesMode})`} */}
</div> </div>
<div <div
style={{ style={{
@ -484,6 +484,10 @@ const PrintStyle11 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0.5rem', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
@ -491,8 +495,8 @@ const PrintStyle11 = ({
style={{ textTransform: 'uppercase', textAlign: 'center' }} style={{ textTransform: 'uppercase', textAlign: 'center' }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} `(${table2Data?.SalesMode})`} */}
</div> </div>
)} )}
<hr className="PrintStyle11-print-dottline" /> <hr className="PrintStyle11-print-dottline" />
@ -682,38 +686,30 @@ const PrintStyle11 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > <div style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>
0 {item?.ProductIdentifierDtls?.map((detail, index) => {
? item?.ProductIdentifierDtls?.filter( const serial = detail.SerialNumber?.trim();
(items) => const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', ');
!( const description = detail.Description?.trim();
items.SerialNumber == '' ||
items.SerialNumber == null // Skip if nothing exists
) if (!serial && !imeis && !description) return null;
)?.map((a) => {
return ( return (
<div>{a.SerialNumber}</div> <div key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
); {/* Serial + IMEI in one line */}
}) {(serial || imeis) && (
: ''}{' '} <div style={{ display: 'flex', gap: '3px' }}>
{item?.ProductIdentifierDtls?.length > {serial && <div>{serial}</div>}
0 {imei && <div>{imeis}</div>}
? item?.ProductIdentifierDtls.filter( </div>
(item1) => )}
item1.IMEI1 !== '' || {/* Description on new line */}
item1.IMEI2 !== '' {description && <div>{description}</div>}
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) })}
: ''} </div>
</div> </div>
) : ( ) : (
<div> <div>
@ -728,38 +724,27 @@ const PrintStyle11 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > <div style={{ display: 'flex', gap: "3px", flexWrap: 'wrap' }}>
0 {item?.ProductIdentifierDtls?.map((detail, index) => {
? item?.ProductIdentifierDtls?.filter( const serial = detail.SerialNumber;
(items) => const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(',');
!( const description = detail.Description;
items.SerialNumber == '' ||
items.SerialNumber == null // Only render if at least one value exists
) if (!serial && !imeis && !description) return null;
)?.map((a) => {
return ( return (
<div>{a.SerialNumber}</div> <div key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
); <div style={{ display: 'flex', gap: '3px' }}>
}) {serial && <div>{serial}</div>}
: ''}{' '} {imeis && <div>{imeis}</div>}
{item?.ProductIdentifierDtls?.length > </div>
0 {description && <div>{description}</div>}
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) })}
: ''} </div>
</div> </div>
)} )}
</td> </td>
@ -3115,8 +3100,8 @@ const PrintStyle11 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} `(${table2Data?.SalesMode})`} */}
</div> </div>
<div <div
style={{ style={{
@ -3135,13 +3120,17 @@ const PrintStyle11 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0.5rem', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
)} )}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase', textAlign: 'center' }}> <div style={{ textTransform: 'uppercase', textAlign: 'center' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} `(${table2Data?.SalesMode})`} */}
</div> </div>
)} )}
@ -3279,52 +3268,39 @@ const PrintStyle11 = ({
(pkg) => pkg.ProdId === item.ProdId (pkg) => pkg.ProdId === item.ProdId
).length > 0 ? ( ).length > 0 ? (
<div> <div>
{PackageDetails?.filter( {/* Package Details */}
(pkg) => pkg.ProdId === item.ProdId {PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId)?.map((pkg, idx) => (
)?.map((item, index) => ( <span key={idx} style={{ display: 'block' }}>
<span {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</span> </span>
))} ))}
{item?.BrandName !== null
? item?.BrandName {/* Brand Name */}
: ''} {item?.BrandName && <span>{item.BrandName}</span>}
&nbsp;
{item?.ProductIdentifierDtls?.length > 0 {/* Product Identifiers */}
? item?.ProductIdentifierDtls?.filter( {item?.ProductIdentifierDtls?.map((detail, idx) => {
(items) => const serial = detail.SerialNumber?.trim();
!( const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', ');
items.SerialNumber == '' || const description = detail.Description?.trim();
items.SerialNumber == null
) // Skip if nothing exists
)?.map((a) => { if (!serial && !imeis && !description) return null;
return ( return (
<div>{a.SerialNumber}</div> <div key={idx} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
); {/* Serial + IMEIs on one line */}
}) {(serial || imeis) && (
: ''}{' '} <div style={{ display: 'flex', gap: '3px' }}>
{item?.ProductIdentifierDtls?.length > 0 {serial && <div>{serial}</div>}
? item?.ProductIdentifierDtls.filter( {imeis && <div>{imeis}</div>}
(item1) => </div>
item1.IMEI1 !== '' || )}
item1.IMEI2 !== '' {/* Description on new line */}
)?.map((item2) => { {description && <div>{description}</div>}
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) })}
: ''}
</div> </div>
) : ( ) : (
<div> <div>
@ -3339,7 +3315,7 @@ const PrintStyle11 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > 0 {/* {item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls?.filter( ? item?.ProductIdentifierDtls?.filter(
(items) => (items) =>
!( !(
@ -3368,7 +3344,31 @@ const PrintStyle11 = ({
</div> </div>
); );
}) })
: ''} : ''} */}
<div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
{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 (
<div key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
{/* Serial + IMEIs on one line */}
{(serial || imeis) && (
<div style={{ display: 'flex', gap: '3px' }}>
{serial && <div>{serial}</div>}
{imeis && <div>{imeis}</div>}
</div>
)}
{/* Description on new line */}
{description && <div>{description}</div>}
</div>
);
})}
</div>
</div> </div>
)} )}
</td> </td>

View File

@ -842,41 +842,31 @@ const Printstyle12 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls <div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
?.length > 0 {item?.ProductIdentifierDtls?.map((detail, index) => {
? item?.ProductIdentifierDtls?.filter( const serial = detail.SerialNumber?.trim();
(items) => const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(', ');
!( const description = detail.Description?.trim();
items.SerialNumber ==
'' || // Skip if all are empty
items.SerialNumber == null if (!serial && !imeis && !description) return null;
)
)?.map((a) => {
return ( return (
<div>{a.SerialNumber}</div> <div key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
); {/* Serial + IMEIs on the same row */}
}) {(serial || imeis) && (
: ''}{' '} <div style={{ display: 'flex', gap: '3px' }}>
{item?.ProductIdentifierDtls {serial && <div>{serial}</div>}
?.length > 0 {imeis && <div>{imeis}</div>}
? item?.ProductIdentifierDtls.filter( </div>
(item1) => )}
item1.IMEI1 !== '' ||
item1.IMEI2 !== '' {/* Description on new line */}
)?.map((item2) => { {description && <div>{description}</div>}
const imei1 =
item2.IMEI1 || '';
const imei2 =
item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) })}
: ''} </div>
</div> </div>
) : ( ) : (
<div> <div>
@ -3521,7 +3511,7 @@ const Printstyle12 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > 0 {/* {item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls?.filter( ? item?.ProductIdentifierDtls?.filter(
(items) => (items) =>
!( !(
@ -3550,7 +3540,32 @@ const Printstyle12 = ({
</div> </div>
); );
}) })
: ''} : ''} */}
<div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>
{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 (
<div key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
{/* Serial + IMEIs in one row */}
{(serial || imeis) && (
<div style={{ display: 'flex', gap: '3px' }}>
{serial && <div>{serial}</div>}
{imeis && <div>{imeis}</div>}
</div>
)}
{/* Description on new line */}
{description && <div>{description}</div>}
</div>
);
})}
</div>
</div> </div>
)} )}
</td> </td>

View File

@ -466,8 +466,8 @@ const Printstyle2 = ({
}} }}
> >
Estimate Bill{' '} Estimate Bill{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' ? ( {table2Data?.OrderType === 'E' ? (
@ -490,8 +490,8 @@ const Printstyle2 = ({
? PaymentStatusSuccess?.[0]?.PaymentTypeName ? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
&nbsp; Bill{' '} &nbsp; Bill{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */}
</div> </div>
)} )}
@ -510,7 +510,13 @@ const Printstyle2 = ({
</div> </div>
<div style={{ fontWeight: '600', fontSize: '10px' }}> <div style={{ fontWeight: '600', fontSize: '10px' }}>
{GlobaldummyData ? formattedDate : Date1} {GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontWeight: '600' }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
</div> </div>
<hr className="PrintStyle2-print-dottline" /> <hr className="PrintStyle2-print-dottline" />
</div> </div>
@ -722,6 +728,7 @@ const Printstyle2 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
<div style={{ display: "flex", gap: "3px" ,flexDirection:"column"}}>
{item?.ProductIdentifierDtls?.length > {item?.ProductIdentifierDtls?.length >
0 0
? item?.ProductIdentifierDtls?.filter( ? item?.ProductIdentifierDtls?.filter(
@ -754,6 +761,17 @@ const Printstyle2 = ({
); );
}) })
: ''} : ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.map((a, i) => (
<span key={i}>{a.Description}</span>
))
: ''}
</div>
</div> </div>
</td> </td>
)} )}
@ -3092,8 +3110,8 @@ const Printstyle2 = ({
}} }}
> >
Estimate Bill{' '} Estimate Bill{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' ? ( {table2Data?.OrderType === 'E' ? (
@ -3117,8 +3135,8 @@ const Printstyle2 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */}
</div> </div>
)} )}
@ -3308,27 +3326,24 @@ const Printstyle2 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > 0 <div style={{ display: 'flex', gap: "3px",flexDirection:"column" }}>
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
return <div>{a.SerialNumber}</div>;
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length > 0 {item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter( ? item?.ProductIdentifierDtls.filter(
(item1) => (items) =>
item1.IMEI1 !== '' || items.SerialNumber &&
item1.IMEI2 !== '' items.SerialNumber !== ''
)?.map((item2) => { ).map((a, i) => (
const imei1 = item2.IMEI1 || ''; <div key={i}>{a.SerialNumber}</div>
const imei2 = item2.IMEI2 || ''; ))
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
).map((id, i) => {
const imei1 = id.IMEI1 || '';
const imei2 = id.IMEI2 || '';
return ( return (
<div> <div key={i}>
{[imei1, imei2] {[imei1, imei2]
.filter(Boolean) .filter(Boolean)
.join(',')} .join(',')}
@ -3336,6 +3351,16 @@ const Printstyle2 = ({
); );
}) })
: ''} : ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.map((a, i) => (
<span key={i}>{a.Description}</span>
))
: ''}
</div>
</div> </div>
</td> </td>
)} )}

View File

@ -228,18 +228,28 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
{table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>} {table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>}
<div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div> <div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div>
{table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? 'Cash Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} </div>} {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? 'Cash Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
</div> </div>
</div>)} </div>)}
{(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) && <div style={{ fontSize: "14px", margin: "2px 0 0 0", textAlign: 'center', padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) && <div style={{ fontSize: "14px", margin: "2px 0 0 0", textAlign: 'center', padding: 0, fontWeight: 600 }}>Estimate Bill
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
<hr className="PrintStyle3-print-dottline" /> <hr className="PrintStyle3-print-dottline" />
<div className="PrintStyle3-print-ordr-dtls"> <div className="PrintStyle3-print-ordr-dtls">
<div style={{ lineheight: '50px' }}> <div style={{ lineheight: '50px' }}>
<div style={{ fontSize: '14px', fontWeight: 600 }} > BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)} </div> <div style={{ fontSize: '14px', fontWeight: 600 }} > BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)} </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '14px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '14px', fontWeight: 600 }} > {GlobaldummyData ? formattedDate : Date1}</div> <div style={{ fontSize: '14px', fontWeight: 600 }} > {GlobaldummyData ? formattedDate : Date1}</div>
</div> </div>
</div> </div>
@ -289,14 +299,41 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
) )
</div>)} </div>)}
&nbsp; {item?.BrandName !== null ? item?.BrandName : ""}&nbsp; &nbsp; {item?.BrandName !== null ? item?.BrandName : ""}&nbsp;
{item?.ProductIdentifierDtls?.length > 0 ? (item?.ProductIdentifierDtls?.filter((items) => !(items.SerialNumber == "" || items.SerialNumber == null)) <div style={{ display: 'flex', gap: "3px",flexDirection:"column"}}>
?.map(a => { return (<div>{a.SerialNumber}</div>) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") {item?.ProductIdentifierDtls?.length > 0
?.map(item2 => { ? item?.ProductIdentifierDtls.filter(
const imei1 = item2.IMEI1 || ""; (items) =>
const imei2 = item2.IMEI2 || ""; items.SerialNumber &&
return (<div>{[imei1, imei2].filter(Boolean).join(",")}</div>); items.SerialNumber !== ''
} ).map((a, i) => (
) : ""} <div key={i}>{a.SerialNumber}</div>
))
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
).map((id, i) => {
const imei1 = id.IMEI1 || '';
const imei2 = id.IMEI2 || '';
return (
<div key={i}>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.map((a, i) => (
<span key={i}>{a.Description} </span>
))
: ''}
</div>
</div> </div>
</div>} </div>}
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right' }}>{item?.HSN}</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>{item?.HSN}</div>} {GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right' }}>{item?.HSN}</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>{item?.HSN}</div>}
@ -1155,16 +1192,27 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
{table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>} {table2Data?.BrGSTIN && <div>GST NO :{GlobaldummyData ? '334bhbsagbysfgbfgbu' : table2Data?.BrGSTIN},</div>}
<div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div> <div style={{ fontWeight: '600' }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.BrMobile}</div>
{table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""} {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
</div> </div>
</div>)} </div>)}
{(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}</div>} {(!estimatePrintHeader && table2Data?.OrderType === "E" && estimateTitle) && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
<hr className="PrintStyle3-print-dottline" /> <hr className="PrintStyle3-print-dottline" />
<div className="PrintStyle3-print-ordr-dtls"> <div className="PrintStyle3-print-ordr-dtls">
<div style={{ lineheight: '50px' }}> <div style={{ lineheight: '50px' }}>
<div style={{ fontSize: '14px', fontWeight: 600 }} > BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)} </div> <div style={{ fontSize: '14px', fontWeight: 600 }} > BILL NO :{GlobaldummyData ? '51' : table2Data?.OrderId && extractLastNumberOrderId(table2Data?.OrderId, table2Data?.FYStatus)} </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '14px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '14px', fontWeight: 600 }} > {GlobaldummyData ? formattedDate : Date1}</div> <div style={{ fontSize: '14px', fontWeight: 600 }} > {GlobaldummyData ? formattedDate : Date1}</div>
</div> </div>
</div> </div>
@ -1210,14 +1258,41 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
) )
</div>)} </div>)}
&nbsp; {item?.BrandName !== null ? item?.BrandName : ""}&nbsp; &nbsp; {item?.BrandName !== null ? item?.BrandName : ""}&nbsp;
{item?.ProductIdentifierDtls?.length > 0 ? (item?.ProductIdentifierDtls?.filter((items) => !(items.SerialNumber == "" || items.SerialNumber == null)) <div style={{ display: 'flex', gap: "3px",flexDirection:"column" }}>
?.map(a => { return (<div>{a.SerialNumber}</div>) })) : ""} {item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter((item1) => item1.IMEI1 !== "" || item1.IMEI2 !== "") {item?.ProductIdentifierDtls?.length > 0
?.map(item2 => { ? item?.ProductIdentifierDtls.filter(
const imei1 = item2.IMEI1 || ""; (items) =>
const imei2 = item2.IMEI2 || ""; items.SerialNumber &&
return (<div>{[imei1, imei2].filter(Boolean).join(",")}</div>); items.SerialNumber !== ''
} ).map((a, i) => (
) : ""} <div key={i}>{a.SerialNumber}</div>
))
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
).map((id, i) => {
const imei1 = id.IMEI1 || '';
const imei2 = id.IMEI2 || '';
return (
<div key={i}>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.map((a, i) => (
<span key={i}>{a.Description}</span>
))
: ''}
</div>
</div> </div>
</div>} </div>}
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right' }}>{item?.HSN}</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>{item?.HSN}</div>} {GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right' }}>{item?.HSN}</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>{item?.HSN}</div>}

View File

@ -90,6 +90,7 @@ const Printstyle4 = ({
const GlobalHsnCode = useSelector(GlobalprintHsnCode); const GlobalHsnCode = useSelector(GlobalprintHsnCode);
const GlobalQrcodet = useSelector(GlobalprintQrcodet); const GlobalQrcodet = useSelector(GlobalprintQrcodet);
const GlobaldummyData = useSelector(GlobalPritdummyData); const GlobaldummyData = useSelector(GlobalPritdummyData);
console.log(GlobaldummyData, "GlobaldummyData")
const GlobalSignature = useSelector(GlobalprintSignature); const GlobalSignature = useSelector(GlobalprintSignature);
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions); const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
const GlobalSignatureImages = useSelector(GlobalSignatureImage); const GlobalSignatureImages = useSelector(GlobalSignatureImage);
@ -113,7 +114,7 @@ const Printstyle4 = ({
{} {}
), ),
]; ];
console.log(table2Data, 'table2Data'); console.log(table2Data, 'eeeeeeeeeeeeeeee');
const estimatePrintHeader = const estimatePrintHeader =
SettingData?.[0]?.SettingDtlDetails?.find( SettingData?.[0]?.SettingDtlDetails?.find(
(setting) => (setting) =>
@ -196,6 +197,7 @@ const Printstyle4 = ({
const TakeawayData = table2Data?.productDetails?.filter( const TakeawayData = table2Data?.productDetails?.filter(
(item) => item.BookingTypeName?.toLowerCase() === 'takeaway' (item) => item.BookingTypeName?.toLowerCase() === 'takeaway'
); );
console.log(TakeawayData, "TakeawayData")
const DineInData = table2Data?.productDetails?.filter( const DineInData = table2Data?.productDetails?.filter(
(item) => item.BookingTypeName?.toLowerCase() === 'dine in' (item) => item.BookingTypeName?.toLowerCase() === 'dine in'
); );
@ -342,6 +344,8 @@ const Printstyle4 = ({
? paginatedChunks[paginatedChunks.length - 1].length ? paginatedChunks[paginatedChunks.length - 1].length
: 0; : 0;
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10); const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10);
console.log(paginatedChunks, 'paginatedChunks')
return ( return (
<> <>
{FormatTheme ? ( {FormatTheme ? (
@ -486,7 +490,14 @@ const Printstyle4 = ({
> >
<div style={{ fontSize: '12px', fontWeight: '500' }}> <div style={{ fontSize: '12px', fontWeight: '500' }}>
Dt: {GlobaldummyData ? formattedDate : Date1} Dt: {GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' &&
<div style={{ fontSize: '12px', fontWeight: '500' }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
<div style={{ fontSize: '12px', fontWeight: '500' }}> <div style={{ fontSize: '12px', fontWeight: '500' }}>
Bill No : Bill No :
{GlobaldummyData {GlobaldummyData
@ -506,8 +517,8 @@ const Printstyle4 = ({
style={{ textTransform: 'uppercase', fontSize: '12px' }} style={{ textTransform: 'uppercase', fontSize: '12px' }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -525,8 +536,8 @@ const Printstyle4 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName ? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<hr className="PrintStyle4-print-dottline" /> <hr className="PrintStyle4-print-dottline" />
@ -695,192 +706,135 @@ const Printstyle4 = ({
</thead> </thead>
<tbody> <tbody>
{dataChunk?.map((item, index) => { {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 ( return (
<tr key={index}> <tr key={index}>
{/* SL NO */}
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td> ? GlobalSlNo && <td>{index + 1}</td>
: SLNO && ( : SLNO && <td>{chunkIndex * chunkSize + index + 1}</td>
<td> }
{chunkIndex * chunkSize + index + 1}
</td> {/* ITEM COLUMN */}
)}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <td>{item?.ProdName}</td> ? GlobalItem && <td>{item?.ProdName}</td>
: Item && ( : Item && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
padding: "10px 5px"
}} }}
> >
{/* Product Name */}
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId
).length > 0 ? (
<div>
{PackageDetails?.filter(
(pkg) =>
pkg.ProdId === item.ProdId
)?.map((item, index) => (
<span
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</span>
))}
{( {/* Package OR Size */}
(item?.ProductIdentifierDtls {packageList.length > 0 ? (
?.length > 0 <div>
? item?.ProductIdentifierDtls.filter( {packageList.map((pkg, i) => (
(items) => <div key={i}>
items.SerialNumber {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
) </div>
.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()}
</div> </div>
) : ( ) : (
<div> <div>
{( {(item?.Size || "1")}{" "}
(item?.Size || '1') + {item?.SinglePc === "Y"
(item?.SinglePc === 'Y' ? "PCS"
? ' PCS' : item?.Type !== "C"
: item?.Type !== 'C' ? item?.UomName
? ` ${item?.UomName}` : "COMBO"}{" "}
: ' COMBO') + {item?.BrandName || ""}
(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()}
</div> </div>
)} )}
</td>
)} {/* Serials */}
{GlobaldummyData {serials.map((s, i) => (
? GlobalQuantity && ( <div key={`serial-${i}`}>{s}</div>
<td style={{ textAlign: 'right' }}> ))}
{item?.SalesQty}
{/* IMEIs */}
{imeis.map((iVal, i) => (
<div key={`imei-${i}`}>{iVal}</div>
))}
{/* Description - Always New Line */}
{descriptions.map((d, i) => (
<div key={`desc-${i}`}>{d}</div>
))}
</td> </td>
) )
: Quantity && ( }
<td style={{ textAlign: 'right' }}>
{/* Quantity */}
{(GlobaldummyData ? GlobalQuantity : Quantity) && (
<td style={{ textAlign: "right" }}>
{item?.SalesQty} {item?.SalesQty}
</td> </td>
)} )}
{GlobaldummyData
? GlobalHsnCode && ( {/* HSN */}
<td style={{ textAlign: 'right' }}> {(GlobaldummyData ? GlobalHsnCode : HsnCode) && (
{item?.HSN} <td style={{ textAlign: "right" }}>
</td>
)
: HsnCode && (
<td style={{ textAlign: 'right' }}>
{item?.HSN} {item?.HSN}
</td> </td>
)} )}
{GlobaldummyData
? GlobalMRP && ( {/* MRP */}
<td style={{ textAlign: 'right' }}> {(GlobaldummyData ? GlobalMRP : MRP) && (
{item?.MRP} <td style={{ textAlign: "right" }}>
</td> {item?.SinglePc === "Y" ? item?.Rate : item?.MRP}
)
: MRP && (
<td style={{ textAlign: 'right' }}>
{item?.SinglePc === 'Y'
? item?.Rate
: item?.MRP}
</td> </td>
)} )}
{GlobaldummyData
? GlobalDiscount && ( {/* Discount */}
<td style={{ textAlign: 'right' }}> {(GlobaldummyData ? GlobalDiscount : Discount) && (
{item.discount} <td style={{ textAlign: "right" }}>
</td> {item?.Type !== "C"
)
: Discount && (
<td style={{ textAlign: 'right' }}>
{item?.Type != 'C'
? item?.OfferAmt || 0 ? item?.OfferAmt || 0
: item?.OfferValue || 0} : item?.OfferValue || 0}
</td> </td>
)} )}
{GlobaldummyData {/* Rate */}
? GlobalRate && ( {(GlobaldummyData ? GlobalRate : Rate) && (
<td style={{ textAlign: 'right' }}> <td style={{ textAlign: "right" }}>
{item?.Rate}
</td>
)
: Rate && (
<td style={{ textAlign: 'right' }}>
{item?.Rate} {item?.Rate}
</td> </td>
)} )}
{GlobaldummyData
? GlobalAmount && ( {/* Amount */}
<td style={{ textAlign: 'right' }}> {(GlobaldummyData ? GlobalAmount : Amount) && (
{item?.TotalAmt} <td style={{ textAlign: "right" }}>
</td> {item?.Type !== "C"
) ? (item?.TotalAmt || 0) - (item?.OfferAmt || 0)
: Amount && ( : (item?.TotalAmt || 0) - (item?.OfferValue || 0)}
<td style={{ textAlign: 'right' }}>
{' '}
{item?.Type != 'C'
? item?.TotalAmt - item?.OfferAmt || 0
: item?.TotalAmt - item?.OfferValue ||
0}
</td> </td>
)} )}
</tr> </tr>
); );
})} })}
@ -3188,7 +3142,16 @@ const Printstyle4 = ({
justifyContent: 'space-between', justifyContent: 'space-between',
}} }}
> >
<div>Dt: {GlobaldummyData ? formattedDate : Date1}</div> <div>
Dt: {GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' &&
<div >
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div>
<div> <div>
Bill No : Bill No :
{GlobaldummyData {GlobaldummyData
@ -3207,8 +3170,8 @@ const Printstyle4 = ({
style={{ textTransform: 'uppercase', fontSize: '12px' }} style={{ textTransform: 'uppercase', fontSize: '12px' }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -3228,8 +3191,8 @@ const Printstyle4 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<hr className="PrintStyle4-print-dottline" /> <hr className="PrintStyle4-print-dottline" />
@ -3363,200 +3326,104 @@ const Printstyle4 = ({
: Item && ( : Item && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
}} }}
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{/* Serial Numbers */}
{item?.ProductIdentifierDtls
?.filter(d => d.SerialNumber)
?.map((d, i) => (
<div key={`serial-${i}`}>
{d.SerialNumber}
</div>
))}
{/* IMEI Numbers */}
{item?.ProductIdentifierDtls
?.filter(d => d.IMEI1 || d.IMEI2)
?.map((d, i) => (
<div key={`imei-${i}`}>
{[d.IMEI1, d.IMEI2].filter(Boolean).join(", ")}
</div>
))}
{/* ✅ Description ALWAYS NEW LINE */}
{item?.ProductIdentifierDtls
?.filter(d => d.Description)
?.map((d, i) => (
<div key={`desc-${i}`}>
{d.Description}
</div>
))}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<td style={{ textAlign: 'right' }}> <td style={{ textAlign: 'right' }}>
{item?.SalesQty} {item?.SalesQty}
<div> <div>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId {/* Package Details */}
).length > 0 ? ( {PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId).length > 0 ? (
<div> <div>
{PackageDetails?.filter( {PackageDetails
(pkg) => pkg.ProdId === item.ProdId ?.filter(pkg => pkg.ProdId === item.ProdId)
)?.map((item, index) => ( ?.map((pkg, index) => (
<span <div key={index}>
key={index} {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
style={{ display: 'block' }} </div>
> ))}
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK ( {/* Serial */}
{item.ParcelType}) {item?.ProductIdentifierDtls
</span> ?.filter(d => d.SerialNumber)
?.map((d, i) => (
<div key={`serial-${i}`}>
{d.SerialNumber}
</div>
))}
{/* IMEI */}
{item?.ProductIdentifierDtls
?.filter(d => d.IMEI1 || d.IMEI2)
?.map((d, i) => (
<div key={`imei-${i}`}>
{[d.IMEI1, d.IMEI2].filter(Boolean).join(', ')}
</div>
))}
{/* ✅ Description NEW LINE */}
{item?.ProductIdentifierDtls
?.filter(d => d.Description)
?.map((d, i) => (
<div key={`desc-${i}`}>
{d.Description}
</div>
))} ))}
{(
(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()}
</div> </div>
) : ( ) : (
<div> <div>
{( {(item?.Size || '1')}{" "}
(item?.Size || '1') + {item?.SinglePc === 'Y'
(item?.SinglePc === 'Y'
? 'PCS' ? 'PCS'
: item?.Type !== 'C' : item?.Type !== 'C'
? ` ${item?.UomName}` ? item?.UomName
: ' COMBO') + : 'COMBO'}{" "}
(item?.BrandName {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()}
</div> </div>
)} )}
</div> </div>
</td> </td>
) )
: Quantity && ( : Quantity && (
<td style={{ textAlign: 'right' }}> <td style={{ textAlign: 'right' }}>
{item?.SalesQty} {item?.SalesQty}
{/* <div style={{ whiteSpace: 'nowrap' }}>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId
).length > 0 ? (
<div>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId
)?.map((item, index) => (
<span
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</span>
))}
{(
(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()}
</div>
) : (
<div>
{(
(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()}
</div>
)}
</div> */}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -3679,6 +3546,7 @@ const Printstyle4 = ({
</div> </div>
</> </>
)} )}
{DineInData?.length > 0 && ( {DineInData?.length > 0 && (
<> <>
<div <div
@ -3809,6 +3677,46 @@ const Printstyle4 = ({
}} }}
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{(
(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()}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -3934,6 +3842,7 @@ const Printstyle4 = ({
</> </>
)} )}
<div className="PrintStyle4-ThirdDivMaster"> <div className="PrintStyle4-ThirdDivMaster">
<div <div
className="print2subTotal" className="print2subTotal"
style={{ style={{
@ -3955,6 +3864,59 @@ const Printstyle4 = ({
: Number(table2Data?.NetAmount).toFixed(2)} : Number(table2Data?.NetAmount).toFixed(2)}
</div> </div>
</div> </div>
{/* <div
className="print2subTotal"
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
fontSize: '8px',
fontWeight: 400,
fontFamily: 'Poppins',
borderBottom: '1px dashed #000',
borderTop: '1px dashed #000',
padding: '5px 0',
}}
>
<div>OVER ALL QTY</div>
<div>
{GlobaldummyData
? '1,066'
: Number(productsData?.reduce((a, b) => a + b.SalesQty, 0))}
</div>
</div> */}
<div
className="print2subTotal"
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
fontSize: '8px',
fontWeight: 400,
fontFamily: 'Poppins',
borderBottom: '1px dashed #000',
borderTop: '1px dashed #000',
padding: '5px 40px',
}}
>
<div style={{ display: "flex", gap: "10px" }}>
<div> ITEM :</div>
<div>
{GlobaldummyData
? '1,066'
: productsData?.length}
</div>
</div>
<div style={{ display: "flex", gap: "10px" }}>
<div> QTY :</div>
<div>
{GlobaldummyData
? '1,066'
: Number(productsData?.reduce((a, b) => a + b.SalesQty, 0))}
</div>
</div>
</div>
{/* <div className="PrintStyle4-ThirdP"> {/* <div className="PrintStyle4-ThirdP">
<div> <div>

View File

@ -437,8 +437,8 @@ const PrintStyle5 = ({
{table2Data?.OrderType === 'E' && estimateTitle && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}> <div style={{ textTransform: 'uppercase' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' ? ( {table2Data?.OrderType === 'E' ? (
@ -452,8 +452,8 @@ const PrintStyle5 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName ? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -465,8 +465,8 @@ const PrintStyle5 = ({
style={{ textTransform: 'uppercase', textAlign: 'center' }} style={{ textTransform: 'uppercase', textAlign: 'center' }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -479,7 +479,13 @@ const PrintStyle5 = ({
}} }}
> >
{' '} {' '}
<div> {GlobaldummyData ? formattedDate : Date1} </div>{' '} <div> {GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '14px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div>{' '}
<div> <div>
{' '} {' '}
Bill No : Bill No :
@ -696,86 +702,104 @@ const PrintStyle5 = ({
) )
) : ( ) : (
<> <>
<div>{item?.ProdName}</div> {(() => {
{PackageDetails?.filter( const identifiers = item?.ProductIdentifierDtls ?? [];
(pkg) => pkg.ProdId === item.ProdId
).length > 0 ? ( const packageList = (PackageDetails ?? []).filter(
<div> pkg => pkg.ProdId === item.ProdId
{PackageDetails?.filter( );
(pkg) => pkg.ProdId === item.ProdId
)?.map((item, index) => (
<span
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS {item.ParcelQty}{' '}
PACK ({item.ParcelType})
</span>
))}
{(item?.ProductIdentifierDtls?.filter(
(items) =>
items.SerialNumber &&
items.SerialNumber !== ''
)?.map((a, index) => (
<div key={`serial-${index}`}>
{a.SerialNumber}
</div>
)) || '') +
(item?.ProductIdentifierDtls?.filter(
(item1) => item1.IMEI1 || item1.IMEI2
)?.map((item2, index) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return ( return (
<div key={`imei-${index}`}> <>
{[imei1, imei2] {/* 🏷 Product Name */}
.filter(Boolean) <div>{item?.ProdName}</div>
.join(',')}
{packageList.length > 0 ? (
// ================= PACKAGE EXISTS =================
<div>
{/* 📦 Package Details */}
{packageList.map((pkg, index) => (
<div key={index}>
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
</div>
))}
{/* 🔢 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 (
<div key={i}>
{serial && <div>{serial}</div>}
{imei && <div>{imei}</div>}
{description && <div>{description}</div>}
</div> </div>
); );
}) || '') + })}
(GlobaldummyData
{/* 🔢 Quantity */}
<div>
{GlobaldummyData
? GlobalQuantity && item?.SalesQty ? GlobalQuantity && item?.SalesQty
: item?.SalesQty)} : item?.SalesQty}
</div>
</div> </div>
) : ( ) : (
// ================= NO PACKAGE =================
<div> <div>
{(item?.Size || '1') +
(item?.SinglePc === 'Y' {/* 📏 Size + UOM */}
? 'PCS' <div>
: item?.Type !== 'C' {(item?.Size || "1")}{" "}
{item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO') + : "COMBO"}
(item?.BrandName || '') +
(item?.ProductIdentifierDtls?.filter(
(items) =>
items.SerialNumber &&
items.SerialNumber !== ''
)?.map((a, index) => (
<div key={`serial-${index}`}>
{a.SerialNumber}
</div> </div>
)) || '') +
(item?.ProductIdentifierDtls?.filter( {/* 🏷 Brand */}
(item1) => item1.IMEI1 || item1.IMEI2 {item?.BrandName && (
)?.map((item2, index) => { <div>{item.BrandName}</div>
const imei1 = item2.IMEI1 || ''; )}
const imei2 = item2.IMEI2 || '';
{/* 🔢 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 ( return (
<div key={`imei-${index}`}> <div key={i}>
{[imei1, imei2] {serial && <div>{serial}</div>}
.filter(Boolean) {imei && <div>{imei}</div>}
.join(',')} {description && <div>{description}</div>}
</div> </div>
); );
}) || '') + })}
'-' +
(GlobaldummyData {/* 🔢 Quantity */}
<div>
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty ? GlobalQuantity && item?.SalesQty
: item?.SalesQty)} : item?.SalesQty}
</div>
</div> </div>
)} )}
</> </>
);
})()}
</>
)} )}
</div> </div>
)} )}
@ -2729,8 +2753,8 @@ const PrintStyle5 = ({
{table2Data?.OrderType === 'E' && estimateTitle && ( {table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}> <div style={{ textTransform: 'uppercase' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' ? ( {table2Data?.OrderType === 'E' ? (
@ -2746,8 +2770,8 @@ const PrintStyle5 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -2757,8 +2781,8 @@ const PrintStyle5 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && ( {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase', textAlign: 'center' }}> <div style={{ textTransform: 'uppercase', textAlign: 'center' }}>
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -2772,7 +2796,12 @@ const PrintStyle5 = ({
}} }}
> >
{' '} {' '}
<div> {GlobaldummyData ? formattedDate : Date1} </div>{' '} <div> {GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '14px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div>{' '}
<div> <div>
{' '} {' '}
Bill No : Bill No :
@ -2978,88 +3007,104 @@ const PrintStyle5 = ({
) )
) : ( ) : (
<> <>
{/* 🏷 Product Name */}
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId {(() => {
).length > 0 ? ( const packages =
(PackageDetails ?? []).filter(pkg => pkg.ProdId === item.ProdId);
const identifiers = item?.ProductIdentifierDtls ?? [];
return packages.length > 0 ? (
// ================= PACKAGE EXISTS =================
<div> <div>
{PackageDetails?.filter( {/* 📦 Package Details */}
(pkg) => pkg.ProdId === item.ProdId {packages.map((pkg, index) => (
)?.map((item, index) => ( <span key={index} style={{ display: "block" }}>
<span {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount} PCS {item.ParcelQty}{' '}
PACK ({item.ParcelType})
</span> </span>
))} ))}
{(item?.BrandName || '') + {/* 🏷 Brand */}
(item?.ProductIdentifierDtls?.filter( {item?.BrandName && <div>{item.BrandName}</div>}
(items) =>
items.SerialNumber && {/* 🔢 Serial / IMEI / Description */}
items.SerialNumber !== '' {identifiers.map((d, i) => {
)?.map((a, index) => ( const values = [
<div key={`serial-${index}`}> d.SerialNumber,
{a.SerialNumber} d.IMEI1,
</div> d.IMEI2,
)) || '') + d.Description
(item?.ProductIdentifierDtls?.filter( ].filter(Boolean);
(item1) => item1.IMEI1 || item1.IMEI2
)?.map((item2, index) => { if (values.length === 0) return null;
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return ( return (
<div key={`imei-${index}`}> <div key={i}>
{[imei1, imei2] {values.join(", ")}
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) || '') + })}
'-' +
(GlobaldummyData {/* 🧪 Debug / Extra Text */}
<div>ssd3</div>
{/* 🔢 Quantity */}
<div>
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty ? GlobalQuantity && item?.SalesQty
: item?.SalesQty)} : item?.SalesQty}
</div>
</div> </div>
) : ( ) : (
// ================= NO PACKAGE =================
<div> <div>
{(item?.Size || '1') + {/* 📏 Size + UOM */}
(item?.SinglePc === 'Y' <div>
? 'PCS' {(item?.Size || "1")}
: item?.Type !== 'C' {item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO') + : "COMBO"}
(item?.BrandName || '') +
(item?.ProductIdentifierDtls?.filter(
(items) =>
items.SerialNumber &&
items.SerialNumber !== ''
)?.map((a, index) => (
<div key={`serial-${index}`}>
{a.SerialNumber}
</div> </div>
)) || '') +
(item?.ProductIdentifierDtls?.filter( {/* 🏷 Brand */}
(item1) => item1.IMEI1 || item1.IMEI2 {item?.BrandName && <div>{item.BrandName}</div>}
)?.map((item2, index) => {
const imei1 = item2.IMEI1 || ''; {/* 🔢 Serial / IMEI / Description */}
const imei2 = item2.IMEI2 || ''; {identifiers.map((d, i) => {
const values = [
d.SerialNumber,
d.IMEI1,
d.IMEI2,
d.Description
].filter(Boolean);
if (values.length === 0) return null;
return ( return (
<div key={`imei-${index}`}> <div key={i}>
{[imei1, imei2] {values.join(", ")}
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) || '') + })}
'-' +
(GlobaldummyData {/* 🧪 Debug / Extra Text */}
<div>ssd4</div>
{/* 🔢 Quantity */}
<div>
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty ? GlobalQuantity && item?.SalesQty
: item?.SalesQty)} : item?.SalesQty}
</div> </div>
)} </div>
);
})()}
</> </>
)} )}
</div> </div>

View File

@ -63,7 +63,7 @@ const Printstyle6 = ({
sportsAppPreference, sportsAppPreference,
MembershipApplied = null, MembershipApplied = null,
}) => { }) => {
console.log(table2Data, 'table2Data'); console.log(table2Data, 'table2Data22222222222222');
const dispatch = useDispatch(); const dispatch = useDispatch();
const GlobalUpiID = useSelector(GlobalUpiIDprint); const GlobalUpiID = useSelector(GlobalUpiIDprint);
const FieldDetails = useSelector(GloabalFieldDetails); const FieldDetails = useSelector(GloabalFieldDetails);
@ -455,8 +455,8 @@ const Printstyle6 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -477,8 +477,8 @@ const Printstyle6 = ({
: PaymentStatus?.length === 1 : PaymentStatus?.length === 1
? PaymentStatus?.[0]?.PaymentTypeName ? PaymentStatus?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */}
</div> </div>
)} )}
</div> </div>
@ -493,8 +493,8 @@ const Printstyle6 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<div <div
@ -514,6 +514,10 @@ const Printstyle6 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '14px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '12px' }}>{Date1}</div> <div style={{ fontSize: '12px' }}>{Date1}</div>
<hr className="PrintStyle6-HrLine" /> <hr className="PrintStyle6-HrLine" />
@ -763,34 +767,67 @@ const Printstyle6 = ({
<> <>
{Item && ( {Item && (
<> <>
{item?.ProdName} {/* 🏷 Product Name */}
{PackageDetails?.filter( <div>{item?.ProdName}</div>
(pkg) =>
pkg.ProdId === item.ProdId {/* 📦 Package OR Size */}
).length > 0 ? ( {(() => {
PackageDetails?.filter( const packageList = (PackageDetails ?? []).filter(
(pkg) => pkg => pkg.ProdId === item.ProdId
pkg.ProdId === item.ProdId );
)?.map((pkg, index) => (
if (packageList.length > 0) {
return packageList.map((pkg, index) => (
<div key={index}> <div key={index}>
{pkg.ParcelCount} PCS{' '} {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
{pkg.ParcelQty} PACK (
{pkg.ParcelType})
</div> </div>
)) ));
) : ( }
<span>
({item?.Size ? item?.Size : '1'} return (
{item?.SinglePc === 'Y' <div>
? 'PCS' ({item?.Size || "1"}
: item?.Type !== 'C' {item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
</span> </div>
)} );
{' - '} })()}
{Quantity && item?.SalesQty}
{/* 🔢 Serial Numbers */}
{(item?.ProductIdentifierDtls ?? [])
.filter(d => d.SerialNumber)
.map((d, i) => (
<div key={`serial-${i}`}>
{d.SerialNumber}
</div>
))}
{/* 📱 IMEI Numbers */}
{(item?.ProductIdentifierDtls ?? [])
.filter(d => d.IMEI1 || d.IMEI2)
.map((d, i) => (
<div key={`imei-${i}`}>
{[d.IMEI1, d.IMEI2].filter(Boolean).join(", ")}
</div>
))}
{/* 📝 Description (Always New Line) */}
{(item?.ProductIdentifierDtls ?? [])
.filter(d => d.SerialNumber || d.IMEI1 || d.IMEI2 || d.Description)
.map((d, i) => (
<div key={`description-${i}`}>
{d.Description}
</div>
))}
{/* 🔢 Quantity */}
<div>
- {Quantity && item?.SalesQty}
</div>
</> </>
)} )}
</> </>
@ -1111,55 +1148,53 @@ const Printstyle6 = ({
) : ( ) : (
<td <td
className="Re-print-body-Rate" className="Re-print-body-Rate"
style={{ textAlign: 'left' }} style={{ textAlign: "left" }}
> >
{(GlobaldummyData {/* 🏷 Product Name + Size */}
? 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 <div>{a.SerialNumber}</div>;
})
: '' +
item?.ProductIdentifierDtls
?.length >
0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div> <div>
{[imei1, imei2] {GlobaldummyData
.filter(Boolean) ? GlobalItem &&
.join(',')} `${item?.ProdName} (${item?.Size}${item?.UomName})`
: Item &&
`${item?.ProdName} (${item?.Size ? item.Size : "1"}${item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName
: "COMBO"
})`}
</div> </div>
);
}) {/* 🏷 Brand */}
: '' + {item?.BrandName && <div>{item.BrandName}</div>}
'-' +
(GlobaldummyData {/* 🔢 Serial Numbers */}
{(item?.ProductIdentifierDtls ?? [])
.filter(d => d.SerialNumber)
.map((d, i) => (
<div key={`serial-${i}`}>{d.SerialNumber}</div>
))}
{/* 📱 IMEI Numbers */}
{(item?.ProductIdentifierDtls ?? [])
.filter(d => d.IMEI1 || d.IMEI2)
.map((d, i) => (
<div key={`imei-${i}`}>
{[d.IMEI1, d.IMEI2].filter(Boolean).join(", ")}
</div>
))}
{(item?.ProductIdentifierDtls ?? [])
.filter(d => d.IMEI1 || d.IMEI2 || d.SerialNumber)
.map((d, i) => (
<div key={`description-${i}`}>{d.Description}</div>
))}
{/* 🔢 Quantity */}
<div>
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty ? GlobalQuantity && item?.SalesQty
: Quantity && item?.SalesQty)} : Quantity && item?.SalesQty}
</div>
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -3311,8 +3346,8 @@ const Printstyle6 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -3335,8 +3370,8 @@ const Printstyle6 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
</div> </div>
@ -3352,8 +3387,8 @@ const Printstyle6 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<div <div
@ -3373,6 +3408,10 @@ const Printstyle6 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '10px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '12px' }}>{Date1}</div> <div style={{ fontSize: '12px' }}>{Date1}</div>
<hr className="PrintStyle6-HrLine" /> <hr className="PrintStyle6-HrLine" />
@ -3822,50 +3861,69 @@ const Printstyle6 = ({
) : ( ) : (
<td <td
className="Re-print-body-Rate" className="Re-print-body-Rate"
style={{ textAlign: 'left' }} style={{ textAlign: "left" }}
> >
{(GlobaldummyData {(() => {
const identifiers = item?.ProductIdentifierDtls ?? [];
const sizeText = GlobaldummyData
? GlobalItem && ? GlobalItem &&
item?.ProdName + `${item?.ProdName} (${item?.Size}${item?.UomName})`
`(${item?.Size + item?.UomName})`
: Item && : Item &&
item?.ProdName + `${item?.ProdName} (${item?.Size || "1"}${item?.SinglePc === "Y"
`(${item?.Size ? item?.Size : '1'}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`) + ? "PCS"
item?.BrandName !== : item?.Type !== "C"
null ? item?.UomName
? item?.BrandName : "COMBO"
: '' + item?.ProductIdentifierDtls?.length > 0 })`;
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
return <div>{a.SerialNumber}</div>;
})
: '' + item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return ( return (
<div> <>
{[imei1, imei2] {/* 🏷 Product Name + Size */}
.filter(Boolean) <div>{sizeText}</div>
.join(',')}
{/* 🏷 Brand */}
{item?.BrandName && <div>{item.BrandName}</div>}
{/* 🔢 Serial Numbers */}
{identifiers
.filter(d => d.SerialNumber)
.map((d, i) => (
<div key={`serial-${i}`}>
{d.SerialNumber}
</div> </div>
); ))}
})
: '' + {/* 📱 IMEI Numbers */}
'-' + {identifiers
(GlobaldummyData .filter(d => d.IMEI1 || d.IMEI2)
.map((d, i) => (
<div key={`imei-${i}`}>
{[d.IMEI1, d.IMEI2].filter(Boolean).join(", ")}
</div>
))}
{/* 📝 Description (only if Serial or IMEI exists) */}
{identifiers
.filter(d => d.SerialNumber || d.IMEI1 || d.IMEI2 || d.Description)
.map((d, i) =>
d.Description ? (
<div key={`description-${i}`}>
{d.Description}
</div>
) : null
)}
{/* 🔢 Quantity */}
<div>
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty ? GlobalQuantity && item?.SalesQty
: Quantity && item?.SalesQty)} : Quantity && item?.SalesQty}
</div>
</>
);
})()}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData

View File

@ -468,8 +468,8 @@ const PrintStyle7 = ({
> >
{' '} {' '}
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' ? ( {table2Data?.OrderType === 'E' ? (
@ -489,8 +489,8 @@ const PrintStyle7 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName ? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
</div> </div>
@ -506,8 +506,8 @@ const PrintStyle7 = ({
> >
{' '} {' '}
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<hr className="PrintStyle7-print-dottline" /> <hr className="PrintStyle7-print-dottline" />
@ -527,6 +527,10 @@ const PrintStyle7 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '10px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
<div className="PrintStyle7-SecondDiv2"> <div className="PrintStyle7-SecondDiv2">
<div <div
@ -697,6 +701,33 @@ const PrintStyle7 = ({
) )
</div> </div>
)} )}
<div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
{(item?.ProductIdentifierDtls ?? [])
.filter(items => items.SerialNumber)
.map((a, i) => (
<div key={`serial-${i}`}>
{a.SerialNumber}
</div>
))}
{(item?.ProductIdentifierDtls ?? [])
.filter(id => id.IMEI1 || id.IMEI2)
.map((id, i) => (
<div key={`imei-${i}`}>
{[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
</div>
))}
{(item?.ProductIdentifierDtls ?? [])
.filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2)
.map((a, i) =>
a.Description ? (
<div key={`desc-${i}`}>
{a.Description}
</div>
) : null
)}
</div>
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -898,62 +929,58 @@ const PrintStyle7 = ({
{chunkIndex * chunkSize + index + 1} {chunkIndex * chunkSize + index + 1}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData ? (
? GlobalItem && <td>{item?.ProdName}</td> GlobalItem && <td>{item?.ProdName}</td>
: Item == true && ( ) : (
Item === true && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
}} }}
> >
{/* 🏷 Product Name */}
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{/* 📦 Size + Brand */}
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
{item?.BrandName !== null {item?.BrandName ? ` ${item.BrandName}` : ""}
? item?.BrandName </div>
: ''}
&nbsp; {/* 🔢 Identifiers */}
{item?.ProductIdentifierDtls?.length > <div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
0 {(item?.ProductIdentifierDtls ?? []).map((data, i) => {
? item?.ProductIdentifierDtls?.filter( const hasSerial = data.SerialNumber;
(items) => const hasIMEI = data.IMEI1 || data.IMEI2;
!(
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
return (
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return ( return (
<div key={i}>
{hasSerial && <div>{data.SerialNumber}</div>}
{hasIMEI && (
<div> <div>
{[imei1, imei2] {[data.IMEI1, data.IMEI2]
.filter(Boolean) .filter(Boolean)
.join(',')} .join(",")}
</div>
)}
{(hasSerial || hasIMEI) && data.Description && (
<div>{data.Description}</div>
)}
</div> </div>
); );
}) })}
: ''}
</div> </div>
</td> </td>
)
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
@ -2923,8 +2950,8 @@ const PrintStyle7 = ({
> >
{' '} {' '}
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
{table2Data?.OrderType === 'E' ? ( {table2Data?.OrderType === 'E' ? (
@ -2946,8 +2973,8 @@ const PrintStyle7 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
</div> </div>
@ -2963,8 +2990,8 @@ const PrintStyle7 = ({
> >
{' '} {' '}
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<hr className="PrintStyle7-print-dottline" /> <hr className="PrintStyle7-print-dottline" />
@ -2983,7 +3010,12 @@ const PrintStyle7 = ({
table2Data?.OrderId, table2Data?.OrderId,
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '10px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div> </div>
<div className="PrintStyle7-SecondDiv2"> <div className="PrintStyle7-SecondDiv2">
<div <div
@ -3132,6 +3164,31 @@ const PrintStyle7 = ({
) )
</div> </div>
)} )}
<div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
{(item?.ProductIdentifierDtls ?? []).filter(
items => items.SerialNumber && items.SerialNumber !== ""
).map((a, i) => (
<div key={`serial-${i}`}>{a.SerialNumber}</div>
))}
{(item?.ProductIdentifierDtls ?? []).filter(
id => id.IMEI1 || id.IMEI2
).map((id, i) => (
<div key={`imei-${i}`}>
{[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
</div>
))}
{(item?.ProductIdentifierDtls ?? []).filter(
items => items.SerialNumber || items.IMEI1 || items.IMEI2
).map((a, i) => (
a.Description && (
<div key={`desc-${i}`}>
{a.Description}
</div>
)
))}
</div>
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -3342,34 +3399,29 @@ const PrintStyle7 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > 0 <div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
? item?.ProductIdentifierDtls?.filter( {(item?.ProductIdentifierDtls ?? [])
(items) => .filter(items => items.SerialNumber)
!( .map((a, i) => (
items.SerialNumber == '' || <div key={`serial-${i}`}>{a.SerialNumber}</div>
items.SerialNumber == null ))}
)
)?.map((a) => { {(item?.ProductIdentifierDtls ?? [])
return <div>{a.SerialNumber}</div>; .filter(id => id.IMEI1 || id.IMEI2)
}) .map((id, i) => (
: ''}{' '} <div key={`imei-${i}`}>
{item?.ProductIdentifierDtls?.length > 0 {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
? item?.ProductIdentifierDtls.filter( </div>
(item1) => ))}
item1.IMEI1 !== '' ||
item1.IMEI2 !== '' {(item?.ProductIdentifierDtls ?? [])
)?.map((item2) => { .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2)
const imei1 = item2.IMEI1 || ''; .map((a, i) =>
const imei2 = item2.IMEI2 || ''; a.Description ? (
return ( <div key={`desc-${i}`}>{a.Description}</div>
<div> ) : null
{[imei1, imei2] )}
.filter(Boolean)
.join(',')}
</div> </div>
);
})
: ''}
</div> </div>
</td> </td>
)} )}

View File

@ -484,8 +484,8 @@ const Printstyle8 = ({
style={{ textTransform: 'uppercase', fontWeight: '600' }} style={{ textTransform: 'uppercase', fontWeight: '600' }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -503,8 +503,8 @@ const Printstyle8 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName ? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -519,7 +519,11 @@ const Printstyle8 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
<div style={{ fontSize: 'clamp(0.63rem, 2.5vw, 1.2rem)' }}> {SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '10px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: "10px" }}>
{GlobaldummyData ? formattedDate : Date1} {GlobaldummyData ? formattedDate : Date1}
</div> </div>
</div> </div>
@ -779,6 +783,41 @@ const Printstyle8 = ({
) )
</div> </div>
)} )}
<div style={{ display: 'flex', gap: "3px" }}>
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber &&
items.SerialNumber !== ''
).map((a, i) => (
<div key={i}>{a.SerialNumber}</div>
))
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
).map((id, i) => {
const imei1 = id.IMEI1 || '';
const imei2 = id.IMEI2 || '';
return (
<div key={i}>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber || items.IMEI1 || id.IMEI2
)?.map((a, i) => (
<span key={i}>{a.Description}</span>
))
: ''}
</div>
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -1106,38 +1145,33 @@ const Printstyle8 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > <div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
0 {(item?.ProductIdentifierDtls ?? [])
? item?.ProductIdentifierDtls?.filter( .filter(items => items.SerialNumber)
(items) => .map((a, i) => (
!( <div key={`serial-${i}`}>
items.SerialNumber == '' || {a.SerialNumber}
items.SerialNumber == null </div>
) ))}
)?.map((a) => {
return ( {(item?.ProductIdentifierDtls ?? [])
<div>{a.SerialNumber}</div> .filter(id => id.IMEI1 || id.IMEI2)
); .map((id, i) => (
}) <div key={`imei-${i}`}>
: ''}{' '} {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
{item?.ProductIdentifierDtls?.length > </div>
0 ))}
? item?.ProductIdentifierDtls.filter(
(item1) => {(item?.ProductIdentifierDtls ?? [])
item1.IMEI1 !== '' || .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2)
item1.IMEI2 !== '' .map((a, i) =>
)?.map((item2) => { a.Description ? (
const imei1 = item2.IMEI1 || ''; <div key={`desc-${i}`}>
const imei2 = item2.IMEI2 || ''; {a.Description}
return ( </div>
<div> ) : null
{[imei1, imei2] )}
.filter(Boolean)
.join(',')}
</div> </div>
);
})
: ''}
</div> </div>
</td> </td>
)} )}
@ -3287,8 +3321,8 @@ const Printstyle8 = ({
style={{ textTransform: 'uppercase', fontWeight: '600' }} style={{ textTransform: 'uppercase', fontWeight: '600' }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -3308,8 +3342,8 @@ const Printstyle8 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -3324,7 +3358,11 @@ const Printstyle8 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
<div style={{ fontSize: 'clamp(0.63rem, 2.5vw, 1.2rem)' }}> {SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '10px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: "10px" }}>
{GlobaldummyData ? formattedDate : Date1} {GlobaldummyData ? formattedDate : Date1}
</div> </div>
</div> </div>
@ -3727,58 +3765,62 @@ const Printstyle8 = ({
{index + 1} {index + 1}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData ? (
? GlobalItem && <td>{item?.ProdName}</td> GlobalItem && <td>{item?.ProdName}</td>
: Item && ( ) : (
Item && (
<td <td
style={{ style={{
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
}} }}
> >
{/* 🏷 Product Name */}
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{/* 📦 Size */}
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size || "1"}{" "}
{item?.SinglePc == 'Y' {item?.SinglePc === "Y"
? 'PCS' ? "PCS"
: item?.Type != 'C' : item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
{item?.BrandName !== null </div>
? item?.BrandName
: ''} {/* 🏷 Brand */}
&nbsp; {item?.BrandName && (
{item?.ProductIdentifierDtls?.length > 0 <div>{item.BrandName}</div>
? item?.ProductIdentifierDtls?.filter( )}
(items) =>
!( {/* 🔢 Identifiers */}
items.SerialNumber == '' || <div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
items.SerialNumber == null {(item?.ProductIdentifierDtls ?? []).map((data, i) => {
) const hasSerial = data.SerialNumber;
)?.map((a) => { const hasIMEI = data.IMEI1 || data.IMEI2;
return <div>{a.SerialNumber}</div>;
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return ( return (
<div key={i}>
{hasSerial && <div>{data.SerialNumber}</div>}
{hasIMEI && (
<div> <div>
{[imei1, imei2] {[data.IMEI1, data.IMEI2]
.filter(Boolean) .filter(Boolean)
.join(',')} .join(",")}
</div>
)}
{(hasSerial || hasIMEI) && data.Description && (
<div>{data.Description}</div>
)}
</div> </div>
); );
}) })}
: ''}
</div> </div>
</td> </td>
)
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && <td>{item?.HSN}</td> ? GlobalHsnCode && <td>{item?.HSN}</td>

View File

@ -485,8 +485,8 @@ const PrintStyle9 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -508,8 +508,8 @@ const PrintStyle9 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName ? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<div> <div>
@ -524,6 +524,10 @@ const PrintStyle9 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '12px', fontWeight: '400' }}> <div style={{ fontSize: '12px', fontWeight: '400' }}>
{' '} {' '}
{GlobaldummyData ? formattedDate : Date1}{' '} {GlobaldummyData ? formattedDate : Date1}{' '}
@ -543,8 +547,8 @@ const PrintStyle9 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<div className="straight-line9"></div> <div className="straight-line9"></div>
@ -705,113 +709,75 @@ const PrintStyle9 = ({
{GlobaldummyData {GlobaldummyData
? GlobalItem && <td>{item?.ProdName}</td> ? GlobalItem && <td>{item?.ProdName}</td>
: Item && ( : Item && (
<td <td style={{ display: "flex", flexDirection: "column" }}>
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId {(() => {
).length > 0 ? ( const packages =
PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId) || [];
const identifiers = item?.ProductIdentifierDtls || [];
return packages.length > 0 ? (
<div> <div>
{PackageDetails?.filter( {/* Package Details */}
(pkg) => pkg.ProdId === item.ProdId {packages.map((pkg, i) => (
)?.map((item, index) => ( <span key={i} style={{ display: "block" }}>
<span {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount}PCS
{item.ParcelQty}PACK(
{item.ParcelType})
</span> </span>
))} ))}
{item?.BrandName !== null
? item?.BrandName {item?.BrandName || ""}
: ''}
&nbsp; {/* Identifiers */}
{item?.ProductIdentifierDtls?.length > <div style={{ display: "flex", gap: "3px", flexWrap: "wrap", flexDirection: "column" }}>
0 {identifiers.map((id, i) => (
? item?.ProductIdentifierDtls?.filter( <div key={i} style={{ display: "flex", gap: "4px", flexWrap: "wrap", flexDirection: "column" }}>
(items) => {id.SerialNumber && <div>{id.SerialNumber}</div>}
!( {(id.IMEI1 || id.IMEI2) && (
items.SerialNumber == '' || <div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}</div>
items.SerialNumber == null )}
) {(id.SerialNumber || id.IMEI1 || id.IMEI2) && id.Description && (
)?.map((a) => { <div>{id.Description}</div>
return ( )}
<div>{a.SerialNumber}</div> </div>
); ))}
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
);
})
: ''}
</div> </div>
) : ( ) : (
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} {/* Size + UOM */}
{item?.SinglePc == 'Y' ({item?.Size || "1"}{" "}
? 'PCS' {item?.SinglePc === "Y"
: item?.Type != 'C' ? "PCS"
: item?.Type !== "C"
? item?.UomName ? item?.UomName
: 'COMBO'} : "COMBO"}
) )
{item?.BrandName !== null
? item?.BrandName {item?.BrandName || ""}
: ''}
&nbsp; {/* Identifiers */}
{item?.ProductIdentifierDtls?.length > {identifiers.map((id, i) => (
0 <div key={i} style={{ display: "flex", gap: "4px", flexWrap: "wrap", flexDirection: "column" }}>
? item?.ProductIdentifierDtls?.filter( {id.SerialNumber && <div>{id.SerialNumber}</div>}
(items) =>
!( {(id.IMEI1 || id.IMEI2) && (
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
return (
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div> <div>
{[imei1, imei2] {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
</div> </div>
)} )}
{(id.SerialNumber || id.IMEI1 || id.IMEI2) &&
id.Description && (
<div>{id.Description}</div>
)}
</div>
))}
</div>
);
})()}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -3226,8 +3192,8 @@ const PrintStyle9 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -3251,8 +3217,8 @@ const PrintStyle9 = ({
: PaymentStatusSuccess?.length === 1 : PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '} : ''}{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -3273,6 +3239,10 @@ const PrintStyle9 = ({
table2Data?.FYStatus table2Data?.FYStatus
)} )}
</div> </div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '12px', fontWeight: '400' }}> <div style={{ fontSize: '12px', fontWeight: '400' }}>
{' '} {' '}
{GlobaldummyData ? formattedDate : Date1}{' '} {GlobaldummyData ? formattedDate : Date1}{' '}
@ -3292,8 +3262,8 @@ const PrintStyle9 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
<div className="straight-line9"></div> <div className="straight-line9"></div>
@ -3438,34 +3408,33 @@ const PrintStyle9 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > 0 <div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
? item?.ProductIdentifierDtls?.filter( {(item?.ProductIdentifierDtls ?? [])
(items) => .filter(items => items.SerialNumber)
!( .map((a, i) => (
items.SerialNumber == '' || <div key={`serial-${i}`}>
items.SerialNumber == null {a.SerialNumber}
) </div>
)?.map((a) => { ))}
return <div>{a.SerialNumber}</div>;
}) {(item?.ProductIdentifierDtls ?? [])
: ''}{' '} .filter(id => id.IMEI1 || id.IMEI2)
{item?.ProductIdentifierDtls?.length > 0 .map((id, i) => (
? item?.ProductIdentifierDtls.filter( <div key={`imei-${i}`}>
(item1) => {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
item1.IMEI1 !== '' || </div>
item1.IMEI2 !== '' ))}
)?.map((item2) => {
const imei1 = item2.IMEI1 || ''; {(item?.ProductIdentifierDtls ?? [])
const imei2 = item2.IMEI2 || ''; .filter(items => items.SerialNumber || items.IMEI1 || items.IMEI2)
return ( .map((a, i) =>
<div> a.Description ? (
{[imei1, imei2] <div key={`desc-${i}`}>
.filter(Boolean) {a.Description}
.join(',')} </div>
) : null
)}
</div> </div>
);
})
: ''}
</div> </div>
</td> </td>
)} )}

View File

@ -125,7 +125,7 @@ const PaymentPdfBooking = ({
const [BranchZip, setBranchZip] = useState(); const [BranchZip, setBranchZip] = useState();
const CashierName = getSession('userName'); const CashierName = getSession('userName');
const printerTemplateStyle = useSelector(SelectedPrintTemplate); const printerTemplateStyle = useSelector(SelectedPrintTemplate);
console.log(printerTemplateStyle, 'printerTemplateStyle'); console.log(printerTemplateStyle, "printerTemplateStyle")
const appPreferences = useSelector(ApplicationPreferences); const appPreferences = useSelector(ApplicationPreferences);
const SettingData = useSelector(PreferenceData); const SettingData = useSelector(PreferenceData);
const estimatePrintHeader = const estimatePrintHeader =
@ -562,90 +562,51 @@ const PaymentPdfBooking = ({
<td className="Re-print-body-Product"> <td className="Re-print-body-Product">
{item?.ProdName} {item?.ProdName}
{PackageDetails?.filter( {/* Package Details */}
(pkg) => pkg.ProdId === item.ProdId {PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId).length > 0 && (
).length > 0 ? (
<div> <div>
{PackageDetails?.filter( {PackageDetails
(pkg) => pkg.ProdId === item.ProdId ?.filter(pkg => pkg.ProdId === item.ProdId)
)?.map((pkg, index) => ( ?.map((pkg, index) => (
<span key={index} style={{ display: 'block' }}> <span key={index} style={{ display: "block" }}>
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ( {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
{pkg.ParcelType})
</span> </span>
))} ))}
<span>
(
{item?.SinglePc === 'Y'
? 'PCS'
: item?.Type !== 'C'
? item?.UomName
: 'COMBO'}
) &nbsp;{' '}
{item?.BrandName !== null ? item?.BrandName : ''}
&nbsp;
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber &&
items.SerialNumber !== ''
).map((a, i) => (
<div key={i}>{a.SerialNumber}</div>
))
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
).map((id, i) => {
const imei1 = id.IMEI1 || '';
const imei2 = id.IMEI2 || '';
return (
<div key={i}>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
);
})
: ''}
</span>
</div>
) : (
<span>
({item?.Size ? item?.Size : '1'}{' '}
{item?.SinglePc === 'Y'
? 'PCS'
: item?.Type !== 'C'
? item?.UomName
: 'COMBO'}
) &nbsp;{' '}
{item?.BrandName !== null ? item?.BrandName : ''}
&nbsp;
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(items) =>
items.SerialNumber &&
items.SerialNumber !== ''
).map((a, i) => (
<div key={i}>{a.SerialNumber}</div>
))
: ''}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
).map((id, i) => {
const imei1 = id.IMEI1 || '';
const imei2 = id.IMEI2 || '';
return (
<div key={i}>
{[imei1, imei2].filter(Boolean).join(',')}
</div>
);
})
: ''}
</span>
)} )}
{/* Size, UOM, Brand */}
<div>
({item?.Size ?? '1'}{" "}
{item?.SinglePc === 'Y' ? "PCS" : item?.Type !== 'C' ? item?.UomName : "COMBO"}
) {item?.BrandName || ""}
</div>
{/* 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 (
<div key={index} style={{ display: "flex", flexDirection: "column", gap: "2px" }}>
{/* Serial + IMEIs */}
{(serial || imeis) && (
<div style={{ display: "flex", gap: "3px" }}>
{serial && <div>{serial}</div>}
{imeis && <div>{imeis}</div>}
</div>
)}
{/* Description */}
{description && <div>{description}</div>}
</div>
);
})}
{/* Available Time */}
{sportsAppPreference && {sportsAppPreference &&
`(${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`} `(${to12Hour(item?.AvailableFrom)} - ${to12Hour(item?.AvailableTo)})`}
</td> </td>