Merge pull request 'svtech requirement' (#289) from svtechissue into main

Reviewed-on: Pozomind/pozo-retail-app#289
This commit is contained in:
karthikalakshmi 2026-03-19 19:11:28 +05:30
commit f74b7cf3c9
2 changed files with 34 additions and 24 deletions

View File

@ -561,7 +561,7 @@ const SelectionComponent = forwardRef((props, ref) => {
PrintType: item.PrintType,
PrintHdrName: item.PrintHdrName,
PrintDocLabel: item.PrintDocLabel,
PrintTotalLabel:item.PrintTotalLabel,
PrintTotalLabel: item.PrintTotalLabel,
// legacy fields are filled from the array so older code still works
PrintHdrColor:
item.PrintHdrColor ||
@ -726,7 +726,7 @@ const SelectionComponent = forwardRef((props, ref) => {
dispatch(changeBillName(PrintHdrName));
dispatch(changeBillNolabel(PrintDocLabel));
dispatch(changetotallabel(PrintTotalLabel));
// derive color objects; prefer the legacy fields but fall back to the PrintColors array
const hdr = getColor(PrintColors, 'headerColor');
const tblHdr = getColor(PrintColors, 'tableHeaderColor');
@ -1059,7 +1059,7 @@ const SelectionComponent = forwardRef((props, ref) => {
PageSize: PageSize,
PrintHdrName: BillName,
PrintDocLabel: BillNolabel,
PrintTotalLabel:totalLabel,
PrintTotalLabel: totalLabel,
PrintType: PrintType ? 'S' : 'C',
PrintTypeId: segmentValue,
// Header color (background) and font
@ -1140,7 +1140,7 @@ const SelectionComponent = forwardRef((props, ref) => {
};
const onfinish = async (values) => {
if (!templateEdit && sizeOptionData?.length == 0) {
setMessageType('error');
setMessageData('Please Setup the Screen');
@ -1207,7 +1207,7 @@ const SelectionComponent = forwardRef((props, ref) => {
...(item?.PrintHdrName ? { PrintHdrName: item.PrintHdrName } : {}),
...(item?.PrintDocLabel ? { PrintDocLabel: item.PrintDocLabel } : {}),
...(item?.PrintTotalLabel ? { PrintTotalLabel: item.PrintTotalLabel } : {}),
...(item?.Signature ? { Signature: item?.Signature } : {}),
PrintType: item?.PrintType,
})
@ -1661,6 +1661,7 @@ const SelectionComponent = forwardRef((props, ref) => {
''
)}
</div>
<Checkbox.Group
style={{
width: '100%',
@ -1670,7 +1671,15 @@ const SelectionComponent = forwardRef((props, ref) => {
>
<Row>
{sizeCheckList
?.filter((item) => item.ConfigName)
?.filter((item) => {
if (item.ConfigName?.toLowerCase?.() === 'rate with tax') {
const rateConfigId = sizeCheckList?.find(
(opt) => opt.ConfigName?.toLowerCase?.() === 'rate'
)?.ConfigId;
return selectedSizeCheckedValues?.includes(rateConfigId);
}
return Boolean(item.ConfigName);
})
?.map((value, key) => (
<Checkbox
style={{ padding: '12px' }}
@ -1700,22 +1709,22 @@ const SelectionComponent = forwardRef((props, ref) => {
}}
/>
</div>
)}
<div style={{ marginTop: '1rem' }}>
<Title level={5} style={{ marginBottom: 12 }}>
BillName
</Title>
<InputField
isOnChange={BillName}
label={<label>Bill Name</label>}
value={BillName}
onChange={(e) => {
setBillName(e.target.value);
dispatch(changeBillName(e.target.value));
}}
/>
</div>
)}
<div style={{ marginTop: '1rem' }}>
<Title level={5} style={{ marginBottom: 12 }}>
BillName
</Title>
<InputField
isOnChange={BillName}
label={<label>Bill Name</label>}
value={BillName}
onChange={(e) => {
setBillName(e.target.value);
dispatch(changeBillName(e.target.value));
}}
/>
</div>
{isbillnoLabel &&
<div style={{ marginTop: '1rem' }}>
<Title level={5} style={{ marginBottom: 12 }}>

View File

@ -72,8 +72,9 @@ const TaxInvoice = ({
const footerColor = printColors?.find(obj => obj.footerColor)?.footerColor;
const netAmtColor = printColors?.find(obj => obj.netAmtColor)?.netAmtColor;
const FieldDetails = useSelector(GloabalFieldDetails);
console.log(FieldDetails,"FieldDetails")
console.log(FieldDetails, "FieldDetails")
const Discount = FieldDetails?.['Discount'];
const rate_with_tax = FieldDetails?.['Rate with Tax'];
console.log(Discount, "Discount")
// Function to convert number to words
const numberToWords = (num) => {
@ -984,7 +985,7 @@ const TaxInvoice = ({
>
{Number(
table2Data?.OrderType !== 'E'
? item.Rate - (item?.SinglePc === 'Y' ? (item?.TaxAmt / item?.SalesQty) : item.ProdTaxAmt)
? rate_with_tax ? item.Rate : item.Rate - (item?.SinglePc === 'Y' ? (item?.TaxAmt / item?.SalesQty) : item.ProdTaxAmt)
: item.Rate || 0
).toLocaleString('en-IN', {
minimumFractionDigits: 2,