Merge pull request 'Fix #262 Print style changes' (#263) from March-3-deployment into main

Reviewed-on: Pozomind/pozo-retail-app#263
This commit is contained in:
karthikalakshmi 2026-03-09 12:48:09 +05:30
commit f564bd3d1b
18 changed files with 2119 additions and 2054 deletions

View File

@ -142,22 +142,28 @@ const BSImeiDetails = (props) => {
}, []);
const AddDeviceDetails = () => {
console.log(
formRef?.current?.getFieldsValue,
'formRef?.current?.getFieldsValue'
SerialNumberList.length, IMEINumberList.length,"SerialNumberList, IMEINumberList"
);
const maxLength = Math.max(SerialNumberList.length, IMEINumberList.length);
// Create the new object array
const description = formRef.current?.getFieldsValue()?.description || '';
const maxLength = Math.max(
SerialNumberList.length,
IMEINumberList.length,
description ? 1 : 0
);
const IdentifyDetails = Array.from({ length: maxLength }, (_, index) => {
const serial = SerialNumberList[index] || ''; // Use serial number or default to empty
const serial = SerialNumberList[index] || '';
const imeiPair = IMEINumberList[index]
? IMEINumberList[index].split(',')
: ['', '']; // Split IMEI numbers or default to empty strings
: ['', ''];
return {
SerialNumber: serial,
IMEI1: imeiPair[0] || '', // First IMEI number
IMEI2: imeiPair[1] || '', // Second IMEI number
MacId: '', // Default empty macid
Description: formRef.current?.getFieldsValue()?.description || '',
IMEI1: imeiPair[0] || '',
IMEI2: imeiPair[1] || '',
MacId: '',
Description: description || '',
};
});
console.log(IdentifyDetails, 'IdentifyDetails');
@ -410,10 +416,10 @@ const BSImeiDetails = (props) => {
<div style={{ display: 'flex', marginTop: '10px' }}>
<Form.Item name="description">
<TextAreaInput
disabled={
IMEINumberList?.length === 0 &&
SerialNumberList?.length === 0
}
// disabled={
// IMEINumberList?.length === 0 &&
// SerialNumberList?.length === 0
// }
autoComplete="off"
label={<label>Description..</label>}
defaultValue=""

View File

@ -4422,7 +4422,7 @@ const BSC1Payment = (props) => {
</>
)}
{/* Customer Orders */}
{(SelCustId && tableOptions?.filter((item) => item.OptionName === 'PreviousBillFetch')
{(SelCustId && BSComboData?.BookingBilling?.[1]?.filter((item) => item.OptionName === 'PreviousBillFetch')
.length === 1) && (
<Tooltip title="Customer Orders" isMobile={isMobile}>
{' '}

View File

@ -1061,12 +1061,10 @@ const InvoiceTemplate = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName +
' Bill'
: ''}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}
</div>
)}
</div>
@ -2861,11 +2859,10 @@ const InvoiceTemplate = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}
: ' Bill')}
</div>
)}
</div>

View File

@ -522,11 +522,10 @@ const PrintA4Style11 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}
: ' Bill')}
</div>
<div
style={{
@ -874,14 +873,13 @@ const PrintA4Style11 = ({
})}
{/* Description */}
{item?.ProductIdentifierDtls?.map((id, index) => (
(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) &&
{
id?.Description && (
<div key={`desc-${index}`}>
{id.Description}
</div>
)
))}
}
</td>
)

View File

@ -517,11 +517,10 @@ const PrintA5Style11 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}
: ' Bill')}
</div>
<div
style={{
@ -847,7 +846,7 @@ const PrintA5Style11 = ({
)}
{/* Description */}
{(id?.SerialNumber || id?.IMEI1 || id?.IMEI2) &&
{
id?.Description && (
<div>{id.Description}</div>
)}

View File

@ -944,11 +944,11 @@ const TaxInvoice = ({
{/* Description outside */}
{item?.ProductIdentifierDtls
?.find(d => d?.Description)
?.[0]
?.Description && (
<div style={{ marginTop: "3px", wordBreak: "break-word" }}>
{item?.ProductIdentifierDtls
?.find(d => d?.Description)
?.[0]
?.Description}
</div>
)}

View File

@ -597,12 +597,10 @@ const PrintStyle1 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName +
' Bill'
: ''}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} */}
</div>
@ -922,15 +920,9 @@ const PrintStyle1 = ({
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0 &&
item?.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && (
<div>{item.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
).Description}</div>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
@ -3911,11 +3903,10 @@ const PrintStyle1 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}
: ' Bill')}
{SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`}
</div>
@ -4185,15 +4176,9 @@ const PrintStyle1 = ({
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0 &&
item?.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && (
<div>{item.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
).Description}</div>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</td>

View File

@ -550,11 +550,10 @@ const PrintStyle10 = ({
<div style={{ textTransform: 'uppercase' }}>
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -818,8 +817,8 @@ const PrintStyle10 = ({
)}
</div>
))}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>
@ -840,8 +839,8 @@ const PrintStyle10 = ({
)}
</div>
))}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
)}
@ -3195,11 +3194,10 @@ const PrintStyle10 = ({
<div style={{ textTransform: 'uppercase' }}>
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -3404,8 +3402,8 @@ const PrintStyle10 = ({
{(id.IMEI1 || id.IMEI2) && <div>{[id.IMEI1, id.IMEI2].filter(Boolean).join(', ')}</div>}
</div>
))}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
) : (
@ -3450,8 +3448,8 @@ const PrintStyle10 = ({
)}
</div>
))}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>

View File

@ -538,11 +538,10 @@ const PrintStyle11 = ({
>
{GlobaldummyData
? 'CASH'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} */}
</div>
@ -791,8 +790,8 @@ const PrintStyle11 = ({
</div>
);
})}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>
@ -824,8 +823,8 @@ const PrintStyle11 = ({
);
})}
</div>
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
@ -3191,11 +3190,10 @@ const PrintStyle11 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode})`} */}
</div>
@ -3399,8 +3397,8 @@ const PrintStyle11 = ({
</div>
);
})}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
) : (
@ -3460,8 +3458,8 @@ const PrintStyle11 = ({
</div>
);
})}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>

View File

@ -663,12 +663,10 @@ const Printstyle12 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName +
' Bill'
: ''}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}
</div>
<div style={{ fontSize: 'clamp(0.75rem, 2.5vw, 1rem)' }}>
{' '}
@ -944,8 +942,8 @@ const Printstyle12 = ({
</div>
);
})}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>
@ -3658,8 +3656,8 @@ const Printstyle12 = ({
</div>
);
})}
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>

View File

@ -562,11 +562,10 @@ const Printstyle2 = ({
>
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
&nbsp; Bill{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */}
@ -853,15 +852,9 @@ const Printstyle2 = ({
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0 &&
item?.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && (
<div>{item.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
).Description}</div>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
@ -3235,11 +3228,10 @@ const Printstyle2 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`}{' '} */}
</div>
@ -3467,15 +3459,9 @@ const Printstyle2 = ({
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0 &&
item?.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && (
<div>{item.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
).Description}</div>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>

View File

@ -310,7 +310,11 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
{table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? 'Cash Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>
{GlobaldummyData ? 'Cash Bill' : BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
</div>
@ -411,15 +415,9 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0 &&
item?.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && (
<div>{item.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
).Description}</div>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>
@ -1300,7 +1298,11 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
{table2Data?.OrderType === "E" && estimateTitle && <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>Estimate Bill
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ? BillName : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill' : ""}
{table2Data?.OrderType === "E" ? "" : <div style={{ fontSize: "14px", margin: "2px 0 0 0", padding: 0, fontWeight: 600 }}>
{GlobaldummyData ? GlobalBilltext ? GlobalBilltext : "Cash" + ' Bill' : BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: 'Bill')}
{/* {SalesModePref?.SettingValue == 'Y' && `(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>}
</div>
@ -1395,15 +1397,9 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
);
})
: ''}
{item?.ProductIdentifierDtls?.length > 0 &&
item?.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && (
<span>{item.ProductIdentifierDtls.find(
(items) =>
items.SerialNumber || items.IMEI1 || items.IMEI2
).Description}</span>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
</div>

View File

@ -112,16 +112,26 @@ const Printstyle4 = ({
const GlobalLogo = useSelector(GlobalprintLogo);
const GlobalCredit = useSelector(GlobalprintCredit);
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
const SelectedHeaderFontColor = useSelector(GlobalSelectedPrintHeaderFontColor);
const SelectedHeaderFontColor = useSelector(
GlobalSelectedPrintHeaderFontColor
);
const SelectedTableHeaderColor = useSelector(GlobalSelectedTableHeaderColor);
const SelectedTableHeaderFontColor = useSelector(GlobalSelectedTableHeaderFontColor);
const SelectedTableHeaderFontColor = useSelector(
GlobalSelectedTableHeaderFontColor
);
const SelectedTableBodyColor = useSelector(GlobalSelectedTableBodyColor);
const SelectedTableBodyFontColor = useSelector(GlobalSelectedTableBodyFontColor);
const SelectedTableBodyFontColor = useSelector(
GlobalSelectedTableBodyFontColor
);
const SelectedRowType = useSelector(GlobalRowType);
const SelectedTableFooterColor = useSelector(GlobalSelectedFooterColor);
const SelectedTableFooterFontColor = useSelector(GlobalSelectedFooterFontColor);
const SelectedTableFooterFontColor = useSelector(
GlobalSelectedFooterFontColor
);
const SelectedNetAmountColor = useSelector(GlobalSelectedNetAmountColor);
const SelectedNetAmountFontColor = useSelector(GlobalSelectedNetAmountFontColor);
const SelectedNetAmountFontColor = useSelector(
GlobalSelectedNetAmountFontColor
);
const SettingData = useSelector(PreferenceData);
const Retailshortname = SettingData?.[0]?.SettingDtlDetails?.find(
(setting) => setting?.SettingIdName?.toLowerCase() === 'retailshortname'
@ -172,11 +182,15 @@ const Printstyle4 = ({
);
let printColors = printDatas?.PrintColors;
const headerColor = printColors?.find(obj => obj.headerColor)?.headerColor;
const tableHeaderColor = printColors?.find(obj => obj.tableHeaderColor)?.tableHeaderColor;
const tableBodyColor = printColors?.find(obj => obj.tableBodyColor)?.tableBodyColor;
const footerColor = printColors?.find(obj => obj.footerColor)?.footerColor;
const netAmtColor = printColors?.find(obj => obj.netAmtColor)?.netAmtColor;
const headerColor = printColors?.find((obj) => obj.headerColor)?.headerColor;
const tableHeaderColor = printColors?.find(
(obj) => obj.tableHeaderColor
)?.tableHeaderColor;
const tableBodyColor = printColors?.find(
(obj) => obj.tableBodyColor
)?.tableBodyColor;
const footerColor = printColors?.find((obj) => obj.footerColor)?.footerColor;
const netAmtColor = printColors?.find((obj) => obj.netAmtColor)?.netAmtColor;
let TermsAndConditions = printDatas?.TermsandConditions;
let SignatureImg = printDatas?.Signature;
@ -366,7 +380,7 @@ const Printstyle4 = ({
} else if (DineInData?.length > 0) {
dataSource = DineInData;
}
console.log(dataSource, 'dataSource');
// Paginate the data
const paginatedChunks = [];
for (let i = 0; i < dataSource.length; i += chunkSize) {
@ -378,16 +392,14 @@ const Printstyle4 = ({
: 0;
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10);
console.log(paginatedChunks, 'paginatedChunks')
console.log(paginatedChunks, 'paginatedChunks');
const headerStyle = {
backgroundColor: GlobaldummyData
? SelectedHeaderColor
: headerColor?.background,
color: GlobaldummyData
? SelectedHeaderFontColor
: headerColor?.font,
}
color: GlobaldummyData ? SelectedHeaderFontColor : headerColor?.font,
};
const tableHeaderStyle = {
backgroundColor: GlobaldummyData
? SelectedTableHeaderColor
@ -396,34 +408,30 @@ const Printstyle4 = ({
color: GlobaldummyData
? SelectedTableHeaderFontColor
: tableHeaderColor?.font,
}
};
const tableBodyStyle = {
backgroundColor: GlobaldummyData
? SelectedTableBodyColor
: tableBodyColor?.background,
color: GlobaldummyData
? SelectedTableBodyFontColor
: tableBodyColor?.font,
}
const rowtypeStyle = GlobaldummyData ? SelectedRowType : tableBodyColor?.rowType;
color: GlobaldummyData ? SelectedTableBodyFontColor : tableBodyColor?.font,
};
const rowtypeStyle = GlobaldummyData
? SelectedRowType
: tableBodyColor?.rowType;
const footerColorStyle = {
backgroundColor: GlobaldummyData
? SelectedTableFooterColor
: footerColor?.background,
color: GlobaldummyData
? SelectedTableFooterFontColor
: footerColor?.font,
}
color: GlobaldummyData ? SelectedTableFooterFontColor : footerColor?.font,
};
const netAmountStyle = {
backgroundColor: GlobaldummyData
? SelectedNetAmountColor
: netAmtColor?.background,
color: GlobaldummyData
? SelectedNetAmountFontColor
: netAmtColor?.font,
}
color: GlobaldummyData ? SelectedNetAmountFontColor : netAmtColor?.font,
};
return (
<>
{FormatTheme ? (
@ -567,11 +575,15 @@ const Printstyle4 = ({
>
<div style={{ fontSize: '12px', fontWeight: '500' }}>
Dt: {GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontWeight: '600' }}>
{SalesModePref?.SettingValue == 'Y' && (
<div style={{ fontWeight: '600' }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? Retailshortname?.Comments : Wholesaleshortname?.Comments}{' '}
</div>}
Name :{' '}
{table2Data?.SalesMode == 'R'
? Retailshortname?.Comments
: Wholesaleshortname?.Comments}{' '}
</div>
)}
</div>
<div style={{ fontSize: '12px', fontWeight: '500' }}>
@ -607,11 +619,10 @@ const Printstyle4 = ({
>
{GlobaldummyData
? 'Cash Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -646,12 +657,32 @@ const Printstyle4 = ({
<tr>
{GlobaldummyData
? GlobalSlNo && (
<th style={{ ...tableHeaderStyle, width: '10px' }}>#</th>
<th
style={{
...tableHeaderStyle,
width: '10px',
}}
>
#
</th>
)
: SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>#</th>}
: SLNO && (
<th
style={{
...tableHeaderStyle,
width: '10px',
}}
>
#
</th>
)}
{GlobaldummyData
? GlobalItem && <th style={{ ...tableHeaderStyle, }}>Item</th>
: Item && <th style={{ ...tableHeaderStyle, }}>Item</th>}
? GlobalItem && (
<th style={{ ...tableHeaderStyle }}>Item</th>
)
: Item && (
<th style={{ ...tableHeaderStyle }}>Item</th>
)}
{GlobaldummyData
? GlobalQuantity && (
<th
@ -728,6 +759,7 @@ const Printstyle4 = ({
...tableHeaderStyle,
width: '10px',
textAlign: 'right',
marginRight: '4px',
}}
>
Dis{' '}
@ -739,6 +771,7 @@ const Printstyle4 = ({
...tableHeaderStyle,
width: '30px',
textAlign: 'right',
marginRight: '4px',
}}
>
Dis{' '}
@ -810,26 +843,27 @@ const Printstyle4 = ({
const descriptions = identifiers
.filter((d) => d.Description)
.map((d) => d.Description);
console.log(descriptions,identifiers,'descriptions')
const packageList =
PackageDetails?.filter(
(pkg) => pkg.ProdId === item.ProdId
) ?? [];
return (
<tr key={index}
<tr
key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
index % 2 !== 1 && rowtypeStyle === 'even'
? {
...tableBodyStyle
...tableBodyStyle,
}
: index % 2 === 1 && rowtypeStyle === "odd"
: index % 2 === 1 && rowtypeStyle === 'odd'
? {
...tableBodyStyle
...tableBodyStyle,
}
: {}
}>
}
>
{/* SL NO */}
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
@ -928,8 +962,10 @@ const Printstyle4 = ({
: Discount) && (
<td style={{ textAlign: 'right' }}>
{item?.Type !== 'C'
? (item?.OfferAmt || item?.DiscountAmt || 0)
: (item?.OfferValue || item?.DiscountAmt || 0)}
? item?.OfferAmt || item?.DiscountAmt || 0
: item?.OfferValue ||
item?.DiscountAmt ||
0}
</td>
)}
@ -976,12 +1012,32 @@ const Printstyle4 = ({
<tr>
{GlobaldummyData
? GlobalSlNo && (
<th style={{ ...tableHeaderStyle, width: '10px' }}>#</th>
<th
style={{
...tableHeaderStyle,
width: '10px',
}}
>
#
</th>
)
: SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>#</th>}
: SLNO && (
<th
style={{
...tableHeaderStyle,
width: '10px',
}}
>
#
</th>
)}
{GlobaldummyData
? GlobalItem && <th style={{ ...tableHeaderStyle, }}>Item</th>
: Item && <th style={{ ...tableHeaderStyle, }}>Item</th>}
? GlobalItem && (
<th style={{ ...tableHeaderStyle }}>Item</th>
)
: Item && (
<th style={{ ...tableHeaderStyle }}>Item</th>
)}
{GlobaldummyData
? GlobalQuantity && (
<th
@ -1125,18 +1181,20 @@ const Printstyle4 = ({
<tbody>
{dataChunk?.map((item, index) => {
return (
<tr key={index}
<tr
key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
index % 2 !== 1 && rowtypeStyle === 'even'
? {
...tableBodyStyle
...tableBodyStyle,
}
: index % 2 === 1 && rowtypeStyle === "odd"
: index % 2 === 1 && rowtypeStyle === 'odd'
? {
...tableBodyStyle
...tableBodyStyle,
}
: {}
}>
}
>
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
: SLNO && (
@ -1211,8 +1269,12 @@ const Printstyle4 = ({
: Discount && (
<td style={{ textAlign: 'right' }}>
{item?.Type !== 'C'
? (item?.OfferAmt || item?.DiscountAmt || 0)
: (item?.OfferValue || item?.DiscountAmt || 0)}
? item?.OfferAmt ||
item?.DiscountAmt ||
0
: item?.OfferValue ||
item?.DiscountAmt ||
0}
</td>
)}
{GlobaldummyData
@ -1248,8 +1310,10 @@ const Printstyle4 = ({
<td style={{ textAlign: 'right' }}>
{' '}
{item?.Type !== 'C'
? item?.TotalAmt - (item?.OfferAmt || 0)
: item?.TotalAmt - (item?.OfferValue || 0)}
? item?.TotalAmt -
(item?.OfferAmt || 0)
: item?.TotalAmt -
(item?.OfferValue || 0)}
</td>
)}
</tr>
@ -1291,7 +1355,7 @@ const Printstyle4 = ({
borderBottom: '1px dashed #000',
borderTop: '1px dashed #000',
padding: '5px 0',
...netAmountStyle
...netAmountStyle,
}}
>
{' '}
@ -1422,7 +1486,6 @@ const Printstyle4 = ({
fontWeight: '600',
borderTop: '1px dashed #000',
borderBottom: '1px dashed #000',
// color: '#e30c0c',
color: '#000',
marginTop: '10px',
padding: '4px 0',
@ -2042,7 +2105,7 @@ const Printstyle4 = ({
pageBreakBefore: 'avoid',
pageBreakInside: 'avoid',
minHeight: 'auto',
...footerColorStyle
...footerColorStyle,
}}
>
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -2283,7 +2346,7 @@ const Printstyle4 = ({
borderBottom: '1px dashed #000',
borderTop: '1px dashed #000',
padding: '5px 0',
...netAmountStyle
...netAmountStyle,
}}
>
<div>Sub Total</div>
@ -3019,7 +3082,7 @@ const Printstyle4 = ({
pageBreakBefore: 'avoid',
pageBreakInside: 'avoid',
minHeight: 'auto',
...footerColorStyle
...footerColorStyle,
}}
>
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -3260,7 +3323,6 @@ const Printstyle4 = ({
fontWeight: '600',
width: '100%',
textAlign: 'center',
// color: '#e30c0c',
color: '#000',
lineHeight: '1',
letterSpacing: '-0.5px',
@ -3321,11 +3383,15 @@ const Printstyle4 = ({
>
<div>
Dt: {GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' && <div style={{ fontWeight: '600' }}>
{SalesModePref?.SettingValue == 'Y' && (
<div style={{ fontWeight: '600' }}>
{' '}
Name : {table2Data?.SalesMode == "R" ? Retailshortname?.Comments : Wholesaleshortname?.Comments}{' '}
</div>}
Name :{' '}
{table2Data?.SalesMode == 'R'
? Retailshortname?.Comments
: Wholesaleshortname?.Comments}{' '}
</div>
)}
</div>
<div>
@ -3362,11 +3428,10 @@ const Printstyle4 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -3394,52 +3459,110 @@ const Printstyle4 = ({
<thead>
<tr>
{GlobaldummyData
? GlobalSlNo && <th style={{ ...tableHeaderStyle, width: '10px' }}>#</th>
: SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>#</th>}
? GlobalSlNo && (
<th style={{ ...tableHeaderStyle, width: '10px' }}>
#
</th>
)
: SLNO && (
<th style={{ ...tableHeaderStyle, width: '10px' }}>
#
</th>
)}
{GlobaldummyData
? GlobalItem && <th style={{ ...tableHeaderStyle, }}>Item</th>
: Item && <th style={{ ...tableHeaderStyle, }}>Item</th>}
? GlobalItem && (
<th style={{ ...tableHeaderStyle }}>Item</th>
)
: Item && <th style={{ ...tableHeaderStyle }}>Item</th>}
{GlobaldummyData
? GlobalQuantity && (
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '10px',
textAlign: 'right',
}}
>
Qty
</th>
)
: Quantity && (
<th style={{ ...tableHeaderStyle, width: '30px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '30px',
textAlign: 'right',
}}
>
Qty
</th>
)}
{GlobaldummyData
? GlobalHsnCode && (
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '10px',
textAlign: 'right',
}}
>
HSN
</th>
)
: HsnCode && (
<th style={{ ...tableHeaderStyle, width: '30px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '30px',
textAlign: 'right',
}}
>
HSN
</th>
)}
{GlobaldummyData
? GlobalMRP && (
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
<th
style={{
...tableHeaderStyle,
width: '10px',
textAlign: 'center',
}}
>
MRP
</th>
)
: MRP && (
<th style={{ ...tableHeaderStyle, width: '30px', textAlign: 'center' }}>
<th
style={{
...tableHeaderStyle,
width: '30px',
textAlign: 'center',
}}
>
MRP
</th>
)}
{GlobaldummyData
? GlobalDiscount && (
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '10px',
textAlign: 'right',
}}
>
Dis{' '}
</th>
)
: Discount && (
<th style={{ ...tableHeaderStyle, width: '25px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '25px',
textAlign: 'right',
}}
>
Dis{' '}
</th>
)}
@ -3467,23 +3590,47 @@ const Printstyle4 = ({
)} */}
{GlobaldummyData
? GlobalRate && (
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '10px',
textAlign: 'right',
}}
>
Rate
</th>
)
: Rate && (
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt
<th
style={{
...tableHeaderStyle,
width: '10px',
textAlign: 'right',
}}
>
Rate
</th>
)}
{GlobaldummyData
? GlobalAmount && (
<th style={{ ...tableHeaderStyle, width: '30px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '30px',
textAlign: 'right',
}}
>
Amt
</th>
)
: Amount && (
<th style={{ ...tableHeaderStyle, width: '30px', textAlign: 'right' }}>
<th
style={{
...tableHeaderStyle,
width: '30px',
textAlign: 'right',
}}
>
Amt
</th>
)}
@ -3493,18 +3640,20 @@ const Printstyle4 = ({
{(GlobaldummyData ? products : TakeawayData)?.map(
(item, index) => {
return (
<tr key={index}
<tr
key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
index % 2 !== 1 && rowtypeStyle === 'even'
? {
...tableBodyStyle
...tableBodyStyle,
}
: index % 2 === 1 && rowtypeStyle === "odd"
: index % 2 === 1 && rowtypeStyle === 'odd'
? {
...tableBodyStyle
...tableBodyStyle,
}
: {}
}>
}
>
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
: SLNO && <td>{index + 1}</td>}
@ -3540,20 +3689,9 @@ const Printstyle4 = ({
))}
{/* Description from first identifier */}
{item?.ProductIdentifierDtls?.find(
(d) =>
d.SerialNumber || d.IMEI1 || d.IMEI2
)?.Description && (
<div>
{
item.ProductIdentifierDtls.find(
(d) =>
d.SerialNumber ||
d.IMEI1 ||
d.IMEI2
).Description
}
</div>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</td>
)}
@ -3599,22 +3737,9 @@ const Printstyle4 = ({
))}
{/* Description from first identifier */}
{item?.ProductIdentifierDtls?.find(
(d) =>
d.SerialNumber ||
d.IMEI1 ||
d.IMEI2
)?.Description && (
<div>
{
item.ProductIdentifierDtls.find(
(d) =>
d.SerialNumber ||
d.IMEI1 ||
d.IMEI2
).Description
}
</div>
{(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)}
</div>
) : (
@ -3677,7 +3802,6 @@ const Printstyle4 = ({
fontSize: '10px',
}}
>
{/* <span style={{ color: '#e30c0c' }}> */}
<span
style={{
color: '#000',
@ -3721,8 +3845,10 @@ const Printstyle4 = ({
: Discount && (
<td style={{ textAlign: 'right' }}>
{item?.Type !== 'C'
? (item?.OfferAmt || item?.DiscountAmt || 0)
: (item?.OfferValue || item?.DiscountAmt || 0)}
? item?.OfferAmt || item?.DiscountAmt || 0
: item?.OfferValue ||
item?.DiscountAmt ||
0}
</td>
)}
@ -3748,7 +3874,8 @@ const Printstyle4 = ({
{' '}
{item?.Type !== 'C'
? item?.TotalAmt - (item?.OfferAmt || 0)
: item?.TotalAmt - (item?.OfferValue || 0)}
: item?.TotalAmt -
(item?.OfferValue || 0)}
</td>
)}
</tr>
@ -3877,18 +4004,20 @@ const Printstyle4 = ({
{(GlobaldummyData ? products : DineInData)?.map(
(item, index) => {
return (
<tr key={index}
<tr
key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
index % 2 !== 1 && rowtypeStyle === 'even'
? {
...tableBodyStyle
...tableBodyStyle,
}
: index % 2 === 1 && rowtypeStyle === "odd"
: index % 2 === 1 && rowtypeStyle === 'odd'
? {
...tableBodyStyle
...tableBodyStyle,
}
: {}
}>
}
>
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
: SLNO && <td>{index + 1}</td>}
@ -3924,22 +4053,10 @@ const Printstyle4 = ({
})
.join('')
: '') +
(item?.ProductIdentifierDtls?.length >
0 &&
item?.ProductIdentifierDtls.find(
(item1) =>
item1.IMEI1 ||
item1.IMEI2 ||
item1.SerialNumber
)?.Description
? ` ${item.ProductIdentifierDtls.find(
(item1) =>
item1.IMEI1 ||
item1.IMEI2 ||
item1.SerialNumber
).Description
}`
: '')
(item?.ProductIdentifierDtls?.length > 0 && item.ProductIdentifierDtls?.[0]?.Description)&&
(
<div>{item.ProductIdentifierDtls?.[0]?.Description}</div>
)
).trim()}
</td>
)}
@ -4007,8 +4124,10 @@ const Printstyle4 = ({
: Discount && (
<td style={{ textAlign: 'right' }}>
{item?.Type !== 'C'
? (item?.OfferAmt || item?.DiscountAmt || 0)
: (item?.OfferValue || item?.DiscountAmt || 0)}
? item?.OfferAmt || item?.DiscountAmt || 0
: item?.OfferValue ||
item?.DiscountAmt ||
0}
</td>
)}
{GlobaldummyData
@ -4045,7 +4164,8 @@ const Printstyle4 = ({
{' '}
{item?.Type !== 'C'
? item?.TotalAmt - (item?.OfferAmt || 0)
: item?.TotalAmt - (item?.OfferValue || 0)}
: item?.TotalAmt -
(item?.OfferValue || 0)}
</td>
)}
</tr>
@ -4080,7 +4200,7 @@ const Printstyle4 = ({
borderBottom: '1px dashed #000',
borderTop: '1px dashed #000',
padding: '5px 0',
...netAmountStyle
...netAmountStyle,
}}
>
<div>Sub Total</div>
@ -4197,7 +4317,6 @@ const Printstyle4 = ({
fontWeight: '600',
borderTop: '1px dashed #000',
borderBottom: '1px dashed #000',
// color: '#e30c0c',
color: '#000',
marginTop: '10px',
padding: '4px 0',
@ -4205,7 +4324,7 @@ const Printstyle4 = ({
>
<div>Total Amount</div>
<div>
<span style={{ fontFamily: 'Inter' }}>
<span style={{ fontFamily: 'Poppins' }}>
</span>
{Number(table2Data?.NetAmount).toFixed(2)}
@ -4771,7 +4890,7 @@ const Printstyle4 = ({
pageBreakBefore: 'avoid',
pageBreakInside: 'avoid',
minHeight: 'auto',
...footerColorStyle
...footerColorStyle,
}}
>
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (

View File

@ -523,11 +523,10 @@ const PrintStyle5 = ({
<div style={{ textTransform: 'uppercase' }}>
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -825,8 +824,8 @@ const PrintStyle5 = ({
})}
{/* 📝 Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
{/* 🔢 Quantity */}
@ -876,8 +875,8 @@ const PrintStyle5 = ({
})}
{/* 📝 Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
{/* 🔢 Quantity */}
@ -2870,11 +2869,10 @@ const PrintStyle5 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -3161,12 +3159,10 @@ const PrintStyle5 = ({
})}
{/* 📝 Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
{/* 🧪 Debug / Extra Text */}
<div>ssd3</div>
{/* 🔢 Quantity */}
<div>
@ -3216,12 +3212,10 @@ const PrintStyle5 = ({
})}
{/* 📝 Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
{/* 🧪 Debug / Extra Text */}
<div>ssd4</div>
{/* 🔢 Quantity */}
<div>

View File

@ -916,9 +916,9 @@ const Printstyle6 = ({
))}
{/* 📝 Description from first identifier */}
{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
@ -1304,9 +1304,9 @@ const Printstyle6 = ({
</div>
))}
{/* 📝 Description from first identifier */}
{(item?.ProductIdentifierDtls ?? []).find(d => d.IMEI1 || d.IMEI2 || d.SerialNumber)?.Description && (
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{(item?.ProductIdentifierDtls ?? []).find(d => d.IMEI1 || d.IMEI2 || d.SerialNumber).Description}
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
@ -3488,11 +3488,10 @@ const Printstyle6 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -4050,10 +4049,8 @@ const Printstyle6 = ({
))}
{/* 📝 Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}
</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
{/* 🔢 Quantity */}

View File

@ -562,11 +562,10 @@ const PrintStyle7 = ({
>
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -806,11 +805,9 @@ const PrintStyle7 = ({
</div>
))}
{(item?.ProductIdentifierDtls ?? [])
.find(items => items.SerialNumber || items.IMEI1 || items.IMEI2)?.Description && (
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{(item?.ProductIdentifierDtls ?? [])
.find(items => items.SerialNumber || items.IMEI1 || items.IMEI2).Description}
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
</div>
@ -1072,9 +1069,9 @@ const PrintStyle7 = ({
})}
{/* 📝 Description from first identifier */}
{(item?.ProductIdentifierDtls ?? []).find(data => data.SerialNumber || data.IMEI1 || data.IMEI2)?.Description && (
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{(item?.ProductIdentifierDtls ?? []).find(data => data.SerialNumber || data.IMEI1 || data.IMEI2).Description}
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
</div>
@ -3069,11 +3066,10 @@ const PrintStyle7 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -3288,13 +3284,9 @@ const PrintStyle7 = ({
</div>
))}
{(item?.ProductIdentifierDtls ?? []).find(
items => items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && (
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{(item?.ProductIdentifierDtls ?? []).find(
items => items.SerialNumber || items.IMEI1 || items.IMEI2
).Description}
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
</div>
@ -3530,9 +3522,9 @@ const PrintStyle7 = ({
</div>
))}
{(item?.ProductIdentifierDtls ?? []).find(items => items.SerialNumber || items.IMEI1 || items.IMEI2)?.Description && (
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{(item?.ProductIdentifierDtls ?? []).find(items => items.SerialNumber || items.IMEI1 || items.IMEI2).Description}
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
</div>

View File

@ -576,11 +576,10 @@ const Printstyle8 = ({
>
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -910,8 +909,10 @@ const Printstyle8 = ({
})
: ''}
</div>
{item?.ProductIdentifierDtls?.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{item.ProductIdentifierDtls.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
</td>
)}
@ -1277,8 +1278,10 @@ const Printstyle8 = ({
</div>
))}
</div>
{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
</td>
)}
@ -3444,11 +3447,10 @@ const Printstyle8 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -3926,8 +3928,10 @@ const Printstyle8 = ({
)}
</div>
))}
{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{item?.ProductIdentifierDtls?.[0]?.Description && (
<div>
{item?.ProductIdentifierDtls?.[0]?.Description}
</div>
)}
</div>
</td>

View File

@ -581,11 +581,10 @@ const PrintStyle9 = ({
>
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -830,8 +829,8 @@ const PrintStyle9 = ({
)}
</div>
))}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
</div>
</div>
@ -863,8 +862,8 @@ const PrintStyle9 = ({
)}
</div>
))}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
</div>
);
@ -3316,11 +3315,10 @@ const PrintStyle9 = ({
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
: BillName ||
(PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
: ' Bill')}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
</div>
@ -3540,8 +3538,8 @@ const PrintStyle9 = ({
</div>
))}
{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
<div>{(item?.ProductIdentifierDtls ?? []).find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}</div>
{identifiers?.[0]?.Description && (
<div>{identifiers?.[0]?.Description}</div>
)}
</div>
</td>