Update src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.jsx

This commit is contained in:
karthikalakshmi 2026-03-03 09:52:32 +05:30
parent e5c2577237
commit 533dbbab1b
1 changed files with 149 additions and 121 deletions

View File

@ -100,9 +100,9 @@ const PrintStyle7 = ({
const GlobalCredit = useSelector(GlobalprintCredit); const GlobalCredit = useSelector(GlobalprintCredit);
const SettingData = useSelector(PreferenceData); const SettingData = useSelector(PreferenceData);
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
(i) => i.SettingIdName === 'PrintUom' (i) => i.SettingIdName === 'PrintUom'
)?.[0]; )?.[0];
const estimatePrintHeader = const estimatePrintHeader =
SettingData?.[0]?.SettingDtlDetails?.find( SettingData?.[0]?.SettingDtlDetails?.find(
(setting) => (setting) =>
@ -471,8 +471,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' ? (
@ -492,8 +492,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>
@ -509,8 +509,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" />
@ -530,6 +530,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
@ -690,17 +694,39 @@ const PrintStyle7 = ({
))} ))}
</div> </div>
) : ( ) : (
UomPrint?.SettingValue === 'Y' &&
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} {UomPrint?.SettingValue === 'Y' && (
{item?.SinglePc == 'Y' <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} </>
? 'PCS' )}
: item?.Type != 'C'
? item?.UomName
: 'COMBO'}
)
</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
@ -902,66 +928,55 @@ 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>
{UomPrint?.SettingValue === 'Y' {UomPrint?.SettingValue === 'Y' && (
? `${item?.Size || '1'} ${ <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} </>
item?.SinglePc === 'Y' )}
? 'PCS' {item?.BrandName ? ` ${item.BrandName}` : ""}
: item?.Type !== 'C' </div>
? item?.UomName
: 'COMBO' {/* 🔢 Identifiers */}
}` <div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
: '' {(item?.ProductIdentifierDtls ?? []).map((data, i) => {
} const hasSerial = data.SerialNumber;
{item?.BrandName !== null const hasIMEI = data.IMEI1 || data.IMEI2;
? item?.BrandName
: ''} return (
&nbsp; <div key={i}>
{item?.ProductIdentifierDtls?.length > {hasSerial && <div>{data.SerialNumber}</div>}
0
? item?.ProductIdentifierDtls?.filter( {hasIMEI && (
(items) => <div>
!( {[data.IMEI1, data.IMEI2]
items.SerialNumber == '' || .filter(Boolean)
items.SerialNumber == null .join(",")}
) </div>
)?.map((a) => { )}
return (
<div>{a.SerialNumber}</div> {(hasSerial || hasIMEI) && data.Description && (
); <div>{data.Description}</div>
}) )}
: ''}{' '} </div>
{item?.ProductIdentifierDtls?.length > );
0 })}
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
</div> </div>
</td> </td>
)} )
)}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -2930,8 +2945,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' ? (
@ -2953,8 +2968,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>
@ -2970,8 +2985,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" />
@ -2990,7 +3005,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
@ -3129,17 +3149,37 @@ const PrintStyle7 = ({
))} ))}
</div> </div>
) : ( ) : (
UomPrint?.SettingValue === 'Y' && <div>
<div> {UomPrint?.SettingValue === 'Y' && (
({item?.Size ? item?.Size : '1'}{' '} <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} </>
{item?.SinglePc == 'Y' )}
? 'PCS' </div>
: item?.Type != 'C'
? item?.UomName
: 'COMBO'}
)
</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
@ -3339,48 +3379,36 @@ const PrintStyle7 = ({
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
<div> <div>
{UomPrint?.SettingValue === 'Y' {UomPrint?.SettingValue === 'Y' && (
? `${item?.Size || '1'} ${ <>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} </>
item?.SinglePc === 'Y' )}
? 'PCS'
: item?.Type !== 'C'
? item?.UomName
: 'COMBO'
}`
: ''
}
{item?.BrandName !== null {item?.BrandName !== null
? 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>
)} )}