Update src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.jsx
This commit is contained in:
parent
754170fb6f
commit
fb09fc5382
|
|
@ -90,6 +90,7 @@ const Printstyle4 = ({
|
||||||
const GlobalHsnCode = useSelector(GlobalprintHsnCode);
|
const GlobalHsnCode = useSelector(GlobalprintHsnCode);
|
||||||
const GlobalQrcodet = useSelector(GlobalprintQrcodet);
|
const GlobalQrcodet = useSelector(GlobalprintQrcodet);
|
||||||
const GlobaldummyData = useSelector(GlobalPritdummyData);
|
const GlobaldummyData = useSelector(GlobalPritdummyData);
|
||||||
|
console.log(GlobaldummyData, "GlobaldummyData")
|
||||||
const GlobalSignature = useSelector(GlobalprintSignature);
|
const GlobalSignature = useSelector(GlobalprintSignature);
|
||||||
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
||||||
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
||||||
|
|
@ -199,6 +200,7 @@ const Printstyle4 = ({
|
||||||
const TakeawayData = table2Data?.productDetails?.filter(
|
const TakeawayData = table2Data?.productDetails?.filter(
|
||||||
(item) => item.BookingTypeName?.toLowerCase() === 'takeaway'
|
(item) => item.BookingTypeName?.toLowerCase() === 'takeaway'
|
||||||
);
|
);
|
||||||
|
console.log(TakeawayData, "TakeawayData")
|
||||||
const DineInData = table2Data?.productDetails?.filter(
|
const DineInData = table2Data?.productDetails?.filter(
|
||||||
(item) => item.BookingTypeName?.toLowerCase() === 'dine in'
|
(item) => item.BookingTypeName?.toLowerCase() === 'dine in'
|
||||||
);
|
);
|
||||||
|
|
@ -345,6 +347,8 @@ const Printstyle4 = ({
|
||||||
? paginatedChunks[paginatedChunks.length - 1].length
|
? paginatedChunks[paginatedChunks.length - 1].length
|
||||||
: 0;
|
: 0;
|
||||||
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10);
|
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10);
|
||||||
|
|
||||||
|
console.log(paginatedChunks, 'paginatedChunks')
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{FormatTheme ? (
|
{FormatTheme ? (
|
||||||
|
|
@ -489,7 +493,14 @@ const Printstyle4 = ({
|
||||||
>
|
>
|
||||||
<div style={{ fontSize: '12px', fontWeight: '500' }}>
|
<div style={{ fontSize: '12px', fontWeight: '500' }}>
|
||||||
Dt: {GlobaldummyData ? formattedDate : Date1}
|
Dt: {GlobaldummyData ? formattedDate : Date1}
|
||||||
|
|
||||||
|
{SalesModePref?.SettingValue == 'Y' &&
|
||||||
|
<div style={{ fontSize: '12px', fontWeight: '500' }}>
|
||||||
|
{' '}
|
||||||
|
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
|
||||||
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ fontSize: '12px', fontWeight: '500' }}>
|
<div style={{ fontSize: '12px', fontWeight: '500' }}>
|
||||||
Bill No :
|
Bill No :
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -509,8 +520,8 @@ const Printstyle4 = ({
|
||||||
style={{ textTransform: 'uppercase', fontSize: '12px' }}
|
style={{ textTransform: 'uppercase', fontSize: '12px' }}
|
||||||
>
|
>
|
||||||
Estimate{' '}
|
Estimate{' '}
|
||||||
{SalesModePref?.SettingValue == 'Y' &&
|
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -528,8 +539,8 @@ const Printstyle4 = ({
|
||||||
: 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>
|
||||||
)}
|
)}
|
||||||
<hr className="PrintStyle4-print-dottline" />
|
<hr className="PrintStyle4-print-dottline" />
|
||||||
|
|
@ -698,194 +709,137 @@ const Printstyle4 = ({
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{dataChunk?.map((item, index) => {
|
{dataChunk?.map((item, index) => {
|
||||||
|
|
||||||
|
const identifiers = item?.ProductIdentifierDtls ?? [];
|
||||||
|
|
||||||
|
const serials = identifiers
|
||||||
|
.filter(d => d.SerialNumber)
|
||||||
|
.map(d => d.SerialNumber);
|
||||||
|
|
||||||
|
const imeis = identifiers
|
||||||
|
.filter(d => d.IMEI1 || d.IMEI2)
|
||||||
|
.map(d => [d.IMEI1, d.IMEI2].filter(Boolean).join(", "));
|
||||||
|
|
||||||
|
const descriptions = identifiers
|
||||||
|
.filter(d => d.Description)
|
||||||
|
.map(d => d.Description);
|
||||||
|
|
||||||
|
const packageList = PackageDetails?.filter(
|
||||||
|
pkg => pkg.ProdId === item.ProdId
|
||||||
|
) ?? [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
|
|
||||||
|
{/* SL NO */}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && <td>{index + 1}</td>
|
? GlobalSlNo && <td>{index + 1}</td>
|
||||||
: SLNO && (
|
: SLNO && <td>{chunkIndex * chunkSize + index + 1}</td>
|
||||||
<td>
|
}
|
||||||
{chunkIndex * chunkSize + index + 1}
|
|
||||||
</td>
|
{/* ITEM COLUMN */}
|
||||||
)}
|
|
||||||
{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",
|
||||||
|
padding: "10px 5px"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{/* Product Name */}
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
{PackageDetails?.filter(
|
|
||||||
(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})
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
|
|
||||||
{(
|
{/* Package OR Size */}
|
||||||
(item?.ProductIdentifierDtls
|
{packageList.length > 0 ? (
|
||||||
?.length > 0
|
<div>
|
||||||
? item?.ProductIdentifierDtls.filter(
|
{packageList.map((pkg, i) => (
|
||||||
(items) =>
|
<div key={i}>
|
||||||
items.SerialNumber
|
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
|
||||||
)
|
</div>
|
||||||
.map(
|
))}
|
||||||
(a, index) =>
|
|
||||||
` ${a.SerialNumber}`
|
|
||||||
)
|
|
||||||
.join('')
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(item1) =>
|
|
||||||
item1.IMEI1 || item1.IMEI2
|
|
||||||
)
|
|
||||||
.map((item2, index) => {
|
|
||||||
const imei1 =
|
|
||||||
item2.IMEI1 || '';
|
|
||||||
const imei2 =
|
|
||||||
item2.IMEI2 || '';
|
|
||||||
return ` ${[imei1, imei2].filter(Boolean).join(',')}`;
|
|
||||||
})
|
|
||||||
.join('')
|
|
||||||
: '')
|
|
||||||
).trim()}
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
{(
|
{(UomPrint?.SettingValue === 'Y'
|
||||||
(UomPrint?.SettingValue === 'Y'
|
|
||||||
? (item?.Size || '1') +
|
? (item?.Size || '1') +
|
||||||
(item?.SinglePc === 'Y'
|
(item?.SinglePc === 'Y'
|
||||||
? ' PCS'
|
? ' PCS'
|
||||||
: item?.Type !== 'C'
|
: item?.Type !== 'C'
|
||||||
? ` ${item?.UomName}`
|
? ` ${item?.UomName}`
|
||||||
: ' COMBO')
|
: ' COMBO')
|
||||||
: '') +
|
: '')}
|
||||||
(item?.BrandName
|
{item?.BrandName || ""}
|
||||||
? ` ${item?.BrandName}`
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(items) =>
|
|
||||||
items.SerialNumber
|
|
||||||
)
|
|
||||||
.map(
|
|
||||||
(a, index) =>
|
|
||||||
` ${a.SerialNumber}`
|
|
||||||
)
|
|
||||||
.join('')
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(item1) =>
|
|
||||||
item1.IMEI1 || item1.IMEI2
|
|
||||||
)
|
|
||||||
.map((item2, index) => {
|
|
||||||
const imei1 =
|
|
||||||
item2.IMEI1 || '';
|
|
||||||
const imei2 =
|
|
||||||
item2.IMEI2 || '';
|
|
||||||
return ` ${[imei1, imei2].filter(Boolean).join(',')}`;
|
|
||||||
})
|
|
||||||
.join('')
|
|
||||||
: '')
|
|
||||||
).trim()}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
|
||||||
? GlobalQuantity && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.SalesQty}
|
|
||||||
</td>
|
|
||||||
)
|
|
||||||
: Quantity && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.SalesQty}
|
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
|
||||||
? GlobalHsnCode && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.HSN}
|
|
||||||
</td>
|
|
||||||
)
|
|
||||||
: HsnCode && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.HSN}
|
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
|
||||||
? GlobalMRP && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.MRP}
|
|
||||||
</td>
|
|
||||||
)
|
|
||||||
: MRP && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.SinglePc === 'Y'
|
|
||||||
? item?.Rate
|
|
||||||
: item?.MRP}
|
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
|
||||||
? GlobalDiscount && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item.discount}
|
|
||||||
</td>
|
|
||||||
)
|
|
||||||
: Discount && (
|
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.Type != 'C'
|
|
||||||
? item?.OfferAmt || 0
|
|
||||||
: item?.OfferValue || 0}
|
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{GlobaldummyData
|
{/* Serials */}
|
||||||
? GlobalRate && (
|
{serials.map((s, i) => (
|
||||||
<td style={{ textAlign: 'right' }}>
|
<div key={`serial-${i}`}>{s}</div>
|
||||||
{item?.Rate}
|
))}
|
||||||
|
|
||||||
|
{/* IMEIs */}
|
||||||
|
{imeis.map((iVal, i) => (
|
||||||
|
<div key={`imei-${i}`}>{iVal}</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Description - Always New Line */}
|
||||||
|
|
||||||
|
|
||||||
|
{descriptions.map((d, i) => (
|
||||||
|
<div key={`desc-${i}`}>{d}</div>
|
||||||
|
))}
|
||||||
</td>
|
</td>
|
||||||
)
|
)
|
||||||
: Rate && (
|
}
|
||||||
<td style={{ textAlign: 'right' }}>
|
|
||||||
{item?.Rate}
|
{/* Quantity */}
|
||||||
</td>
|
{(GlobaldummyData ? GlobalQuantity : Quantity) && (
|
||||||
)}
|
<td style={{ textAlign: "right" }}>
|
||||||
{GlobaldummyData
|
{item?.SalesQty}
|
||||||
? GlobalAmount && (
|
</td>
|
||||||
<td style={{ textAlign: 'right' }}>
|
)}
|
||||||
{item?.TotalAmt}
|
|
||||||
</td>
|
{/* HSN */}
|
||||||
)
|
{(GlobaldummyData ? GlobalHsnCode : HsnCode) && (
|
||||||
: Amount && (
|
<td style={{ textAlign: "right" }}>
|
||||||
<td style={{ textAlign: 'right' }}>
|
{item?.HSN}
|
||||||
{' '}
|
</td>
|
||||||
{item?.Type != 'C'
|
)}
|
||||||
? item?.TotalAmt - item?.OfferAmt || 0
|
|
||||||
: item?.TotalAmt - item?.OfferValue ||
|
{/* MRP */}
|
||||||
0}
|
{(GlobaldummyData ? GlobalMRP : MRP) && (
|
||||||
</td>
|
<td style={{ textAlign: "right" }}>
|
||||||
)}
|
{item?.SinglePc === "Y" ? item?.Rate : item?.MRP}
|
||||||
|
</td>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Discount */}
|
||||||
|
{(GlobaldummyData ? GlobalDiscount : Discount) && (
|
||||||
|
<td style={{ textAlign: "right" }}>
|
||||||
|
{item?.Type !== "C"
|
||||||
|
? item?.OfferAmt || 0
|
||||||
|
: item?.OfferValue || 0}
|
||||||
|
</td>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Rate */}
|
||||||
|
{(GlobaldummyData ? GlobalRate : Rate) && (
|
||||||
|
<td style={{ textAlign: "right" }}>
|
||||||
|
{item?.Rate}
|
||||||
|
</td>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Amount */}
|
||||||
|
{(GlobaldummyData ? GlobalAmount : Amount) && (
|
||||||
|
<td style={{ textAlign: "right" }}>
|
||||||
|
{item?.Type !== "C"
|
||||||
|
? (item?.TotalAmt || 0) - (item?.OfferAmt || 0)
|
||||||
|
: (item?.TotalAmt || 0) - (item?.OfferValue || 0)}
|
||||||
|
</td>
|
||||||
|
)}
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
@ -3195,7 +3149,16 @@ const Printstyle4 = ({
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>Dt: {GlobaldummyData ? formattedDate : Date1}</div>
|
<div>
|
||||||
|
Dt: {GlobaldummyData ? formattedDate : Date1}
|
||||||
|
|
||||||
|
{SalesModePref?.SettingValue == 'Y' &&
|
||||||
|
<div >
|
||||||
|
{' '}
|
||||||
|
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
|
||||||
|
</div>}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
Bill No :
|
Bill No :
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -3214,8 +3177,8 @@ const Printstyle4 = ({
|
||||||
style={{ textTransform: 'uppercase', fontSize: '12px' }}
|
style={{ textTransform: 'uppercase', fontSize: '12px' }}
|
||||||
>
|
>
|
||||||
Estimate{' '}
|
Estimate{' '}
|
||||||
{SalesModePref?.SettingValue == 'Y' &&
|
{/* {SalesModePref?.SettingValue == 'Y' &&
|
||||||
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}
|
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -3235,8 +3198,8 @@ const Printstyle4 = ({
|
||||||
: 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>
|
||||||
)}
|
)}
|
||||||
<hr className="PrintStyle4-print-dottline" />
|
<hr className="PrintStyle4-print-dottline" />
|
||||||
|
|
@ -3370,203 +3333,101 @@ const Printstyle4 = ({
|
||||||
: Item && (
|
: Item && (
|
||||||
<td
|
<td
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: "flex",
|
||||||
flexDirection: 'column',
|
flexDirection: "column",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
<div>
|
|
||||||
{PackageDetails?.filter(
|
|
||||||
(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})
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
|
|
||||||
{(
|
{/* Serial Numbers */}
|
||||||
(item?.ProductIdentifierDtls
|
{item?.ProductIdentifierDtls
|
||||||
?.length > 0
|
?.filter(d => d.SerialNumber)
|
||||||
? item?.ProductIdentifierDtls.filter(
|
?.map((d, i) => (
|
||||||
(items) => items.SerialNumber
|
<div key={`serial-${i}`}>
|
||||||
)
|
{d.SerialNumber}
|
||||||
.map(
|
|
||||||
(a, index) =>
|
|
||||||
` ${a.SerialNumber}`
|
|
||||||
)
|
|
||||||
.join('')
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(item1) =>
|
|
||||||
item1.IMEI1 || item1.IMEI2
|
|
||||||
)
|
|
||||||
.map((item2, index) => {
|
|
||||||
const imei1 =
|
|
||||||
item2.IMEI1 || '';
|
|
||||||
const imei2 =
|
|
||||||
item2.IMEI2 || '';
|
|
||||||
return ` ${[imei1, imei2].filter(Boolean).join(',')}`;
|
|
||||||
})
|
|
||||||
.join('')
|
|
||||||
: '')
|
|
||||||
).trim()}
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
))}
|
||||||
<div>
|
|
||||||
{(
|
{/* IMEI Numbers */}
|
||||||
(UomPrint?.SettingValue === 'Y'
|
{item?.ProductIdentifierDtls
|
||||||
? (item?.Size || '1') +
|
?.filter(d => d.IMEI1 || d.IMEI2)
|
||||||
(item?.SinglePc === 'Y'
|
?.map((d, i) => (
|
||||||
? ' PCS'
|
<div key={`imei-${i}`}>
|
||||||
: item?.Type !== 'C'
|
{[d.IMEI1, d.IMEI2].filter(Boolean).join(", ")}
|
||||||
? ` ${item?.UomName}`
|
|
||||||
: ' COMBO')
|
|
||||||
: '') +
|
|
||||||
(item?.BrandName
|
|
||||||
? ` ${item?.BrandName}`
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(items) => items.SerialNumber
|
|
||||||
)
|
|
||||||
.map(
|
|
||||||
(a, index) =>
|
|
||||||
` ${a.SerialNumber}`
|
|
||||||
)
|
|
||||||
.join('')
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(item1) =>
|
|
||||||
item1.IMEI1 || item1.IMEI2
|
|
||||||
)
|
|
||||||
.map((item2, index) => {
|
|
||||||
const imei1 =
|
|
||||||
item2.IMEI1 || '';
|
|
||||||
const imei2 =
|
|
||||||
item2.IMEI2 || '';
|
|
||||||
return ` ${[imei1, imei2].filter(Boolean).join(',')}`;
|
|
||||||
})
|
|
||||||
.join('')
|
|
||||||
: '')
|
|
||||||
).trim()}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
))}
|
||||||
</div>
|
|
||||||
|
{/* ✅ Description ALWAYS NEW LINE */}
|
||||||
|
{item?.ProductIdentifierDtls
|
||||||
|
?.filter(d => d.Description)
|
||||||
|
?.map((d, i) => (
|
||||||
|
<div key={`desc-${i}`}>
|
||||||
|
{d.Description}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<td style={{ textAlign: 'right' }}>
|
<td style={{ textAlign: 'right' }}>
|
||||||
{item?.SalesQty}
|
{item?.SalesQty}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
{/* Package Details */}
|
||||||
|
{PackageDetails?.filter(pkg => pkg.ProdId === item.ProdId).length > 0 ? (
|
||||||
|
<div>
|
||||||
|
{PackageDetails
|
||||||
|
?.filter(pkg => pkg.ProdId === item.ProdId)
|
||||||
|
?.map((pkg, index) => (
|
||||||
|
<div key={index}>
|
||||||
|
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Serial */}
|
||||||
|
{item?.ProductIdentifierDtls
|
||||||
|
?.filter(d => d.SerialNumber)
|
||||||
|
?.map((d, i) => (
|
||||||
|
<div key={`serial-${i}`}>
|
||||||
|
{d.SerialNumber}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* IMEI */}
|
||||||
|
{item?.ProductIdentifierDtls
|
||||||
|
?.filter(d => d.IMEI1 || d.IMEI2)
|
||||||
|
?.map((d, i) => (
|
||||||
|
<div key={`imei-${i}`}>
|
||||||
|
{[d.IMEI1, d.IMEI2].filter(Boolean).join(', ')}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* ✅ Description NEW LINE */}
|
||||||
|
{item?.ProductIdentifierDtls
|
||||||
|
?.filter(d => d.Description)
|
||||||
|
?.map((d, i) => (
|
||||||
|
<div key={`desc-${i}`}>
|
||||||
|
{d.Description}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div>
|
||||||
|
{UomPrint?.SettingValue === 'Y' && (
|
||||||
|
<>({item?.Size || '1'}) {item?.SinglePc === 'Y' ? 'PCS' : item?.Type !== 'C' ? item?.UomName : 'COMBO'} </>
|
||||||
|
)}
|
||||||
|
{item?.BrandName || ""}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<td style={{ textAlign: 'right' }}>
|
<td style={{ textAlign: 'right' }}>
|
||||||
{item?.SalesQty}
|
{item?.SalesQty}
|
||||||
{/* <div style={{ whiteSpace: 'nowrap' }}>
|
|
||||||
{PackageDetails?.filter(
|
|
||||||
(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})
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
|
|
||||||
{(
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(items) => items.SerialNumber
|
|
||||||
)
|
|
||||||
.map(
|
|
||||||
(a, index) =>
|
|
||||||
` ${a.SerialNumber}`
|
|
||||||
)
|
|
||||||
.join('')
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(item1) =>
|
|
||||||
item1.IMEI1 || item1.IMEI2
|
|
||||||
)
|
|
||||||
.map((item2, index) => {
|
|
||||||
const imei1 =
|
|
||||||
item2.IMEI1 || '';
|
|
||||||
const imei2 =
|
|
||||||
item2.IMEI2 || '';
|
|
||||||
return ` ${[imei1, imei2].filter(Boolean).join(',')}`;
|
|
||||||
})
|
|
||||||
.join('')
|
|
||||||
: '')
|
|
||||||
).trim()}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div>
|
|
||||||
{(
|
|
||||||
(item?.Size || '1') +
|
|
||||||
(item?.SinglePc === 'Y'
|
|
||||||
? ' PCS'
|
|
||||||
: item?.Type !== 'C'
|
|
||||||
? ` ${item?.UomName}`
|
|
||||||
: ' COMBO') +
|
|
||||||
(item?.BrandName
|
|
||||||
? ` ${item?.BrandName}`
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(items) => items.SerialNumber
|
|
||||||
)
|
|
||||||
.map(
|
|
||||||
(a, index) =>
|
|
||||||
` ${a.SerialNumber}`
|
|
||||||
)
|
|
||||||
.join('')
|
|
||||||
: '') +
|
|
||||||
(item?.ProductIdentifierDtls
|
|
||||||
?.length > 0
|
|
||||||
? item?.ProductIdentifierDtls.filter(
|
|
||||||
(item1) =>
|
|
||||||
item1.IMEI1 || item1.IMEI2
|
|
||||||
)
|
|
||||||
.map((item2, index) => {
|
|
||||||
const imei1 =
|
|
||||||
item2.IMEI1 || '';
|
|
||||||
const imei2 =
|
|
||||||
item2.IMEI2 || '';
|
|
||||||
return ` ${[imei1, imei2].filter(Boolean).join(',')}`;
|
|
||||||
})
|
|
||||||
.join('')
|
|
||||||
: '')
|
|
||||||
).trim()}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div> */}
|
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -3689,6 +3550,7 @@ const Printstyle4 = ({
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{DineInData?.length > 0 && (
|
{DineInData?.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|
@ -3819,6 +3681,46 @@ const Printstyle4 = ({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
|
{(
|
||||||
|
(item?.ProductIdentifierDtls
|
||||||
|
?.length > 0
|
||||||
|
? item?.ProductIdentifierDtls.filter(
|
||||||
|
(items) => items.SerialNumber
|
||||||
|
)
|
||||||
|
.map(
|
||||||
|
(a, index) =>
|
||||||
|
` ${a.SerialNumber}`
|
||||||
|
)
|
||||||
|
.join('')
|
||||||
|
: '') +
|
||||||
|
(item?.ProductIdentifierDtls
|
||||||
|
?.length > 0
|
||||||
|
? item?.ProductIdentifierDtls.filter(
|
||||||
|
(item1) =>
|
||||||
|
item1.IMEI1 || item1.IMEI2
|
||||||
|
)
|
||||||
|
.map((item2) => {
|
||||||
|
const imei1 =
|
||||||
|
item2.IMEI1 || '';
|
||||||
|
const imei2 =
|
||||||
|
item2.IMEI2 || '';
|
||||||
|
return ` ${[imei1, imei2].filter(Boolean).join(',')}`;
|
||||||
|
})
|
||||||
|
.join('')
|
||||||
|
: '')
|
||||||
|
+
|
||||||
|
(item?.ProductIdentifierDtls
|
||||||
|
?.length > 0
|
||||||
|
? item?.ProductIdentifierDtls.filter(
|
||||||
|
(item1) =>
|
||||||
|
item1.IMEI1 || item1.IMEI2 || item1.SerialNumber
|
||||||
|
)
|
||||||
|
.map((item2) => {
|
||||||
|
return ` ${item2?.Description}`;
|
||||||
|
})
|
||||||
|
.join('')
|
||||||
|
: '')
|
||||||
|
).trim()}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -3840,15 +3742,15 @@ const Printstyle4 = ({
|
||||||
<td style={{ textAlign: 'right' }}>
|
<td style={{ textAlign: 'right' }}>
|
||||||
{item?.SalesQty}
|
{item?.SalesQty}
|
||||||
{UomPrint?.SettingValue === 'Y' &&
|
{UomPrint?.SettingValue === 'Y' &&
|
||||||
<div>
|
<div>
|
||||||
({item?.Size ? item?.Size : '1'}{' '}
|
({item?.Size ? item?.Size : '1'}{' '}
|
||||||
{item?.SinglePc == 'Y'
|
{item?.SinglePc == 'Y'
|
||||||
? 'PCS'
|
? 'PCS'
|
||||||
: item?.Type != 'C'
|
: item?.Type != 'C'
|
||||||
? item?.UomName
|
? item?.UomName
|
||||||
: 'COMBO'}
|
: 'COMBO'}
|
||||||
)
|
)
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3946,6 +3848,7 @@ const Printstyle4 = ({
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<div className="PrintStyle4-ThirdDivMaster">
|
<div className="PrintStyle4-ThirdDivMaster">
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="print2subTotal"
|
className="print2subTotal"
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -3967,6 +3870,59 @@ const Printstyle4 = ({
|
||||||
: Number(table2Data?.NetAmount).toFixed(2)}
|
: Number(table2Data?.NetAmount).toFixed(2)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* <div
|
||||||
|
className="print2subTotal"
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
fontSize: '8px',
|
||||||
|
fontWeight: 400,
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
borderBottom: '1px dashed #000',
|
||||||
|
borderTop: '1px dashed #000',
|
||||||
|
padding: '5px 0',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div>OVER ALL QTY</div>
|
||||||
|
<div>
|
||||||
|
{GlobaldummyData
|
||||||
|
? '1,066'
|
||||||
|
: Number(productsData?.reduce((a, b) => a + b.SalesQty, 0))}
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
<div
|
||||||
|
className="print2subTotal"
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
fontSize: '8px',
|
||||||
|
fontWeight: 400,
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
borderBottom: '1px dashed #000',
|
||||||
|
borderTop: '1px dashed #000',
|
||||||
|
padding: '5px 40px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ display: "flex", gap: "10px" }}>
|
||||||
|
<div> ITEM :</div>
|
||||||
|
<div>
|
||||||
|
{GlobaldummyData
|
||||||
|
? '1,066'
|
||||||
|
: productsData?.length}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style={{ display: "flex", gap: "10px" }}>
|
||||||
|
<div> QTY :</div>
|
||||||
|
<div>
|
||||||
|
{GlobaldummyData
|
||||||
|
? '1,066'
|
||||||
|
: Number(productsData?.reduce((a, b) => a + b.SalesQty, 0))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* <div className="PrintStyle4-ThirdP">
|
{/* <div className="PrintStyle4-ThirdP">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue