From 7ad5ed941f093af62e235dc1ebf13f5417db97bd Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Fri, 24 Mar 2023 15:05:07 +0300 Subject: [PATCH] mb fix bonusCoefficient --- src/client/Containers/Calculation/Elements/props/common.ts | 6 ++++++ src/client/process/bonuses/reactions.ts | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/client/Containers/Calculation/Elements/props/common.ts b/src/client/Containers/Calculation/Elements/props/common.ts index b60da25..ecfcdf2 100644 --- a/src/client/Containers/Calculation/Elements/props/common.ts +++ b/src/client/Containers/Calculation/Elements/props/common.ts @@ -369,6 +369,12 @@ const elementsProps: Partial> = { labelImportProgramSum: { middleware: value => formatMoney(value), }, + tbxBonusCoefficient: { + min: '0.00', + max: '10.00', + step: '0.10', + precision: 4, + }, }; export const numberElementsProps: Partial> = diff --git a/src/client/process/bonuses/reactions.ts b/src/client/process/bonuses/reactions.ts index 55dcef5..a24b394 100644 --- a/src/client/process/bonuses/reactions.ts +++ b/src/client/process/bonuses/reactions.ts @@ -136,7 +136,10 @@ export default function ($calculation: ICalculationStore) { const max_sale_bonus = (evo_coefficient_bonus?.evo_sot_coefficient || 0) * 100; if (max_sale_bonus) { - $calculation.setValue('bonusCoefficient', saleBonus / max_sale_bonus); + $calculation.setValue( + 'bonusCoefficient', + round(saleBonus / max_sale_bonus, 4), + ); } else { $calculation.setValue('bonusCoefficient', 0); }