From cbb0e70edf4dbe763f56c434c831d67d3ef68901 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 13 Apr 2023 20:47:10 +0300 Subject: [PATCH] fix tbxBonusCoefficient value --- apps/web/process/bonuses/reactions/common.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/process/bonuses/reactions/common.ts b/apps/web/process/bonuses/reactions/common.ts index 0d0da52..ba9aacd 100644 --- a/apps/web/process/bonuses/reactions/common.ts +++ b/apps/web/process/bonuses/reactions/common.ts @@ -5,6 +5,7 @@ import { disposableReaction } from '@/utils/mobx'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import { reaction } from 'mobx'; +import { round } from 'tools'; dayjs.extend(utc); @@ -83,7 +84,9 @@ export default function reactions(context: ProcessContext) { const coefficient = await getCoefficient(productId); const maxBonus = (coefficient?.evo_sot_coefficient || 0) * 100; - $calculation.element('tbxBonusCoefficient').setValue(maxBonus ? saleBonus / maxBonus : 0); + $calculation + .element('tbxBonusCoefficient') + .setValue(maxBonus ? round(saleBonus / maxBonus, 4) : 0); } else { $calculation.element('tbxBonusCoefficient').resetValue(); }