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

This commit is contained in:
karthikalakshmi 2026-03-03 09:54:56 +05:30
parent 46ef51019b
commit ccccf8b149
1 changed files with 1460 additions and 1503 deletions

View File

@ -112,7 +112,8 @@ const PrintStyle9 = ({
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const estimateTitle = const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find( SettingData?.[0]?.SettingDtlDetails?.find(
(setting) => setting?.SettingIdName?.toLowerCase() === 'estimatetitle' (setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y'; )?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
@ -487,8 +488,8 @@ const PrintStyle9 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -510,8 +511,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>
@ -526,6 +527,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}{' '}
@ -534,9 +539,7 @@ const PrintStyle9 = ({
</div> </div>
)} )}
{!estimatePrintHeader && {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
table2Data?.OrderType === 'E' &&
estimateTitle && (
<div <div
className="" className=""
style={{ style={{
@ -547,8 +550,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>
@ -709,113 +712,78 @@ const PrintStyle9 = ({
{GlobaldummyData {GlobaldummyData
? GlobalItem && <td>{item?.ProdName}</td> ? GlobalItem && <td>{item?.ProdName}</td>
: Item && ( : Item && (
<td <td style={{ display: "flex", flexDirection: "column" }}>
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId {(() => {
).length > 0 ? ( const packages =
PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId) || [];
const identifiers = item?.ProductIdentifierDtls || [];
return packages.length > 0 ? (
<div> <div>
{PackageDetails?.filter( {/* Package Details */}
(pkg) => pkg.ProdId === item.ProdId {packages.map((pkg, i) => (
)?.map((item, index) => ( <span key={i} style={{ display: "block" }}>
<span {pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount}PCS
{item.ParcelQty}PACK(
{item.ParcelType})
</span> </span>
))} ))}
{item?.BrandName !== null
? item?.BrandName {item?.BrandName && <div>{item.BrandName}</div>}
: ''}
&nbsp; {/* Identifiers */}
{item?.ProductIdentifierDtls?.length > <div style={{ display: "flex", gap: "3px", flexWrap: "wrap", flexDirection: "column" }}>
0 {identifiers.map((id, i) => (
? item?.ProductIdentifierDtls?.filter( <div key={i} style={{ display: "flex", gap: "4px", flexWrap: "wrap", flexDirection: "column" }}>
(items) => {id.SerialNumber && <div>{id.SerialNumber}</div>}
!( {(id.IMEI1 || id.IMEI2) && (
items.SerialNumber == '' || <div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}</div>
items.SerialNumber == null )}
) {(id.SerialNumber || id.IMEI1 || id.IMEI2) && id.Description && (
)?.map((a) => { <div>{id.Description}</div>
return ( )}
<div>{a.SerialNumber}</div> </div>
); ))}
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
);
})
: ''}
</div> </div>
) : ( ) : (
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} {/* Size + UOM */}
{item?.SinglePc == 'Y' {UomPrint?.SettingValue === 'Y' && (
? 'PCS'
: item?.Type != 'C'
? item?.UomName
: 'COMBO'}
)
{item?.BrandName !== null
? item?.BrandName
: ''}
&nbsp;
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
return (
<div>{a.SerialNumber}</div>
);
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div> <div>
{[imei1, imei2] ({item?.Size || "1"}{" "}
.filter(Boolean) {item?.SinglePc === "Y"
.join(',')} ? "PCS"
</div> : item?.Type !== "C"
); ? item?.UomName
}) : "COMBO"})
: ''}
</div> </div>
)} )}
{item?.BrandName && <div>{item.BrandName}</div>}
{/* Identifiers */}
{identifiers.map((id, i) => (
<div key={i} style={{ display: "flex", gap: "4px", flexWrap: "wrap", flexDirection: "column" }}>
{id.SerialNumber && <div>{id.SerialNumber}</div>}
{(id.IMEI1 || id.IMEI2) && (
<div>
{[id.IMEI1, id.IMEI2].filter(Boolean).join(",")}
</div>
)}
{(id.SerialNumber || id.IMEI1 || id.IMEI2) &&
id.Description && (
<div>{id.Description}</div>
)}
</div>
))}
</div>
);
})()}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -1073,10 +1041,10 @@ const PrintStyle9 = ({
? 'PCS' ? 'PCS'
: item?.Type != 'C' : item?.Type != 'C'
? item?.UomName ? item?.UomName
: 'COMBO'} : 'COMBO'})
)
</div> </div>
)} )}
{item?.BrandName && <div>{item.BrandName}</div>}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -1898,10 +1866,8 @@ const PrintStyle9 = ({
{lastTransaction?.AdjustmentType === 'REFUND' {lastTransaction?.AdjustmentType === 'REFUND'
? '-' ? '-'
: '+'} : '+'}
{Math.abs( {Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.BeforeAdjustment ?? 0) - (lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
(lastTransaction?.AfterAdjustment ?? 0)
).toFixed(2)}
</span> </span>
</div> </div>
<div <div
@ -2883,10 +2849,8 @@ const PrintStyle9 = ({
{lastTransaction?.AdjustmentType === 'REFUND' {lastTransaction?.AdjustmentType === 'REFUND'
? '-' ? '-'
: '+'} : '+'}
{Math.abs( {Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.BeforeAdjustment ?? 0) - (lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
(lastTransaction?.AfterAdjustment ?? 0)
).toFixed(2)}
</span> </span>
</div> </div>
<div <div
@ -3236,8 +3200,8 @@ const PrintStyle9 = ({
}} }}
> >
Estimate{' '} Estimate{' '}
{SalesModePref?.SettingValue == 'Y' && {/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div> </div>
)} )}
@ -3261,8 +3225,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>
)} )}
@ -3283,6 +3247,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}{' '}
@ -3291,9 +3259,7 @@ const PrintStyle9 = ({
</div> </div>
)} )}
{!estimatePrintHeader && {!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
table2Data?.OrderType === 'E' &&
estimateTitle && (
<div <div
className="" className=""
style={{ style={{
@ -3304,8 +3270,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,48 +3404,43 @@ const PrintStyle9 = ({
}} }}
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{UomPrint?.SettingValue === 'Y' && (
<div> <div>
{UomPrint?.SettingValue === 'Y' ({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
: ''}
&nbsp;
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
return <div>{a.SerialNumber}</div>;
})
: ''}{' '}
{item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls.filter(
(item1) =>
item1.IMEI1 !== '' ||
item1.IMEI2 !== ''
)?.map((item2) => {
const imei1 = item2.IMEI1 || '';
const imei2 = item2.IMEI2 || '';
return (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div> </div>
); )}
}) {item?.BrandName && <div>{item.BrandName}</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> </div>
</td> </td>
)} )}
@ -3696,7 +3657,6 @@ const PrintStyle9 = ({
}} }}
> >
<div>{item?.ProdName}</div> <div>{item?.ProdName}</div>
{UomPrint?.SettingValue === 'Y' && (
<div> <div>
({item?.Size ? item?.Size : '1'}{' '} ({item?.Size ? item?.Size : '1'}{' '}
{item?.SinglePc == 'Y' {item?.SinglePc == 'Y'
@ -3706,7 +3666,6 @@ const PrintStyle9 = ({
: 'COMBO'} : 'COMBO'}
) )
</div> </div>
)}
</td> </td>
)} )}
{GlobaldummyData {GlobaldummyData
@ -4471,10 +4430,8 @@ const PrintStyle9 = ({
<span>{'Adjustment Amount'}</span> <span>{'Adjustment Amount'}</span>
<span> <span>
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'} {lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
{Math.abs( {Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.BeforeAdjustment ?? 0) - (lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
(lastTransaction?.AfterAdjustment ?? 0)
).toFixed(2)}
</span> </span>
</div> </div>
<div <div