fix 100000004 payments validation

This commit is contained in:
Chika 2021-04-01 12:53:07 +03:00
parent bdacd7f71a
commit 2c6cb3942d

View File

@ -246,24 +246,26 @@ const validatePaymentsTable = () => {
)(
Array.from({ length: 3 }, () => ({
paymentRelation: {
validation: areEqual3MiddleRows ? false : true,
validation: !areEqual3MiddleRows,
},
})),
);
if (isValidRows) {
const areCorrect3MiddleRows = isEqual(
targetRows.map(x => x.paymentRelation?.value).sort((a, b) => a - b),
targetRows.map(x => x.paymentRelation?.value),
targetRows.slice(0).sort((a, b) => a - b),
targetRows,
);
CalculationStore.setTableRow(
CalculationStore.setTableRows(
'tablePayments',
1,
)({
paymentRelation: {
validation: areCorrect3MiddleRows ? true : false,
},
});
)(
Array.from({ length: 3 }, () => ({
paymentRelation: {
validation: areCorrect3MiddleRows,
},
})),
);
}
break;
}