round priceWithVAT to 2
This commit is contained in:
parent
591abe97c5
commit
e6d7b17376
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user