process/price: fix NaN

This commit is contained in:
vchikalkin 2023-05-25 16:39:56 +03:00
parent ab5700dd92
commit 6a95fbb3f2

View File

@ -123,7 +123,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
(firstPaymentRub) => {
const { plPriceRub, addEquipmentPrice, importProgramSum } = $calculation.$values.getValues();
const perc = (firstPaymentRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
$calculation.element('tbxFirstPaymentPerc').setValue(perc);
$calculation.element('tbxFirstPaymentPerc').setValue(perc || 0);
}
);
@ -147,7 +147,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
(comissionRub) => {
const { plPriceRub, addEquipmentPrice, importProgramSum } = $calculation.$values.getValues();
const perc = (comissionRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
$calculation.element('tbxComissionPerc').setValue(perc);
$calculation.element('tbxComissionPerc').setValue(perc || 0);
}
);
@ -187,7 +187,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
}
const perc = (lastPaymentRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
$calculation.element('tbxLastPaymentPerc').setValue(perc);
$calculation.element('tbxLastPaymentPerc').setValue(perc || 0);
}
);
}