Integrate monthly IVA with projected sales in QA

This commit is contained in:
2026-10-21 14:05:46 +02:00
parent 0d7b70459d
commit 3f5430c3ce
18 changed files with 690 additions and 12 deletions
+6 -2
View File
@@ -1,4 +1,5 @@
import { SimulationPublishedIva, type PublishedIvaInput } from './simulation-published-iva';
import { SimulationMonthlyIva } from './simulation-monthly-iva';
import {
PublicDocumentContent,
type PublicDocument,
@@ -2311,12 +2312,14 @@ export function SimulationForm() {
);
}
if (!publishedInput) sessionStorage.removeItem(idempotencyStorageKey);
return simulation ?? null;
} catch (cause) {
setServerError(
cause instanceof Error
? cause.message
: 'Erro de ligação. Tente novamente.',
);
return null;
} finally {
calculationInFlightRef.current = false;
setIsCalculating(false);
@@ -3463,15 +3466,16 @@ export function SimulationForm() {
{(current.id === 'financial' ||
(draft.purpose === 'simulate_only' &&
current.id === 'tax')) && (
<SimulationCashflowPlanner
<details className="rounded border p-3"><summary>Cenário personalizado de tesouraria — imposto manual, separado do IVA calculado</summary><SimulationCashflowPlanner
snapshot={String(draft.cashflow_snapshot ?? '')}
onSnapshotChange={(value) =>
change('cashflow_snapshot', value)
}
currency={String(draft.currency ?? '')}
onCurrencyChange={(value) => change('currency', value)}
/>
/></details>
)}
{(current.id === 'financial' || current.id === 'tax') && <SimulationMonthlyIva draft={draft} busy={isCalculating} onCalculate={runSimulation} onChange={change} />}
{current.id === 'financial' &&
(draft.detail_level === 'advanced' ||
draft.journey_type === 'small_business') &&