Preserve documented turnover corrections in PEC viability estimates
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
import {
|
||||
newPecCorrection,
|
||||
type PecCorrection,
|
||||
} from '@/lib/irpc-pec-correction';
|
||||
export function SimulationIrpcPecCorrection({
|
||||
value,
|
||||
original,
|
||||
subjectNuit,
|
||||
onChange,
|
||||
}: {
|
||||
value?: PecCorrection;
|
||||
original: string;
|
||||
subjectNuit: string;
|
||||
onChange: (c: PecCorrection) => void;
|
||||
}) {
|
||||
if (!value)
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
onChange(newPecCorrection(original, subjectNuit))
|
||||
}
|
||||
>
|
||||
Rectificar volume na simulação PEC
|
||||
</button>
|
||||
);
|
||||
const patch = (c: Partial<PecCorrection>) => onChange({ ...value, ...c }),
|
||||
field = (
|
||||
key: Exclude<keyof PecCorrection, 'version' | 'apply'>,
|
||||
label: string,
|
||||
) => (
|
||||
<label className="block">
|
||||
{label}
|
||||
<input
|
||||
aria-label={label}
|
||||
value={value[key]}
|
||||
onChange={(e) => patch({ [key]: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
);
|
||||
return (
|
||||
<section
|
||||
aria-label="Rectificação da estimativa PEC"
|
||||
className="rounded border p-3"
|
||||
>
|
||||
<h6>Volume de negócios corrigido</h6>
|
||||
<p>
|
||||
O volume original permanece {original || 'por indicar'} MZN. A
|
||||
nova fonte fundamenta a correcção da simulação2026; não submete
|
||||
declaração fiscal.
|
||||
</p>
|
||||
<label className="block">
|
||||
Aplicar rectificação PEC
|
||||
<select
|
||||
aria-label="Aplicar rectificação PEC"
|
||||
value={value.apply}
|
||||
onChange={(e) =>
|
||||
patch({
|
||||
apply: e.target.value as PecCorrection['apply'],
|
||||
})
|
||||
}
|
||||
>
|
||||
<option value="">Por decidir</option>
|
||||
<option value="yes">
|
||||
Usar volume corrigido na estimativa
|
||||
</option>
|
||||
<option value="no">Conservar volume original</option>
|
||||
</select>
|
||||
</label>
|
||||
<details open={value.apply !== 'no'}>
|
||||
<summary>Alterar rectificação PEC</summary>
|
||||
{field('originalTurnover', 'Volume original analisado — PEC')}
|
||||
{field('revisedTurnover', 'Volume corrigido — PEC')}
|
||||
{field('subjectNuit', 'NUIT da rectificação PEC')}
|
||||
{field('turnoverYear', 'Ano do volume corrigido — PEC')}
|
||||
{field('reference', 'Fonte e fundamento da rectificação PEC')}
|
||||
</details>
|
||||
<p>
|
||||
Trocar a opção conserva os dois valores. Uma alteração da base
|
||||
original exige nova conferência; recalcule o fecho e a hipótese
|
||||
de tesouraria para reflectir a estimativa corrigida.
|
||||
</p>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import {SimulationIrpcPecCorrection} from './simulation-irpc-pec-correction';
|
||||
import {SimulationIrpcPecPlan} from './simulation-irpc-pec-plan';
|
||||
import {
|
||||
newPecObligation,
|
||||
calculatePecObligation,
|
||||
pecObligationSource,
|
||||
type PecObligation,
|
||||
} from '@/lib/irpc-pec-obligation';
|
||||
import { fractionPresentation } from '@/lib/fiscal-rational';
|
||||
@@ -42,7 +42,7 @@ export function SimulationIrpcPecObligation({
|
||||
patch = (changes: Partial<PecObligation>) =>
|
||||
onChange({ ...p, ...changes });
|
||||
const field = (
|
||||
key: Exclude<keyof PecObligation, 'version' | 'scope' | 'plan'>,
|
||||
key: Exclude<keyof PecObligation, 'version' | 'scope' | 'plan' | 'correction'>,
|
||||
label: string,
|
||||
) => (
|
||||
<label className="block">
|
||||
@@ -104,6 +104,7 @@ export function SimulationIrpcPecObligation({
|
||||
'turnoverReference',
|
||||
'Fonte do volume de negócios — PEC',
|
||||
)}
|
||||
<SimulationIrpcPecCorrection value={p.correction} original={p.previousTurnover} subjectNuit={p.subjectNuit} onChange={correction=>patch({correction})}/>
|
||||
{field(
|
||||
'previousPpcPaid',
|
||||
'PPC efectivamente pagos no ano anterior — MZN',
|
||||
@@ -143,7 +144,7 @@ export function SimulationIrpcPecObligation({
|
||||
</p>
|
||||
<details>
|
||||
<summary>Fonte e limites PEC</summary>
|
||||
<p>{pecObligationSource}</p>
|
||||
<p>{m.source}</p>
|
||||
</details>
|
||||
</section>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user