Merge pull request 'payment-option-issue' (#38) from payment-option-issue into main
Reviewed-on: Pozomind/pozo-retail-app#38
This commit is contained in:
commit
a7aefab589
|
|
@ -4553,6 +4553,7 @@ const BSC1Payment = (props) => {
|
|||
open={GlobalSalesPaymentoptions}
|
||||
width={500}
|
||||
height={1000}
|
||||
destroyOnClose={true}
|
||||
handleCancel={() => {
|
||||
dispatch(changeSalesPaymentoption(false));
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1297,35 +1297,35 @@ function PaymentOptions() {
|
|||
const myDataStructure = transformData(checkedOptions);
|
||||
let consolidatedData = await processFlowData(myDataStructure);
|
||||
|
||||
if (payAtCounterSalesDefaultMode) {
|
||||
consolidatedData = consolidatedData.map((flow) => {
|
||||
if (flow.FlowName !== 'sales') return flow;
|
||||
|
||||
return {
|
||||
...flow,
|
||||
OptionDetails: flow.OptionDetails.map((option) => {
|
||||
if (option.OptionName !== 'Pay at the counter') return option;
|
||||
|
||||
const modeDetailsWithDefault =
|
||||
option.ModeDetails?.map((mode) => {
|
||||
const isSelected =
|
||||
mode.ModeName?.toLowerCase() ===
|
||||
payAtCounterSalesDefaultMode.toLowerCase();
|
||||
|
||||
return {
|
||||
...mode,
|
||||
ModeDefault: isSelected ? 'Y' : 'N',
|
||||
};
|
||||
}) || [];
|
||||
if (payAtCounterSalesDefaultMode) {
|
||||
consolidatedData = consolidatedData.map((flow) => {
|
||||
if (flow.FlowName !== 'sales') return flow;
|
||||
|
||||
return {
|
||||
...option,
|
||||
ModeDetails: modeDetailsWithDefault,
|
||||
...flow,
|
||||
OptionDetails: flow.OptionDetails.map((option) => {
|
||||
if (option.OptionName !== 'Pay at the counter') return option;
|
||||
|
||||
const modeDetailsWithDefault =
|
||||
option.ModeDetails?.map((mode) => {
|
||||
const isSelected =
|
||||
mode.ModeName?.toLowerCase() ===
|
||||
payAtCounterSalesDefaultMode.toLowerCase();
|
||||
|
||||
return {
|
||||
...mode,
|
||||
ModeDefault: isSelected ? 'Y' : 'N',
|
||||
};
|
||||
}) || [];
|
||||
|
||||
return {
|
||||
...option,
|
||||
ModeDetails: modeDetailsWithDefault,
|
||||
};
|
||||
}),
|
||||
};
|
||||
}),
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const postData = {};
|
||||
postData['AppId'] = AppId;
|
||||
|
|
@ -1365,6 +1365,7 @@ function PaymentOptions() {
|
|||
UserId,
|
||||
});
|
||||
} catch (err) {
|
||||
dispatch(changeCommonPaymentOptions([]));
|
||||
console.error('Failed to refresh payment options', err);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1450,7 +1451,7 @@ function PaymentOptions() {
|
|||
border: '1px solid #d4d4d4',
|
||||
fontFamily: 'Poppins',
|
||||
fontSize: '13px',
|
||||
width:'150px'
|
||||
width: '150px'
|
||||
}}
|
||||
>
|
||||
{getPayAtCounterSalesDropdownOptions().map((opt) => (
|
||||
|
|
|
|||
Loading…
Reference in New Issue