From e6d7b17376520dddbc60803a80073083f10849f0 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 5 Apr 2023 18:34:36 +0300 Subject: [PATCH] round priceWithVAT to 2 --- apps/web/process/price/reactions/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/process/price/reactions/common.ts b/apps/web/process/price/reactions/common.ts index 40511e7..1683a1f 100644 --- a/apps/web/process/price/reactions/common.ts +++ b/apps/web/process/price/reactions/common.ts @@ -2,7 +2,7 @@ import { VAT } from '@/constants/values'; import * as CRMTypes from '@/graphql/crm.types'; import type { ProcessContext } from '@/process/types'; import { reaction } from 'mobx'; -import { makeDisposable } from 'tools'; +import { makeDisposable, round } from 'tools'; export default function reactions({ store, apolloClient }: ProcessContext) { const { $calculation, $process } = store; @@ -95,7 +95,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) { .element('tbxLeaseObjectPriceWthtVAT') .setValue(leaseObjectPrice - VATInLeaseObjectPrice); } else { - const priceWithVAT = leaseObjectPrice / (1 + VAT); + const priceWithVAT = round(leaseObjectPrice / (1 + VAT), 2); const priceVAT = leaseObjectPrice - priceWithVAT; $calculation.element('tbxLeaseObjectPriceWthtVAT').setValue(priceWithVAT); $calculation.element('tbxVATInLeaseObjectPrice').setValue(priceVAT);