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

This commit is contained in:
karthikalakshmi 2026-03-03 10:12:11 +05:30
parent 1869b0afb7
commit 4ae0a294dc
1 changed files with 1609 additions and 1690 deletions

View File

@ -111,7 +111,8 @@ const PrintStyle10 = ({
)?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) => setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type'
@ -463,8 +464,8 @@ const PrintStyle10 = ({
{table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
@ -479,8 +480,8 @@ const PrintStyle10 = ({
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
</div>
@ -488,18 +489,13 @@ const PrintStyle10 = ({
</div>
)}
{!estimatePrintHeader &&
table2Data?.OrderType === 'E' &&
estimateTitle && (
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div
style={{
textTransform: 'uppercase',
textAlign: 'center',
}}
style={{ textTransform: 'uppercase', textAlign: 'center' }}
>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
<div
@ -512,6 +508,10 @@ const PrintStyle10 = ({
{' '}
{GlobaldummyData ? formattedDate : Date1}{' '}
</div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', fontWeight: 600, textAlign: 'right' }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<hr class="straightline" />
</div>
@ -690,8 +690,8 @@ const PrintStyle10 = ({
textAlign: 'left',
}}
>
{item?.ProdName}(
{item?.Size + item?.UomName})
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`}
</td>
)
: Item && (
@ -722,86 +722,36 @@ const PrintStyle10 = ({
? 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 style={{ display: 'flex', flexDirection: 'column', gap: '3px' }}>
{item?.ProductIdentifierDtls?.map((id, i) => (
<div key={i} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
{id.SerialNumber && <div>{id.SerialNumber}</div>}
{(id.IMEI1 || id.IMEI2) && (
<div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}</div>
)}
{id.Description && <div>{id.Description}</div>}
</div>
))}
</div>
);
})
: ''}
</div>
) : (
<div style={{ display: 'flex', flexDirection: 'column', gap: '5px' }}>
{/* Product size + brand */}
<div>
{UomPrint?.SettingValue === 'Y'
? `${item?.Size || '1'} ${
item?.SinglePc === '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>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
{UomPrint?.SettingValue === 'Y' && `(${item?.Size || '1'} ${item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'})`}
{item?.BrandName && ` ${item?.BrandName}`}
</div>
);
})
: ''}
{/* Product identifiers */}
{item?.ProductIdentifierDtls?.map((id, i) => (
<div key={i} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
{id.SerialNumber && <div>{id.SerialNumber}</div>}
{(id.IMEI1 || id.IMEI2) && (
<div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}</div>
)}
{id.Description && <div>{id.Description}</div>}
</div>
))}
</div>
)}
</td>
@ -1067,8 +1017,8 @@ const PrintStyle10 = ({
textAlign: 'left',
}}
>
{item?.ProdName}(
{item?.Size + item?.UomName})
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`}
</td>
)
: Item && (
@ -1877,10 +1827,8 @@ const PrintStyle10 = ({
{lastTransaction?.AdjustmentType === 'REFUND'
? '-'
: '+'}
{Math.abs(
(lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)
).toFixed(2)}
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
</span>
</div>
<div
@ -2829,10 +2777,8 @@ const PrintStyle10 = ({
{lastTransaction?.AdjustmentType === 'REFUND'
? '-'
: '+'}
{Math.abs(
(lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)
).toFixed(2)}
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
</span>
</div>
<div
@ -3136,8 +3082,8 @@ const PrintStyle10 = ({
{table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
@ -3152,21 +3098,19 @@ const PrintStyle10 = ({
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
</div>
</div>
</div>
)}
{!estimatePrintHeader &&
table2Data?.OrderType === 'E' &&
estimateTitle && (
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase' }}>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
<div
@ -3314,7 +3258,8 @@ const PrintStyle10 = ({
<td
style={{ width: '10px', textAlign: 'left' }}
>
{item?.ProdName}({item?.Size + item?.UomName})
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`}
</td>
)
: Item && (
@ -3328,68 +3273,32 @@ const PrintStyle10 = ({
{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 !== 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 style={{ display: 'flex', flexDirection: 'column', gap: '5px' }}>
{/* Package Details */}
{PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId).map((pkg, index) => (
<div key={index}>
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
</div>
);
})
: ''}
))}
{/* Brand */}
{item?.BrandName && <div>{item.BrandName}</div>}
{/* Product Identifiers */}
{item?.ProductIdentifierDtls?.map((id, i) => (
<div key={i} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
{id.SerialNumber && <div>{id.SerialNumber}</div>}
{(id.IMEI1 || id.IMEI2) && <div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}</div>}
{id.Description && <div>{id.Description}</div>}
</div>
))}
</div>
) : (
<div>
{UomPrint?.SettingValue === 'Y'
? `${item?.Size || '1'} ${
item?.SinglePc === 'Y'
? 'PCS'
: item?.Type !== 'C'
? item?.UomName
: 'COMBO'
}`
: ''}
{item?.BrandName !== null
? item?.BrandName
: ''}
{UomPrint?.SettingValue === 'Y' && `(${item?.Size ? item?.Size : '1'} ${item?.SinglePc == 'Y' ? 'PCS' : item?.Type != 'C' ? item?.UomName : 'COMBO'})`}
{item?.BrandName && ` ${item?.BrandName}`}
&nbsp;
{item?.ProductIdentifierDtls?.length > 0
{/* {item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
@ -3416,7 +3325,18 @@ const PrintStyle10 = ({
</div>
);
})
: ''}
: ''} */}
<div style={{ display: 'flex', flexDirection: 'column', gap: "3px" }}>
{item?.ProductIdentifierDtls?.map((id, i) => (
<div key={i} style={{ display: 'flex', flexDirection: 'column', gap: "2px" }}>
{id.SerialNumber && <div>{id.SerialNumber}</div>}
{(id.IMEI1 || id.IMEI2) && (
<div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}</div>
)}
{id.Description && <div>{id.Description}</div>}
</div>
))}
</div>
</div>
)}
</td>
@ -3642,7 +3562,8 @@ const PrintStyle10 = ({
<td
style={{ width: '10px', textAlign: 'left' }}
>
{item?.ProdName}({item?.Size + item?.UomName})
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' && `(${item?.Size + item?.UomName})`}
</td>
)
: Item && (
@ -4388,10 +4309,8 @@ const PrintStyle10 = ({
<span>{'Adjustment Amount'}</span>
<span>
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
{Math.abs(
(lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)
).toFixed(2)}
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
</span>
</div>
<div