[2] merge branch release/dyn-3974_full-price-nds

This commit is contained in:
obarykina 2024-02-08 09:46:56 +03:00
parent eb6f0ef949
commit 46c0b305b6
3 changed files with 18 additions and 5 deletions

View File

@ -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'] }],

View File

@ -10,4 +10,5 @@ export const rows: FormTabRows = [
[['tbxImporterRewardPerc', 'tbxImporterRewardRub']],
[['tbxBonusCoefficient', 'tbxComissionRub', 'tbxComissionPerc']],
[['cbxSupplierFinancing', 'cbxPartialVAT', 'cbxFloatingRate']],
[['cbxQuotePriceWithFullVAT']],
];

View File

@ -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);
}
}
);