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 =
<div> PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId) || [];
{PackageDetails?.filter(
(pkg) => const identifiers = item?.ProductIdentifierDtls || [];
pkg.ProdId === item.ProdId
)?.map((item, index) => ( return (
<span <>
key={index} {/* Package OR Size */}
style={{ display: 'block' }} {packages.length > 0 ? (
> <div>
{item.ParcelCount} PCS{' '} {packages.map((pkg, index) => (
{item.ParcelQty} PACK ( <span key={index} style={{ display: "block" }}>
{item.ParcelType}) {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.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> </div>
); )}
})
: ''}{' '} {/* Description on new line */}
{item?.ProductIdentifierDtls?.length > 0 {id?.Description && <div>{id.Description}</div>}
? item?.ProductIdentifierDtls.filter( </div>
(item1) => ))}
item1.IMEI1 !== '' || </>
item1.IMEI2 !== '' );
)?.map((item2) => { })()}
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</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,88 +700,78 @@ 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} </span>
style={{ display: 'block' }} ))}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</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( </div>
(items) => ))}
!(
items.SerialNumber == {/* IMEI */}
'' || {item?.ProductIdentifierDtls?.map((id, index) => {
items.SerialNumber == null const imei1 = id?.IMEI1 || "";
) const imei2 = id?.IMEI2 || "";
)?.map((a) => {
return ( return (
<div>{a.SerialNumber}</div> (imei1 || imei2) && (
); <div key={`imei-${index}`}>
}) {[imei1, imei2].filter(Boolean).join(",")}
: ''}{' '}
{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 */}
{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 && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -1755,67 +1756,57 @@ 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 && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>

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,88 +700,71 @@ 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} </span>
style={{ display: 'block' }} ))}
>
{item.ParcelCount} PCS{' '}
{item.ParcelQty} PACK (
{item.ParcelType})
</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) && (
) <div>
)?.map((a) => { {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
return ( </div>
<div>{a.SerialNumber}</div> )}
);
}) {/* Description */}
: ''}{' '} {(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) &&
{item?.ProductIdentifierDtls id?.Description && (
?.length > 0 <div>{id.Description}</div>
? item?.ProductIdentifierDtls.filter( )}
(item1) =>
item1.IMEI1 !== '' || </div>
item1.IMEI2 !== '' ))
)?.map((item2) => { : null}
const imei1 =
item2.IMEI1 || '';
const imei2 =
item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
</td> </td>
)} )
)}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -1694,67 +1686,54 @@ 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 && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>

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 (
<div>{a.SerialNumber}</div> return (
); <div key={idx} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
}) {/* Serial + IMEIs on one line */}
: ''}{' '} {(serial || imeis) && (
{item?.ProductIdentifierDtls?.length > 0 <div style={{ display: 'flex', gap: '3px' }}>
? item?.ProductIdentifierDtls.filter( {serial && <div>{serial}</div>}
(item1) => {imeis && <div>{imeis}</div>}
item1.IMEI1 !== '' || </div>
item1.IMEI2 !== '' )}
)?.map((item2) => { {/* Description on new line */}
const imei1 = item2.IMEI1 || ''; {description && <div>{description}</div>}
const imei2 = item2.IMEI2 || ''; </div>
return ( );
<div> })}
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</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,38 +728,50 @@ const Printstyle2 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > <div style={{ display: "flex", gap: "3px" ,flexDirection:"column"}}>
0 {item?.ProductIdentifierDtls?.length >
? item?.ProductIdentifierDtls?.filter( 0
(items) => ? item?.ProductIdentifierDtls?.filter(
!( (items) =>
items.SerialNumber == '' || !(
items.SerialNumber == null items.SerialNumber == '' ||
) items.SerialNumber == null
)?.map((a) => { )
return ( )?.map((a) => {
<div>{a.SerialNumber}</div> return (
); <div>{a.SerialNumber}</div>
}) );
: ''}{' '} })
{item?.ProductIdentifierDtls?.length > : ''}{' '}
0 {item?.ProductIdentifierDtls?.length >
? item?.ProductIdentifierDtls.filter( 0
(item1) => ? item?.ProductIdentifierDtls.filter(
item1.IMEI1 !== '' || (item1) =>
item1.IMEI2 !== '' item1.IMEI1 !== '' ||
)?.map((item2) => { item1.IMEI2 !== ''
const imei1 = item2.IMEI1 || ''; )?.map((item2) => {
const imei2 = item2.IMEI2 || ''; const imei1 = item2.IMEI1 || '';
return ( const imei2 = item2.IMEI2 || '';
<div> return (
{[imei1, imei2] <div>
.filter(Boolean) {[imei1, imei2]
.join(',')} .filter(Boolean)
</div> .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>
</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,34 +3326,41 @@ const Printstyle2 = ({
? item?.BrandName ? item?.BrandName
: ''} : ''}
&nbsp; &nbsp;
{item?.ProductIdentifierDtls?.length > 0 <div style={{ display: 'flex', gap: "3px",flexDirection:"column" }}>
? item?.ProductIdentifierDtls?.filter( {item?.ProductIdentifierDtls?.length > 0
(items) => ? item?.ProductIdentifierDtls.filter(
!( (items) =>
items.SerialNumber == '' || items.SerialNumber &&
items.SerialNumber == null items.SerialNumber !== ''
) ).map((a, i) => (
)?.map((a) => { <div key={i}>{a.SerialNumber}</div>
return <div>{a.SerialNumber}</div>; ))
}) : ''}
: ''}{' '} {item?.ProductIdentifierDtls?.length > 0
{item?.ProductIdentifierDtls?.length > 0 ? item?.ProductIdentifierDtls.filter(
? item?.ProductIdentifierDtls.filter( (id) => id.IMEI1 !== '' || id.IMEI2 !== ''
(item1) => ).map((id, i) => {
item1.IMEI1 !== '' || const imei1 = id.IMEI1 || '';
item1.IMEI2 !== '' const imei2 = id.IMEI2 || '';
)?.map((item2) => { return (
const imei1 = item2.IMEI1 || ''; <div key={i}>
const imei2 = item2.IMEI2 || ''; {[imei1, imei2]
return ( .filter(Boolean)
<div> .join(',')}
{[imei1, imei2] </div>
.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>
</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>
)}
{GlobaldummyData
? GlobalQuantity && (
<td style={{ textAlign: 'right' }}>
{item?.SalesQty}
</td>
)
: Quantity && (
<td style={{ textAlign: 'right' }}>
{item?.SalesQty}
</td>
)}
{GlobaldummyData
? GlobalHsnCode && (
<td style={{ textAlign: 'right' }}>
{item?.HSN}
</td>
)
: HsnCode && (
<td style={{ textAlign: 'right' }}>
{item?.HSN}
</td>
)}
{GlobaldummyData
? GlobalMRP && (
<td style={{ textAlign: 'right' }}>
{item?.MRP}
</td>
)
: MRP && (
<td style={{ textAlign: 'right' }}>
{item?.SinglePc === 'Y'
? item?.Rate
: item?.MRP}
</td>
)}
{GlobaldummyData
? GlobalDiscount && (
<td style={{ textAlign: 'right' }}>
{item.discount}
</td>
)
: Discount && (
<td style={{ textAlign: 'right' }}>
{item?.Type != 'C'
? item?.OfferAmt || 0
: item?.OfferValue || 0}
</td>
)}
{GlobaldummyData {/* Serials */}
? GlobalRate && ( {serials.map((s, i) => (
<td style={{ textAlign: 'right' }}> <div key={`serial-${i}`}>{s}</div>
{item?.Rate} ))}
{/* 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>
) )
: Rate && ( }
<td style={{ textAlign: 'right' }}>
{item?.Rate} {/* Quantity */}
</td> {(GlobaldummyData ? GlobalQuantity : Quantity) && (
)} <td style={{ textAlign: "right" }}>
{GlobaldummyData {item?.SalesQty}
? GlobalAmount && ( </td>
<td style={{ textAlign: 'right' }}> )}
{item?.TotalAmt}
</td> {/* HSN */}
) {(GlobaldummyData ? GlobalHsnCode : HsnCode) && (
: Amount && ( <td style={{ textAlign: "right" }}>
<td style={{ textAlign: 'right' }}> {item?.HSN}
{' '} </td>
{item?.Type != 'C' )}
? item?.TotalAmt - item?.OfferAmt || 0
: item?.TotalAmt - item?.OfferValue || {/* MRP */}
0} {(GlobaldummyData ? GlobalMRP : MRP) && (
</td> <td style={{ textAlign: "right" }}>
)} {item?.SinglePc === "Y" ? item?.Rate : item?.MRP}
</td>
)}
{/* Discount */}
{(GlobaldummyData ? GlobalDiscount : Discount) && (
<td style={{ textAlign: "right" }}>
{item?.Type !== "C"
? item?.OfferAmt || 0
: item?.OfferValue || 0}
</td>
)}
{/* Rate */}
{(GlobaldummyData ? GlobalRate : Rate) && (
<td style={{ textAlign: "right" }}>
{item?.Rate}
</td>
)}
{/* Amount */}
{(GlobaldummyData ? GlobalAmount : Amount) && (
<td style={{ textAlign: "right" }}>
{item?.Type !== "C"
? (item?.TotalAmt || 0) - (item?.OfferAmt || 0)
: (item?.TotalAmt || 0) - (item?.OfferValue || 0)}
</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>
{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>
))}
{( <div>
(item?.ProductIdentifierDtls
?.length > 0 {/* Package Details */}
? item?.ProductIdentifierDtls.filter( {PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId).length > 0 ? (
(items) => items.SerialNumber <div>
) {PackageDetails
.map( ?.filter(pkg => pkg.ProdId === item.ProdId)
(a, index) => ?.map((pkg, index) => (
` ${a.SerialNumber}` <div key={index}>
) {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
.join('') </div>
: '') + ))}
(item?.ProductIdentifierDtls
?.length > 0 {/* Serial */}
? item?.ProductIdentifierDtls.filter( {item?.ProductIdentifierDtls
(item1) => ?.filter(d => d.SerialNumber)
item1.IMEI1 || item1.IMEI2 ?.map((d, i) => (
) <div key={`serial-${i}`}>
.map((item2, index) => { {d.SerialNumber}
const imei1 = </div>
item2.IMEI1 || ''; ))}
const imei2 =
item2.IMEI2 || ''; {/* IMEI */}
return ` ${[imei1, imei2].filter(Boolean).join(',')}`; {item?.ProductIdentifierDtls
}) ?.filter(d => d.IMEI1 || d.IMEI2)
.join('') ?.map((d, i) => (
: '') <div key={`imei-${i}`}>
).trim()} {[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>
))}
</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,85 +702,103 @@ 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) => ( return (
<span <>
key={index} {/* 🏷 Product Name */}
style={{ display: 'block' }} <div>{item?.ProdName}</div>
>
{item.ParcelCount} PCS {item.ParcelQty}{' '} {packageList.length > 0 ? (
PACK ({item.ParcelType}) // ================= PACKAGE EXISTS =================
</span> <div>
))}
{(item?.ProductIdentifierDtls?.filter( {/* 📦 Package Details */}
(items) => {packageList.map((pkg, index) => (
items.SerialNumber && <div key={index}>
items.SerialNumber !== '' {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
)?.map((a, index) => ( </div>
<div key={`serial-${index}`}> ))}
{a.SerialNumber}
</div> {/* 🔢 Identifiers (Serial / IMEI / Description) */}
)) || '') + {identifiers.map((d, i) => {
(item?.ProductIdentifierDtls?.filter( const serial = d.SerialNumber;
(item1) => item1.IMEI1 || item1.IMEI2 const imei = [d.IMEI1, d.IMEI2].filter(Boolean).join(", ");
)?.map((item2, index) => { const description = d.Description;
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || ''; if (!serial && !imei && !description) return null;
return (
<div key={`imei-${index}`}> return (
{[imei1, imei2] <div key={i}>
.filter(Boolean) {serial && <div>{serial}</div>}
.join(',')} {imei && <div>{imei}</div>}
{description && <div>{description}</div>}
</div>
);
})}
{/* 🔢 Quantity */}
<div>
{GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty}
</div> </div>
);
}) || '') +
(GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty)}
</div>
) : (
<div>
{(item?.Size || '1') +
(item?.SinglePc === 'Y'
? 'PCS'
: item?.Type !== 'C'
? item?.UomName
: 'COMBO') +
(item?.BrandName || '') +
(item?.ProductIdentifierDtls?.filter(
(items) =>
items.SerialNumber &&
items.SerialNumber !== ''
)?.map((a, index) => (
<div key={`serial-${index}`}>
{a.SerialNumber}
</div> </div>
)) || '') + ) : (
(item?.ProductIdentifierDtls?.filter( // ================= NO PACKAGE =================
(item1) => item1.IMEI1 || item1.IMEI2 <div>
)?.map((item2, index) => {
const imei1 = item2.IMEI1 || ''; {/* 📏 Size + UOM */}
const imei2 = item2.IMEI2 || ''; <div>
return ( {(item?.Size || "1")}{" "}
<div key={`imei-${index}`}> {item?.SinglePc === "Y"
{[imei1, imei2] ? "PCS"
.filter(Boolean) : item?.Type !== "C"
.join(',')} ? item?.UomName
: "COMBO"}
</div> </div>
);
}) || '') + {/* 🏷 Brand */}
'-' + {item?.BrandName && (
(GlobaldummyData <div>{item.BrandName}</div>
? GlobalQuantity && item?.SalesQty )}
: item?.SalesQty)}
</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>
);
})}
{/* 🔢 Quantity */}
<div>
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty}
</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 ? (
<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?.BrandName || '') + {(() => {
(item?.ProductIdentifierDtls?.filter( const packages =
(items) => (PackageDetails ?? []).filter(pkg => pkg.ProdId === item.ProdId);
items.SerialNumber &&
items.SerialNumber !== '' const identifiers = item?.ProductIdentifierDtls ?? [];
)?.map((a, index) => (
<div key={`serial-${index}`}> return packages.length > 0 ? (
{a.SerialNumber} // ================= PACKAGE EXISTS =================
</div> <div>
)) || '') + {/* 📦 Package Details */}
(item?.ProductIdentifierDtls?.filter( {packages.map((pkg, index) => (
(item1) => item1.IMEI1 || item1.IMEI2 <span key={index} style={{ display: "block" }}>
)?.map((item2, index) => { {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
const imei1 = item2.IMEI1 || ''; </span>
const imei2 = item2.IMEI2 || ''; ))}
{/* 🏷 Brand */}
{item?.BrandName && <div>{item.BrandName}</div>}
{/* 🔢 Serial / IMEI / Description */}
{identifiers.map((d, i) => {
const values = [
d.SerialNumber,
d.IMEI1,
d.IMEI2,
d.Description
].filter(Boolean);
if (values.length === 0) return null;
return ( return (
<div key={`imei-${index}`}> <div key={i}>
{[imei1, imei2] {values.join(", ")}
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) || '') + })}
'-' +
(GlobaldummyData {/* 🧪 Debug / Extra Text */}
? GlobalQuantity && item?.SalesQty <div>ssd3</div>
: item?.SalesQty)}
</div> {/* 🔢 Quantity */}
) : ( <div>
<div> -
{(item?.Size || '1') + {GlobaldummyData
(item?.SinglePc === 'Y' ? GlobalQuantity && item?.SalesQty
? 'PCS' : item?.SalesQty}
: item?.Type !== 'C' </div>
? item?.UomName </div>
: 'COMBO') + ) : (
(item?.BrandName || '') + // ================= NO PACKAGE =================
(item?.ProductIdentifierDtls?.filter( <div>
(items) => {/* 📏 Size + UOM */}
items.SerialNumber && <div>
items.SerialNumber !== '' {(item?.Size || "1")}
)?.map((a, index) => ( {item?.SinglePc === "Y"
<div key={`serial-${index}`}> ? "PCS"
{a.SerialNumber} : item?.Type !== "C"
</div> ? item?.UomName
)) || '') + : "COMBO"}
(item?.ProductIdentifierDtls?.filter( </div>
(item1) => item1.IMEI1 || item1.IMEI2
)?.map((item2, index) => { {/* 🏷 Brand */}
const imei1 = item2.IMEI1 || ''; {item?.BrandName && <div>{item.BrandName}</div>}
const imei2 = item2.IMEI2 || '';
{/* 🔢 Serial / IMEI / Description */}
{identifiers.map((d, i) => {
const values = [
d.SerialNumber,
d.IMEI1,
d.IMEI2,
d.Description
].filter(Boolean);
if (values.length === 0) return null;
return ( return (
<div key={`imei-${index}`}> <div key={i}>
{[imei1, imei2] {values.join(", ")}
.filter(Boolean)
.join(',')}
</div> </div>
); );
}) || '') + })}
'-' +
(GlobaldummyData {/* 🧪 Debug / Extra Text */}
? GlobalQuantity && item?.SalesQty <div>ssd4</div>
: item?.SalesQty)}
</div> {/* 🔢 Quantity */}
)} <div>
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty}
</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) => (
<div key={index}> if (packageList.length > 0) {
{pkg.ParcelCount} PCS{' '} return packageList.map((pkg, index) => (
{pkg.ParcelQty} PACK ( <div key={index}>
{pkg.ParcelType}) {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
</div>
));
}
return (
<div>
({item?.Size || "1"}
{item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName
: "COMBO"}
)
</div> </div>
)) );
) : ( })()}
<span>
({item?.Size ? item?.Size : '1'} {/* 🔢 Serial Numbers */}
{item?.SinglePc === 'Y' {(item?.ProductIdentifierDtls ?? [])
? 'PCS' .filter(d => d.SerialNumber)
: item?.Type !== 'C' .map((d, i) => (
? item?.UomName <div key={`serial-${i}`}>
: 'COMBO'} {d.SerialNumber}
) </div>
</span> ))}
)}
{' - '} {/* 📱 IMEI Numbers */}
{Quantity && item?.SalesQty} {(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 && <div>
item?.ProdName + {GlobaldummyData
`(${item?.Size + item?.UomName})` ? GlobalItem &&
: Item && `${item?.ProdName} (${item?.Size}${item?.UomName})`
item?.ProdName + : Item &&
`(${item?.Size ? item?.Size : '1'}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`) + `${item?.ProdName} (${item?.Size ? item.Size : "1"}${item?.SinglePc === "Y"
item?.BrandName !== ? "PCS"
null : item?.Type !== "C"
? item?.BrandName ? item?.UomName
: '' + : "COMBO"
item?.ProductIdentifierDtls })`}
?.length > </div>
0
? item?.ProductIdentifierDtls?.filter( {/* 🏷 Brand */}
(items) => {item?.BrandName && <div>{item.BrandName}</div>}
!(
items.SerialNumber == '' || {/* 🔢 Serial Numbers */}
items.SerialNumber == null {(item?.ProductIdentifierDtls ?? [])
) .filter(d => d.SerialNumber)
)?.map((a) => { .map((d, i) => (
return <div>{a.SerialNumber}</div>; <div key={`serial-${i}`}>{d.SerialNumber}</div>
}) ))}
: '' +
item?.ProductIdentifierDtls {/* 📱 IMEI Numbers */}
?.length > {(item?.ProductIdentifierDtls ?? [])
0 .filter(d => d.IMEI1 || d.IMEI2)
? item?.ProductIdentifierDtls.filter( .map((d, i) => (
(item1) => <div key={`imei-${i}`}>
item1.IMEI1 !== '' || {[d.IMEI1, d.IMEI2].filter(Boolean).join(", ")}
item1.IMEI2 !== '' </div>
)?.map((item2) => { ))}
const imei1 = item2.IMEI1 || ''; {(item?.ProductIdentifierDtls ?? [])
const imei2 = item2.IMEI2 || ''; .filter(d => d.IMEI1 || d.IMEI2 || d.SerialNumber)
return ( .map((d, i) => (
<div> <div key={`description-${i}`}>{d.Description}</div>
{[imei1, imei2] ))}
.filter(Boolean)
.join(',')} {/* 🔢 Quantity */}
</div> <div>
); -
}) {GlobaldummyData
: '' + ? GlobalQuantity && item?.SalesQty
'-' + : Quantity && item?.SalesQty}
(GlobaldummyData </div>
? GlobalQuantity && item?.SalesQty
: Quantity && item?.SalesQty)}
</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 {(() => {
? GlobalItem && const identifiers = item?.ProductIdentifierDtls ?? [];
item?.ProdName +
`(${item?.Size + item?.UomName})` const sizeText = GlobaldummyData
: Item && ? GlobalItem &&
item?.ProdName + `${item?.ProdName} (${item?.Size}${item?.UomName})`
`(${item?.Size ? item?.Size : '1'}${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`) + : Item &&
item?.BrandName !== `${item?.ProdName} (${item?.Size || "1"}${item?.SinglePc === "Y"
null ? "PCS"
? item?.BrandName : item?.Type !== "C"
: '' + item?.ProductIdentifierDtls?.length > 0 ? item?.UomName
? item?.ProductIdentifierDtls?.filter( : "COMBO"
(items) => })`;
!(
items.SerialNumber == '' || return (
items.SerialNumber == null <>
) {/* 🏷 Product Name + Size */}
)?.map((a) => { <div>{sizeText}</div>
return <div>{a.SerialNumber}</div>;
}) {/* 🏷 Brand */}
: '' + item?.ProductIdentifierDtls?.length > {item?.BrandName && <div>{item.BrandName}</div>}
0
? item?.ProductIdentifierDtls.filter( {/* 🔢 Serial Numbers */}
(item1) => {identifiers
item1.IMEI1 !== '' || .filter(d => d.SerialNumber)
item1.IMEI2 !== '' .map((d, i) => (
)?.map((item2) => { <div key={`serial-${i}`}>
const imei1 = item2.IMEI1 || ''; {d.SerialNumber}
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
); ))}
})
: '' + {/* 📱 IMEI Numbers */}
'-' + {identifiers
(GlobaldummyData .filter(d => d.IMEI1 || d.IMEI2)
? GlobalQuantity && item?.SalesQty .map((d, i) => (
: Quantity && item?.SalesQty)} <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
: 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,63 +929,59 @@ 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 == '' || return (
items.SerialNumber == null <div key={i}>
) {hasSerial && <div>{data.SerialNumber}</div>}
)?.map((a) => {
return ( {hasIMEI && (
<div>{a.SerialNumber}</div> <div>
); {[data.IMEI1, data.IMEI2]
}) .filter(Boolean)
: ''}{' '} .join(",")}
{item?.ProductIdentifierDtls?.length > </div>
0 )}
? item?.ProductIdentifierDtls.filter(
(item1) => {(hasSerial || hasIMEI) && data.Description && (
item1.IMEI1 !== '' || <div>{data.Description}</div>
item1.IMEI2 !== '' )}
)?.map((item2) => { </div>
const imei1 = item2.IMEI1 || ''; );
const imei2 = item2.IMEI2 || ''; })}
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
</div> </div>
</td> </td>
)} )
)}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -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(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </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>
</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
)
)?.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>
); ))}
})
: ''} {(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>
</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,59 +3765,63 @@ 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>;
}) return (
: ''}{' '} <div key={i}>
{item?.ProductIdentifierDtls?.length > 0 {hasSerial && <div>{data.SerialNumber}</div>}
? item?.ProductIdentifierDtls.filter(
(item1) => {hasIMEI && (
item1.IMEI1 !== '' || <div>
item1.IMEI2 !== '' {[data.IMEI1, data.IMEI2]
)?.map((item2) => { .filter(Boolean)
const imei1 = item2.IMEI1 || ''; .join(",")}
const imei2 = item2.IMEI2 || ''; </div>
return ( )}
<div>
{[imei1, imei2] {(hasSerial || hasIMEI) && data.Description && (
.filter(Boolean) <div>{data.Description}</div>
.join(',')} )}
</div> </div>
); );
}) })}
: ''}
</div> </div>
</td> </td>
)} )
)}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && <td>{item?.HSN}</td> ? GlobalHsnCode && <td>{item?.HSN}</td>
: HsnCode && <td>{item?.HSN}</td>} : HsnCode && <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 =
<div> PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId) || [];
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId const identifiers = item?.ProductIdentifierDtls || [];
)?.map((item, index) => (
<span return packages.length > 0 ? (
key={index} <div>
style={{ display: 'block' }} {/* Package Details */}
> {packages.map((pkg, i) => (
{item.ParcelCount}PCS <span key={i} style={{ display: "block" }}>
{item.ParcelQty}PACK( {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
{item.ParcelType}) </span>
</span> ))}
))}
{item?.BrandName !== null {item?.BrandName || ""}
? item?.BrandName
: ''} {/* Identifiers */}
&nbsp; <div style={{ display: "flex", gap: "3px", flexWrap: "wrap", flexDirection: "column" }}>
{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) && (
!( <div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}</div>
items.SerialNumber == '' || )}
items.SerialNumber == null {(id.SerialNumber || id.IMEI1 || id.IMEI2) && id.Description && (
) <div>{id.Description}</div>
)?.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>
); ))}
}) </div>
: ''} </div>
</div> ) : (
) : ( <div>
<div> {/* Size + UOM */}
({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 || ""}
: ''}
&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 == '' || <div>
items.SerialNumber == null {[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
) </div>
)?.map((a) => { )}
return (
<div>{a.SerialNumber}</div> {(id.SerialNumber || id.IMEI1 || id.IMEI2) &&
); id.Description && (
}) <div>{id.Description}</div>
: ''}{' '} )}
{item?.ProductIdentifierDtls?.length > </div>
0 ))}
? item?.ProductIdentifierDtls.filter( </div>
(item1) => );
item1.IMEI1 !== '' || })()}
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</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}
)
)?.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>
); ))}
})
: ''} {(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>
</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,92 +562,53 @@ 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>
);
})
: ''}
</span>
</div> </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>
<td className="Re-print-body-Rate">{item?.SalesQty}</td> <td className="Re-print-body-Rate">{item?.SalesQty}</td>
<td className="Re-print-body-Rate">{item?.Rate}</td> <td className="Re-print-body-Rate">{item?.Rate}</td>