Update src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.jsx
This commit is contained in:
parent
ccccf8b149
commit
754170fb6f
|
|
@ -115,7 +115,8 @@ const Printstyle8 = ({
|
|||
)?.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'
|
||||
|
|
@ -486,8 +487,8 @@ const Printstyle8 = ({
|
|||
style={{ textTransform: 'uppercase', fontWeight: '600' }}
|
||||
>
|
||||
Estimate{' '}
|
||||
{SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
||||
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
@ -505,8 +506,8 @@ const Printstyle8 = ({
|
|||
: PaymentStatusSuccess?.length === 1
|
||||
? PaymentStatusSuccess?.[0]?.PaymentTypeName
|
||||
: ''}{' '}
|
||||
{SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
||||
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
@ -521,7 +522,11 @@ const Printstyle8 = ({
|
|||
table2Data?.FYStatus
|
||||
)}
|
||||
</div>
|
||||
<div style={{ fontSize: 'clamp(0.63rem, 2.5vw, 1.2rem)' }}>
|
||||
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '10px', fontWeight: 600 }}>
|
||||
{' '}
|
||||
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
|
||||
</div>}
|
||||
<div style={{ fontSize: "10px" }}>
|
||||
{GlobaldummyData ? formattedDate : Date1}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -773,16 +778,45 @@ const Printstyle8 = ({
|
|||
) : (
|
||||
UomPrint?.SettingValue === 'Y' && (
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
<div style={{ display: 'flex', gap: "3px" }}>
|
||||
{item?.ProductIdentifierDtls?.length > 0
|
||||
? item?.ProductIdentifierDtls.filter(
|
||||
(items) =>
|
||||
items.SerialNumber &&
|
||||
items.SerialNumber !== ''
|
||||
).map((a, i) => (
|
||||
<div key={i}>{a.SerialNumber}</div>
|
||||
))
|
||||
: ''}
|
||||
{item?.ProductIdentifierDtls?.length > 0
|
||||
? item?.ProductIdentifierDtls.filter(
|
||||
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
|
||||
).map((id, i) => {
|
||||
const imei1 = id.IMEI1 || '';
|
||||
const imei2 = id.IMEI2 || '';
|
||||
return (
|
||||
<div key={i}>
|
||||
{[imei1, imei2]
|
||||
.filter(Boolean)
|
||||
.join(',')}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
: ''}
|
||||
{item?.ProductIdentifierDtls?.length > 0
|
||||
? item?.ProductIdentifierDtls.filter(
|
||||
(items) =>
|
||||
items.SerialNumber || items.IMEI1 || id.IMEI2
|
||||
)?.map((a, i) => (
|
||||
<span key={i}>{a.Description}</span>
|
||||
))
|
||||
|
||||
: ''}
|
||||
</div>
|
||||
</td>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
|
|
@ -1098,52 +1132,38 @@ const Printstyle8 = ({
|
|||
}}
|
||||
>
|
||||
<div>{item?.ProdName}</div>
|
||||
{UomPrint?.SettingValue === 'Y' && (
|
||||
<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
|
||||
? 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?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
: ''}
|
||||
)}
|
||||
{item?.BrandName !== null && <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>
|
||||
)}
|
||||
|
|
@ -1749,10 +1769,8 @@ const Printstyle8 = ({
|
|||
{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
|
||||
|
|
@ -2748,10 +2766,8 @@ const Printstyle8 = ({
|
|||
{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
|
||||
|
|
@ -3297,8 +3313,8 @@ const Printstyle8 = ({
|
|||
style={{ textTransform: 'uppercase', fontWeight: '600' }}
|
||||
>
|
||||
Estimate{' '}
|
||||
{SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
||||
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
@ -3318,8 +3334,8 @@ const Printstyle8 = ({
|
|||
: PaymentStatusSuccess?.length === 1
|
||||
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
|
||||
: ''}{' '}
|
||||
{SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
||||
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
@ -3334,7 +3350,11 @@ const Printstyle8 = ({
|
|||
table2Data?.FYStatus
|
||||
)}
|
||||
</div>
|
||||
<div style={{ fontSize: 'clamp(0.63rem, 2.5vw, 1.2rem)' }}>
|
||||
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontSize: '10px', fontWeight: 600 }}>
|
||||
{' '}
|
||||
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
|
||||
</div>}
|
||||
<div style={{ fontSize: "10px" }}>
|
||||
{GlobaldummyData ? formattedDate : Date1}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3503,13 +3523,7 @@ const Printstyle8 = ({
|
|||
) : (
|
||||
UomPrint?.SettingValue === 'Y' && (
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
|
|
@ -3739,60 +3753,58 @@ const Printstyle8 = ({
|
|||
{index + 1}
|
||||
</td>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <td>{item?.ProdName}</td>
|
||||
: Item && (
|
||||
{GlobaldummyData ? (
|
||||
GlobalItem && <td>{item?.ProdName}</td>
|
||||
) : (
|
||||
Item && (
|
||||
<td
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
}}
|
||||
>
|
||||
{/* 🏷 Product Name */}
|
||||
<div>{item?.ProdName}</div>
|
||||
|
||||
{/* 📦 Size */}
|
||||
{UomPrint?.SettingValue === 'Y' && (
|
||||
<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
|
||||
? 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 || '';
|
||||
({item?.Size || "1"}) {item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO"}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 🏷 Brand */}
|
||||
{item?.BrandName && (
|
||||
<div>{item.BrandName}</div>
|
||||
)}
|
||||
|
||||
{/* 🔢 Identifiers */}
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
|
||||
{(item?.ProductIdentifierDtls ?? []).map((data, i) => {
|
||||
const hasSerial = data.SerialNumber;
|
||||
const hasIMEI = data.IMEI1 || data.IMEI2;
|
||||
|
||||
return (
|
||||
<div key={i}>
|
||||
{hasSerial && <div>{data.SerialNumber}</div>}
|
||||
|
||||
{hasIMEI && (
|
||||
<div>
|
||||
{[imei1, imei2]
|
||||
{[data.IMEI1, data.IMEI2]
|
||||
.filter(Boolean)
|
||||
.join(',')}
|
||||
.join(",")}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(hasSerial || hasIMEI) && data.Description && (
|
||||
<div>{data.Description}</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
: ''}
|
||||
})}
|
||||
</div>
|
||||
</td>
|
||||
)
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && <td>{item?.HSN}</td>
|
||||
|
|
@ -4343,10 +4355,8 @@ const Printstyle8 = ({
|
|||
<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
|
||||
|
|
|
|||
Loading…
Reference in New Issue