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

This commit is contained in:
karthikalakshmi 2026-03-03 09:57:22 +05:30
parent a4dffb91df
commit 38a0494c6c
1 changed files with 142 additions and 153 deletions

View File

@ -467,8 +467,8 @@ const PrintStyle11 = ({
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} */}
</div>
<div
style={{
@ -487,6 +487,10 @@ const PrintStyle11 = ({
table2Data?.FYStatus
)}
</div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0.5rem', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div>
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
@ -494,8 +498,8 @@ const PrintStyle11 = ({
style={{ textTransform: 'uppercase', textAlign: 'center' }}
>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} */}
</div>
)}
<hr className="PrintStyle11-print-dottline" />
@ -685,87 +689,65 @@ const PrintStyle11 = ({
? item?.BrandName
: ''}
&nbsp;
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
<div style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>
{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>{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 key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
{/* Serial + IMEI in one line */}
{(serial || imeis) && (
<div style={{ display: 'flex', gap: '3px' }}>
{serial && <div>{serial}</div>}
{imei && <div>{imeis}</div>}
</div>
)}
{/* Description on new line */}
{description && <div>{description}</div>}
</div>
);
})
: ''}
})}
</div>
</div>
) : (
<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'
}`
: ''
}
: 'COMBO'}
)
{item?.BrandName !== null
? item?.BrandName
: ''}
&nbsp;
{item?.ProductIdentifierDtls?.length >
0
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
items.SerialNumber == '' ||
items.SerialNumber == null
)
)?.map((a) => {
<div style={{ display: 'flex', gap: "3px", flexWrap: 'wrap' }}>
{item?.ProductIdentifierDtls?.map((detail, index) => {
const serial = detail.SerialNumber;
const imeis = [detail.IMEI1, detail.IMEI2].filter(Boolean).join(',');
const description = detail.Description;
// Only render if at least one value exists
if (!serial && !imeis && !description) return null;
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 key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
<div style={{ display: 'flex', gap: '3px' }}>
{serial && <div>{serial}</div>}
{imeis && <div>{imeis}</div>}
</div>
{description && <div>{description}</div>}
</div>
);
})
: ''}
})}
</div>
</div>
)}
</td>
@ -1020,8 +1002,6 @@ const PrintStyle11 = ({
}}
>
<div>{item?.ProdName}</div>
{UomPrint?.SettingValue === 'Y' &&
<div>
({item?.Size ? item?.Size : '1'}{' '}
{item?.SinglePc == 'Y'
@ -1031,7 +1011,6 @@ const PrintStyle11 = ({
: 'COMBO'}
)
</div>
}
</td>
)}
{GlobaldummyData
@ -3124,8 +3103,8 @@ const PrintStyle11 = ({
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} */}
</div>
<div
style={{
@ -3144,13 +3123,17 @@ const PrintStyle11 = ({
table2Data?.FYStatus
)}
</div>
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '13px', margin: '0rem 0.5rem', fontWeight: 600 }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
</div>}
</div>
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
<div style={{ textTransform: 'uppercase', textAlign: 'center' }}>
Estimate{' '}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} */}
</div>
)}
@ -3288,70 +3271,53 @@ const PrintStyle11 = ({
(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})
{/* Package Details */}
{PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId)?.map((pkg, idx) => (
<span key={idx} 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) => {
{item?.BrandName && <div>{item.BrandName}</div>}
{/* Product Identifiers */}
{item?.ProductIdentifierDtls?.map((detail, idx) => {
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>{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 key={idx} 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>
{UomPrint?.SettingValue === 'Y'
? `${item?.Size || '1'} ${
item?.SinglePc === 'Y'
{UomPrint?.SettingValue === 'Y' && (
<div>
({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
: 'COMBO'})
</div>
)}
{item?.BrandName && <div>{item.BrandName}</div>}
{/* {item?.ProductIdentifierDtls?.length > 0
? item?.ProductIdentifierDtls?.filter(
(items) =>
!(
@ -3380,7 +3346,31 @@ const PrintStyle11 = ({
</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>
)}
</td>
@ -3600,18 +3590,17 @@ const PrintStyle11 = ({
}}
>
<div>{item?.ProdName}</div>
{UomPrint?.SettingValue === 'Y' &&
{UomPrint?.SettingValue === 'Y' && (
<div>
({item?.Size ? item?.Size : '1'}{' '}
{item?.SinglePc == 'Y'
? 'PCS'
: item?.Type != 'C'
? item?.UomName
: 'COMBO'}
)
: 'COMBO'})
</div>
}
)}
{item?.BrandName && <div>{item.BrandName}</div>}
</td>
)}
{GlobaldummyData