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';
|
)?.SettingValue === 'Y';
|
||||||
const estimateTitle =
|
const estimateTitle =
|
||||||
SettingData?.[0]?.SettingDtlDetails?.find(
|
SettingData?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) => setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
|
(setting) =>
|
||||||
|
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
|
||||||
)?.SettingValue === 'Y';
|
)?.SettingValue === 'Y';
|
||||||
const bookingTypePreference = appPreferences?.find(
|
const bookingTypePreference = appPreferences?.find(
|
||||||
(preference) => preference?.PreferredCatName === 'Booking Type'
|
(preference) => preference?.PreferredCatName === 'Booking Type'
|
||||||
|
|
@ -486,8 +487,8 @@ const Printstyle8 = ({
|
||||||
style={{ textTransform: 'uppercase', fontWeight: '600' }}
|
style={{ textTransform: 'uppercase', fontWeight: '600' }}
|
||||||
>
|
>
|
||||||
Estimate{' '}
|
Estimate{' '}
|
||||||
{SalesModePref?.SettingValue == 'Y' &&
|
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -505,8 +506,8 @@ const Printstyle8 = ({
|
||||||
: PaymentStatusSuccess?.length === 1
|
: PaymentStatusSuccess?.length === 1
|
||||||
? PaymentStatusSuccess?.[0]?.PaymentTypeName
|
? PaymentStatusSuccess?.[0]?.PaymentTypeName
|
||||||
: ''}{' '}
|
: ''}{' '}
|
||||||
{SalesModePref?.SettingValue == 'Y' &&
|
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -521,7 +522,11 @@ const Printstyle8 = ({
|
||||||
table2Data?.FYStatus
|
table2Data?.FYStatus
|
||||||
)}
|
)}
|
||||||
</div>
|
</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}
|
{GlobaldummyData ? formattedDate : Date1}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -773,16 +778,45 @@ const Printstyle8 = ({
|
||||||
) : (
|
) : (
|
||||||
UomPrint?.SettingValue === 'Y' && (
|
UomPrint?.SettingValue === 'Y' && (
|
||||||
<div>
|
<div>
|
||||||
({item?.Size ? item?.Size : '1'}{' '}
|
({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'}
|
||||||
{item?.SinglePc == 'Y'
|
|
||||||
? 'PCS'
|
|
||||||
: item?.Type != 'C'
|
|
||||||
? item?.UomName
|
|
||||||
: 'COMBO'}
|
|
||||||
)
|
|
||||||
</div>
|
</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>
|
</td>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -1098,52 +1132,38 @@ const Printstyle8 = ({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
|
{UomPrint?.SettingValue === 'Y' && (
|
||||||
<div>
|
<div>
|
||||||
{UomPrint?.SettingValue === 'Y'
|
({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'
|
|
||||||
}`
|
|
||||||
: ''}
|
|
||||||
{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(',')}
|
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -1749,10 +1769,8 @@ const Printstyle8 = ({
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND'
|
{lastTransaction?.AdjustmentType === 'REFUND'
|
||||||
? '-'
|
? '-'
|
||||||
: '+'}
|
: '+'}
|
||||||
{Math.abs(
|
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
|
||||||
(lastTransaction?.BeforeAdjustment ?? 0) -
|
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
|
||||||
(lastTransaction?.AfterAdjustment ?? 0)
|
|
||||||
).toFixed(2)}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -2748,10 +2766,8 @@ const Printstyle8 = ({
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND'
|
{lastTransaction?.AdjustmentType === 'REFUND'
|
||||||
? '-'
|
? '-'
|
||||||
: '+'}
|
: '+'}
|
||||||
{Math.abs(
|
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
|
||||||
(lastTransaction?.BeforeAdjustment ?? 0) -
|
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
|
||||||
(lastTransaction?.AfterAdjustment ?? 0)
|
|
||||||
).toFixed(2)}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -3297,8 +3313,8 @@ const Printstyle8 = ({
|
||||||
style={{ textTransform: 'uppercase', fontWeight: '600' }}
|
style={{ textTransform: 'uppercase', fontWeight: '600' }}
|
||||||
>
|
>
|
||||||
Estimate{' '}
|
Estimate{' '}
|
||||||
{SalesModePref?.SettingValue == 'Y' &&
|
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -3318,8 +3334,8 @@ const Printstyle8 = ({
|
||||||
: PaymentStatusSuccess?.length === 1
|
: PaymentStatusSuccess?.length === 1
|
||||||
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
|
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
|
||||||
: ''}{' '}
|
: ''}{' '}
|
||||||
{SalesModePref?.SettingValue == 'Y' &&
|
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -3334,7 +3350,11 @@ const Printstyle8 = ({
|
||||||
table2Data?.FYStatus
|
table2Data?.FYStatus
|
||||||
)}
|
)}
|
||||||
</div>
|
</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}
|
{GlobaldummyData ? formattedDate : Date1}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3503,13 +3523,7 @@ const Printstyle8 = ({
|
||||||
) : (
|
) : (
|
||||||
UomPrint?.SettingValue === 'Y' && (
|
UomPrint?.SettingValue === 'Y' && (
|
||||||
<div>
|
<div>
|
||||||
({item?.Size ? item?.Size : '1'}{' '}
|
({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'}
|
||||||
{item?.SinglePc == 'Y'
|
|
||||||
? 'PCS'
|
|
||||||
: item?.Type != 'C'
|
|
||||||
? item?.UomName
|
|
||||||
: 'COMBO'}
|
|
||||||
)
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
|
|
@ -3739,60 +3753,58 @@ const Printstyle8 = ({
|
||||||
{index + 1}
|
{index + 1}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData ? (
|
||||||
? GlobalItem && <td>{item?.ProdName}</td>
|
GlobalItem && <td>{item?.ProdName}</td>
|
||||||
: Item && (
|
) : (
|
||||||
|
Item && (
|
||||||
<td
|
<td
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flexDirection: 'column',
|
flexDirection: "column",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{/* 🏷 Product Name */}
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
|
|
||||||
|
{/* 📦 Size */}
|
||||||
|
{UomPrint?.SettingValue === 'Y' && (
|
||||||
<div>
|
<div>
|
||||||
{UomPrint?.SettingValue === 'Y'
|
({item?.Size || "1"}) {item?.SinglePc === "Y" ? "PCS" : item?.Type !== "C" ? item?.UomName : "COMBO"}
|
||||||
? `${item?.Size || '1'} ${
|
</div>
|
||||||
item?.SinglePc === 'Y'
|
)}
|
||||||
? 'PCS'
|
|
||||||
: item?.Type !== 'C'
|
{/* 🏷 Brand */}
|
||||||
? item?.UomName
|
{item?.BrandName && (
|
||||||
: 'COMBO'
|
<div>{item.BrandName}</div>
|
||||||
}`
|
)}
|
||||||
: ''}
|
|
||||||
{item?.BrandName !== null
|
{/* 🔢 Identifiers */}
|
||||||
? item?.BrandName
|
<div style={{ display: "flex", flexDirection: "column", gap: "3px" }}>
|
||||||
: ''}
|
{(item?.ProductIdentifierDtls ?? []).map((data, i) => {
|
||||||
|
const hasSerial = data.SerialNumber;
|
||||||
{item?.ProductIdentifierDtls?.length > 0
|
const hasIMEI = data.IMEI1 || data.IMEI2;
|
||||||
? 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 (
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
{hasSerial && <div>{data.SerialNumber}</div>}
|
||||||
|
|
||||||
|
{hasIMEI && (
|
||||||
<div>
|
<div>
|
||||||
{[imei1, imei2]
|
{[data.IMEI1, data.IMEI2]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(',')}
|
.join(",")}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(hasSerial || hasIMEI) && data.Description && (
|
||||||
|
<div>{data.Description}</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})}
|
||||||
: ''}
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && <td>{item?.HSN}</td>
|
? GlobalHsnCode && <td>{item?.HSN}</td>
|
||||||
|
|
@ -4343,10 +4355,8 @@ const Printstyle8 = ({
|
||||||
<span>{'Adjustment Amount'}</span>
|
<span>{'Adjustment Amount'}</span>
|
||||||
<span>
|
<span>
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
||||||
{Math.abs(
|
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
|
||||||
(lastTransaction?.BeforeAdjustment ?? 0) -
|
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
|
||||||
(lastTransaction?.AfterAdjustment ?? 0)
|
|
||||||
).toFixed(2)}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue