diff --git a/apps/web/Components/Calculation/Form/CreateKP/config.ts b/apps/web/Components/Calculation/Form/CreateKP/config.ts index ec33030..66dc672 100644 --- a/apps/web/Components/Calculation/Form/CreateKP/config.ts +++ b/apps/web/Components/Calculation/Form/CreateKP/config.ts @@ -4,8 +4,7 @@ export const id = 'create-kp'; export const title = 'Создание КП'; export const rows: FormTabRows = [ - [['cbxPriceWithDiscount', 'cbxFullPriceWithDiscount', 'cbxQuotePriceWithFullVAT']], - [['cbxCostIncrease']], + [['cbxPriceWithDiscount', 'cbxFullPriceWithDiscount', 'cbxCostIncrease']], [['cbxInsurance', 'cbxRegistrationQuote', 'cbxTechnicalCardQuote']], [['cbxNSIB', 'cbxQuoteRedemptionGraph', 'cbxShowFinGAP']], [['tbxQuoteName', 'radioQuoteContactGender'], { gridTemplateColumns: ['1fr', '2fr 1fr'] }], diff --git a/apps/web/Components/Calculation/Form/Unlimited/config.ts b/apps/web/Components/Calculation/Form/Unlimited/config.ts index c7b0628..74a4353 100644 --- a/apps/web/Components/Calculation/Form/Unlimited/config.ts +++ b/apps/web/Components/Calculation/Form/Unlimited/config.ts @@ -10,4 +10,5 @@ export const rows: FormTabRows = [ [['tbxImporterRewardPerc', 'tbxImporterRewardRub']], [['tbxBonusCoefficient', 'tbxComissionRub', 'tbxComissionPerc']], [['cbxSupplierFinancing', 'cbxPartialVAT', 'cbxFloatingRate']], + [['cbxQuotePriceWithFullVAT']], ]; diff --git a/apps/web/process/create-kp/reactions.ts b/apps/web/process/create-kp/reactions.ts index f191f4b..6fbebf2 100644 --- a/apps/web/process/create-kp/reactions.ts +++ b/apps/web/process/create-kp/reactions.ts @@ -1,8 +1,9 @@ import type { ProcessContext } from '../types'; +import { disposableReaction } from '@/utils/mobx'; import { reaction } from 'mobx'; export function common({ store }: ProcessContext) { - const { $calculation } = store; + const { $calculation, $process } = store; reaction( () => $calculation.element('radioBalanceHolder').getValue(), @@ -37,9 +38,21 @@ export function common({ store }: ProcessContext) { () => $calculation.element('cbxPartialVAT').getValue(), (partialVAT) => { if (partialVAT === true) { - $calculation.element('cbxQuotePriceWithFullVAT').setValue(true).unblock(); + $calculation.element('cbxQuotePriceWithFullVAT').unblock(); } else { - $calculation.element('cbxQuotePriceWithFullVAT').setValue(false).block(); + $calculation.element('cbxQuotePriceWithFullVAT').block(); + } + } + ); + + disposableReaction( + () => $process.has('LoadKP'), + () => $calculation.element('cbxPartialVAT').getValue(), + (partialVAT) => { + if (partialVAT === true) { + $calculation.element('cbxQuotePriceWithFullVAT').setValue(true); + } else { + $calculation.element('cbxQuotePriceWithFullVAT').setValue(false); } } );