From 3bff7ca53e95f0b84641744cdcfc7c8d5f0aa458 Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 2 Feb 2021 15:38:43 +0300 Subject: [PATCH] firstPaymentPerc single reaction --- .../Effects/reactions/tablesReactions.ts | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts index c2a31a8..23864cc 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts @@ -430,6 +430,23 @@ export default [ }, }), + calculationStore => ({ + expression: () => { + const { firstPaymentPerc } = calculationStore.values; + return firstPaymentPerc; + }, + effect: firstPaymentPerc => { + calculationStore.setTableRow( + 'tablePayments', + 0, + )({ + paymentRelation: { + value: firstPaymentPerc, + }, + }); + }, + }), + (calculationStore, calculationProcess) => ({ expression: () => { const { @@ -438,7 +455,6 @@ export default [ parmentsDecreasePercent, seasonType, highSeasonStart: highSeasonStartId, - firstPaymentPerc, lastPaymentPerc, } = calculationStore.values; @@ -452,7 +468,6 @@ export default [ parmentsDecreasePercent, seasonType, highSeasonStart: parseInt(highSeasonStart?.name || '2'), - firstPaymentPerc, lastPaymentPerc, }; }, @@ -460,13 +475,14 @@ export default [ if (calculationProcess.process === Process.LoadKp) { return; } + + const { firstPaymentPerc } = calculationStore.values; const { leasingPeriod, graphType, parmentsDecreasePercent, seasonType, highSeasonStart, - firstPaymentPerc, lastPaymentPerc, } = nextParams;