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';
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'
@ -487,8 +488,8 @@ const PrintStyle9 = ({
}}
>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
@ -510,8 +511,8 @@ const PrintStyle9 = ({
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
<div>
@ -526,6 +527,10 @@ const PrintStyle9 = ({
table2Data?.FYStatus
)}
</div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '12px', fontWeight: '400' }}>
{' '}
{GlobaldummyData ? formattedDate : Date1}{' '}
@ -534,9 +539,7 @@ const PrintStyle9 = ({
</div>
)}
{!estimatePrintHeader &&
table2Data?.OrderType === 'E' &&
estimateTitle && (
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div
className=""
style={{
@ -547,8 +550,8 @@ const PrintStyle9 = ({
}}
>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
<div className="straight-line9"></div>
@ -709,113 +712,78 @@ const PrintStyle9 = ({
{GlobaldummyData
? GlobalItem && <td>{item?.ProdName}</td>
: Item && (
<td
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<td style={{ display: "flex", flexDirection: "column" }}>
<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>
{PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId
)?.map((item, index) => (
<span
key={index}
style={{ display: 'block' }}
>
{item.ParcelCount}PCS
{item.ParcelQty}PACK(
{item.ParcelType})
{/* Package Details */}
{packages.map((pkg, i) => (
<span key={i} style={{ display: "block" }}>
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.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(',')}
{item?.BrandName && <div>{item.BrandName}</div>}
{/* Identifiers */}
<div style={{ display: "flex", gap: "3px", flexWrap: "wrap", flexDirection: "column" }}>
{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>
);
})
: ''}
</div>
) : (
<div>
({item?.Size ? 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 (
{/* Size + UOM */}
{UomPrint?.SettingValue === 'Y' && (
<div>
{[imei1, imei2]
.filter(Boolean)
.join(',')}
</div>
);
})
: ''}
({item?.Size || "1"}{" "}
{item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName
: "COMBO"})
</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>
)}
{GlobaldummyData
@ -1073,10 +1041,10 @@ const PrintStyle9 = ({
? 'PCS'
: item?.Type != 'C'
? item?.UomName
: 'COMBO'}
)
: 'COMBO'})
</div>
)}
{item?.BrandName && <div>{item.BrandName}</div>}
</td>
)}
{GlobaldummyData
@ -1898,10 +1866,8 @@ const PrintStyle9 = ({
{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
@ -2883,10 +2849,8 @@ const PrintStyle9 = ({
{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
@ -3236,8 +3200,8 @@ const PrintStyle9 = ({
}}
>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
@ -3261,8 +3225,8 @@ const PrintStyle9 = ({
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
@ -3283,6 +3247,10 @@ const PrintStyle9 = ({
table2Data?.FYStatus
)}
</div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
<div style={{ fontSize: '12px', fontWeight: '400' }}>
{' '}
{GlobaldummyData ? formattedDate : Date1}{' '}
@ -3291,9 +3259,7 @@ const PrintStyle9 = ({
</div>
)}
{!estimatePrintHeader &&
table2Data?.OrderType === 'E' &&
estimateTitle && (
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div
className=""
style={{
@ -3304,8 +3270,8 @@ const PrintStyle9 = ({
}}
>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
)}
<div className="straight-line9"></div>
@ -3438,48 +3404,43 @@ const PrintStyle9 = ({
}}
>
<div>{item?.ProdName}</div>
{UomPrint?.SettingValue === 'Y' && (
<div>
{UomPrint?.SettingValue === 'Y'
? `${item?.Size || '1'} ${
item?.SinglePc === 'Y'
({item?.Size ? item?.Size : '1'}{' '}
{item?.SinglePc == 'Y'
? 'PCS'
: item?.Type !== 'C'
: 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(',')}
: 'COMBO'})
</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>
</td>
)}
@ -3696,7 +3657,6 @@ const PrintStyle9 = ({
}}
>
<div>{item?.ProdName}</div>
{UomPrint?.SettingValue === 'Y' && (
<div>
({item?.Size ? item?.Size : '1'}{' '}
{item?.SinglePc == 'Y'
@ -3706,7 +3666,6 @@ const PrintStyle9 = ({
: 'COMBO'}
)
</div>
)}
</td>
)}
{GlobaldummyData
@ -4471,10 +4430,8 @@ const PrintStyle9 = ({
<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