fix(v12): complete currency schedule and import diagnostics
This commit is contained in:
@@ -87,10 +87,12 @@ export function ProjectTeamPlanner({
|
||||
value,
|
||||
onChange,
|
||||
financialPlanSnapshot = '',
|
||||
projectCurrency = '',
|
||||
}: {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
financialPlanSnapshot?: string;
|
||||
projectCurrency?: string;
|
||||
}) {
|
||||
const rows = readRows<TeamNeed>(value, teamKeys);
|
||||
const persist = (next: TeamNeed[]) => onChange(JSON.stringify(next));
|
||||
@@ -297,7 +299,10 @@ export function ProjectTeamPlanner({
|
||||
<InvestmentReportTables
|
||||
tables={[
|
||||
buildComplementaryTables(
|
||||
{ project_team_snapshot: value },
|
||||
{
|
||||
project_team_snapshot: value,
|
||||
currency: projectCurrency,
|
||||
},
|
||||
restoreBusinessPlanSnapshot(financialPlanSnapshot),
|
||||
)[2],
|
||||
]}
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
businessPlanNumberError,
|
||||
exportBusinessPlanCsv,
|
||||
forecastBusinessPlan,
|
||||
financialPlanImportMessage,
|
||||
MAX_BUSINESS_PLAN_SNAPSHOT_LENGTH,
|
||||
restoreBusinessPlanSnapshot,
|
||||
serializeBusinessPlanSnapshot,
|
||||
@@ -196,10 +197,7 @@ export function SimulationBusinessPlan({
|
||||
try {
|
||||
const source = await file.text();
|
||||
const imported = restoreBusinessPlanSnapshot(source);
|
||||
if (!imported)
|
||||
throw new Error(
|
||||
'O ficheiro não contém um plano JSON reconhecido pelo InvestMoz.',
|
||||
);
|
||||
if (!imported) throw new Error(financialPlanImportMessage(source));
|
||||
savePlan(imported);
|
||||
setSnapshotError('');
|
||||
} catch (cause) {
|
||||
|
||||
@@ -3473,6 +3473,7 @@ export function SimulationForm() {
|
||||
{current.id === 'team' && (
|
||||
<>
|
||||
<ProjectTeamPlanner
|
||||
projectCurrency={String(draft.currency ?? '')}
|
||||
financialPlanSnapshot={String(
|
||||
draft.business_plan_snapshot ?? '',
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user