Update src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle12.jsx
This commit is contained in:
parent
fb09fc5382
commit
a4dffb91df
|
|
@ -104,9 +104,6 @@ const Printstyle12 = ({
|
|||
const GlobalCredit = useSelector(GlobalprintCredit);
|
||||
const SettingData = useSelector(PreferenceData);
|
||||
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
|
||||
(i) => i.SettingIdName === 'PrintUom'
|
||||
)?.[0];
|
||||
const estimatePrintHeader =
|
||||
SettingData?.[0]?.SettingDtlDetails?.find(
|
||||
(setting) =>
|
||||
|
|
@ -841,62 +838,46 @@ const Printstyle12 = ({
|
|||
{item.ParcelType})
|
||||
</span>
|
||||
))}
|
||||
{item?.BrandName !== null
|
||||
? item?.BrandName
|
||||
: ''}
|
||||
|
||||
{item?.ProductIdentifierDtls
|
||||
?.length > 0
|
||||
? item?.ProductIdentifierDtls?.filter(
|
||||
(items) =>
|
||||
!(
|
||||
items.SerialNumber ==
|
||||
'' ||
|
||||
items.SerialNumber == null
|
||||
)
|
||||
)?.map((a) => {
|
||||
{item?.BrandName && <div>{item.BrandName}</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 all are empty
|
||||
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 + IMEIs on the same row */}
|
||||
{(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>
|
||||
) : (
|
||||
<div>
|
||||
{UomPrint?.SettingValue === 'Y'
|
||||
? `${item?.Size || '1'} ${
|
||||
item?.SinglePc === 'Y'
|
||||
{UomPrint?.SettingValue === 'Y' && (
|
||||
<div>
|
||||
({item?.Size || '1'}){' '}
|
||||
{item?.SinglePc === 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type !== 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'
|
||||
}`
|
||||
: ''
|
||||
}
|
||||
{item?.BrandName !== null
|
||||
? item?.BrandName
|
||||
: ''}
|
||||
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
</div>
|
||||
)}
|
||||
{item?.BrandName && <div>{item.BrandName}</div>}
|
||||
{item?.ProductIdentifierDtls
|
||||
?.length > 0
|
||||
? item?.ProductIdentifierDtls?.filter(
|
||||
|
|
@ -1133,18 +1114,16 @@ const Printstyle12 = ({
|
|||
}}
|
||||
>
|
||||
<div>{item?.ProdName}</div>
|
||||
{UomPrint?.SettingValue === 'Y' &&
|
||||
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
</div>
|
||||
}
|
||||
{UomPrint?.SettingValue === 'Y' && (
|
||||
<div>
|
||||
({item?.Size || '1'}){' '}
|
||||
{item?.SinglePc === 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type !== 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
|
|
@ -3482,10 +3461,7 @@ const Printstyle12 = ({
|
|||
{item.ParcelType})
|
||||
</span>
|
||||
))}
|
||||
{item?.BrandName !== null
|
||||
? item?.BrandName
|
||||
: ''}
|
||||
|
||||
{item?.BrandName && <div>{item.BrandName}</div>}
|
||||
{item?.ProductIdentifierDtls?.length > 0
|
||||
? item?.ProductIdentifierDtls?.filter(
|
||||
(items) =>
|
||||
|
|
@ -3519,21 +3495,18 @@ const Printstyle12 = ({
|
|||
</div>
|
||||
) : (
|
||||
<div>
|
||||
{UomPrint?.SettingValue === 'Y'
|
||||
? `${item?.Size || '1'} ${
|
||||
item?.SinglePc === 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type !== 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'
|
||||
}`
|
||||
: ''
|
||||
}
|
||||
{item?.BrandName !== null
|
||||
? item?.BrandName
|
||||
: ''}
|
||||
|
||||
{item?.ProductIdentifierDtls?.length > 0
|
||||
{UomPrint?.SettingValue === 'Y' && (
|
||||
<div>
|
||||
({item?.Size || '1'}){' '}
|
||||
{item?.SinglePc === 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type !== 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
</div>
|
||||
)}
|
||||
{item?.BrandName && <div>{item.BrandName}</div>}
|
||||
{/* {item?.ProductIdentifierDtls?.length > 0
|
||||
? item?.ProductIdentifierDtls?.filter(
|
||||
(items) =>
|
||||
!(
|
||||
|
|
@ -3562,7 +3535,32 @@ const Printstyle12 = ({
|
|||
</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 empty entries
|
||||
if (!serial && !imeis && !description) return null;
|
||||
|
||||
return (
|
||||
<div key={index} style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
|
||||
{/* Serial + IMEIs in one row */}
|
||||
{(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>
|
||||
|
|
@ -3751,18 +3749,16 @@ const Printstyle12 = ({
|
|||
}}
|
||||
>
|
||||
<div>{item?.ProdName}</div>
|
||||
{UomPrint?.SettingValue === 'Y'
|
||||
&&
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
</div>
|
||||
}
|
||||
{UomPrint?.SettingValue === 'Y' && (
|
||||
<div>
|
||||
({item?.Size || '1'}){' '}
|
||||
{item?.SinglePc === 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type !== 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
|
|
|
|||
Loading…
Reference in New Issue