diff --git a/apps/web/process/payments/reactions.ts b/apps/web/process/payments/reactions.ts index da009ca..7d736f2 100644 --- a/apps/web/process/payments/reactions.ts +++ b/apps/web/process/payments/reactions.ts @@ -339,7 +339,7 @@ export default function paymentsReactions({ store }: ReactionsContext) { }, ]; - if (!$process.has('LoadKP')) { + if (!$process.has('LoadKP') && degressionType !== 100_000_007) { $tables.payments.setValues(rows.map((row) => row.value)); } @@ -348,48 +348,6 @@ export default function paymentsReactions({ store }: ReactionsContext) { } ); - makeDisposable( - () => - reaction( - () => { - const graphType = $calculation.element('radioGraphType').getValue(); - const payments = toJS($tables.payments.values); - const degressionType = $calculation.element('selectSeasonType').getValue(); - - return { - degressionType, - graphType, - payments, - }; - }, - (nextParams, prevParams) => { - if (nextParams.graphType === 100_000_001 && nextParams.degressionType === 100_000_007) { - const changes = difference(nextParams.payments, prevParams.payments); - - if (changes === null || changes.length > 1) return; - - const [changeIndex] = changes; - const value = nextParams.payments[changeIndex]; - const payments = nextParams.payments.slice(1, -1).map((payment, i) => { - if (i <= changeIndex - 2) return payment; - - return value; - }); - - const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue(); - const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue(); - - $tables.payments.setValues([firstPaymentPerc, ...payments, lastPaymentPerc]); - } - }, - { - delay: 50, - equals: comparer.structural, - } - ), - () => $process.has('LoadKP') - ); - /** * Сезонный */