feat(finance): project PGC-PE supplier advances by operation in QA
This commit is contained in:
@@ -10570,3 +10570,16 @@ A matriz conserva 88 linhas e as restantes 86 inalteradas, incluindo B01/B02/B04
|
||||
E14 e `docs/investmoz/v2/auditoria-portal/prova-oportunidades-p01-p02-p09-20261120.json` registam as provas sobre `ae1acb7c` e os dois DOCX Revis?o 1. A carteira passa a mostrar oportunidades p?blicas na pr?pria consulta, com filtros e associa??es documentadas; corredor n?o atribui implanta??o provincial. P02 validado no recorte Mocuba/Zambezia/Maputo Prov?ncia, sujeito ? aceita??o. P01 continua parcial por associa??es n?o demonstradas em todas as categorias; P09 parcial: invent?rio QA de `/negocios` com zero neg?cios existentes e zero publicados, sem caso documental para provar resultados individuais e sem cria??o de ofertas. C11 parcial: escolha documental Soja/Beira chegou ao rascunho da prepara??o de dossier sint?tico por login normal, sem presumir sector, localiza??o ou associa??o confirmada. N?o equivale a orienta??o territorial/financeira integral nem encerra requisitos.
|
||||
|
||||
Quatro testes HTTP novos aprovados individualmente, dois frontend, tipos, lint, PHPStan e build QA aprovados; computador e m?vel 390?844 conferidos. Fontes e registos documentais preservados, sem oportunidades artificiais; conta/dossier privados de ensaio apenas na QA existente. Restantes 84 linhas, aprova??es anteriores e F31-B documental preservados. Sem instala??o, publica??o, migra??es ou in?cio de outras frentes.
|
||||
|
||||
|
||||
## 21/11/2026 — F20-B PGC-PE implementado e demonstrado em QA, proposto para aceitação
|
||||
|
||||
Autorização expressa do proprietário: primeiro incremento PGC-PE, aplicação após reconhecimento e factura correspondente, contratos especiais excluídos; avanço apenas em QA, F22 suspenso. Não é uma escolha universal do regime de todos os investidores. F20-A permanece aprovado e encerrado (`1f44a63c`, aceitação `d1fcdcd9`).
|
||||
|
||||
Na etapa financeira, abrir **Adiantamentos por operação — PGC-PE**, seleccionar o regime e preencher operações/parcelas e fornecedor, datas independentes de reconhecimento/factura, valor reconhecido e movimentos previstos. Activar explicitamente as agendas pretendidas; pagamentos manuais/em dias dessas categorias ficam guardados inactivos. Distribuir todo o reconhecimento de mercadorias/serviços por operações sem duplicar montantes. As outras agendas, saldos iniciais e planos anteriores mantêm-se. Snapshot 21 guarda configuração e movimentos no mecanismo privado existente.
|
||||
|
||||
Pagamento antecipado reconhece activo no cenário; aplicação só com reconhecimento e factura da mesma operação/parcela, limitada ao activo/obrigação, sem caixa adicional; devolução reduz activo e aumenta caixa sem receita; pagamento do remanescente não pode repetir o valor já adiantado. Obrigação bruta, activo e líquido são apresentados separadamente. Não compensar operações distintas do mesmo fornecedor. Reconhecimento desconhecido/futuro conserva o adiantamento; não deslocar movimentos fora do horizonte para o último mês nem inferir abertura. Factura documental anterior ao início não presume uma dívida inicial.
|
||||
|
||||
Demonstrados os dois encadeamentos recepção/factura, utilização parcial/devolução, exclusões, gravação e recuperação exacta em computador e emulação móvel sem armazenamento local. A prova encontrou e corrigiu a ligação de devoluções à ponte fiscal, com regressão: devolução não é outra cobrança/receita. Balanços reconciliados e CSV/JSON conferidos; tabelas partilhadas por relatório integral/Word/impressão, sem alegar nova prova autónoma de impressão nativa. 11 testes novos e 4 da ponte afectados aprovados; falha textual de unidades da ronda anterior reproduzida no código base, não atribuída a F20-B. Tipos/lint/build nos recibos.
|
||||
|
||||
Ver **E26** em `../v2/auditoria-portal/apresentacao-contexto-qa-20261115.md` e os recibos `e26-f20-b-20261121/`. F20-B **IMPLEMENTADO E DEMONSTRADO EM QA, PROPOSTO PARA ACEITAÇÃO**; F20 global parcial, F22 suspenso. Só a linha F20 muda entre as 88, com restantes 87 preservadas. Sem automatizar IVA, câmbio, perdas, penalizações, contratos especiais, novos activos ou empréstimos. Sem instalação, publicação, push ou migração.
|
||||
|
||||
@@ -1173,7 +1173,7 @@ Nomes de ficheiros na coluna de implementação referem-se a `resources/js/lib/`
|
||||
| F17 | PN P0052 | Relatório financeiro | Calcular automaticamente vendas dos anos seguintes a partir do crescimento esperado | INTEGRADO E VALIDADO | business-financial-plan.ts; financial-plan-details.tsx; simulation-business-plan.tsx | 9c34af04 | Opt-in explícito de crescimento composto das quantidades após cada 12 meses; agendas mensais explícitas prevalecem, preços/custos unitários mantêm-se. Nove regressões novas e integrações afectadas: 37 testes aprovados; E8. Sem activação automática nos planos anteriores. |
|
||||
| F18 | PN P0055 | Relatório financeiro | Separar capital do proprietário, do investidor e dinheiro adicional angariado no plano geral | INTEGRADO E VALIDADO | financial-plan-details.tsx; business-financial-plan.ts; integral-financial-report.ts | 9c34af04 | Proprietário, investidor e capital adicional discriminados; soma exacta ao centavo actualiza equity e divergências são recusadas no cálculo. Empréstimos/suprimentos/subvenções conservam tipos próprios. Capital adicional é contribuição de capital expressamente indicada, não receita ou dívida inferida. E8: UI real, roundtrip, HTTP e exportações. |
|
||||
| F19 | PN P0057 | Relatório financeiro | Recolher rendas, seguros, utilidades e marketing separadamente nas despesas correntes | INTEGRADO E VALIDADO | financial-plan-details.tsx; business-financial-plan.ts; integral-financial-report.ts | 9c34af04 | Rendas, seguros, utilidades, marketing e outras despesas discriminadas substituem o agregado reconhecido, sem dupla contagem ou alteração dos pagamentos. Juros e depreciação conservam campos próprios. Agregado/agenda anteriores preservados e ocultados enquanto as linhas são usadas. E8: totais mensais/anuais, cenários e saldos reconciliados. |
|
||||
| F20 | PN P0058; ME P0143/P0163 | Relatório financeiro | Prazos de recebimento/pagamento: cobrança e compras diferidas | PARCIALMENTE DEMONSTRADO | business-financial-plan.ts; financial-day-terms.ts; financial-day-terms.tsx; simulation-business-plan.tsx | E15/E23/E24/E25; implementação 1f44a63c; aceitação do proprietário em 21/11/2026; e25-f20-a-20261121/functional-receipt.json; e25-f20-a-20261121/verification.json | F20-A APROVADO E ENCERRADO EM QA pelo proprietário em 21/11/2026, no âmbito demonstrado pelo commit 1f44a63c e E25, sem adiantamentos. Adesão explícita por agenda; dias de calendário, datas individuais ou coortes no último dia identificadas como aproximação; caixa no vencimento; exclusão de antecipações/datas insuficientes; parcelas sem duplicação; horizonte 1–60 e vencimentos posteriores identificados. Snapshot 20 opcional; planos anteriores e agendas manuais conservados, outras receitas independentes preservadas. Provas reais de activação, gravação e recuperação exacta em computador/emulação móvel. 15 testes anteriores reutilizados, seis cenários antigos preservados e regressão adicional aprovada. F20 global mantém-se parcial: F20-B suspenso para validação contabilística; F22 separado; V11/V12 e restantes 87 linhas preservados. Sem instalação, publicação ou migrações. |
|
||||
| F20 | PN P0058; ME P0143/P0163 | Relatório financeiro | Prazos de recebimento/pagamento: cobrança e compras diferidas | PARCIALMENTE DEMONSTRADO | business-financial-plan.ts; financial-day-terms.ts; financial-day-terms.tsx; supplier-advances.ts; supplier-advances.tsx; financial-fiscal-bridge.ts; simulation-business-plan.tsx | E15/E23/E24/E25/E26; implementação 1f44a63c; aceitação do proprietário em 21/11/2026; e25-f20-a-20261121/functional-receipt.json; e25-f20-a-20261121/verification.json | F20-A APROVADO E ENCERRADO EM QA pelo proprietário em 21/11/2026, no âmbito demonstrado pelo commit 1f44a63c e E25, sem adiantamentos. Adesão explícita por agenda; dias de calendário, datas individuais ou coortes no último dia identificadas como aproximação; caixa no vencimento; exclusão de antecipações/datas insuficientes; parcelas sem duplicação; horizonte 1–60 e vencimentos posteriores identificados. Snapshot 20 opcional; planos anteriores e agendas manuais conservados, outras receitas independentes preservadas. Provas reais de activação, gravação e recuperação exacta em computador/emulação móvel. 15 testes anteriores reutilizados, seis cenários antigos preservados e regressão adicional aprovada. F20 global mantém-se parcial: F20-B autorizado pelo proprietário para PGC-PE, implementado e demonstrado em QA em E26, PROPOSTO PARA ACEITAÇÃO: pagamento, reconhecimento, factura, aplicação e devolução separados; sem compensação entre operações e sem segunda saída de caixa. F22 permanece suspenso; V11/V12 e restantes 87 linhas preservados. Sem instalação, publicação ou migrações. |
|
||||
| F21 | PN P0058 | Relatório financeiro | Dividendos como entrada própria e movimento derivado de caixa/capital | INTEGRADO E VALIDADO | financial-plan-details.tsx; business-financial-plan.ts; integral-financial-report.ts; project-dossier-report.ts | 9c34af04 | Dividendos mensais declarados reduzem caixa e capital, sem reduzir o lucro; não são execução de pagamentos ou autorização jurídica. Reconciliação em 13 meses e dois anos, validação de negativos/agendas incompletas, recuperação, CSV e Word/impressão. E8. |
|
||||
| F22 | PN P0058 | Relatório financeiro | Novos empréstimos e compras de activos ao longo dos períodos | PENDENTE COM CAUSA IDENTIFICADA | business-financial-plan.ts; integral-financial-report.ts | E15/E23; verificacao-f20-f22-v11-v12-20261120.json; referência 50b95936 | E23 confirma a ausência de novos desembolsos/aquisições por período no contrato/editor/relatório inspeccionados. Financiamento e activos iniciais preservados; reembolsos e mercadorias não substituem estes movimentos. Antes de implementar, fechar reconhecimento/pagamento dos activos, início/base/vida útil da depreciação e efeitos na dívida/juros/reembolso, sem inferir condições bancárias. Documentos Revisão 1 conferidos; sem alteração funcional ou novos testes. Pendente com causa identificada. |
|
||||
| F23 | PN P0043/P0117–0150 | Relatório financeiro | Resumo executivo com objectivos, missão e chaves para o sucesso | IMPLEMENTADO MAS NÃO VALIDADO | project-dossier-report.ts:223–245 | 93fc837a (consolidação) | Resumo existente usa project_summary, problema, proposta de valor e clientes. Não demonstra os três conteúdos expressamente pedidos; não confundir título Resumo executivo com cumprimento integral. |
|
||||
@@ -2247,3 +2247,42 @@ Recibos e imagens: [pasta E25](e25-f20-a-20261121/verification.json), com hashes
|
||||
Decisão expressa do proprietário: aceite F20-A em QA no commit `1f44a63c`. Registada a aceitação apenas na linha F20 e no manual existente, sem alterar os recibos, snapshots ou imagens E25. O estado «proposto para aceitação» nos recibos da entrega conserva a sua natureza histórica; a decisão posterior é a aqui registada. As restantes 87 linhas e todas as aprovações anteriores permanecem iguais. Não foram alterados código, cálculos, dados ou provas, nem executados testes.
|
||||
|
||||
**Próximo incremento pendente: F20-B — adiantamentos identificados por operação.** Depende da validação contabilística do reconhecimento do adiantamento no activo, da aplicação na recepção e de eventual devolução, sem compensação entre operações distintas e com compatibilidade dos planos guardados. Continua suspenso; esta identificação não autoriza análise adicional ou implementação. F22 permanece igualmente suspenso e separado, dependente das decisões de reconhecimento de novos activos, depreciação e movimentos de dívida por período. Sem instalação, publicação ou migrações.
|
||||
|
||||
## E26 — F20-B: adiantamentos por operação PGC-PE, prova em QA — 21/11/2026
|
||||
|
||||
### Decisão e limite da autorização
|
||||
|
||||
O proprietário confirmou expressamente: começar pelo **PGC-PE**, aplicar o adiantamento apenas após reconhecimento da operação e factura correspondente e excluir os contratos especiais da automatização inicial. Autorizou avançar com F20-B **em QA**, mantendo F22 suspenso. Não se adoptou um regime universal para todos os planos. F20-A permanece **APROVADO E ENCERRADO EM QA**, conforme `d1fcdcd9`, sem reabrir a aceitação nem repetir o seu percurso integral.
|
||||
|
||||
**F20-B: IMPLEMENTADO E DEMONSTRADO EM QA, PROPOSTO PARA ACEITAÇÃO. F20 global permanece PARCIALMENTE DEMONSTRADO.** Não houve instalação, publicação, push, migração ou alteração da base activa.
|
||||
|
||||
### Comportamento implementado
|
||||
|
||||
- Contrato opcional `supplierAdvances`, snapshot **21** apenas quando existe esse contrato; escolha explícita de PGC-PE e adesão por agenda de mercadorias/serviços. Activar substitui a caixa da categoria manual/em dias, guardada inactiva, sem somar os mesmos pagamentos. O modo de serviços abrange o total operacional e só se aplica se todas as despesas desse total forem serviços elegíveis. Saldos de abertura, pessoal, juros, impostos, activos e dívida mantêm os contratos anteriores.
|
||||
- Operação, parcela e fornecedor identificados; montante reconhecido e datas de reconhecimento/factura independentes. A distribuição por operações tem de coincidir exactamente com o reconhecimento económico mensal existente; não altera fórmulas, presume recepção pela factura ou converte desconhecido em zero. Factura documental anterior ao início é permitida sem inferir saldo de abertura; reconhecimentos e movimentos anteriores não são individualizados por inferência.
|
||||
- Movimentos previstos individualizados: pagamento antecipado, aplicação, devolução e pagamento do remanescente. Datas obrigatórias, montantes positivos e identificadores sem duplicação. Ordem por data, com ordem de apresentação nos movimentos do mesmo dia. Adiantamento antes do reconhecimento; aplicação/pagamento apenas após reconhecimento e factura. Aplicação limitada ao saldo da própria parcela e obrigação; devolução limitada ao remanescente activo. Pagamento não pode exceder o líquido por liquidar após considerar o adiantamento associado.
|
||||
- Aplicação não movimenta caixa. Devolução aumenta caixa e reduz adiantamento, sem receita, nova venda ou recebível. Na ponte fiscal, devolução tem origem própria, sem integrar receitas contabilísticas nem outras cobranças. A prova no editor identificou e permitiu corrigir essa integração, com regressão específica.
|
||||
- Balanço separa **obrigação bruta** e **adiantamento no activo**; líquido por liquidar é calculado por operação/parcela, não pela diferença de totais de operações diferentes, mesmo com o mesmo fornecedor. Sem recebimento/factura no horizonte, o saldo conserva-se identificado; movimentos futuros são conferidos e discriminados fora do horizonte, sem os deslocar para o último mês.
|
||||
- Relatório integral/Word/impressão usam as mesmas tabelas com rubricas de adiantamentos e obrigações e discriminação dos movimentos. CSV inclui operação, parcela, fornecedor, datas, saldos mensais e movimentos. A prova desta entrega confere as tabelas reais e CSV/JSON; não declara uma nova ronda independente de impressão nativa ou renderização Word.
|
||||
- IVA, diferenças cambiais, perdas, penalizações, contratos com transferência de controlo ou obrigação incondicional anterior e F22 excluídos. Projecção sem tratamento de IVA não significa taxa zero. Não executa pagamentos nem lançamentos contabilísticos reais.
|
||||
|
||||
### Evidência de aceitação em QA
|
||||
|
||||
Conta e rascunho sintéticos próprios de F20-B; preservado o rascunho F20-A. Router existente limita à base `main_reference_20261104_test:55441`; navegação/pedidos de página Playwright limitados à origem `http://127.0.0.3:18724`. Sem instalação de dependências ou atalhos de autenticação.
|
||||
|
||||
| Critério | Resultado demonstrado |
|
||||
| --- | --- |
|
||||
| Adesão | Confirmação recusada manteve a agenda anterior; adesão aceite para as duas categorias. PGC-PE explícito |
|
||||
| Recepção antes da factura | Adiantamento 30.000 em Janeiro; Fevereiro: obrigação bruta 100.000, activo 30.000 e líquido 70.000; aplicação em Março sem caixa; pagamento de 70.000 em Abril |
|
||||
| Factura antes da recepção | Factura Janeiro, adiantamento Fevereiro, reconhecimento/aplicação Março; sem mercadorias/gasto antecipados pela factura |
|
||||
| Aplicação parcial e devolução | Serviço reconhecido por 12.000, adiantamento 20.000: aplicação 12.000 e activo remanescente 8.000; devolução 8.000 sem receita |
|
||||
| Exclusões | Aplicação anterior a reconhecimento/factura e contrato especial recusados no editor; sobreaplicação, duplicações, devolução/pagamento excessivos e distribuições inconsistentes recusados nos testes |
|
||||
| Isolamento | Teste com duas operações do mesmo fornecedor conserva 20.000 de activo separado de 12.000 de outra dívida; não permite aplicação cruzada |
|
||||
| Continuidade | JSON do editor igual ao snapshot persistido; recuperação exacta em sessões novas sem armazenamento local, computador 1440×1000 e emulação móvel 390×844; sem erros de página |
|
||||
| Demonstrações | Balanços mensais e anual parcial reconciliados; aplicações sem caixa e devoluções sem receita; horizonte 1/60 e transição anual conferidos |
|
||||
|
||||
**Testes:** 11 novos de F20-B e 4 da ponte financeira/fiscal afectados passaram. A ronda dos contratos afectados anterior à correcção da ponte teve 58 aprovações e uma falha textual preexistente: `monthly unit schedules must match the horizon and contain valid quantities` espera `/Quantidade/`, mas a mensagem anterior é «Previsão de Vendas / Unidades…». A mesma falha foi reproduzida no código intacto de `d1fcdcd9` (35 de 36 aprovados). Não foi alterada a validação de unidades para fazer passar esse teste. Provas de F20-A e dos seis cenários anteriores mantidas; a regressão dirigida do invólucro F20-A passou quando esse código foi alterado, sem repetir o percurso funcional aceite. Tipos, lint e compilação final isolada conferidos nos logs da entrega.
|
||||
|
||||
[Recibo funcional](e26-f20-b-20261121/functional-receipt.json), [verificação e hashes](e26-f20-b-20261121/verification.json). Imagens, snapshots sintéticos e logs na mesma pasta. Scripts de reprodução em `outputs/f20-b-20261121/`; cookies/sessões não versionados. Limites: 120 operações, 60 movimentos por operação e 60 KB por snapshot; emulação móvel, não certificação de aparelho físico.
|
||||
|
||||
Apenas a linha F20 foi actualizada na matriz única; as restantes 87 linhas mantêm-se. O encerramento de F20-A não é revogado. A implementação em QA de F20-B aguarda aceitação do proprietário e não autoriza instalação. F22 mantém-se suspenso.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
@@ -0,0 +1,77 @@
|
||||
✔ financial forecast reconciles revenue, finance sources, working capital and monthly cash (5.220291ms)
|
||||
✔ opening payable installments reduce cash without changing profit and retain unpaid balances (1.814625ms)
|
||||
✔ opening payable schedule caps cent rounding at the remaining balance (0.299ms)
|
||||
✔ monthly unit schedules drive revenue, costs, inventory and scenario volume (1.867667ms)
|
||||
✖ monthly unit schedules must match the horizon and contain valid quantities (1.476583ms)
|
||||
✔ monthly prices and unit costs affect revenue, consumption and scenarios (2.155834ms)
|
||||
✔ monthly money schedules cover the horizon and reject invalid amounts (0.890042ms)
|
||||
✔ monthly operating and payroll expense schedules remain separate from payments (1.262791ms)
|
||||
✔ monthly operating schedules require full horizon, exact cents and current snapshot version (3.891709ms)
|
||||
✔ losses and negative closing cash remain visible instead of being clamped to zero (1.412292ms)
|
||||
✔ principal repayments affect cash but are excluded from profit expenses (0.878667ms)
|
||||
✔ depreciation allocation reconciles exactly over useful life (0.282208ms)
|
||||
✔ missing currency, products, invalid numbers and invalid horizons are explicit errors (0.865083ms)
|
||||
✔ versioned plan snapshots restore assumptions and reject unsupported or oversized data (2.243709ms)
|
||||
✔ business plan serializer refuses snapshots above the server storage limit (0.245083ms)
|
||||
✔ sales invoicing and receipts follow an optional declared collection lag (0.57725ms)
|
||||
✔ scheduled collection percentage keeps unpaid invoices in receivables with exact rounding (0.445292ms)
|
||||
✔ sales recovery applies only to overdue invoices and never exceeds open balances (0.727375ms)
|
||||
✔ opening receivables affect cash only when a month and collection percentage are declared (0.581292ms)
|
||||
✔ opening receivable installments reconcile to the initial balance across months (1.840542ms)
|
||||
✔ opening receivable installments cap independently rounded cents at the available balance (0.330417ms)
|
||||
✔ inventory purchases, consumption, closing stock and stock shortfall reconcile independently of payments (0.214916ms)
|
||||
✔ inventory lead time separates monthly orders, receipts, shortages and goods still in transit (0.359166ms)
|
||||
✔ monthly inventory purchase schedule reconciles variable orders, lead times, receipts and transit (1.693ms)
|
||||
✔ monthly variable purchase payments affect cash independently from inventory orders and profit (0.380625ms)
|
||||
✔ product inventory schedules reconcile independently and do not transfer stock between products (1.280958ms)
|
||||
✔ supplier payment terms drive purchase cash flow and expose amounts due beyond the horizon (0.974417ms)
|
||||
✔ supplier order installments reconcile exact cents, cash dates and unallocated balances (1.30975ms)
|
||||
✔ business assumptions survive the existing encrypted-draft snapshot split and restore (1.730917ms)
|
||||
✔ presentation currency conversion requires and reports its rate, date, and declared source (1.925417ms)
|
||||
✔ CSV marks presentation currency conversion as an unverified user planning assumption (1.85125ms)
|
||||
✔ business plan export carries its assumptions, formulas, period, currency, and matching result (1.427541ms)
|
||||
✔ business plan CSV preserves declared monthly product schedules (0.485958ms)
|
||||
✔ CSV export exposes the sales collection assumption and outstanding receivable (1.593958ms)
|
||||
✔ business plan CSV neutralizes formula-like labels and preserves negative financial values (1.207916ms)
|
||||
✔ financial scenarios expose user-declared changes without creating tax values (9.2825ms)
|
||||
ℹ tests 36
|
||||
ℹ suites 0
|
||||
ℹ pass 35
|
||||
ℹ fail 1
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 412.537708
|
||||
|
||||
✖ failing tests:
|
||||
|
||||
test at tests\frontend\.f20-b-baseline.test.mjs:289:6
|
||||
✖ monthly unit schedules must match the horizon and contain valid quantities (1.476583ms)
|
||||
AssertionError [ERR_ASSERTION]: The input did not match the regular expression /Quantidade/. Input:
|
||||
|
||||
'Error: Previsão de Vendas / Unidades do produto 1, mês 1: preencha uma quantidade não negativa com até três casas decimais; indique zero apenas quando aplicável.'
|
||||
|
||||
at TestContext.<anonymous> (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/tests/frontend/.f20-b-baseline.test.mjs:304:12)
|
||||
at Test.runInAsyncScope (node:async_hooks:227:14)
|
||||
at Test.run (node:internal/test_runner/test:1397:25)
|
||||
at Test.processPendingSubtests (node:internal/test_runner/test:969:18)
|
||||
at Test.postRun (node:internal/test_runner/test:1537:19)
|
||||
at Test.run (node:internal/test_runner/test:1462:12)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:969:7) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: Error: Previsão de Vendas / Unidades do produto 1, mês 1: preencha uma quantidade não negativa com até três casas decimais; indique zero apenas quando aplicável.
|
||||
at file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/.f20-b-baseline.ts:1842:31
|
||||
at Array.map (<anonymous>)
|
||||
at file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/.f20-b-baseline.ts:1838:32
|
||||
at Array.map (<anonymous>)
|
||||
at forecastBusinessPlanBase (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/.f20-b-baseline.ts:1772:42)
|
||||
at forecastBusinessPlan (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/.f20-b-baseline.ts:1472:16)
|
||||
at file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/tests/frontend/.f20-b-baseline.test.mjs:306:13
|
||||
at getActual (node:assert:611:5)
|
||||
at strict.throws (node:assert:759:24)
|
||||
at TestContext.<anonymous> (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/tests/frontend/.f20-b-baseline.test.mjs:304:12),
|
||||
expected: /Quantidade/,
|
||||
operator: 'throws',
|
||||
diff: 'simple'
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
[plugin laravel:fonts] Optimized font fallbacks require the optional "fontaine" package. Install it, or set "optimizedFallbacks: false" on your fonts to disable the feature.
|
||||
transforming...
|
||||
✓ 2899 modules transformed.
|
||||
rendering chunks...
|
||||
computing gzip size...
|
||||
public/build-qa-opportunities/assets/layers-BWBAp2CZ.png 0.69 kB
|
||||
public/build-qa-opportunities/assets/layers-2x-Bpkbi35X.png 1.25 kB
|
||||
public/build-qa-opportunities/assets/marker-icon-hN30_KVU.png 1.46 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-400-normal-BTkUljjl.woff2 13.12 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-700-normal-CrvTEWhy.woff2 13.46 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-500-normal-DCA2Z9Cj.woff2 13.49 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-600-normal-Dkgu5AE5.woff2 13.49 kB
|
||||
public/build-qa-opportunities/assets/noto-serif-400-normal-BV_iYGc9.woff2 14.40 kB
|
||||
public/build-qa-opportunities/assets/noto-serif-700-normal-CIw17UNa.woff2 15.23 kB
|
||||
public/build-qa-opportunities/assets/noto-serif-600-normal-BiuDA9L7.woff2 15.31 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-400-normal-DPpKfCgK.woff 16.68 kB
|
||||
public/build-qa-opportunities/assets/instrument-sans-400-normal-DRC__1Mx.woff2 16.86 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-700-normal-ZyrKABVF.woff 16.95 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-500-normal-CDPngY5C.woff 17.09 kB
|
||||
public/build-qa-opportunities/assets/noto-sans-600-normal-DVJMj_t0.woff 17.10 kB
|
||||
public/build-qa-opportunities/assets/instrument-sans-500-normal-Dk9ku72i.woff2 17.23 kB
|
||||
public/build-qa-opportunities/assets/instrument-sans-600-normal-B7fBEWYG.woff2 17.40 kB
|
||||
public/build-qa-opportunities/assets/noto-serif-400-normal-DT0cwSa_.woff 17.81 kB
|
||||
public/build-qa-opportunities/fonts-manifest.json 18.53 kB │ gzip: 1.23 kB
|
||||
public/build-qa-opportunities/assets/noto-serif-700-normal-mX-AlFMT.woff 18.54 kB
|
||||
public/build-qa-opportunities/assets/noto-serif-600-normal-RZopCp-J.woff 18.68 kB
|
||||
public/build-qa-opportunities/assets/instrument-sans-400-normal-D1W7dsQl.woff 21.24 kB
|
||||
public/build-qa-opportunities/assets/instrument-sans-500-normal-Z6ESRlEs.woff 21.65 kB
|
||||
public/build-qa-opportunities/assets/instrument-sans-600-normal-B9e8oLYv.woff 21.67 kB
|
||||
public/build-qa-opportunities/manifest.json 120.80 kB │ gzip: 12.86 kB
|
||||
public/build-qa-opportunities/assets/fonts-CcFLQaQ-.css 7.91 kB │ gzip: 0.65 kB
|
||||
public/build-qa-opportunities/assets/investment-catalogue-WaRR19FV.css 8.15 kB │ gzip: 2.00 kB
|
||||
public/build-qa-opportunities/assets/interactive-investment-map-Bm3WjoQm.css 10.62 kB │ gzip: 2.65 kB
|
||||
public/build-qa-opportunities/assets/app-DIHbk86v.css 158.84 kB │ gzip: 25.54 kB
|
||||
public/build-qa-opportunities/assets/input-text-BlEFHnL-.js 0.09 kB │ gzip: 0.10 kB
|
||||
public/build-qa-opportunities/assets/check-PcBNn_NG.js 0.12 kB │ gzip: 0.14 kB
|
||||
public/build-qa-opportunities/assets/company-comparison-qLTgpXjz.js 0.12 kB │ gzip: 0.13 kB
|
||||
public/build-qa-opportunities/assets/chevron-down-Bjkqe1aH.js 0.12 kB │ gzip: 0.14 kB
|
||||
public/build-qa-opportunities/assets/chevron-right-K0fOEtTQ.js 0.12 kB │ gzip: 0.14 kB
|
||||
public/build-qa-opportunities/assets/display-value-DRR1EAAK.js 0.13 kB │ gzip: 0.12 kB
|
||||
public/build-qa-opportunities/assets/value-text-BztaYdGl.js 0.14 kB │ gzip: 0.12 kB
|
||||
public/build-qa-opportunities/assets/loader-circle-DS8Tf4er.js 0.14 kB │ gzip: 0.15 kB
|
||||
public/build-qa-opportunities/assets/shared-B-QpuOU2.js 0.15 kB │ gzip: 0.13 kB
|
||||
public/build-qa-opportunities/assets/arrow-left-DMVHIw8Z.js 0.16 kB │ gzip: 0.16 kB
|
||||
public/build-qa-opportunities/assets/arrow-up-right-BIVouzdL.js 0.16 kB │ gzip: 0.15 kB
|
||||
public/build-qa-opportunities/assets/search-BRvPeo47.js 0.17 kB │ gzip: 0.16 kB
|
||||
public/build-qa-opportunities/assets/circle-check-DckzuBoW.js 0.17 kB │ gzip: 0.16 kB
|
||||
public/build-qa-opportunities/assets/product-usage-CHhCL93_.js 0.18 kB │ gzip: 0.17 kB
|
||||
public/build-qa-opportunities/assets/editorial-states-Bc7NQzsj.js 0.19 kB │ gzip: 0.16 kB
|
||||
public/build-qa-opportunities/assets/types-BoD_IJFv.js 0.19 kB │ gzip: 0.16 kB
|
||||
public/build-qa-opportunities/assets/participation-identity-BWabb4yN.js 0.24 kB │ gzip: 0.18 kB
|
||||
public/build-qa-opportunities/assets/circle-alert-uV7omYjr.js 0.24 kB │ gzip: 0.18 kB
|
||||
public/build-qa-opportunities/assets/eye-CmcEBfxN.js 0.25 kB │ gzip: 0.20 kB
|
||||
public/build-qa-opportunities/assets/log-in-Wgc8VLfq.js 0.25 kB │ gzip: 0.22 kB
|
||||
public/build-qa-opportunities/assets/partnership-history-CfclSLAo.js 0.27 kB │ gzip: 0.19 kB
|
||||
public/build-qa-opportunities/assets/compiler-runtime-sKsOXjDo.js 0.27 kB │ gzip: 0.23 kB
|
||||
public/build-qa-opportunities/assets/file-text-CEJtuNfp.js 0.33 kB │ gzip: 0.21 kB
|
||||
public/build-qa-opportunities/assets/confirm-Culw9Q-x.js 0.36 kB │ gzip: 0.22 kB
|
||||
public/build-qa-opportunities/assets/country-select-Bo9GXSHJ.js 0.40 kB │ gzip: 0.29 kB
|
||||
public/build-qa-opportunities/assets/text-link-BBvcP60s.js 0.40 kB │ gzip: 0.27 kB
|
||||
public/build-qa-opportunities/assets/content-management-entry-C_oY4VyW.js 0.42 kB │ gzip: 0.31 kB
|
||||
public/build-qa-opportunities/assets/handshake-YqyTTm3a.js 0.44 kB │ gzip: 0.28 kB
|
||||
public/build-qa-opportunities/assets/investment-guides-DO58L8zr.js 0.45 kB │ gzip: 0.26 kB
|
||||
public/build-qa-opportunities/assets/currency-select-BGabtvj1.js 0.46 kB │ gzip: 0.33 kB
|
||||
public/build-qa-opportunities/assets/evidence-details-BR-xEWlz.js 0.47 kB │ gzip: 0.32 kB
|
||||
public/build-qa-opportunities/assets/operation-key-Dr4VtGxa.js 0.51 kB │ gzip: 0.35 kB
|
||||
public/build-qa-opportunities/assets/spinner-Dmx1j41V.js 0.52 kB │ gzip: 0.36 kB
|
||||
public/build-qa-opportunities/assets/types-Cxp_Nskt.js 0.55 kB │ gzip: 0.32 kB
|
||||
public/build-qa-opportunities/assets/sliders-horizontal-D-4FqAHA.js 0.58 kB │ gzip: 0.26 kB
|
||||
public/build-qa-opportunities/assets/page-preparation-guard-B-OckhBt.js 0.59 kB │ gzip: 0.35 kB
|
||||
public/build-qa-opportunities/assets/portal-presentation-fH7FShU8.js 0.62 kB │ gzip: 0.38 kB
|
||||
public/build-qa-opportunities/assets/confidentiality-C2eqbRBb.js 0.64 kB │ gzip: 0.41 kB
|
||||
public/build-qa-opportunities/assets/dist-RzQD0wUd.js 0.68 kB │ gzip: 0.43 kB
|
||||
public/build-qa-opportunities/assets/published-opportunities-empty-C6GPHq6x.js 0.69 kB │ gzip: 0.44 kB
|
||||
public/build-qa-opportunities/assets/dist-qw3FPjRO.js 0.74 kB │ gzip: 0.49 kB
|
||||
public/build-qa-opportunities/assets/labels-DxqjesIG.js 0.74 kB │ gzip: 0.46 kB
|
||||
public/build-qa-opportunities/assets/preparation-intent-Di5hC8UV.js 0.82 kB │ gzip: 0.40 kB
|
||||
public/build-qa-opportunities/assets/wayfinder-Dp7PqxvV.js 0.89 kB │ gzip: 0.53 kB
|
||||
public/build-qa-opportunities/assets/createLucideIcon-oMeAlXbs.js 0.95 kB │ gzip: 0.56 kB
|
||||
public/build-qa-opportunities/assets/context-documents-Bh7vrWBo.js 1.01 kB │ gzip: 0.57 kB
|
||||
public/build-qa-opportunities/assets/label-Dpfg_IeY.js 1.02 kB │ gzip: 0.62 kB
|
||||
public/build-qa-opportunities/assets/technical-incident-labels-DlL6bSeE.js 1.02 kB │ gzip: 0.51 kB
|
||||
public/build-qa-opportunities/assets/territorial-source-evidence-C-r-yjcy.js 1.05 kB │ gzip: 0.57 kB
|
||||
public/build-qa-opportunities/assets/use-interest-draft-CDw2a6F9.js 1.05 kB │ gzip: 0.55 kB
|
||||
public/build-qa-opportunities/assets/investment-consumer-identity-Cxp_hGfX.js 1.07 kB │ gzip: 0.59 kB
|
||||
public/build-qa-opportunities/assets/article-BRP7vfqa.js 1.08 kB │ gzip: 0.65 kB
|
||||
public/build-qa-opportunities/assets/search-state-RHLy6yI7.js 1.10 kB │ gzip: 0.68 kB
|
||||
public/build-qa-opportunities/assets/rolldown-runtime-Dd_uD5pT.js 1.10 kB │ gzip: 0.62 kB
|
||||
public/build-qa-opportunities/assets/catalogue-investment-map-kwnVx3mS.js 1.12 kB │ gzip: 0.62 kB
|
||||
public/build-qa-opportunities/assets/investment-contexts-BQGiwu9n.js 1.17 kB │ gzip: 0.60 kB
|
||||
public/build-qa-opportunities/assets/catalogue-choice-select-BAtEMbIT.js 1.19 kB │ gzip: 0.75 kB
|
||||
public/build-qa-opportunities/assets/profile-json-Bza-VQzw.js 1.20 kB │ gzip: 0.72 kB
|
||||
public/build-qa-opportunities/assets/investment-budget-range-CfaWEAZF.js 1.21 kB │ gzip: 0.62 kB
|
||||
public/build-qa-opportunities/assets/document-DT7AOa2E.js 1.23 kB │ gzip: 0.72 kB
|
||||
public/build-qa-opportunities/assets/shared-JTxA6RNb.js 1.24 kB │ gzip: 0.74 kB
|
||||
public/build-qa-opportunities/assets/public-detail-DtyRpwvw.js 1.25 kB │ gzip: 0.72 kB
|
||||
public/build-qa-opportunities/assets/public-offer-card-CUto2arx.js 1.30 kB │ gzip: 0.70 kB
|
||||
public/build-qa-opportunities/assets/input-BJ-Jg-jz.js 1.37 kB │ gzip: 0.75 kB
|
||||
public/build-qa-opportunities/assets/cluster-competitiveness-hNV0FaaW.js 1.37 kB │ gzip: 0.73 kB
|
||||
public/build-qa-opportunities/assets/verify-email-CoGq_UFt.js 1.40 kB │ gzip: 0.74 kB
|
||||
public/build-qa-opportunities/assets/business-types-SGCXhH6X.js 1.47 kB │ gzip: 0.75 kB
|
||||
public/build-qa-opportunities/assets/verification-BOcn3HIw.js 1.48 kB │ gzip: 0.52 kB
|
||||
public/build-qa-opportunities/assets/manage-WUHHHj6c.js 1.56 kB │ gzip: 0.74 kB
|
||||
public/build-qa-opportunities/assets/educational-article-card-0rCqZ1kX.js 1.59 kB │ gzip: 0.72 kB
|
||||
public/build-qa-opportunities/assets/partnership-source-links-VfrXk2FZ.js 1.65 kB │ gzip: 0.91 kB
|
||||
public/build-qa-opportunities/assets/catalogue-NFAS2NlM.js 1.78 kB │ gzip: 0.96 kB
|
||||
public/build-qa-opportunities/assets/technical-incident-notice-CjziWA6m.js 1.79 kB │ gzip: 0.89 kB
|
||||
public/build-qa-opportunities/assets/report-DRxtlCFu.js 1.80 kB │ gzip: 0.93 kB
|
||||
public/build-qa-opportunities/assets/demographic-context-DHHS20Dk.js 1.84 kB │ gzip: 0.98 kB
|
||||
public/build-qa-opportunities/assets/preparation-index-CdgPdpQ-.js 1.87 kB │ gzip: 0.89 kB
|
||||
public/build-qa-opportunities/assets/opportunity-technical-incidents-C4aVbut7.js 1.88 kB │ gzip: 0.98 kB
|
||||
public/build-qa-opportunities/assets/password-input-DdsNob7W.js 1.89 kB │ gzip: 1.06 kB
|
||||
public/build-qa-opportunities/assets/passkey-verify-2gWsf9U3.js 2.04 kB │ gzip: 1.15 kB
|
||||
public/build-qa-opportunities/assets/public-record-offline-BmjvnSLE.js 2.07 kB │ gzip: 1.22 kB
|
||||
public/build-qa-opportunities/assets/investors-Di6y94fY.js 2.09 kB │ gzip: 1.15 kB
|
||||
public/build-qa-opportunities/assets/catalogue-context--5uVQF8t.js 2.09 kB │ gzip: 0.97 kB
|
||||
public/build-qa-opportunities/assets/forgot-password-ATkh9gdZ.js 2.10 kB │ gzip: 0.98 kB
|
||||
public/build-qa-opportunities/assets/sources-CqnAac-N.js 2.13 kB │ gzip: 1.12 kB
|
||||
public/build-qa-opportunities/assets/saved-B6Pl_09D.js 2.21 kB │ gzip: 1.10 kB
|
||||
public/build-qa-opportunities/assets/zone-map-D2Rwog04.js 2.26 kB │ gzip: 1.16 kB
|
||||
public/build-qa-opportunities/assets/appearance-C_yKqbn0.js 2.36 kB │ gzip: 1.14 kB
|
||||
public/build-qa-opportunities/assets/shared-CBJ3c_x-.js 2.37 kB │ gzip: 1.24 kB
|
||||
public/build-qa-opportunities/assets/editorial-subjects-C6_MfRSK.js 2.38 kB │ gzip: 1.14 kB
|
||||
public/build-qa-opportunities/assets/context-installation-BP3wYXpM.js 2.39 kB │ gzip: 1.23 kB
|
||||
public/build-qa-opportunities/assets/workspace-4_R1CLYI.js 2.40 kB │ gzip: 1.20 kB
|
||||
public/build-qa-opportunities/assets/reset-password-BEcAFKJj.js 2.43 kB │ gzip: 0.98 kB
|
||||
public/build-qa-opportunities/assets/manage-DKc809Y1.js 2.47 kB │ gzip: 1.10 kB
|
||||
public/build-qa-opportunities/assets/confirm-password-CzE4gi0v.js 2.47 kB │ gzip: 1.06 kB
|
||||
public/build-qa-opportunities/assets/territory-search-select-BPwyqg6Q.js 2.48 kB │ gzip: 1.28 kB
|
||||
public/build-qa-opportunities/assets/public-document-content-CxPCjivY.js 2.49 kB │ gzip: 0.90 kB
|
||||
public/build-qa-opportunities/assets/structures-Dr2nXdub.js 2.49 kB │ gzip: 1.35 kB
|
||||
public/build-qa-opportunities/assets/bootstrap-confirmation-9RmA5-Yz.js 2.55 kB │ gzip: 1.19 kB
|
||||
public/build-qa-opportunities/assets/territory-associations-ByaLmJD-.js 2.55 kB │ gzip: 1.11 kB
|
||||
public/build-qa-opportunities/assets/installation-Dly8Xg6e.js 2.59 kB │ gzip: 1.28 kB
|
||||
public/build-qa-opportunities/assets/technical-support-DlW3Jv7q.js 2.60 kB │ gzip: 1.18 kB
|
||||
public/build-qa-opportunities/assets/management-CvdeRZYq.js 2.68 kB │ gzip: 1.18 kB
|
||||
public/build-qa-opportunities/assets/experiments-Cp0V8qyP.js 2.73 kB │ gzip: 1.31 kB
|
||||
public/build-qa-opportunities/assets/password-CB_NxgQN.js 2.73 kB │ gzip: 0.73 kB
|
||||
public/build-qa-opportunities/assets/opportunity-install-B232n6lM.js 2.75 kB │ gzip: 1.34 kB
|
||||
public/build-qa-opportunities/assets/dist-BobFCjoG.js 2.92 kB │ gzip: 1.29 kB
|
||||
public/build-qa-opportunities/assets/offer-navigation-DLl-_mMp.js 2.98 kB │ gzip: 1.11 kB
|
||||
public/build-qa-opportunities/assets/portal-api-CpQBRfcu.js 2.98 kB │ gzip: 1.50 kB
|
||||
public/build-qa-opportunities/assets/two-factor-challenge-BwtYH1Um.js 3.24 kB │ gzip: 1.52 kB
|
||||
public/build-qa-opportunities/assets/territory-geometry-preview-B3502nAU.js 3.25 kB │ gzip: 1.46 kB
|
||||
public/build-qa-opportunities/assets/workspace-B7ckvblV.js 3.29 kB │ gzip: 1.44 kB
|
||||
public/build-qa-opportunities/assets/partnership-agreement-instrument-CCnuZNBy.js 3.43 kB │ gzip: 1.49 kB
|
||||
public/build-qa-opportunities/assets/funding-classification-B9TtsXJ_.js 3.44 kB │ gzip: 1.64 kB
|
||||
public/build-qa-opportunities/assets/guide-mndEuKFT.js 3.45 kB │ gzip: 1.43 kB
|
||||
public/build-qa-opportunities/assets/history-DSPDM8gM.js 3.46 kB │ gzip: 1.70 kB
|
||||
public/build-qa-opportunities/assets/audit-Xdo8qR4z.js 3.51 kB │ gzip: 1.69 kB
|
||||
public/build-qa-opportunities/assets/show-CoAwkrJM.js 3.60 kB │ gzip: 1.82 kB
|
||||
public/build-qa-opportunities/assets/corridor-agribusiness-BcIVf-hW.js 3.72 kB │ gzip: 1.53 kB
|
||||
public/build-qa-opportunities/assets/business-opportunity-DFoLnLS4.js 3.73 kB │ gzip: 1.63 kB
|
||||
public/build-qa-opportunities/assets/management-access-D4VE9LUB.js 3.75 kB │ gzip: 1.43 kB
|
||||
public/build-qa-opportunities/assets/businesses-CtRRljpq.js 3.76 kB │ gzip: 1.57 kB
|
||||
public/build-qa-opportunities/assets/editorial-reading-DUFQmJtD.js 3.89 kB │ gzip: 1.68 kB
|
||||
public/build-qa-opportunities/assets/sector-content-analysis-3po9rf38.js 3.93 kB │ gzip: 1.85 kB
|
||||
public/build-qa-opportunities/assets/catalog-B6dpdVsW.js 3.95 kB │ gzip: 1.51 kB
|
||||
public/build-qa-opportunities/assets/desk-assignments-CfWpiIpK.js 3.99 kB │ gzip: 1.95 kB
|
||||
public/build-qa-opportunities/assets/dashboard-CxoTLkSg.js 3.99 kB │ gzip: 1.61 kB
|
||||
public/build-qa-opportunities/assets/investment-context-cards-gJe_oyxw.js 4.05 kB │ gzip: 1.84 kB
|
||||
public/build-qa-opportunities/assets/shared-D6jgQoDX.js 4.09 kB │ gzip: 2.05 kB
|
||||
public/build-qa-opportunities/assets/opportunity-contact-form-Cb6iDQ1U.js 4.10 kB │ gzip: 1.67 kB
|
||||
public/build-qa-opportunities/assets/conversation-DRmJaXeI.js 4.42 kB │ gzip: 1.95 kB
|
||||
public/build-qa-opportunities/assets/reference-CT10Sdv7.js 4.46 kB │ gzip: 2.00 kB
|
||||
public/build-qa-opportunities/assets/territory-geometry-import-BnSl5jzG.js 4.49 kB │ gzip: 1.90 kB
|
||||
public/build-qa-opportunities/assets/context-inheritance-CF90v_VV.js 4.64 kB │ gzip: 1.99 kB
|
||||
public/build-qa-opportunities/assets/opportunity-origin-D3o6OTRg.js 4.64 kB │ gzip: 2.07 kB
|
||||
public/build-qa-opportunities/assets/installation-CnslW5oi.js 4.67 kB │ gzip: 1.95 kB
|
||||
public/build-qa-opportunities/assets/opportunities-YsMGMCR_.js 4.73 kB │ gzip: 1.77 kB
|
||||
public/build-qa-opportunities/assets/references-BaWmbMpT.js 4.79 kB │ gzip: 2.22 kB
|
||||
public/build-qa-opportunities/assets/offer-confidential-access-Bu9EgZ3d.js 4.83 kB │ gzip: 1.91 kB
|
||||
public/build-qa-opportunities/assets/opportunity-curation-7Gt2cWer.js 4.88 kB │ gzip: 2.04 kB
|
||||
public/build-qa-opportunities/assets/business-verifications-DHd3REmx.js 4.90 kB │ gzip: 1.72 kB
|
||||
public/build-qa-opportunities/assets/crm-edit-comparison-Db53T7I7.js 4.91 kB │ gzip: 1.99 kB
|
||||
public/build-qa-opportunities/assets/investment-complements-QVC9ynRR.js 5.00 kB │ gzip: 2.05 kB
|
||||
public/build-qa-opportunities/assets/service-CbUB6_Ll.js 5.05 kB │ gzip: 2.33 kB
|
||||
public/build-qa-opportunities/assets/agreement-history-BfSa8E7Q.js 5.13 kB │ gzip: 2.10 kB
|
||||
public/build-qa-opportunities/assets/catalogue-hfnQHndy.js 5.13 kB │ gzip: 2.54 kB
|
||||
public/build-qa-opportunities/assets/workspace-COn0Fmzi.js 5.20 kB │ gzip: 2.19 kB
|
||||
public/build-qa-opportunities/assets/article-editor-ByLxbPbJ.js 5.25 kB │ gzip: 2.20 kB
|
||||
public/build-qa-opportunities/assets/demography-VJBwNqjR.js 5.28 kB │ gzip: 2.15 kB
|
||||
public/build-qa-opportunities/assets/economic-references-C7dNVUC6.js 5.61 kB │ gzip: 2.52 kB
|
||||
public/build-qa-opportunities/assets/context-start-D_5VTFIv.js 5.73 kB │ gzip: 2.21 kB
|
||||
public/build-qa-opportunities/assets/portfolio-BJrLNjWB.js 5.73 kB │ gzip: 2.03 kB
|
||||
public/build-qa-opportunities/assets/convert-B3LtI2n6.js 5.81 kB │ gzip: 2.40 kB
|
||||
public/build-qa-opportunities/assets/editorial-subject-form-B2W8E2NJ.js 5.87 kB │ gzip: 2.66 kB
|
||||
public/build-qa-opportunities/assets/public-sector-cards-Esb1aTm6.js 5.94 kB │ gzip: 2.55 kB
|
||||
public/build-qa-opportunities/assets/demography-install-B57rikBv.js 6.05 kB │ gzip: 2.50 kB
|
||||
public/build-qa-opportunities/assets/context-BUNebOkS.js 6.06 kB │ gzip: 2.65 kB
|
||||
public/build-qa-opportunities/assets/request-Cq-GjzRy.js 6.10 kB │ gzip: 2.41 kB
|
||||
public/build-qa-opportunities/assets/structure-geography-C_GOYx9w.js 6.12 kB │ gzip: 2.22 kB
|
||||
public/build-qa-opportunities/assets/editorial-workflow-DYYZzXOw.js 6.22 kB │ gzip: 2.29 kB
|
||||
public/build-qa-opportunities/assets/investment-map-panel-omy0I5Gs.js 6.27 kB │ gzip: 2.88 kB
|
||||
public/build-qa-opportunities/assets/procurement-TZKWRMdk.js 6.35 kB │ gzip: 2.73 kB
|
||||
public/build-qa-opportunities/assets/register-DH2Ps_wk.js 6.43 kB │ gzip: 2.71 kB
|
||||
public/build-qa-opportunities/assets/leads-Bu2UK8ON.js 6.56 kB │ gzip: 2.82 kB
|
||||
public/build-qa-opportunities/assets/business-marketplace-BbVZgsth.js 6.59 kB │ gzip: 2.51 kB
|
||||
public/build-qa-opportunities/assets/interest-xqtiIFPC.js 6.63 kB │ gzip: 2.23 kB
|
||||
public/build-qa-opportunities/assets/demography-BxaBdOBx.js 6.66 kB │ gzip: 2.51 kB
|
||||
public/build-qa-opportunities/assets/investment-territory-CLtvthDH.js 6.71 kB │ gzip: 2.59 kB
|
||||
public/build-qa-opportunities/assets/fiscal-qa-review-bsBzE64p.js 6.74 kB │ gzip: 2.69 kB
|
||||
public/build-qa-opportunities/assets/business-interest-BRbpJ3zt.js 6.82 kB │ gzip: 2.60 kB
|
||||
public/build-qa-opportunities/assets/interests-C0MCvWri.js 6.83 kB │ gzip: 2.79 kB
|
||||
public/build-qa-opportunities/assets/catalogue-CdnFMKkm.js 6.84 kB │ gzip: 2.82 kB
|
||||
public/build-qa-opportunities/assets/business-classification-D177C7vp.js 7.01 kB │ gzip: 2.57 kB
|
||||
public/build-qa-opportunities/assets/dist-Ddn_hEUd.js 7.02 kB │ gzip: 2.71 kB
|
||||
public/build-qa-opportunities/assets/blank-2jFZEe2q.js 7.07 kB │ gzip: 2.77 kB
|
||||
public/build-qa-opportunities/assets/analysis-BfsqxAl2.js 7.11 kB │ gzip: 2.96 kB
|
||||
public/build-qa-opportunities/assets/profile-B9W0t4xz.js 7.19 kB │ gzip: 2.47 kB
|
||||
public/build-qa-opportunities/assets/install-BNUOVYwj.js 7.23 kB │ gzip: 3.03 kB
|
||||
public/build-qa-opportunities/assets/investor-COYuuRY_.js 7.30 kB │ gzip: 2.89 kB
|
||||
public/build-qa-opportunities/assets/proactive-supply-review-Bspf5LP7.js 7.55 kB │ gzip: 2.73 kB
|
||||
public/build-qa-opportunities/assets/legacy-CBGwFFnl.js 7.78 kB │ gzip: 2.61 kB
|
||||
public/build-qa-opportunities/assets/jsx-runtime-BpzPEenQ.js 7.89 kB │ gzip: 2.99 kB
|
||||
public/build-qa-opportunities/assets/shared-BFCbvJo7.js 7.90 kB │ gzip: 3.08 kB
|
||||
public/build-qa-opportunities/assets/business-objects-kxM4nmMX.js 7.95 kB │ gzip: 2.57 kB
|
||||
public/build-qa-opportunities/assets/assisted-BgxTQXO8.js 8.06 kB │ gzip: 3.16 kB
|
||||
public/build-qa-opportunities/assets/value-network-Cp8UYtMs.js 8.06 kB │ gzip: 3.08 kB
|
||||
public/build-qa-opportunities/assets/company-comparison-BOMp61iN.js 8.16 kB │ gzip: 3.01 kB
|
||||
public/build-qa-opportunities/assets/editor-i942Hovy.js 8.21 kB │ gzip: 2.97 kB
|
||||
public/build-qa-opportunities/assets/territorial-editorial-B0ni24WA.js 8.22 kB │ gzip: 3.03 kB
|
||||
public/build-qa-opportunities/assets/opportunity-promotion-CyWpImc1.js 8.40 kB │ gzip: 2.96 kB
|
||||
public/build-qa-opportunities/assets/publication-history-DfLO6jOc.js 8.42 kB │ gzip: 3.02 kB
|
||||
public/build-qa-opportunities/assets/print-Tn3aXHlY.js 8.66 kB │ gzip: 3.55 kB
|
||||
public/build-qa-opportunities/assets/dialog-BWJfsOV9.js 8.81 kB │ gzip: 2.76 kB
|
||||
public/build-qa-opportunities/assets/investor-path-Rg_QseUc.js 8.82 kB │ gzip: 3.53 kB
|
||||
public/build-qa-opportunities/assets/shared-DXIXdF9G.js 8.92 kB │ gzip: 3.83 kB
|
||||
public/build-qa-opportunities/assets/iva-modelo-a-CSFJ5jT7.js 8.94 kB │ gzip: 3.27 kB
|
||||
public/build-qa-opportunities/assets/zone-relations-Dd1ee-r8.js 8.95 kB │ gzip: 2.99 kB
|
||||
public/build-qa-opportunities/assets/similar-businesses-HTwQGVGQ.js 9.11 kB │ gzip: 3.58 kB
|
||||
public/build-qa-opportunities/assets/interactive-investment-map-CrrPTJwT.js 9.13 kB │ gzip: 3.60 kB
|
||||
public/build-qa-opportunities/assets/fiscal-qa-preview-mA3oBtSi.js 9.15 kB │ gzip: 3.33 kB
|
||||
public/build-qa-opportunities/assets/why-invest-DZN9zoMJ.js 9.16 kB │ gzip: 3.49 kB
|
||||
public/build-qa-opportunities/assets/interest-history-oHNykKmC.js 9.48 kB │ gzip: 3.45 kB
|
||||
public/build-qa-opportunities/assets/content-hub-oCf6Hau_.js 9.95 kB │ gzip: 2.93 kB
|
||||
public/build-qa-opportunities/assets/privacy-policy-LI1lpUCK.js 10.36 kB │ gzip: 3.07 kB
|
||||
public/build-qa-opportunities/assets/editorial-edition-Zq39X7mf.js 10.36 kB │ gzip: 3.47 kB
|
||||
public/build-qa-opportunities/assets/panel-1sRDK5_b.js 10.46 kB │ gzip: 4.29 kB
|
||||
public/build-qa-opportunities/assets/result-yez5wOFo.js 10.57 kB │ gzip: 4.73 kB
|
||||
public/build-qa-opportunities/assets/dashboard-37WpNF5V.js 10.92 kB │ gzip: 3.47 kB
|
||||
public/build-qa-opportunities/assets/zone-attachments-C_KZMaph.js 10.94 kB │ gzip: 2.75 kB
|
||||
public/build-qa-opportunities/assets/business-CoqOS2ef.js 11.10 kB │ gzip: 3.08 kB
|
||||
public/build-qa-opportunities/assets/funding-B8zcEg_z.js 11.36 kB │ gzip: 3.66 kB
|
||||
public/build-qa-opportunities/assets/detail-BrMeg9of.js 11.73 kB │ gzip: 4.30 kB
|
||||
public/build-qa-opportunities/assets/login-B6Sjhxjk.js 11.89 kB │ gzip: 4.92 kB
|
||||
public/build-qa-opportunities/assets/demographic-evidence-CTcUntUH.js 12.22 kB │ gzip: 4.70 kB
|
||||
public/build-qa-opportunities/assets/support-installation-tsBpnQkP.js 12.36 kB │ gzip: 4.86 kB
|
||||
public/build-qa-opportunities/assets/tempo-brand-BXcnRsyn.js 12.38 kB │ gzip: 5.01 kB
|
||||
public/build-qa-opportunities/assets/show-BH-jgf8B.js 12.43 kB │ gzip: 4.01 kB
|
||||
public/build-qa-opportunities/assets/guide-CBZTH5ZN.js 12.58 kB │ gzip: 4.03 kB
|
||||
public/build-qa-opportunities/assets/contact-D4UOlLaN.js 12.65 kB │ gzip: 4.33 kB
|
||||
public/build-qa-opportunities/assets/show-C5NAKOXB.js 12.65 kB │ gzip: 4.50 kB
|
||||
public/build-qa-opportunities/assets/dossier-prefill-BZAfHUG4.js 12.72 kB │ gzip: 4.64 kB
|
||||
public/build-qa-opportunities/assets/technical-incident-GDB_x0wp.js 12.73 kB │ gzip: 4.96 kB
|
||||
public/build-qa-opportunities/assets/competitiveness-60nqrOfg.js 12.74 kB │ gzip: 4.23 kB
|
||||
public/build-qa-opportunities/assets/editor-tVh6DVBu.js 12.96 kB │ gzip: 3.75 kB
|
||||
public/build-qa-opportunities/assets/fiscal-forms-DjKLL-oZ.js 13.04 kB │ gzip: 4.76 kB
|
||||
public/build-qa-opportunities/assets/opportunity-classification-Dm_W66ep.js 13.44 kB │ gzip: 4.55 kB
|
||||
public/build-qa-opportunities/assets/project-dossier-document-mDKRMrL7.js 13.57 kB │ gzip: 5.40 kB
|
||||
public/build-qa-opportunities/assets/react-CjVep8xp.js 13.90 kB │ gzip: 4.61 kB
|
||||
public/build-qa-opportunities/assets/investment-step-help-DHkq1rOX.js 14.11 kB │ gzip: 5.64 kB
|
||||
public/build-qa-opportunities/assets/case-wwTeoOmv.js 14.77 kB │ gzip: 5.38 kB
|
||||
public/build-qa-opportunities/assets/product-usage-D6uLRWN5.js 14.81 kB │ gzip: 5.30 kB
|
||||
public/build-qa-opportunities/assets/opportunity-search-filters-B2V9QZ-e.js 15.15 kB │ gzip: 4.85 kB
|
||||
public/build-qa-opportunities/assets/terms-of-use-CUQdwKes.js 15.27 kB │ gzip: 4.20 kB
|
||||
public/build-qa-opportunities/assets/edit-DUnuWWSX.js 15.38 kB │ gzip: 5.14 kB
|
||||
public/build-qa-opportunities/assets/relationship-repair-brZoqSge.js 16.29 kB │ gzip: 5.62 kB
|
||||
public/build-qa-opportunities/assets/company-preparation-H46DSEpQ.js 16.35 kB │ gzip: 5.29 kB
|
||||
public/build-qa-opportunities/assets/edit-BxBUOWea.js 16.60 kB │ gzip: 4.88 kB
|
||||
public/build-qa-opportunities/assets/edit-D0pBsW0D.js 16.93 kB │ gzip: 4.91 kB
|
||||
public/build-qa-opportunities/assets/use-two-factor-auth-D9w0KtSq.js 17.31 kB │ gzip: 6.30 kB
|
||||
public/build-qa-opportunities/assets/search-DK_g82QS.js 17.39 kB │ gzip: 5.78 kB
|
||||
public/build-qa-opportunities/assets/administration-CgUGyaX7.js 17.41 kB │ gzip: 4.30 kB
|
||||
public/build-qa-opportunities/assets/notifications-Bk3pS8nf.js 17.61 kB │ gzip: 5.84 kB
|
||||
public/build-qa-opportunities/assets/funding-institution-CA21qozm.js 17.78 kB │ gzip: 6.01 kB
|
||||
public/build-qa-opportunities/assets/ai-CGCgg57o.js 18.08 kB │ gzip: 6.92 kB
|
||||
public/build-qa-opportunities/assets/submission-RZCfjJhK.js 19.99 kB │ gzip: 6.32 kB
|
||||
public/build-qa-opportunities/assets/opportunity-resources-sDhrp8RI.js 20.20 kB │ gzip: 7.22 kB
|
||||
public/build-qa-opportunities/assets/about-BtlawfeW.js 20.95 kB │ gzip: 7.03 kB
|
||||
public/build-qa-opportunities/assets/zones-CNmm0f1u.js 21.16 kB │ gzip: 5.22 kB
|
||||
public/build-qa-opportunities/assets/service-editor-Bb3ZaUPy.js 21.30 kB │ gzip: 6.58 kB
|
||||
public/build-qa-opportunities/assets/declaration-Bzl3lixx.js 22.15 kB │ gzip: 7.14 kB
|
||||
public/build-qa-opportunities/assets/Combination-BBDI-RbM.js 23.03 kB │ gzip: 8.24 kB
|
||||
public/build-qa-opportunities/assets/desk-internal-operations-D5ult1G-.js 23.14 kB │ gzip: 6.54 kB
|
||||
public/build-qa-opportunities/assets/education-BD4Gx66v.js 23.40 kB │ gzip: 8.19 kB
|
||||
public/build-qa-opportunities/assets/investment-opportunity-choices-DXDgIBJw.js 23.97 kB │ gzip: 7.97 kB
|
||||
public/build-qa-opportunities/assets/context-DOKgqu7k.js 24.36 kB │ gzip: 7.90 kB
|
||||
public/build-qa-opportunities/assets/preparation-CZuBYZNl.js 24.56 kB │ gzip: 6.73 kB
|
||||
public/build-qa-opportunities/assets/utils-CCDJ05Ll.js 27.31 kB │ gzip: 8.71 kB
|
||||
public/build-qa-opportunities/assets/business-wizard-DzK0rkrh.js 28.60 kB │ gzip: 9.42 kB
|
||||
public/build-qa-opportunities/assets/proactive-investment-DfIQuXvs.js 28.65 kB │ gzip: 9.16 kB
|
||||
public/build-qa-opportunities/assets/lead-vUXgd2g8.js 29.03 kB │ gzip: 9.96 kB
|
||||
public/build-qa-opportunities/assets/preparation-Cvh5VSHO.js 29.25 kB │ gzip: 8.51 kB
|
||||
public/build-qa-opportunities/assets/form-l0ubsbUV.js 29.80 kB │ gzip: 8.04 kB
|
||||
public/build-qa-opportunities/assets/welcome-pOD0TMQx.js 30.73 kB │ gzip: 6.49 kB
|
||||
public/build-qa-opportunities/assets/manage-GV_WvYCX.js 31.17 kB │ gzip: 7.63 kB
|
||||
public/build-qa-opportunities/assets/profile-Dl-qn24G.js 31.38 kB │ gzip: 9.51 kB
|
||||
public/build-qa-opportunities/assets/security-f6R1jfHt.js 32.11 kB │ gzip: 10.06 kB
|
||||
public/build-qa-opportunities/assets/editor-CWbYf7YK.js 35.03 kB │ gzip: 11.76 kB
|
||||
public/build-qa-opportunities/assets/case-DBvJBnfK.js 37.37 kB │ gzip: 10.32 kB
|
||||
public/build-qa-opportunities/assets/room-Bg8k9V54.js 38.25 kB │ gzip: 12.14 kB
|
||||
public/build-qa-opportunities/assets/request-BtcX_ciV.js 41.86 kB │ gzip: 11.29 kB
|
||||
public/build-qa-opportunities/assets/simulation-form-BJot6R_W.js 42.25 kB │ gzip: 10.94 kB
|
||||
public/build-qa-opportunities/assets/detail-BePHrGF-.js 46.42 kB │ gzip: 15.19 kB
|
||||
public/build-qa-opportunities/assets/PortalInvestidor-DAKsQHoD.js 48.71 kB │ gzip: 14.87 kB
|
||||
public/build-qa-opportunities/assets/catalogue-Z2moFu35.js 50.68 kB │ gzip: 16.26 kB
|
||||
public/build-qa-opportunities/assets/dropdown-menu-DeBy_kF_.js 57.05 kB │ gzip: 19.02 kB
|
||||
public/build-qa-opportunities/assets/zone-CuSTiULY.js 62.42 kB │ gzip: 15.63 kB
|
||||
public/build-qa-opportunities/assets/business-financial-plan-DurcgcyR.js 68.55 kB │ gzip: 18.14 kB
|
||||
public/build-qa-opportunities/assets/opportunity-draft-Dst_5999.js 70.65 kB │ gzip: 20.89 kB
|
||||
public/build-qa-opportunities/assets/show-9tOEoFHW.js 87.11 kB │ gzip: 26.75 kB
|
||||
public/build-qa-opportunities/assets/document-zip-bqFSTgG4.js 95.97 kB │ gzip: 28.50 kB
|
||||
public/build-qa-opportunities/assets/investment-operating-assistance-CvLEnGer.js 140.35 kB │ gzip: 41.99 kB
|
||||
public/build-qa-opportunities/assets/leaflet-src-CUWrUTR2.js 148.82 kB │ gzip: 43.39 kB
|
||||
public/build-qa-opportunities/assets/app-CjW-s2sW.js 167.29 kB │ gzip: 51.88 kB
|
||||
public/build-qa-opportunities/assets/dist-BRfsww6z.js 307.99 kB │ gzip: 96.67 kB
|
||||
public/build-qa-opportunities/assets/document-word-CqTGSyXu.js 403.66 kB │ gzip: 115.44 kB
|
||||
public/build-qa-opportunities/assets/project-dossier-CtnpzEb8.js 1,010.94 kB │ gzip: 274.58 kB
|
||||
public/build-qa-opportunities/assets/services-DsBoLDo_.js 1,047.92 kB │ gzip: 247.62 kB
|
||||
|
||||
✓ built in 26.83s
|
||||
[plugin builtin:vite-reporter]
|
||||
(!) Some chunks are larger than 500 kB after minification. Consider:
|
||||
- Using dynamic import() to code-split the application
|
||||
- Use build.rolldownOptions.output.codeSplitting to improve chunking: https://rolldown.rs/reference/OutputOptions.codeSplitting
|
||||
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
|
||||
[PLUGIN_TIMINGS] Your build spent 98% of 26.8s inside plugin hooks (26.3s).
|
||||
Measured inside the callback, so queue time is excluded and time the callback itself awaited is not:
|
||||
- @rolldown/plugin-babel transform (87%, 23.5s, 438 calls)
|
||||
- @tailwindcss/vite:generate:build transform (7%, 2.0s, 3 calls)
|
||||
Those rows are 95% of the build; the rest of the 98% is below.
|
||||
Not measurable — 1 hook whose calls overlap, so elapsed time covers work other calls were doing. Profile with `node --cpu-prof`:
|
||||
- vite:css transform (3 calls)
|
||||
See https://rolldown.rs/reference/InputOptions.checks#plugintimings for more details.
|
||||
@@ -0,0 +1,23 @@
|
||||
✔ financial to fiscal bridge reconciles accounting result while leaving tax base indeterminate (41.370667ms)
|
||||
✔ financial bridge separates opening receivables and scheduled sales collections (1.574084ms)
|
||||
✔ bridge maps monthly recognised expenses but keeps scheduled payments in cash only (0.497916ms)
|
||||
✔ financial bridge rejects a corrupted monthly cash schedule (0.581541ms)
|
||||
✔ F20-B refund reconciles in the editor fiscal bridge without becoming taxable revenue or other collections (31.040875ms)
|
||||
✔ F20-B accepts a prior documentary invoice without inferring an opening balance; horizon 60 retains future events (3.318125ms)
|
||||
✔ F20-B reception before invoice: gross obligation and asset separated, no second payment on application (10.191083ms)
|
||||
✔ F20-B invoice before reception does not recognize goods or expenses early (5.116834ms)
|
||||
✔ F20-B service partial use and refund: no new income or expenditure (3.573875ms)
|
||||
✔ F20-B different operations of same supplier never offset each other (5.822292ms)
|
||||
✔ F20-B application, refunds and remaining payments are bounded by same-parcel balances (1.724083ms)
|
||||
✔ F20-B rejects special contracts, missing regime, invalid dates, duplicate parcels and inconsistent allocations (3.159292ms)
|
||||
✔ F20-B missing or future recognition preserves advances, no inferred opening allocation or last-month cash (3.929416ms)
|
||||
✔ F20-B snapshot 21 round-trips inactive agendas, rejects foreign versions and invalid active ledgers (3.205625ms)
|
||||
✔ F20-B inactive mode preserves every old value and F20-A can coexist only on unselected categories (2.491ms)
|
||||
ℹ tests 15
|
||||
ℹ suites 0
|
||||
ℹ pass 15
|
||||
ℹ fail 0
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 449.701208
|
||||
@@ -0,0 +1,100 @@
|
||||
✔ financial forecast reconciles revenue, finance sources, working capital and monthly cash (7.204208ms)
|
||||
✔ opening payable installments reduce cash without changing profit and retain unpaid balances (6.470166ms)
|
||||
✔ opening payable schedule caps cent rounding at the remaining balance (0.33375ms)
|
||||
✔ monthly unit schedules drive revenue, costs, inventory and scenario volume (1.676709ms)
|
||||
✖ monthly unit schedules must match the horizon and contain valid quantities (3.988791ms)
|
||||
✔ monthly prices and unit costs affect revenue, consumption and scenarios (0.961209ms)
|
||||
✔ monthly money schedules cover the horizon and reject invalid amounts (0.575ms)
|
||||
✔ monthly operating and payroll expense schedules remain separate from payments (1.024625ms)
|
||||
✔ monthly operating schedules require full horizon, exact cents and current snapshot version (4.523416ms)
|
||||
✔ losses and negative closing cash remain visible instead of being clamped to zero (0.858459ms)
|
||||
✔ principal repayments affect cash but are excluded from profit expenses (0.741792ms)
|
||||
✔ depreciation allocation reconciles exactly over useful life (0.374667ms)
|
||||
✔ missing currency, products, invalid numbers and invalid horizons are explicit errors (0.88225ms)
|
||||
✔ versioned plan snapshots restore assumptions and reject unsupported or oversized data (13.405542ms)
|
||||
✔ business plan serializer refuses snapshots above the server storage limit (4.354708ms)
|
||||
✔ sales invoicing and receipts follow an optional declared collection lag (3.722583ms)
|
||||
✔ scheduled collection percentage keeps unpaid invoices in receivables with exact rounding (2.08575ms)
|
||||
✔ sales recovery applies only to overdue invoices and never exceeds open balances (18.055459ms)
|
||||
✔ opening receivables affect cash only when a month and collection percentage are declared (0.789208ms)
|
||||
✔ opening receivable installments reconcile to the initial balance across months (3.54825ms)
|
||||
✔ opening receivable installments cap independently rounded cents at the available balance (0.376833ms)
|
||||
✔ inventory purchases, consumption, closing stock and stock shortfall reconcile independently of payments (0.292583ms)
|
||||
✔ inventory lead time separates monthly orders, receipts, shortages and goods still in transit (0.322666ms)
|
||||
✔ monthly inventory purchase schedule reconciles variable orders, lead times, receipts and transit (1.412542ms)
|
||||
✔ monthly variable purchase payments affect cash independently from inventory orders and profit (0.549708ms)
|
||||
✔ product inventory schedules reconcile independently and do not transfer stock between products (4.764375ms)
|
||||
✔ supplier payment terms drive purchase cash flow and expose amounts due beyond the horizon (2.867083ms)
|
||||
✔ supplier order installments reconcile exact cents, cash dates and unallocated balances (1.081958ms)
|
||||
✔ business assumptions survive the existing encrypted-draft snapshot split and restore (1.757416ms)
|
||||
✔ presentation currency conversion requires and reports its rate, date, and declared source (4.207ms)
|
||||
✔ CSV marks presentation currency conversion as an unverified user planning assumption (6.738125ms)
|
||||
✔ business plan export carries its assumptions, formulas, period, currency, and matching result (0.486167ms)
|
||||
✔ business plan CSV preserves declared monthly product schedules (0.405208ms)
|
||||
✔ CSV export exposes the sales collection assumption and outstanding receivable (0.361125ms)
|
||||
✔ business plan CSV neutralizes formula-like labels and preserves negative financial values (6.230292ms)
|
||||
✔ financial scenarios expose user-declared changes without creating tax values (5.580375ms)
|
||||
✔ F20-A preserves explicitly classified independent other income when replacing sales collections (34.680042ms)
|
||||
✔ F20-A replaces only opted-in cash agendas, preserves recognition and reconciles every monthly balance (6.910542ms)
|
||||
✔ F20-A calendar days cover zero, individual dates, leap February and year transition (9.002583ms)
|
||||
✔ F20-A excludes early and unknown payments including within the same month, never silently normalizes them (14.270167ms)
|
||||
✔ F20-A parcels reconcile to recognition and reject duplicates without merging distinct equal payments (2.498459ms)
|
||||
✔ F20-A retains future receivables and payables at horizons 1 and 60 and restores manual schedules explicitly (4.8ms)
|
||||
✔ F20-A version 20 recovers dates, inactive manual inputs and outcomes; invalid terms and foreign versions are rejected (7.494875ms)
|
||||
✔ acceptance regression: summary uses the same cash, tax payments and startup funding gap as its seven tables (27.726583ms)
|
||||
✔ review regression: cash deficit does not create an undeclared loan or inflate projected liabilities (1.522542ms)
|
||||
✔ review regression: print export repeats rubrics in readable slices without losing any of sixty months or five annual periods (67.759416ms)
|
||||
✔ seven integrated statements reconcile monthly flows, annual totals and closing stocks without changing the existing engine (7.3255ms)
|
||||
✔ missing inputs, insufficient inventory and inconsistent opening capital remain explicit, never balancing plugs (3.034333ms)
|
||||
✔ partial years, changing product schedules and negative cash keep exact amounts and disclosed assumptions (1.007916ms)
|
||||
✔ dossier print and Word exports include the seven statements and approved ratios, escape labels and split wide tables (210.758625ms)
|
||||
✔ F20-B reception before invoice: gross obligation and asset separated, no second payment on application (31.942792ms)
|
||||
✔ F20-B invoice before reception does not recognize goods or expenses early (3.266667ms)
|
||||
✔ F20-B service partial use and refund: no new income or expenditure (6.276ms)
|
||||
✔ F20-B different operations of same supplier never offset each other (4.531875ms)
|
||||
✔ F20-B application, refunds and remaining payments are bounded by same-parcel balances (2.215292ms)
|
||||
✔ F20-B rejects special contracts, missing regime, invalid dates, duplicate parcels and inconsistent allocations (1.967666ms)
|
||||
✔ F20-B missing or future recognition preserves advances, no inferred opening allocation or last-month cash (6.15225ms)
|
||||
✔ F20-B snapshot 21 round-trips inactive agendas, rejects foreign versions and invalid active ledgers (5.280833ms)
|
||||
✔ F20-B inactive mode preserves every old value and F20-A can coexist only on unselected categories (2.525083ms)
|
||||
ℹ tests 59
|
||||
ℹ suites 0
|
||||
ℹ pass 58
|
||||
ℹ fail 1
|
||||
ℹ cancelled 0
|
||||
ℹ skipped 0
|
||||
ℹ todo 0
|
||||
ℹ duration_ms 1177.769292
|
||||
|
||||
✖ failing tests:
|
||||
|
||||
test at tests\frontend\business-financial-plan.test.mjs:289:6
|
||||
✖ monthly unit schedules must match the horizon and contain valid quantities (3.988791ms)
|
||||
AssertionError [ERR_ASSERTION]: The input did not match the regular expression /Quantidade/. Input:
|
||||
|
||||
'Error: Previsão de Vendas / Unidades do produto 1, mês 1: preencha uma quantidade não negativa com até três casas decimais; indique zero apenas quando aplicável.'
|
||||
|
||||
at TestContext.<anonymous> (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/tests/frontend/business-financial-plan.test.mjs:304:12)
|
||||
at Test.runInAsyncScope (node:async_hooks:227:14)
|
||||
at Test.run (node:internal/test_runner/test:1397:25)
|
||||
at Test.processPendingSubtests (node:internal/test_runner/test:969:18)
|
||||
at Test.postRun (node:internal/test_runner/test:1537:19)
|
||||
at Test.run (node:internal/test_runner/test:1462:12)
|
||||
at async Test.processPendingSubtests (node:internal/test_runner/test:969:7) {
|
||||
generatedMessage: true,
|
||||
code: 'ERR_ASSERTION',
|
||||
actual: Error: Previsão de Vendas / Unidades do produto 1, mês 1: preencha uma quantidade não negativa com até três casas decimais; indique zero apenas quando aplicável.
|
||||
at file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/business-financial-plan.ts:1893:31
|
||||
at Array.map (<anonymous>)
|
||||
at file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/business-financial-plan.ts:1889:32
|
||||
at Array.map (<anonymous>)
|
||||
at forecastBusinessPlanBase (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/business-financial-plan.ts:1823:42)
|
||||
at forecastBusinessPlan (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/resources/js/lib/business-financial-plan.ts:1507:42)
|
||||
at file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/tests/frontend/business-financial-plan.test.mjs:306:13
|
||||
at getActual (node:assert:611:5)
|
||||
at strict.throws (node:assert:759:24)
|
||||
at TestContext.<anonymous> (file:///C:/laragon/www/portal-investidor-continuity-qa-20261120/tests/frontend/business-financial-plan.test.mjs:304:12),
|
||||
expected: /Quantidade/,
|
||||
operator: 'throws',
|
||||
diff: 'simple'
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"scope": "F20-B PGC-PE only, synthetic QA",
|
||||
"url": "http://127.0.0.3:18724/simulador-fiscal?draft=03530658-b40f-4804-ad9d-1c8476d68d70",
|
||||
"qaDatabase": "main_reference_20261104_test",
|
||||
"errors": [],
|
||||
"blocked": [],
|
||||
"cases": [
|
||||
{
|
||||
"name": "reception-before-invoice",
|
||||
"table": "Mês\tObrigação bruta\tAdiantamento activo\tLíquido por liquidar\n1\t0.00\t30000.00\t0.00\n2\t100000.00\t30000.00\t70000.00\n3\t70000.00\t0.00\t70000.00\n4\t0.00\t0.00\t0.00",
|
||||
"optInDismissed": true,
|
||||
"optInAccepted": true
|
||||
},
|
||||
{
|
||||
"name": "early-application-rejected",
|
||||
"diagnostic": "Adiantamentos — OP-1/P-1: aplicação exige reconhecimento e factura correspondente, sem antecipar datas."
|
||||
},
|
||||
{
|
||||
"name": "special-contract-rejected",
|
||||
"diagnostic": "Adiantamentos — OP-1/P-1: confirme contrato ordinário; contratos especiais estão excluídos."
|
||||
},
|
||||
{
|
||||
"name": "invoice-before-reception",
|
||||
"table": "Mês\tObrigação bruta\tAdiantamento activo\tLíquido por liquidar\n1\t0.00\t0.00\t0.00\n2\t0.00\t30000.00\t0.00\n3\t70000.00\t0.00\t70000.00\n4\t0.00\t0.00\t0.00"
|
||||
},
|
||||
{
|
||||
"name": "partial-service-and-refund",
|
||||
"table": "Mês\tObrigação bruta\tAdiantamento activo\tLíquido por liquidar\n1\t0.00\t20000.00\t0.00\n2\t0.00\t8000.00\t0.00\n3\t0.00\t0.00\t0.00\n4\t0.00\t0.00\t0.00",
|
||||
"balance": "Diferença do balanço\t0,00\t0,00\t0,00\t0,00\t0,00"
|
||||
}
|
||||
],
|
||||
"recovery": [
|
||||
{
|
||||
"mobile": false,
|
||||
"url": "http://127.0.0.3:18724/simulador-fiscal?draft=03530658-b40f-4804-ad9d-1c8476d68d70",
|
||||
"exactSnapshot": true,
|
||||
"bounds": {
|
||||
"left": 206,
|
||||
"right": 1234,
|
||||
"width": 1440
|
||||
}
|
||||
},
|
||||
{
|
||||
"mobile": true,
|
||||
"url": "http://127.0.0.3:18724/simulador-fiscal?draft=03530658-b40f-4804-ad9d-1c8476d68d70",
|
||||
"exactSnapshot": true,
|
||||
"bounds": {
|
||||
"left": 54,
|
||||
"right": 336,
|
||||
"width": 390
|
||||
}
|
||||
}
|
||||
],
|
||||
"balance": "Diferença do balanço\t0,00\t0,00\t0,00\t0,00\t0,00",
|
||||
"cashflow": "Fluxo de Caixa\nRubrica\t2027-01\t2027-02\t2027-03\t2027-04\t2027 (parcial)\nCaixa inicial\t900,00\t-29 120,00\t-29 140,00\t-29 160,00\t900,00\nRecebimentos\t0,00\t0,00\t0,00\t0,00\t0,00\nPagamentos de compras\t30 000,00\t0,00\t0,00\t70 000,00\t100 000,00\nPagamentos operacionais\t0,00\t0,00\t0,00\t0,00\t0,00\nPagamentos de pessoal\t0,00\t0,00\t0,00\t0,00\t0,00\nJuros pagos\t0,00\t0,00\t0,00\t0,00\t0,00\nCapital reembolsado\t0,00\t0,00\t0,00\t0,00\t0,00\nPagamento de obrigações iniciais\t0,00\t0,00\t0,00\t0,00\t0,00\nPagamento fiscal estimado\t20,00\t20,00\t20,00\t20,00\t80,00\nFluxo líquido\t-30 020,00\t-20,00\t-20,00\t-70 020,00\t-100 080,00\nCaixa final\t-29 120,00\t-29 140,00\t-29 160,00\t-99 180,00\t-99 180,00\nAdiantamentos pagos (discriminação)\t30 000,00\t0,00\t0,00\t0,00\t30 000,00\nAplicações sem movimento de caixa (discriminação)\t0,00\t0,00\t30 000,00\t0,00\t30 000,00\nDevoluções de adiantamentos (discriminação)\t0,00\t0,00\t0,00\t0,00\t0,00\nRemanescentes pagos (discriminação)\t0,00\t0,00\t0,00\t70 000,00\t70 000,00",
|
||||
"status": "functional QA proof completed; proposed for owner acceptance"
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 148 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
@@ -0,0 +1,136 @@
|
||||
{
|
||||
"version": 21,
|
||||
"plan": {
|
||||
"currency": "MZN",
|
||||
"openingCash": "1000",
|
||||
"assetInvestment": "600",
|
||||
"equity": "600",
|
||||
"products": [
|
||||
{
|
||||
"label": "Sintético F20-B",
|
||||
"monthlyUnits": "0",
|
||||
"unitPrice": "0",
|
||||
"unitVariableCost": "0"
|
||||
}
|
||||
],
|
||||
"depreciationLifeMonths": 60,
|
||||
"periods": 4,
|
||||
"monthlyCollections": "0",
|
||||
"monthlyVariableCostPayments": "999",
|
||||
"monthlyInventoryPurchases": "400",
|
||||
"monthlyOperatingExpenses": "0",
|
||||
"monthlyOperatingPayments": "888",
|
||||
"monthlyPayrollExpense": "0",
|
||||
"monthlyPayrollPayments": "0",
|
||||
"inventory": "0",
|
||||
"receivables": "0",
|
||||
"payables": "0",
|
||||
"shareholderLoans": "0",
|
||||
"bankLoanProceeds": "0",
|
||||
"grants": "0",
|
||||
"assetDepreciation": "600",
|
||||
"monthlyInterestExpense": "0",
|
||||
"monthlyInterestPayment": "0",
|
||||
"monthlyPrincipalRepayment": "0",
|
||||
"salesCollectionLagMonths": 0,
|
||||
"salesCollectionPercent": "100",
|
||||
"openingReceivablesCollectionPercent": "0",
|
||||
"reportAssumptions": {
|
||||
"startYear": "2027",
|
||||
"openingFixedAssets": "0",
|
||||
"openingOtherAssets": "0",
|
||||
"openingEquity": "1000",
|
||||
"startupExpenses": [
|
||||
{
|
||||
"label": "Constituição",
|
||||
"amount": "100"
|
||||
}
|
||||
],
|
||||
"taxExpenseByMonth": [
|
||||
"30",
|
||||
"30",
|
||||
"30",
|
||||
"30"
|
||||
],
|
||||
"taxPaymentByMonth": [
|
||||
"20",
|
||||
"20",
|
||||
"20",
|
||||
"20"
|
||||
],
|
||||
"taxSource": "Hipótese sintética de teste; não é taxa legal",
|
||||
"grantsTreatment": "",
|
||||
"manualCollectionsKind": ""
|
||||
},
|
||||
"monthlyOperatingExpensesByPeriod": [
|
||||
"0",
|
||||
"0",
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
"useInventoryPurchaseSchedule": true,
|
||||
"inventoryPurchaseSchedule": [
|
||||
{
|
||||
"amount": "0",
|
||||
"leadMonths": 0
|
||||
},
|
||||
{
|
||||
"amount": "100000",
|
||||
"leadMonths": 0
|
||||
},
|
||||
{
|
||||
"amount": "0",
|
||||
"leadMonths": 0
|
||||
},
|
||||
{
|
||||
"amount": "0",
|
||||
"leadMonths": 0
|
||||
}
|
||||
],
|
||||
"supplierAdvances": {
|
||||
"regime": "PGC-PE",
|
||||
"purchases": true,
|
||||
"services": true,
|
||||
"operations": [
|
||||
{
|
||||
"kind": "purchases",
|
||||
"originId": "OP-1",
|
||||
"parcelId": "P-1",
|
||||
"supplier": "Fornecedor sintético",
|
||||
"amount": "100000",
|
||||
"recognitionDate": "2027-02-15",
|
||||
"invoiceDate": "2027-03-01",
|
||||
"ordinaryContract": true,
|
||||
"events": [
|
||||
{
|
||||
"id": "A",
|
||||
"kind": "advance",
|
||||
"date": "2027-01-10",
|
||||
"amount": "30000"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"kind": "apply",
|
||||
"date": "2027-03-01",
|
||||
"amount": "30000"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"kind": "settle",
|
||||
"date": "2027-04-01",
|
||||
"amount": "70000"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"inventoryPurchaseLeadMonths": 0,
|
||||
"useProductInventorySchedule": false,
|
||||
"useSupplierPaymentTerms": false,
|
||||
"monthlyVariableCostPaymentsByPeriod": null,
|
||||
"openingReceivablesCollectionMonth": null,
|
||||
"openingReceivablesInstallments": [],
|
||||
"openingPayablesInstallments": [],
|
||||
"salesRecoverySchedule": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
{
|
||||
"version": 21,
|
||||
"plan": {
|
||||
"currency": "MZN",
|
||||
"openingCash": "1000",
|
||||
"assetInvestment": "600",
|
||||
"equity": "600",
|
||||
"products": [
|
||||
{
|
||||
"label": "Sintético F20-B",
|
||||
"monthlyUnits": "0",
|
||||
"unitPrice": "0",
|
||||
"unitVariableCost": "0"
|
||||
}
|
||||
],
|
||||
"depreciationLifeMonths": 60,
|
||||
"periods": 4,
|
||||
"monthlyCollections": "0",
|
||||
"monthlyVariableCostPayments": "999",
|
||||
"monthlyInventoryPurchases": "400",
|
||||
"monthlyOperatingExpenses": "0",
|
||||
"monthlyOperatingPayments": "888",
|
||||
"monthlyPayrollExpense": "0",
|
||||
"monthlyPayrollPayments": "0",
|
||||
"inventory": "0",
|
||||
"receivables": "0",
|
||||
"payables": "0",
|
||||
"shareholderLoans": "0",
|
||||
"bankLoanProceeds": "0",
|
||||
"grants": "0",
|
||||
"assetDepreciation": "600",
|
||||
"monthlyInterestExpense": "0",
|
||||
"monthlyInterestPayment": "0",
|
||||
"monthlyPrincipalRepayment": "0",
|
||||
"salesCollectionLagMonths": 0,
|
||||
"salesCollectionPercent": "100",
|
||||
"openingReceivablesCollectionPercent": "0",
|
||||
"reportAssumptions": {
|
||||
"startYear": "2027",
|
||||
"openingFixedAssets": "0",
|
||||
"openingOtherAssets": "0",
|
||||
"openingEquity": "1000",
|
||||
"startupExpenses": [
|
||||
{
|
||||
"label": "Constituição",
|
||||
"amount": "100"
|
||||
}
|
||||
],
|
||||
"taxExpenseByMonth": [
|
||||
"30",
|
||||
"30",
|
||||
"30",
|
||||
"30"
|
||||
],
|
||||
"taxPaymentByMonth": [
|
||||
"20",
|
||||
"20",
|
||||
"20",
|
||||
"20"
|
||||
],
|
||||
"taxSource": "Hipótese sintética de teste; não é taxa legal",
|
||||
"grantsTreatment": "",
|
||||
"manualCollectionsKind": ""
|
||||
},
|
||||
"monthlyOperatingExpensesByPeriod": [
|
||||
"0",
|
||||
"12000",
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
"useInventoryPurchaseSchedule": true,
|
||||
"inventoryPurchaseSchedule": [
|
||||
{
|
||||
"amount": "0",
|
||||
"leadMonths": 0
|
||||
},
|
||||
{
|
||||
"amount": "0",
|
||||
"leadMonths": 0
|
||||
},
|
||||
{
|
||||
"amount": "0",
|
||||
"leadMonths": 0
|
||||
},
|
||||
{
|
||||
"amount": "0",
|
||||
"leadMonths": 0
|
||||
}
|
||||
],
|
||||
"supplierAdvances": {
|
||||
"regime": "PGC-PE",
|
||||
"purchases": true,
|
||||
"services": true,
|
||||
"operations": [
|
||||
{
|
||||
"kind": "services",
|
||||
"originId": "OP-1",
|
||||
"parcelId": "P-1",
|
||||
"supplier": "Fornecedor sintético",
|
||||
"amount": "12000",
|
||||
"recognitionDate": "2027-02-05",
|
||||
"invoiceDate": "2027-02-08",
|
||||
"ordinaryContract": true,
|
||||
"events": [
|
||||
{
|
||||
"id": "A",
|
||||
"kind": "advance",
|
||||
"date": "2027-01-10",
|
||||
"amount": "20000"
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"kind": "apply",
|
||||
"date": "2027-02-08",
|
||||
"amount": "12000"
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"kind": "refund",
|
||||
"date": "2027-03-01",
|
||||
"amount": "8000"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"inventoryPurchaseLeadMonths": 0,
|
||||
"useProductInventorySchedule": false,
|
||||
"useSupplierPaymentTerms": false,
|
||||
"monthlyVariableCostPaymentsByPeriod": null,
|
||||
"openingReceivablesCollectionMonth": null,
|
||||
"openingReceivablesInstallments": [],
|
||||
"openingPayablesInstallments": [],
|
||||
"salesRecoverySchedule": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"date": "2026-11-21",
|
||||
"status": "IMPLEMENTED_AND_DEMONSTRATED_IN_QA_PROPOSED_FOR_ACCEPTANCE",
|
||||
"scope": "F20-B supplier advances, PGC-PE only, owner authorised",
|
||||
"priorAcceptance": {
|
||||
"F20-A": "1f44a63c accepted in d1fcdcd9; not reopened"
|
||||
},
|
||||
"qa": {
|
||||
"url": "http://127.0.0.3:18724",
|
||||
"database": "main_reference_20261104_test",
|
||||
"databasePort": 55441,
|
||||
"syntheticDraft": "03530658-b40f-4804-ad9d-1c8476d68d70"
|
||||
},
|
||||
"newTests": 11,
|
||||
"focusedDeltaTests": {
|
||||
"passed": 15,
|
||||
"failed": 0,
|
||||
"includes": "11 F20-B tests and 4 financial/fiscal bridge tests"
|
||||
},
|
||||
"affectedContracts": {
|
||||
"passed": 58,
|
||||
"failed": 1,
|
||||
"knownFailure": "business-financial-plan monthly unit schedules: expectation /Quantidade/ no longer matches existing message Previsão de Vendas / Unidades; reproduced on untouched HEAD d1fcdcd9 (35/36 passing). Not caused by F20-B."
|
||||
},
|
||||
"limits": [
|
||||
"F20 global remains partial pending owner acceptance and overall coverage review",
|
||||
"F22 remains suspended",
|
||||
"no installation, publication, push, migrations or active data changes",
|
||||
"synthetic projections, not accounting postings or actual payments",
|
||||
"no automated VAT, FX differences, losses, penalties or special contracts",
|
||||
"no conversion of opening balances; inactive previous agendas retained",
|
||||
"snapshot 21 is opt-in; legacy snapshots unchanged",
|
||||
"120 operations, 60 events each, existing 60 KB snapshot cap",
|
||||
"mobile emulation, not a physical handset certification"
|
||||
],
|
||||
"hashes": {
|
||||
"desktop-editor.png": "9c5631868c7db9a958fdf6dcb3ec2cc81c21626688b762416b49435092e7d512",
|
||||
"f20-b-baseline-tests.log": "2861be26516ce3027cf2d95a1aa230795c4497a7b886a554b9762c1e0233c15b",
|
||||
"f20-b-build.log": "76ddd241b79aa5d7a8d069883db6c55ab8e3e2e33b2e89ce2098a4e3336f49bb",
|
||||
"f20-b-delta-tests.log": "ce4de249fdace049099fc55182ac4244b5f370953c1c271cb481d82b9e400df2",
|
||||
"f20-b-lint.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"f20-b-tests.log": "469c325c7ebf8dc1da71380ba8288c3008c433cd63a22f0fa4f960eeb3e2aace",
|
||||
"f20-b-types.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"functional-receipt.json": "053070f30cef41c669fccc1485d7f2ec4dc4eb3698c693bf57688fb8d7406dc9",
|
||||
"recovered-desktop.png": "b4e55b483e5a2a17f36fcbf6dbc502d522e74da032cd0bd4a342c65af7e549d4",
|
||||
"recovered-mobile.png": "1a14b7f0e72e9f02c7d2a7e0cf5396d44972d099d6a78009b77263bf5f8f0eec",
|
||||
"saved-active.json": "bb9fdb372d957386be05020134f62ddaa33aa2cd129837d680f8658f529244e4",
|
||||
"saved-refund.json": "956bddae3285f7f79af0ae3b5312e075eaf3a72be9166c7dde40916cb60a1ab8"
|
||||
},
|
||||
"checks": {
|
||||
"types": "passed",
|
||||
"lint": "passed",
|
||||
"build": "passed; optional fontaine and chunk/plugin timing warnings only",
|
||||
"matrixOriginalRowsChanged": [
|
||||
"F20"
|
||||
],
|
||||
"remaining87Rows": "preserved byte-for-byte at line content level",
|
||||
"F20-AEvidence": "unchanged",
|
||||
"functionalReceipt": "passed; no page errors; exact server snapshot recovery in both viewports"
|
||||
},
|
||||
"logCopies": "Versioned log copies normalise LF and trailing whitespace only; original stdout retained in outputs/. Results unchanged."
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { SupplierAdvancesEditor } from '@/components/supplier-advances';
|
||||
import CurrencySelect from '@/components/currency-select';
|
||||
import { useEffect, useId, useState } from 'react';
|
||||
import {
|
||||
@@ -950,6 +951,7 @@ export function SimulationBusinessPlan({
|
||||
<PlanEconomicClassification plan={plan} onChange={savePlan} />
|
||||
<FinancialPlanDetails plan={plan} onChange={savePlan} />
|
||||
<FinancialDayTerms plan={plan} onChange={savePlan} />
|
||||
<SupplierAdvancesEditor plan={plan} onChange={savePlan} />
|
||||
<StartupAssetRequirements
|
||||
plan={plan}
|
||||
onChange={savePlan}
|
||||
@@ -3070,9 +3072,10 @@ export function SimulationBusinessPlan({
|
||||
<output className="block rounded bg-amber-50 p-3 text-sm">
|
||||
Compras a fornecedores ainda por pagar no fim do
|
||||
horizonte: {result.supplierPaymentsOutstandingAtEnd}{' '}
|
||||
{currency}. Os pagamentos sao calculados pelas
|
||||
encomendas e prazos declarados; nao representam
|
||||
credito confirmado pelo fornecedor.
|
||||
{currency}.{' '}
|
||||
{plan.supplierAdvances?.purchases
|
||||
? 'Obrigação bruta das compras identificadas, após aplicações e liquidações. Os adiantamentos activos e o líquido por liquidar estão discriminados por operação acima.'
|
||||
: 'Os pagamentos são calculados pelas encomendas e prazos declarados; não representam crédito confirmado pelo fornecedor.'}
|
||||
</output>
|
||||
)}
|
||||
{result.conversion && (
|
||||
|
||||
@@ -0,0 +1,448 @@
|
||||
import {
|
||||
forecastBusinessPlan,
|
||||
type BusinessFinancialPlanInput,
|
||||
} from '@/lib/business-financial-plan';
|
||||
import {
|
||||
advanceLabels,
|
||||
advanceEventLabels,
|
||||
type SupplierAdvances,
|
||||
type SupplierAdvanceOperation,
|
||||
} from '@/lib/supplier-advances';
|
||||
|
||||
export function SupplierAdvancesEditor({
|
||||
plan,
|
||||
onChange,
|
||||
}: {
|
||||
plan: BusinessFinancialPlanInput;
|
||||
onChange: (plan: BusinessFinancialPlanInput) => void;
|
||||
}) {
|
||||
const c: SupplierAdvances = plan.supplierAdvances ?? {
|
||||
regime: '',
|
||||
purchases: false,
|
||||
services: false,
|
||||
operations: [],
|
||||
};
|
||||
const save = (next: SupplierAdvances) =>
|
||||
onChange({ ...plan, supplierAdvances: next });
|
||||
const update = (index: number, patch: Partial<SupplierAdvanceOperation>) =>
|
||||
save({
|
||||
...c,
|
||||
operations: c.operations.map((o, i) =>
|
||||
i === index ? { ...o, ...patch } : o,
|
||||
),
|
||||
});
|
||||
let result: ReturnType<typeof forecastBusinessPlan> | undefined;
|
||||
let diagnostic = '';
|
||||
try {
|
||||
result = forecastBusinessPlan(plan);
|
||||
} catch (e) {
|
||||
diagnostic =
|
||||
e instanceof Error ? e.message : 'Reveja os dados do plano.';
|
||||
}
|
||||
return (
|
||||
<details className="my-3 min-w-0 space-y-3 rounded border p-3">
|
||||
<summary className="font-semibold">
|
||||
Adiantamentos por operação — PGC-PE
|
||||
</summary>
|
||||
<p>
|
||||
Projecções de mercadorias e serviços adquiridos. O pagamento
|
||||
antecipado fica no activo; a aplicação exige reconhecimento e
|
||||
factura da mesma operação e parcela, sem nova saída de caixa. A
|
||||
devolução reduz o adiantamento e não constitui receita.
|
||||
</p>
|
||||
<p>
|
||||
A agenda seleccionada substitui integralmente os pagamentos
|
||||
manuais e os prazos em dias da categoria, conservados inactivos.
|
||||
Distribua o reconhecimento económico completo por operações,
|
||||
incluindo as sem adiantamento. Não converte saldos de abertura.
|
||||
Serviços: utilize apenas se todas as despesas operacionais forem
|
||||
serviços elegíveis.
|
||||
</p>
|
||||
<p>
|
||||
Sem IVA, diferenças cambiais, perdas ou penalizações
|
||||
automatizados; isso não pressupõe taxa zero. Novos activos,
|
||||
empréstimos e contratos com transferência de controlo ou
|
||||
obrigação incondicional antes da entrega estão fora deste
|
||||
incremento. Os movimentos são previsões, não pagamentos
|
||||
executados.
|
||||
</p>
|
||||
<label className="grid gap-1">
|
||||
Referencial dos adiantamentos
|
||||
<select
|
||||
className="w-full rounded border p-2"
|
||||
value={c.regime}
|
||||
onChange={(e) =>
|
||||
save({
|
||||
...c,
|
||||
regime: e.target
|
||||
.value as SupplierAdvances['regime'],
|
||||
})
|
||||
}
|
||||
>
|
||||
<option value="">
|
||||
Seleccione o regime aplicável ao plano
|
||||
</option>
|
||||
<option value="PGC-PE">PGC-PE</option>
|
||||
</select>
|
||||
</label>
|
||||
{(['purchases', 'services'] as const).map((kind) => (
|
||||
<fieldset
|
||||
key={kind}
|
||||
className="min-w-0 space-y-2 rounded border p-3"
|
||||
>
|
||||
<legend>{advanceLabels[kind]}</legend>
|
||||
<label className="grid gap-1">
|
||||
Agenda de {advanceLabels[kind]}
|
||||
<select
|
||||
className="w-full rounded border p-2"
|
||||
value={c[kind] ? 'operations' : 'previous'}
|
||||
onChange={(e) => {
|
||||
if (
|
||||
e.target.value === 'operations' &&
|
||||
!window.confirm(
|
||||
`Activar adiantamentos por operação para ${advanceLabels[kind]}? Esta agenda substitui todos os pagamentos da categoria; os anteriores ficam guardados e não serão somados.`,
|
||||
)
|
||||
)
|
||||
return;
|
||||
save({
|
||||
...c,
|
||||
[kind]: e.target.value === 'operations',
|
||||
});
|
||||
}}
|
||||
>
|
||||
<option value="previous">
|
||||
Agenda anterior preservada
|
||||
</option>
|
||||
<option value="operations">
|
||||
Operações e adiantamentos (adesão explícita)
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
{c.operations.map((o, i) =>
|
||||
o.kind !== kind ? null : (
|
||||
<div
|
||||
key={i}
|
||||
className="min-w-0 space-y-3 rounded border p-3"
|
||||
role="group"
|
||||
aria-label={`Operação ${i + 1} de ${advanceLabels[kind]}`}
|
||||
>
|
||||
<div className="grid min-w-0 gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{(
|
||||
[
|
||||
['Operação', 'originId'],
|
||||
['Parcela', 'parcelId'],
|
||||
['Fornecedor', 'supplier'],
|
||||
[
|
||||
'Valor reconhecido da operação/parcela',
|
||||
'amount',
|
||||
],
|
||||
[
|
||||
'Data de reconhecimento',
|
||||
'recognitionDate',
|
||||
],
|
||||
[
|
||||
'Data da factura correspondente',
|
||||
'invoiceDate',
|
||||
],
|
||||
] as const
|
||||
).map(([label, key]) => (
|
||||
<label
|
||||
key={key}
|
||||
className="grid min-w-0 gap-1"
|
||||
>
|
||||
{label}
|
||||
<input
|
||||
className="w-full min-w-0 rounded border p-2"
|
||||
type={
|
||||
key.endsWith('Date')
|
||||
? 'date'
|
||||
: 'text'
|
||||
}
|
||||
value={o[key]}
|
||||
onChange={(e) =>
|
||||
update(i, {
|
||||
[key]: e.target.value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
<p className="text-sm">
|
||||
Sem data confirmada, deixe-a em branco. Não
|
||||
se presume coincidência entre
|
||||
recepção/prestação e factura; a aplicação
|
||||
permanece impedida enquanto faltar um desses
|
||||
eventos. Reconhecimento fora do horizonte
|
||||
conserva o adiantamento no activo.
|
||||
</p>
|
||||
<label className="flex items-start gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={o.ordinaryContract}
|
||||
onChange={(e) =>
|
||||
update(i, {
|
||||
ordinaryContract:
|
||||
e.target.checked,
|
||||
})
|
||||
}
|
||||
/>
|
||||
Contrato ordinário: sem transferência de
|
||||
controlo nem obrigação incondicional de
|
||||
pagamento antes da entrega/prestação
|
||||
</label>
|
||||
{o.events.map((e, j) => (
|
||||
<div
|
||||
key={j}
|
||||
className="grid min-w-0 gap-2 rounded border p-2 sm:grid-cols-2"
|
||||
role="group"
|
||||
aria-label={`Movimento ${j + 1}`}
|
||||
>
|
||||
<label className="grid gap-1">
|
||||
Movimento
|
||||
<select
|
||||
className="w-full rounded border p-2"
|
||||
value={e.kind}
|
||||
onChange={(v) =>
|
||||
update(i, {
|
||||
events: o.events.map(
|
||||
(a, k) =>
|
||||
k === j
|
||||
? {
|
||||
...a,
|
||||
kind: v
|
||||
.target
|
||||
.value as typeof e.kind,
|
||||
}
|
||||
: a,
|
||||
),
|
||||
})
|
||||
}
|
||||
>
|
||||
{Object.entries(
|
||||
advanceEventLabels,
|
||||
).map(([value, label]) => (
|
||||
<option
|
||||
key={value}
|
||||
value={value}
|
||||
>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
{(
|
||||
[
|
||||
['Identificador', 'id'],
|
||||
['Data', 'date'],
|
||||
['Montante', 'amount'],
|
||||
] as const
|
||||
).map(([label, key]) => (
|
||||
<label
|
||||
key={key}
|
||||
className="grid min-w-0 gap-1"
|
||||
>
|
||||
{label}
|
||||
<input
|
||||
className="w-full min-w-0 rounded border p-2"
|
||||
type={
|
||||
key === 'date'
|
||||
? 'date'
|
||||
: 'text'
|
||||
}
|
||||
value={e[key]}
|
||||
onChange={(v) =>
|
||||
update(i, {
|
||||
events: o.events.map(
|
||||
(a, k) =>
|
||||
k === j
|
||||
? {
|
||||
...a,
|
||||
[key]: v
|
||||
.target
|
||||
.value,
|
||||
}
|
||||
: a,
|
||||
),
|
||||
})
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
))}
|
||||
<button
|
||||
type="button"
|
||||
className="rounded border px-3 py-2"
|
||||
onClick={() =>
|
||||
update(i, {
|
||||
events: o.events.filter(
|
||||
(_, k) => k !== j,
|
||||
),
|
||||
})
|
||||
}
|
||||
>
|
||||
Remover movimento {j + 1}
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
<p className="text-sm">
|
||||
Os movimentos são processados por data; no
|
||||
mesmo dia, na ordem apresentada. Aplicação e
|
||||
pagamento exigem a factura e o
|
||||
reconhecimento. O pagamento do remanescente
|
||||
não pode voltar a pagar o adiantamento
|
||||
associado.
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded border px-3 py-2"
|
||||
disabled={o.events.length >= 60}
|
||||
onClick={() =>
|
||||
update(i, {
|
||||
events: [
|
||||
...o.events,
|
||||
{
|
||||
id: '',
|
||||
kind: 'advance',
|
||||
date: '',
|
||||
amount: '',
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
>
|
||||
Adicionar movimento
|
||||
</button>{' '}
|
||||
<button
|
||||
type="button"
|
||||
className="rounded border px-3 py-2"
|
||||
onClick={() =>
|
||||
save({
|
||||
...c,
|
||||
operations: c.operations.filter(
|
||||
(_, k) => k !== i,
|
||||
),
|
||||
})
|
||||
}
|
||||
>
|
||||
Remover operação {i + 1}
|
||||
</button>
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
className="rounded border px-3 py-2"
|
||||
disabled={c.operations.length >= 120}
|
||||
onClick={() =>
|
||||
save({
|
||||
...c,
|
||||
operations: [
|
||||
...c.operations,
|
||||
{
|
||||
kind,
|
||||
originId: '',
|
||||
parcelId: '',
|
||||
supplier: '',
|
||||
amount: '',
|
||||
recognitionDate: '',
|
||||
invoiceDate: '',
|
||||
ordinaryContract: false,
|
||||
events: [],
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
>
|
||||
Adicionar operação de {advanceLabels[kind]}
|
||||
</button>
|
||||
</fieldset>
|
||||
))}
|
||||
{diagnostic && (c.purchases || c.services) && (
|
||||
<p role="alert">{diagnostic}</p>
|
||||
)}
|
||||
{result?.supplierAdvanceLedger && (
|
||||
<section
|
||||
aria-label="Saldos dos adiantamentos por operação"
|
||||
className="space-y-3"
|
||||
>
|
||||
<h4 className="font-semibold">
|
||||
Obrigação, adiantamento e líquido por liquidar
|
||||
</h4>
|
||||
{result.supplierAdvanceLedger.operations.map((o) => (
|
||||
<div
|
||||
key={JSON.stringify([
|
||||
o.kind,
|
||||
o.originId,
|
||||
o.parcelId,
|
||||
])}
|
||||
className="min-w-0 rounded border p-2"
|
||||
>
|
||||
<p className="font-medium">
|
||||
{o.originId}/{o.parcelId} — {o.supplier}
|
||||
</p>
|
||||
<p>
|
||||
Reconhecimento:{' '}
|
||||
{o.recognitionDate || 'por confirmar'}. Factura:{' '}
|
||||
{o.invoiceDate || 'por confirmar'}.{' '}
|
||||
{o.recognitionOutsideHorizon
|
||||
? 'Reconhecimento fora do horizonte ou por confirmar; saldo conservado.'
|
||||
: ''}
|
||||
</p>
|
||||
<div className="overflow-x-auto">
|
||||
<table
|
||||
aria-label={`Saldos de ${o.originId}/${o.parcelId}`}
|
||||
className="w-full text-sm"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
{[
|
||||
'Mês',
|
||||
'Obrigação bruta',
|
||||
'Adiantamento activo',
|
||||
'Líquido por liquidar',
|
||||
].map((h) => (
|
||||
<th
|
||||
key={h}
|
||||
className="p-2 text-left"
|
||||
>
|
||||
{h}
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{o.monthly.map((m) => (
|
||||
<tr key={m.month}>
|
||||
<td className="p-2">
|
||||
{m.month}
|
||||
</td>
|
||||
<td className="p-2">
|
||||
{m.obligation}
|
||||
</td>
|
||||
<td className="p-2">
|
||||
{m.advance}
|
||||
</td>
|
||||
<td className="p-2">
|
||||
{m.netDue}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{o.events.map((e) => (
|
||||
<p key={e.id}>
|
||||
{advanceEventLabels[e.kind]} — {e.date}:{' '}
|
||||
{e.amount} {plan.currency}.{' '}
|
||||
{e.outsideHorizon
|
||||
? 'Fora do horizonte, sem caixa neste plano.'
|
||||
: ''}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
</details>
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
import {
|
||||
advanceEventLabels,
|
||||
buildSupplierAdvances,
|
||||
isSupplierAdvances,
|
||||
type SupplierAdvances,
|
||||
} from './supplier-advances.ts';
|
||||
import {
|
||||
buildDayTermSchedule,
|
||||
isDayTerms,
|
||||
@@ -90,6 +96,7 @@ function validCurrency(value: string): boolean {
|
||||
export type BusinessFinancialPlanInput = {
|
||||
/** Explicit opt-in. Missing keeps all historical calculations unchanged. */
|
||||
dayTerms?: DayTerms;
|
||||
supplierAdvances?: SupplierAdvances;
|
||||
economicClassification?: {
|
||||
code: string;
|
||||
revision: string;
|
||||
@@ -210,24 +217,27 @@ export function serializeBusinessPlanSnapshot(
|
||||
): string {
|
||||
const snapshot = JSON.stringify({
|
||||
version:
|
||||
plan.dayTerms !== undefined
|
||||
? 20
|
||||
: plan.startupAssetRequirements
|
||||
? 19
|
||||
: [
|
||||
'applyAnnualGrowth',
|
||||
'creditTermDays',
|
||||
'dividendsByPeriod',
|
||||
'operatingExpenseLines',
|
||||
'fundingBreakdown',
|
||||
'reportSource',
|
||||
].some(
|
||||
(key) =>
|
||||
plan[key as keyof BusinessFinancialPlanInput] !==
|
||||
undefined,
|
||||
)
|
||||
? 18
|
||||
: 17,
|
||||
plan.supplierAdvances !== undefined
|
||||
? 21
|
||||
: plan.dayTerms !== undefined
|
||||
? 20
|
||||
: plan.startupAssetRequirements
|
||||
? 19
|
||||
: [
|
||||
'applyAnnualGrowth',
|
||||
'creditTermDays',
|
||||
'dividendsByPeriod',
|
||||
'operatingExpenseLines',
|
||||
'fundingBreakdown',
|
||||
'reportSource',
|
||||
].some(
|
||||
(key) =>
|
||||
plan[
|
||||
key as keyof BusinessFinancialPlanInput
|
||||
] !== undefined,
|
||||
)
|
||||
? 18
|
||||
: 17,
|
||||
plan: {
|
||||
...plan,
|
||||
...(plan.useSupplierPaymentTerms === true
|
||||
@@ -312,7 +322,8 @@ export function restoreBusinessPlanSnapshot(
|
||||
decoded.version !== 17 &&
|
||||
decoded.version !== 18 &&
|
||||
decoded.version !== 19 &&
|
||||
decoded.version !== 20) ||
|
||||
decoded.version !== 20 &&
|
||||
decoded.version !== 21) ||
|
||||
!decoded.plan ||
|
||||
typeof decoded.plan !== 'object'
|
||||
)
|
||||
@@ -320,7 +331,13 @@ export function restoreBusinessPlanSnapshot(
|
||||
const plan = decoded.plan as Record<string, unknown>;
|
||||
if (
|
||||
plan.dayTerms !== undefined &&
|
||||
(decoded.version !== 20 || !isDayTerms(plan.dayTerms))
|
||||
(![20, 21].includes(decoded.version) || !isDayTerms(plan.dayTerms))
|
||||
)
|
||||
return null;
|
||||
if (
|
||||
plan.supplierAdvances !== undefined &&
|
||||
(decoded.version !== 21 ||
|
||||
!isSupplierAdvances(plan.supplierAdvances))
|
||||
)
|
||||
return null;
|
||||
if (
|
||||
@@ -455,7 +472,9 @@ export function restoreBusinessPlanSnapshot(
|
||||
)
|
||||
return null;
|
||||
if (
|
||||
[12, 13, 14, 15, 16, 17, 20].includes(Number(decoded.version)) &&
|
||||
[12, 13, 14, 15, 16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
) &&
|
||||
(!Object.hasOwn(plan, 'inventoryPurchaseSchedule') ||
|
||||
!Object.hasOwn(plan, 'useInventoryPurchaseSchedule') ||
|
||||
typeof plan.useInventoryPurchaseSchedule !== 'boolean')
|
||||
@@ -466,7 +485,7 @@ export function restoreBusinessPlanSnapshot(
|
||||
plan.inventoryPurchaseSchedule !== null
|
||||
) {
|
||||
if (
|
||||
![12, 13, 14, 15, 16, 17, 20].includes(
|
||||
![12, 13, 14, 15, 16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
) ||
|
||||
!Array.isArray(plan.inventoryPurchaseSchedule) ||
|
||||
@@ -491,14 +510,14 @@ export function restoreBusinessPlanSnapshot(
|
||||
)
|
||||
return null;
|
||||
if (
|
||||
[13, 14, 15, 16, 17, 20].includes(Number(decoded.version)) &&
|
||||
[13, 14, 15, 16, 17, 20, 21].includes(Number(decoded.version)) &&
|
||||
!Object.hasOwn(plan, 'monthlyVariableCostPaymentsByPeriod')
|
||||
)
|
||||
return null;
|
||||
if (
|
||||
plan.monthlyVariableCostPaymentsByPeriod !== undefined &&
|
||||
plan.monthlyVariableCostPaymentsByPeriod !== null &&
|
||||
(![13, 14, 15, 16, 17, 20].includes(Number(decoded.version)) ||
|
||||
(![13, 14, 15, 16, 17, 20, 21].includes(Number(decoded.version)) ||
|
||||
!Array.isArray(plan.monthlyVariableCostPaymentsByPeriod) ||
|
||||
plan.monthlyVariableCostPaymentsByPeriod.length <
|
||||
Number(plan.periods) ||
|
||||
@@ -563,7 +582,7 @@ export function restoreBusinessPlanSnapshot(
|
||||
if (openingCollectionRate < 0n || openingCollectionRate > 100_000_000n)
|
||||
return null;
|
||||
if (
|
||||
[7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20].includes(
|
||||
[7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
)
|
||||
) {
|
||||
@@ -636,7 +655,7 @@ export function restoreBusinessPlanSnapshot(
|
||||
)
|
||||
return null;
|
||||
if (
|
||||
[8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20].includes(
|
||||
[8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
)
|
||||
) {
|
||||
@@ -675,7 +694,7 @@ export function restoreBusinessPlanSnapshot(
|
||||
const schedule = plan[field];
|
||||
if (
|
||||
schedule !== undefined &&
|
||||
(![11, 12, 13, 14, 15, 16, 17, 20].includes(
|
||||
(![11, 12, 13, 14, 15, 16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
) ||
|
||||
!Array.isArray(schedule) ||
|
||||
@@ -765,7 +784,7 @@ export function restoreBusinessPlanSnapshot(
|
||||
const costSchedule = productData.unitVariableCostByPeriod;
|
||||
const validMoneySchedule = (values: unknown) =>
|
||||
values === undefined ||
|
||||
([10, 11, 12, 13, 14, 15, 16, 17, 20].includes(
|
||||
([10, 11, 12, 13, 14, 15, 16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
) &&
|
||||
Array.isArray(values) &&
|
||||
@@ -774,7 +793,7 @@ export function restoreBusinessPlanSnapshot(
|
||||
values.every((value) => typeof value === 'string'));
|
||||
return (
|
||||
(schedule !== undefined &&
|
||||
(![9, 10, 11, 12, 13, 14, 15, 16, 17, 20].includes(
|
||||
(![9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
) ||
|
||||
!Array.isArray(schedule) ||
|
||||
@@ -813,7 +832,7 @@ export function restoreBusinessPlanSnapshot(
|
||||
entry.paymentLagMonths < 0 ||
|
||||
entry.paymentLagMonths > 12)) ||
|
||||
(entry.paymentInstallments !== undefined &&
|
||||
(![16, 17, 20].includes(
|
||||
(![16, 17, 20, 21].includes(
|
||||
Number(decoded.version),
|
||||
) ||
|
||||
!Array.isArray(
|
||||
@@ -933,7 +952,10 @@ export function restoreBusinessPlanSnapshot(
|
||||
? plan.monthlyVariableCostPaymentsByPeriod.map(String)
|
||||
: null,
|
||||
} as unknown as BusinessFinancialPlanInput;
|
||||
if (restored.dayTerms && !options.editable)
|
||||
if (
|
||||
(restored.dayTerms || restored.supplierAdvances) &&
|
||||
!options.editable
|
||||
)
|
||||
forecastBusinessPlan(restored);
|
||||
return restored;
|
||||
} catch {
|
||||
@@ -1466,40 +1488,70 @@ type ActiveDayTerms = ReturnType<typeof buildDayTermSchedule> & {
|
||||
|
||||
export function forecastBusinessPlan(input: BusinessFinancialPlanInput) {
|
||||
const config = input.dayTerms;
|
||||
const advances = input.supplierAdvances;
|
||||
if (config !== undefined && !isDayTerms(config))
|
||||
throw new Error('Prazos em dias: estrutura inválida.');
|
||||
if (!config || !(config.sales || config.purchases || config.services))
|
||||
return forecastBusinessPlanBase(input);
|
||||
// First pass obtains economic recognition from the unchanged calculator. The second
|
||||
// replaces only opted-in cash schedules. Neither pass mutates stored/manual inputs.
|
||||
if (advances !== undefined && !isSupplierAdvances(advances))
|
||||
throw new Error('Adiantamentos: estrutura inválida.');
|
||||
const useAdvances = advances && (advances.purchases || advances.services);
|
||||
// A category has exactly one cash agenda. Inactive day/manual inputs remain saved.
|
||||
const activeDays = config
|
||||
? {
|
||||
...config,
|
||||
purchases: config.purchases && !advances?.purchases,
|
||||
services: config.services && !advances?.services,
|
||||
}
|
||||
: undefined;
|
||||
const useDays =
|
||||
activeDays &&
|
||||
(activeDays.sales || activeDays.purchases || activeDays.services);
|
||||
if (!useDays && !useAdvances) return forecastBusinessPlanBase(input);
|
||||
const economic = forecastBusinessPlanBase(input);
|
||||
if (!input.reportAssumptions?.startYear?.trim())
|
||||
throw new Error(
|
||||
'Prazos em dias — Ano inicial: preencha o ano do relatório.',
|
||||
);
|
||||
const day = buildDayTermSchedule(
|
||||
config,
|
||||
Number(input.reportAssumptions.startYear),
|
||||
economic.rows.length,
|
||||
{
|
||||
sales: economic.rows.map((r) => cents(r.revenue, 'Vendas')),
|
||||
purchases: economic.rows.map((r) =>
|
||||
r.inventoryReceipts === null
|
||||
? null
|
||||
: cents(r.inventoryReceipts, 'Recepções'),
|
||||
),
|
||||
services: economic.rows.map((r) =>
|
||||
cents(r.operatingExpenses, 'Serviços reconhecidos'),
|
||||
),
|
||||
},
|
||||
cents,
|
||||
);
|
||||
return forecastBusinessPlanBase(input, { ...day, config });
|
||||
const year = Number(input.reportAssumptions?.startYear);
|
||||
const recognized = {
|
||||
sales: economic.rows.map((r) => cents(r.revenue, 'Vendas')),
|
||||
purchases: economic.rows.map((r) =>
|
||||
r.inventoryReceipts === null
|
||||
? null
|
||||
: cents(r.inventoryReceipts, 'Recepções'),
|
||||
),
|
||||
services: economic.rows.map((r) =>
|
||||
cents(r.operatingExpenses, 'Serviços reconhecidos'),
|
||||
),
|
||||
};
|
||||
const day = useDays
|
||||
? {
|
||||
...buildDayTermSchedule(
|
||||
activeDays,
|
||||
year,
|
||||
economic.rows.length,
|
||||
recognized,
|
||||
cents,
|
||||
),
|
||||
config: activeDays,
|
||||
}
|
||||
: undefined;
|
||||
const advance = useAdvances
|
||||
? {
|
||||
...buildSupplierAdvances(
|
||||
advances,
|
||||
year,
|
||||
economic.rows.length,
|
||||
recognized,
|
||||
cents,
|
||||
),
|
||||
config: advances,
|
||||
}
|
||||
: undefined;
|
||||
return forecastBusinessPlanBase(input, day, advance);
|
||||
}
|
||||
|
||||
function forecastBusinessPlanBase(
|
||||
input: BusinessFinancialPlanInput,
|
||||
day?: ActiveDayTerms,
|
||||
advance?: ReturnType<typeof buildSupplierAdvances> & {
|
||||
config: SupplierAdvances;
|
||||
},
|
||||
) {
|
||||
if (input.startupAssetRequirements) {
|
||||
const needs = calculateStartupAssetRequirements(input);
|
||||
@@ -2304,13 +2356,17 @@ function forecastBusinessPlanBase(
|
||||
const rows = [];
|
||||
|
||||
for (let month = 1; month <= periods; month++) {
|
||||
const periodVariableCostPayment = day?.config.purchases
|
||||
? day.schedules.purchases[month - 1]
|
||||
: variableCostPaymentsByPeriod[month - 1];
|
||||
const periodVariableCostPayment = advance?.config.purchases
|
||||
? advance.payments.purchases[month - 1]
|
||||
: day?.config.purchases
|
||||
? day.schedules.purchases[month - 1]
|
||||
: variableCostPaymentsByPeriod[month - 1];
|
||||
const periodOperatingExpense = operatingExpenseByPeriod[month - 1];
|
||||
const periodOperatingPayment = day?.config.services
|
||||
? day.schedules.services[month - 1]
|
||||
: operatingPaymentsByPeriod[month - 1];
|
||||
const periodOperatingPayment = advance?.config.services
|
||||
? advance.payments.services[month - 1]
|
||||
: day?.config.services
|
||||
? day.schedules.services[month - 1]
|
||||
: operatingPaymentsByPeriod[month - 1];
|
||||
const periodPayrollExpense = payrollExpenseByPeriod[month - 1];
|
||||
const periodPayrollPayment = payrollPaymentsByPeriod[month - 1];
|
||||
const revenue = revenueByPeriod[month - 1];
|
||||
@@ -2504,7 +2560,10 @@ function forecastBusinessPlanBase(
|
||||
const openingPayablesPayments =
|
||||
openingPayablesInstallmentSchedule.get(month) ?? 0n;
|
||||
openingPayablesBalance -= openingPayablesPayments;
|
||||
const allCollections = totalCollections + openingReceivablesCollections;
|
||||
const allCollections =
|
||||
totalCollections +
|
||||
openingReceivablesCollections +
|
||||
(advance?.refunds[month - 1] ?? 0n);
|
||||
const totalPayments =
|
||||
periodVariableCostPayment +
|
||||
periodOperatingPayment +
|
||||
@@ -2752,15 +2811,28 @@ function forecastBusinessPlanBase(
|
||||
? null
|
||||
: salesCollectionPercent,
|
||||
totalPayments: format(totalOperatingPayments),
|
||||
supplierPaymentsOutstandingAtEnd: day?.config.purchases
|
||||
supplierPaymentsOutstandingAtEnd: advance?.config.purchases
|
||||
? format(
|
||||
day.events
|
||||
.filter((e) => e.kind === 'purchases' && e.outsideHorizon)
|
||||
.reduce((sum, e) => sum + BigInt(e.amount), 0n),
|
||||
advance.operations
|
||||
.filter((o) => o.kind === 'purchases')
|
||||
.reduce(
|
||||
(sum, o) =>
|
||||
sum +
|
||||
cents(o.monthly.at(-1)!.obligation, 'Obrigação'),
|
||||
0n,
|
||||
),
|
||||
)
|
||||
: useSupplierPaymentTerms
|
||||
? format(supplierPaymentsOutstanding)
|
||||
: null,
|
||||
: day?.config.purchases
|
||||
? format(
|
||||
day.events
|
||||
.filter(
|
||||
(e) => e.kind === 'purchases' && e.outsideHorizon,
|
||||
)
|
||||
.reduce((sum, e) => sum + BigInt(e.amount), 0n),
|
||||
)
|
||||
: useSupplierPaymentTerms
|
||||
? format(supplierPaymentsOutstanding)
|
||||
: null,
|
||||
totalProfitBeforeTax: format(totalProfitBeforeTax),
|
||||
endingCash: format(cash),
|
||||
inventoryProjection,
|
||||
@@ -3032,6 +3104,15 @@ function forecastBusinessPlanBase(
|
||||
};
|
||||
return {
|
||||
...output,
|
||||
...(advance
|
||||
? {
|
||||
supplierAdvanceLedger: {
|
||||
regime: advance.config.regime,
|
||||
monthly: advance.monthly,
|
||||
operations: advance.operations,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
presentationCurrency,
|
||||
conversion,
|
||||
...(day
|
||||
@@ -3629,6 +3710,57 @@ export function exportBusinessPlanCsv(
|
||||
]),
|
||||
);
|
||||
}
|
||||
if (result.supplierAdvanceLedger) {
|
||||
rows.push(
|
||||
[],
|
||||
[
|
||||
'Adiantamentos por operação — PGC-PE; projecções sem IVA, câmbio, perdas ou penalizações',
|
||||
],
|
||||
[
|
||||
'Operação',
|
||||
'Parcela',
|
||||
'Fornecedor',
|
||||
'Reconhecimento',
|
||||
'Factura',
|
||||
'Mês',
|
||||
'Obrigação bruta',
|
||||
'Adiantamento activo',
|
||||
'Líquido por liquidar',
|
||||
],
|
||||
...result.supplierAdvanceLedger.operations.flatMap((o) =>
|
||||
o.monthly.map((m) => [
|
||||
o.originId,
|
||||
o.parcelId,
|
||||
o.supplier,
|
||||
o.recognitionDate || 'Por confirmar',
|
||||
o.invoiceDate || 'Por confirmar',
|
||||
m.month,
|
||||
m.obligation,
|
||||
m.advance,
|
||||
m.netDue,
|
||||
]),
|
||||
),
|
||||
[],
|
||||
[
|
||||
'Operação',
|
||||
'Parcela',
|
||||
'Movimento',
|
||||
'Data',
|
||||
'Montante',
|
||||
'Horizonte',
|
||||
],
|
||||
...result.supplierAdvanceLedger.operations.flatMap((o) =>
|
||||
o.events.map((e) => [
|
||||
o.originId,
|
||||
o.parcelId,
|
||||
advanceEventLabels[e.kind],
|
||||
e.date,
|
||||
e.amount,
|
||||
e.outsideHorizon ? 'Fora do horizonte' : 'No horizonte',
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
return `\uFEFF${rows
|
||||
.map((row) => row.map(csvCell).join(','))
|
||||
.join('\r\n')}`;
|
||||
|
||||
@@ -86,11 +86,16 @@ function assertForecastReconciles(forecast: Forecast): void {
|
||||
);
|
||||
previousOpeningReceivables = openingReceivablesBalance;
|
||||
totalOpeningReceivablesCollections += openingReceivablesCollections;
|
||||
const advanceRefund = cents(
|
||||
forecast.supplierAdvanceLedger?.monthly[row.month - 1].refunded ??
|
||||
'0',
|
||||
);
|
||||
const otherCollections =
|
||||
row.otherCollections === null
|
||||
? cents(String(row.cashCollections)) -
|
||||
salesCollections -
|
||||
openingReceivablesCollections
|
||||
openingReceivablesCollections -
|
||||
advanceRefund
|
||||
: cents(String(row.otherCollections));
|
||||
if (otherCollections < 0n)
|
||||
throw new Error(
|
||||
@@ -100,7 +105,10 @@ function assertForecastReconciles(forecast: Forecast): void {
|
||||
const collections = cents(String(row.cashCollections));
|
||||
if (
|
||||
collections !==
|
||||
salesCollections + openingReceivablesCollections + otherCollections
|
||||
salesCollections +
|
||||
openingReceivablesCollections +
|
||||
otherCollections +
|
||||
advanceRefund
|
||||
)
|
||||
throw new Error(
|
||||
'As cobranças mensais não reconciliam com as suas origens.',
|
||||
@@ -260,8 +268,20 @@ export function buildFinancialFiscalBridge(forecast: Forecast) {
|
||||
(row.salesCollections === null
|
||||
? 0n
|
||||
: cents(row.salesCollections)) -
|
||||
cents(row.openingReceivablesCollections),
|
||||
cents(row.openingReceivablesCollections) -
|
||||
cents(
|
||||
forecast.supplierAdvanceLedger?.monthly[
|
||||
row.month - 1
|
||||
].refunded ?? '0',
|
||||
),
|
||||
),
|
||||
...(forecast.supplierAdvanceLedger
|
||||
? {
|
||||
supplierAdvanceRefunds:
|
||||
forecast.supplierAdvanceLedger.monthly[row.month - 1]
|
||||
.refunded,
|
||||
}
|
||||
: {}),
|
||||
collections: row.cashCollections,
|
||||
collectionsTotal: row.cashCollections,
|
||||
salesReceivablesBalance: row.salesReceivablesClosing,
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
type BusinessFinancialPlanInput,
|
||||
} from './business-financial-plan.ts';
|
||||
import { calculateStartupAssetRequirements } from './startup-asset-requirements.ts';
|
||||
import { advanceEventLabels } from './supplier-advances.ts';
|
||||
|
||||
export type InvestmentReportTable = {
|
||||
id: string;
|
||||
@@ -518,7 +519,10 @@ export function buildIntegralFinancialTables(
|
||||
const opening = cash;
|
||||
cash += netCash;
|
||||
receivables +=
|
||||
cents(row.revenue) - cents(row.cashCollections) + otherIncome;
|
||||
cents(row.revenue) -
|
||||
cents(row.cashCollections) +
|
||||
otherIncome +
|
||||
cents(result.supplierAdvanceLedger?.monthly[i].refunded ?? '0');
|
||||
const purchases =
|
||||
row.inventoryReceipts === null
|
||||
? null
|
||||
@@ -538,6 +542,13 @@ export function buildIntegralFinancialTables(
|
||||
cents(row.payrollPayments) -
|
||||
cents(row.interestPayment) -
|
||||
cents(row.openingPayablesPayments);
|
||||
const advance = cents(
|
||||
result.supplierAdvanceLedger?.monthly[i].advance ?? '0',
|
||||
);
|
||||
obligations += cents(
|
||||
result.supplierAdvanceLedger?.monthly[i].refunded ?? '0',
|
||||
);
|
||||
const grossObligations = obligations + advance;
|
||||
taxDue += taxExpenses[i] - taxPayments[i];
|
||||
depreciation += cents(row.depreciation);
|
||||
principal += cents(row.principalRepayment);
|
||||
@@ -566,11 +577,12 @@ export function buildIntegralFinancialTables(
|
||||
fixed -
|
||||
depreciation +
|
||||
otherAssets +
|
||||
positive(-obligations) +
|
||||
positive(-grossObligations) +
|
||||
advance +
|
||||
positive(-taxDue);
|
||||
const liabilities =
|
||||
positive(-receivables) +
|
||||
positive(obligations) +
|
||||
positive(grossObligations) +
|
||||
positive(taxDue) +
|
||||
loans -
|
||||
principal +
|
||||
@@ -581,7 +593,8 @@ export function buildIntegralFinancialTables(
|
||||
opening,
|
||||
cash,
|
||||
receivables,
|
||||
obligations: obligationsKnown ? obligations : null,
|
||||
obligations: obligationsKnown ? grossObligations : null,
|
||||
advance,
|
||||
taxDue,
|
||||
profit,
|
||||
netCash,
|
||||
@@ -679,7 +692,12 @@ export function buildIntegralFinancialTables(
|
||||
for (const [key, label] of [
|
||||
['cash', 'Caixa líquida'],
|
||||
['receivables', 'Recebíveis líquidos'],
|
||||
['obligations', 'Obrigações operacionais líquidas'],
|
||||
[
|
||||
'obligations',
|
||||
result.supplierAdvanceLedger
|
||||
? 'Obrigações operacionais brutas'
|
||||
: 'Obrigações operacionais líquidas',
|
||||
],
|
||||
['taxDue', 'Saldo fiscal estimado'],
|
||||
['fixed', 'Activos fixos líquidos'],
|
||||
['loans', 'Empréstimos e suprimentos por reembolsar'],
|
||||
@@ -694,6 +712,43 @@ export function buildIntegralFinancialTables(
|
||||
label,
|
||||
ledger.map((row) => row[key]),
|
||||
);
|
||||
if (result.supplierAdvanceLedger) {
|
||||
stocks(
|
||||
'balance',
|
||||
'Adiantamentos identificados a fornecedores',
|
||||
ledger.map((row) => row.advance),
|
||||
);
|
||||
stocks(
|
||||
'balance',
|
||||
'Líquido por liquidar — operações identificadas',
|
||||
result.supplierAdvanceLedger.monthly.map((row) =>
|
||||
cents(row.netDue),
|
||||
),
|
||||
);
|
||||
for (const [key, label] of [
|
||||
['paid', 'Adiantamentos pagos'],
|
||||
['applied', 'Aplicações sem movimento de caixa'],
|
||||
['refunded', 'Devoluções de adiantamentos'],
|
||||
['settled', 'Remanescentes pagos'],
|
||||
] as const)
|
||||
flows(
|
||||
'cashflow',
|
||||
label + ' (discriminação)',
|
||||
result.supplierAdvanceLedger.monthly.map((row) =>
|
||||
cents(row[key]),
|
||||
),
|
||||
);
|
||||
table('balance').notes.push(
|
||||
'PGC-PE: adiantamentos identificados apresentados no activo, separados das obrigações brutas. Líquido por liquidar é calculado por operação/parcela, sem compensação entre operações. Devoluções não são receita; aplicações não movimentam caixa.',
|
||||
);
|
||||
table('cashflow').notes.push(
|
||||
'Adiantamentos, aplicações, devoluções e remanescentes são projecções discriminadas, já incluídas nos totais de caixa quando aplicável; não somar novamente. Sem automatização de IVA, câmbio, perdas, penalizações ou contratos especiais.',
|
||||
...result.supplierAdvanceLedger.operations.map(
|
||||
(o) =>
|
||||
`${o.originId}/${o.parcelId} — ${o.supplier}: reconhecimento ${o.recognitionDate || 'por confirmar'}; factura ${o.invoiceDate || 'por confirmar'}. ${o.events.map((e) => `${advanceEventLabels[e.kind]}: ${e.date}, ${e.amount} ${plan.currency}${e.outsideHorizon ? ' (fora do horizonte)' : ''}`).join('; ')}.`,
|
||||
),
|
||||
);
|
||||
}
|
||||
table('balance').rows.push([
|
||||
'Existências',
|
||||
...ledger.map((row) =>
|
||||
|
||||
@@ -0,0 +1,340 @@
|
||||
export type AdvanceKind = 'purchases' | 'services';
|
||||
export type AdvanceEventKind = 'advance' | 'apply' | 'refund' | 'settle';
|
||||
export type SupplierAdvanceOperation = {
|
||||
originId: string;
|
||||
parcelId: string;
|
||||
supplier: string;
|
||||
kind: AdvanceKind;
|
||||
amount: string;
|
||||
recognitionDate: string;
|
||||
invoiceDate: string;
|
||||
ordinaryContract: boolean;
|
||||
events: {
|
||||
id: string;
|
||||
kind: AdvanceEventKind;
|
||||
date: string;
|
||||
amount: string;
|
||||
}[];
|
||||
};
|
||||
export type SupplierAdvances = {
|
||||
regime: '' | 'PGC-PE';
|
||||
purchases: boolean;
|
||||
services: boolean;
|
||||
operations: SupplierAdvanceOperation[];
|
||||
};
|
||||
export const advanceLabels = {
|
||||
purchases: 'Mercadorias',
|
||||
services: 'Serviços adquiridos',
|
||||
};
|
||||
export const advanceEventLabels = {
|
||||
advance: 'Pagamento antecipado',
|
||||
apply: 'Aplicação do adiantamento',
|
||||
refund: 'Devolução do adiantamento',
|
||||
settle: 'Pagamento do remanescente',
|
||||
};
|
||||
const text = (v: unknown) => typeof v === 'string' && v.length <= 160;
|
||||
export function isSupplierAdvances(v: unknown): v is SupplierAdvances {
|
||||
if (!v || typeof v !== 'object') return false;
|
||||
const c = v as SupplierAdvances;
|
||||
return (
|
||||
['', 'PGC-PE'].includes(c.regime) &&
|
||||
typeof c.purchases === 'boolean' &&
|
||||
typeof c.services === 'boolean' &&
|
||||
Array.isArray(c.operations) &&
|
||||
c.operations.length <= 120 &&
|
||||
c.operations.every(
|
||||
(o) =>
|
||||
o &&
|
||||
['purchases', 'services'].includes(o.kind) &&
|
||||
typeof o.ordinaryContract === 'boolean' &&
|
||||
[
|
||||
'originId',
|
||||
'parcelId',
|
||||
'supplier',
|
||||
'amount',
|
||||
'recognitionDate',
|
||||
'invoiceDate',
|
||||
].every((k) => text(o[k as keyof SupplierAdvanceOperation])) &&
|
||||
Array.isArray(o.events) &&
|
||||
o.events.length <= 60 &&
|
||||
o.events.every(
|
||||
(e) =>
|
||||
e &&
|
||||
text(e.id) &&
|
||||
text(e.date) &&
|
||||
text(e.amount) &&
|
||||
Object.hasOwn(advanceEventLabels, e.kind),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function date(value: string): Date | null {
|
||||
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return null;
|
||||
const d = new Date(value + 'T00:00:00Z');
|
||||
return Number.isFinite(d.getTime()) &&
|
||||
d.toISOString().slice(0, 10) === value
|
||||
? d
|
||||
: null;
|
||||
}
|
||||
const money = (n: bigint) => `${n / 100n}.${String(n % 100n).padStart(2, '0')}`;
|
||||
|
||||
/** Projected events only. No accounting postings or actual payments are executed. */
|
||||
export function buildSupplierAdvances(
|
||||
config: SupplierAdvances,
|
||||
year: number,
|
||||
periods: number,
|
||||
recognized: Record<AdvanceKind, (bigint | null)[]>,
|
||||
parse: (value: string, label: string) => bigint,
|
||||
) {
|
||||
if (!isSupplierAdvances(config))
|
||||
throw Error('Adiantamentos: estrutura inválida.');
|
||||
if (config.regime !== 'PGC-PE')
|
||||
throw Error(
|
||||
'Adiantamentos: seleccione explicitamente PGC-PE. Outros regimes não estão automatizados.',
|
||||
);
|
||||
if (!Number.isSafeInteger(year) || year < 1900 || year > 9993)
|
||||
throw Error(
|
||||
'Adiantamentos: preencha o ano inicial do relatório entre 1900 e 9993.',
|
||||
);
|
||||
const index = (d: Date) =>
|
||||
(d.getUTCFullYear() - year) * 12 + d.getUTCMonth();
|
||||
const start = new Date(Date.UTC(year, 0, 1));
|
||||
const end = new Date(Date.UTC(year, periods, 1));
|
||||
const sums = {
|
||||
purchases: Array<bigint>(periods).fill(0n),
|
||||
services: Array<bigint>(periods).fill(0n),
|
||||
};
|
||||
const payments = {
|
||||
purchases: Array<bigint>(periods).fill(0n),
|
||||
services: Array<bigint>(periods).fill(0n),
|
||||
};
|
||||
const refunds = Array<bigint>(periods).fill(0n);
|
||||
const paid = Array<bigint>(periods).fill(0n);
|
||||
const applied = Array<bigint>(periods).fill(0n);
|
||||
const settled = Array<bigint>(periods).fill(0n);
|
||||
const balances = Array.from({ length: periods }, () => ({
|
||||
advance: 0n,
|
||||
obligation: 0n,
|
||||
netDue: 0n,
|
||||
}));
|
||||
const seen = new Set<string>();
|
||||
const origins = new Map<string, string>();
|
||||
const operations = config.operations
|
||||
.filter((o) => config[o.kind])
|
||||
.map((o) => {
|
||||
const label = `Adiantamentos — ${o.originId || 'operação por preencher'}/${o.parcelId || 'parcela por preencher'}`;
|
||||
const fail = (message: string): never => {
|
||||
throw Error(`${label}: ${message}`);
|
||||
};
|
||||
if (!o.originId.trim() || !o.parcelId.trim() || !o.supplier.trim())
|
||||
fail('identifique operação, parcela e fornecedor.');
|
||||
if (!o.ordinaryContract)
|
||||
fail(
|
||||
'confirme contrato ordinário; contratos especiais estão excluídos.',
|
||||
);
|
||||
const key = JSON.stringify([
|
||||
o.kind,
|
||||
o.originId.trim(),
|
||||
o.parcelId.trim(),
|
||||
]);
|
||||
if (seen.has(key)) fail('operação/parcela duplicada.');
|
||||
seen.add(key);
|
||||
const originKey = JSON.stringify([o.kind, o.originId.trim()]);
|
||||
const identity = JSON.stringify([
|
||||
o.supplier.trim(),
|
||||
o.recognitionDate,
|
||||
o.invoiceDate,
|
||||
]);
|
||||
if (origins.has(originKey) && origins.get(originKey) !== identity)
|
||||
fail(
|
||||
'parcelas da mesma operação devem conservar fornecedor, reconhecimento e factura.',
|
||||
);
|
||||
origins.set(originKey, identity);
|
||||
const amount = parse(o.amount, `${label} — valor da operação`);
|
||||
if (amount <= 0n)
|
||||
fail('indique um valor positivo para a operação.');
|
||||
const recognition = o.recognitionDate
|
||||
? date(o.recognitionDate)
|
||||
: null;
|
||||
const invoice = o.invoiceDate ? date(o.invoiceDate) : null;
|
||||
if (o.recognitionDate && !recognition)
|
||||
fail('data de reconhecimento inválida.');
|
||||
if (o.invoiceDate && !invoice) fail('data de factura inválida.');
|
||||
if (recognition && recognition < start)
|
||||
fail(
|
||||
'saldos anteriores não podem ser individualizados por inferência; use apenas operações novas do plano.',
|
||||
);
|
||||
if (recognition && index(recognition) < periods)
|
||||
sums[o.kind][index(recognition)] += amount;
|
||||
const ids = new Set<string>();
|
||||
const events = o.events
|
||||
.map((e, order) => {
|
||||
if (!e.id.trim() || ids.has(e.id.trim()))
|
||||
fail('identifique cada movimento sem duplicações.');
|
||||
ids.add(e.id.trim());
|
||||
const when = date(e.date);
|
||||
if (!when || when < start)
|
||||
fail(
|
||||
'data de movimento insuficiente, inválida ou anterior ao plano.',
|
||||
);
|
||||
const value = parse(
|
||||
e.amount,
|
||||
`${label} — ${advanceEventLabels[e.kind]}`,
|
||||
);
|
||||
if (value <= 0n)
|
||||
fail('os movimentos devem ter montantes positivos.');
|
||||
return { ...e, value, when: when!, order };
|
||||
})
|
||||
.sort(
|
||||
(a, b) =>
|
||||
a.when.getTime() - b.when.getTime() ||
|
||||
a.order - b.order,
|
||||
);
|
||||
let advance = 0n,
|
||||
obligation = 0n,
|
||||
isRecognized = false,
|
||||
eventIndex = 0;
|
||||
const audit: {
|
||||
id: string;
|
||||
kind: AdvanceEventKind;
|
||||
date: string;
|
||||
amount: string;
|
||||
outsideHorizon: boolean;
|
||||
advance: string;
|
||||
obligation: string;
|
||||
netDue: string;
|
||||
}[] = [];
|
||||
const process = (e: (typeof events)[number]) => {
|
||||
if (!isRecognized && recognition && recognition <= e.when) {
|
||||
obligation = amount;
|
||||
isRecognized = true;
|
||||
}
|
||||
const m = index(e.when);
|
||||
const inside = m >= 0 && m < periods;
|
||||
if (e.kind === 'advance') {
|
||||
if (isRecognized)
|
||||
fail(
|
||||
'pagamento após reconhecimento deve ser remanescente, não novo adiantamento.',
|
||||
);
|
||||
advance += e.value;
|
||||
if (inside) {
|
||||
payments[o.kind][m] += e.value;
|
||||
paid[m] += e.value;
|
||||
}
|
||||
} else if (e.kind === 'apply') {
|
||||
if (!isRecognized || !invoice || invoice > e.when)
|
||||
fail(
|
||||
'aplicação exige reconhecimento e factura correspondente, sem antecipar datas.',
|
||||
);
|
||||
if (e.value > advance || e.value > obligation)
|
||||
fail(
|
||||
'aplicação excede o saldo da mesma parcela ou a obrigação reconhecida.',
|
||||
);
|
||||
advance -= e.value;
|
||||
obligation -= e.value;
|
||||
if (inside) applied[m] += e.value;
|
||||
} else if (e.kind === 'refund') {
|
||||
if (e.value > advance)
|
||||
fail(
|
||||
'devolução excede o adiantamento não utilizado da mesma parcela.',
|
||||
);
|
||||
advance -= e.value;
|
||||
if (inside) refunds[m] += e.value;
|
||||
} else {
|
||||
const netDue =
|
||||
obligation > advance ? obligation - advance : 0n;
|
||||
if (!isRecognized || !invoice || invoice > e.when)
|
||||
fail(
|
||||
'pagamento do remanescente exige reconhecimento e factura.',
|
||||
);
|
||||
if (e.value > netDue)
|
||||
fail(
|
||||
'pagamento excede o líquido por liquidar; não volte a pagar o adiantamento associado.',
|
||||
);
|
||||
obligation -= e.value;
|
||||
if (inside) {
|
||||
payments[o.kind][m] += e.value;
|
||||
settled[m] += e.value;
|
||||
}
|
||||
}
|
||||
audit.push({
|
||||
id: e.id,
|
||||
kind: e.kind,
|
||||
date: e.date,
|
||||
amount: money(e.value),
|
||||
outsideHorizon: !inside,
|
||||
advance: money(advance),
|
||||
obligation: money(obligation),
|
||||
netDue: money(
|
||||
obligation > advance ? obligation - advance : 0n,
|
||||
),
|
||||
});
|
||||
};
|
||||
const monthly = [];
|
||||
for (let m = 0; m < periods; m++) {
|
||||
const boundary = new Date(Date.UTC(year, m + 1, 1));
|
||||
while (
|
||||
eventIndex < events.length &&
|
||||
events[eventIndex].when < boundary
|
||||
)
|
||||
process(events[eventIndex++]);
|
||||
if (!isRecognized && recognition && recognition < boundary) {
|
||||
obligation = amount;
|
||||
isRecognized = true;
|
||||
}
|
||||
const netDue = obligation > advance ? obligation - advance : 0n;
|
||||
balances[m].advance += advance;
|
||||
balances[m].obligation += obligation;
|
||||
balances[m].netDue += netDue;
|
||||
monthly.push({
|
||||
month: m + 1,
|
||||
advance: money(advance),
|
||||
obligation: money(obligation),
|
||||
netDue: money(netDue),
|
||||
recognized: isRecognized,
|
||||
});
|
||||
}
|
||||
// Validate future events as well; they never leak into the last month of cash.
|
||||
while (eventIndex < events.length) process(events[eventIndex++]);
|
||||
return {
|
||||
originId: o.originId,
|
||||
parcelId: o.parcelId,
|
||||
supplier: o.supplier,
|
||||
kind: o.kind,
|
||||
amount: money(amount),
|
||||
recognitionDate: o.recognitionDate,
|
||||
invoiceDate: o.invoiceDate,
|
||||
recognitionOutsideHorizon: !recognition || recognition >= end,
|
||||
monthly,
|
||||
events: audit,
|
||||
};
|
||||
});
|
||||
for (const kind of ['purchases', 'services'] as const) {
|
||||
if (!config[kind]) continue;
|
||||
for (let m = 0; m < periods; m++) {
|
||||
if (
|
||||
recognized[kind][m] === null ||
|
||||
sums[kind][m] !== recognized[kind][m]
|
||||
)
|
||||
throw Error(
|
||||
`Adiantamentos — ${advanceLabels[kind]}, mês ${m + 1}: distribua exactamente o reconhecimento económico por operações/parcelas, sem repetir valores nem converter dados desconhecidos em zero.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
return {
|
||||
payments,
|
||||
refunds,
|
||||
operations,
|
||||
monthly: balances.map((b, i) => ({
|
||||
month: i + 1,
|
||||
advance: money(b.advance),
|
||||
obligation: money(b.obligation),
|
||||
netDue: money(b.netDue),
|
||||
paid: money(paid[i]),
|
||||
applied: money(applied[i]),
|
||||
refunded: money(refunds[i]),
|
||||
settled: money(settled[i]),
|
||||
})),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import {financialReportFixture} from './integral-financial-plan.mjs';
|
||||
export function advanceFixture({kind='purchases',amount='100000',recognition='2027-02-15',invoice='2027-03-01',periods=4}={}) {
|
||||
const p=financialReportFixture(periods);
|
||||
p.products=[{label:'Sintético F20-B',monthlyUnits:'0',unitPrice:'0',unitVariableCost:'0'}];
|
||||
p.monthlyOperatingExpenses='0';p.monthlyOperatingExpensesByPeriod=Array(periods).fill('0');
|
||||
p.monthlyPayrollExpense=p.monthlyPayrollPayments=p.monthlyInterestExpense=p.monthlyInterestPayment=p.monthlyPrincipalRepayment='0';
|
||||
p.monthlyVariableCostPayments='999';p.monthlyOperatingPayments='888';
|
||||
p.useInventoryPurchaseSchedule=true;
|
||||
p.inventoryPurchaseSchedule=Array.from({length:periods},()=>({amount:'0',leadMonths:0}));
|
||||
if(recognition) {
|
||||
const m=(Number(recognition.slice(0,4))-2027)*12+Number(recognition.slice(5,7))-1;
|
||||
if(m<periods) {
|
||||
if(kind==='purchases')p.inventoryPurchaseSchedule[m].amount=amount;
|
||||
else p.monthlyOperatingExpensesByPeriod[m]=amount;
|
||||
}
|
||||
}
|
||||
// Both agendas explicitly selected; zero-recognition category has no operations.
|
||||
p.supplierAdvances={regime:'PGC-PE',purchases:true,services:true,operations:[{
|
||||
kind,originId:'OP-1',parcelId:'P-1',supplier:'Fornecedor sintético',amount,
|
||||
recognitionDate:recognition,invoiceDate:invoice,ordinaryContract:true,events:[],
|
||||
}]};
|
||||
return p;
|
||||
}
|
||||
export const event=(id,kind,date,amount)=>({id,kind,date,amount});
|
||||
@@ -0,0 +1,297 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
forecastBusinessPlan,
|
||||
serializeBusinessPlanSnapshot,
|
||||
restoreBusinessPlanSnapshot,
|
||||
exportBusinessPlanCsv,
|
||||
} from '../../resources/js/lib/business-financial-plan.ts';
|
||||
import { buildIntegralFinancialTables } from '../../resources/js/lib/integral-financial-report.ts';
|
||||
import { advanceFixture, event } from './fixtures/supplier-advances.mjs';
|
||||
import { buildFinancialFiscalBridge } from '../../resources/js/lib/financial-fiscal-bridge.ts';
|
||||
|
||||
test('F20-B refund reconciles in the editor fiscal bridge without becoming taxable revenue or other collections', () => {
|
||||
const p = advanceFixture({
|
||||
kind: 'services',
|
||||
amount: '12000',
|
||||
recognition: '2027-02-05',
|
||||
invoice: '2027-02-08',
|
||||
});
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2027-01-10', '20000'),
|
||||
event('B', 'apply', '2027-02-08', '12000'),
|
||||
event('C', 'refund', '2027-03-01', '8000'),
|
||||
];
|
||||
const bridge = buildFinancialFiscalBridge(forecastBusinessPlan(p));
|
||||
assert.equal(bridge.cashSchedule[2].supplierAdvanceRefunds, '8000.00');
|
||||
assert.equal(bridge.cashSchedule[2].otherCollections, '0.00');
|
||||
assert.equal(
|
||||
bridge.accountingLines.find((l) => l.code === 'revenue').total,
|
||||
'0.00',
|
||||
);
|
||||
});
|
||||
|
||||
test('F20-B accepts a prior documentary invoice without inferring an opening balance; horizon 60 retains future events', () => {
|
||||
const p = advanceFixture({
|
||||
recognition: '2031-12-20',
|
||||
invoice: '2026-12-01',
|
||||
periods: 60,
|
||||
});
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2027-01-01', '30000'),
|
||||
event('B', 'apply', '2031-12-20', '30000'),
|
||||
event('C', 'settle', '2032-01-01', '70000'),
|
||||
];
|
||||
const r = forecastBusinessPlan(p);
|
||||
assert.equal(r.supplierAdvanceLedger.monthly[0].advance, '30000.00');
|
||||
assert.equal(r.supplierAdvanceLedger.monthly[59].obligation, '70000.00');
|
||||
assert.equal(r.rows[59].variableCostPayments, '0.00');
|
||||
assert.equal(
|
||||
r.supplierAdvanceLedger.operations[0].events[2].outsideHorizon,
|
||||
true,
|
||||
);
|
||||
});
|
||||
const ledger = (p) => forecastBusinessPlan(p).supplierAdvanceLedger;
|
||||
function reconciled(p) {
|
||||
const tables = buildIntegralFinancialTables(p);
|
||||
assert.ok(
|
||||
tables.every((t) => t.issues.length === 0),
|
||||
JSON.stringify(tables.map((t) => [t.id, t.issues])),
|
||||
);
|
||||
const row = tables
|
||||
.find((t) => t.id === 'balance')
|
||||
.rows.find((r) => r[0] === 'Diferença do balanço');
|
||||
assert.ok(
|
||||
row.slice(1).every((v) => v === '0.00'),
|
||||
JSON.stringify(row),
|
||||
);
|
||||
return tables;
|
||||
}
|
||||
test('F20-B reception before invoice: gross obligation and asset separated, no second payment on application', () => {
|
||||
const p = advanceFixture();
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2027-01-10', '30000'),
|
||||
event('B', 'apply', '2027-03-01', '30000'),
|
||||
event('C', 'settle', '2027-04-01', '70000'),
|
||||
];
|
||||
const before = structuredClone(p),
|
||||
r = forecastBusinessPlan(p),
|
||||
l = r.supplierAdvanceLedger;
|
||||
assert.deepEqual(p, before);
|
||||
assert.deepEqual(
|
||||
l.monthly.map((m) => [m.obligation, m.advance, m.netDue]),
|
||||
[
|
||||
['0.00', '30000.00', '0.00'],
|
||||
['100000.00', '30000.00', '70000.00'],
|
||||
['70000.00', '0.00', '70000.00'],
|
||||
['0.00', '0.00', '0.00'],
|
||||
],
|
||||
);
|
||||
assert.deepEqual(
|
||||
r.rows.map((m) => m.variableCostPayments),
|
||||
['30000.00', '0.00', '0.00', '70000.00'],
|
||||
);
|
||||
assert.equal(r.totalPayments, '100000.00');
|
||||
const tables = reconciled(p),
|
||||
b = tables.find((t) => t.id === 'balance');
|
||||
assert.equal(
|
||||
b.rows.find((r) => r[0] === 'Obrigações operacionais brutas')[2],
|
||||
'100000.00',
|
||||
);
|
||||
assert.equal(
|
||||
b.rows.find(
|
||||
(r) => r[0] === 'Adiantamentos identificados a fornecedores',
|
||||
)[2],
|
||||
'30000.00',
|
||||
);
|
||||
assert.equal(exportBusinessPlanCsv(p).includes('OP-1'), true);
|
||||
});
|
||||
test('F20-B invoice before reception does not recognize goods or expenses early', () => {
|
||||
const p = advanceFixture({
|
||||
recognition: '2027-03-10',
|
||||
invoice: '2027-01-10',
|
||||
});
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2027-02-01', '30000'),
|
||||
event('B', 'apply', '2027-03-10', '30000'),
|
||||
event('C', 'settle', '2027-04-01', '70000'),
|
||||
];
|
||||
const r = forecastBusinessPlan(p);
|
||||
assert.deepEqual(
|
||||
r.rows.map((m) => m.inventoryReceipts),
|
||||
['0.00', '0.00', '100000.00', '0.00'],
|
||||
);
|
||||
assert.deepEqual(
|
||||
ledger(p).monthly.map((m) => m.obligation),
|
||||
['0.00', '0.00', '70000.00', '0.00'],
|
||||
);
|
||||
reconciled(p);
|
||||
});
|
||||
test('F20-B service partial use and refund: no new income or expenditure', () => {
|
||||
const p = advanceFixture({
|
||||
kind: 'services',
|
||||
amount: '12000',
|
||||
recognition: '2027-02-05',
|
||||
invoice: '2027-02-08',
|
||||
});
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2027-01-10', '20000'),
|
||||
event('B', 'apply', '2027-02-08', '12000'),
|
||||
event('C', 'refund', '2027-03-01', '8000'),
|
||||
];
|
||||
const r = forecastBusinessPlan(p);
|
||||
assert.deepEqual(
|
||||
ledger(p).monthly.map((m) => m.advance),
|
||||
['20000.00', '8000.00', '0.00', '0.00'],
|
||||
);
|
||||
assert.equal(r.rows[2].cashCollections, '8000.00');
|
||||
assert.equal(r.rows[2].revenue, '0.00');
|
||||
assert.equal(r.totalProfitBeforeTax, '-12040.00'); // accepted fixture depreciation: 10/month
|
||||
const tables = reconciled(p);
|
||||
assert.ok(
|
||||
tables
|
||||
.find((t) => t.id === 'profit-loss')
|
||||
.rows.find((r) => r[0] === 'Outras receitas de caixa declaradas')
|
||||
.slice(1)
|
||||
.every((v) => v === '0.00'),
|
||||
);
|
||||
assert.equal(
|
||||
tables
|
||||
.find((t) => t.id === 'balance')
|
||||
.rows.find((r) => r[0] === 'Recebíveis líquidos')[3],
|
||||
'0.00',
|
||||
);
|
||||
});
|
||||
test('F20-B different operations of same supplier never offset each other', () => {
|
||||
const p = advanceFixture({
|
||||
amount: '20000',
|
||||
recognition: '2027-03-01',
|
||||
invoice: '2027-03-01',
|
||||
});
|
||||
const a = p.supplierAdvances.operations[0];
|
||||
a.events = [event('A', 'advance', '2027-01-01', '20000')];
|
||||
p.supplierAdvances.operations.push({
|
||||
...structuredClone(a),
|
||||
originId: 'OP-2',
|
||||
amount: '12000',
|
||||
recognitionDate: '2027-02-01',
|
||||
invoiceDate: '2027-02-01',
|
||||
events: [],
|
||||
});
|
||||
p.inventoryPurchaseSchedule[1].amount = '12000';
|
||||
const l = ledger(p);
|
||||
assert.equal(l.monthly[1].advance, '20000.00');
|
||||
assert.equal(l.monthly[1].obligation, '12000.00');
|
||||
assert.equal(l.monthly[1].netDue, '12000.00');
|
||||
reconciled(p);
|
||||
p.supplierAdvances.operations[1].events = [
|
||||
event('B', 'apply', '2027-02-01', '12000'),
|
||||
];
|
||||
assert.throws(() => forecastBusinessPlan(p), /excede o saldo/);
|
||||
});
|
||||
test('F20-B application, refunds and remaining payments are bounded by same-parcel balances', () => {
|
||||
const p = advanceFixture(),
|
||||
o = p.supplierAdvances.operations[0];
|
||||
o.events = [
|
||||
event('A', 'advance', '2027-01-10', '30000'),
|
||||
event('B', 'apply', '2027-02-15', '30000'),
|
||||
];
|
||||
assert.throws(() => forecastBusinessPlan(p), /reconhecimento e factura/);
|
||||
o.events[1].date = '2027-03-01';
|
||||
o.events[1].amount = '30000.01';
|
||||
assert.throws(() => forecastBusinessPlan(p), /excede o saldo/);
|
||||
o.events[1] = event('B', 'refund', '2027-01-11', '30000.01');
|
||||
assert.throws(() => forecastBusinessPlan(p), /devolução excede/);
|
||||
o.events[1] = event('B', 'settle', '2027-03-01', '100000');
|
||||
assert.throws(() => forecastBusinessPlan(p), /líquido por liquidar/);
|
||||
o.events[1] = event('B', 'advance', '2027-03-01', '1');
|
||||
assert.throws(() => forecastBusinessPlan(p), /após reconhecimento/);
|
||||
});
|
||||
test('F20-B rejects special contracts, missing regime, invalid dates, duplicate parcels and inconsistent allocations', () => {
|
||||
const p = advanceFixture(),
|
||||
o = p.supplierAdvances.operations[0];
|
||||
o.ordinaryContract = false;
|
||||
assert.throws(() => forecastBusinessPlan(p), /contratos especiais/);
|
||||
o.ordinaryContract = true;
|
||||
p.supplierAdvances.regime = '';
|
||||
assert.throws(() => forecastBusinessPlan(p), /seleccione explicitamente/);
|
||||
p.supplierAdvances.regime = 'PGC-PE';
|
||||
o.recognitionDate = '2027-02-30';
|
||||
assert.throws(() => forecastBusinessPlan(p), /reconhecimento inválida/);
|
||||
o.recognitionDate = '2027-02-15';
|
||||
o.events = [event('A', 'advance', '', '1')];
|
||||
assert.throws(() => forecastBusinessPlan(p), /data de movimento/);
|
||||
o.events = [];
|
||||
p.supplierAdvances.operations.push(structuredClone(o));
|
||||
assert.throws(() => forecastBusinessPlan(p), /duplicada/);
|
||||
p.supplierAdvances.operations.pop();
|
||||
o.amount = '99999';
|
||||
assert.throws(
|
||||
() => forecastBusinessPlan(p),
|
||||
/exactamente o reconhecimento/,
|
||||
);
|
||||
});
|
||||
test('F20-B missing or future recognition preserves advances, no inferred opening allocation or last-month cash', () => {
|
||||
for (const recognition of ['', '2028-02-01']) {
|
||||
const p = advanceFixture({ recognition, invoice: '', periods: 1 });
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2027-01-01', '20000'),
|
||||
event('B', 'refund', '2027-02-01', '8000'),
|
||||
];
|
||||
assert.equal(ledger(p).monthly[0].advance, '20000.00');
|
||||
assert.equal(ledger(p).operations[0].events[1].outsideHorizon, true);
|
||||
assert.equal(forecastBusinessPlan(p).rows[0].cashCollections, '0.00');
|
||||
reconciled(p);
|
||||
}
|
||||
const p = advanceFixture();
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2026-12-31', '1'),
|
||||
];
|
||||
assert.throws(() => forecastBusinessPlan(p), /anterior ao plano/);
|
||||
});
|
||||
test('F20-B snapshot 21 round-trips inactive agendas, rejects foreign versions and invalid active ledgers', () => {
|
||||
const p = advanceFixture();
|
||||
p.supplierAdvances.operations[0].events = [
|
||||
event('A', 'advance', '2027-01-01', '30000'),
|
||||
];
|
||||
const s = serializeBusinessPlanSnapshot(p);
|
||||
assert.equal(JSON.parse(s).version, 21);
|
||||
const r = restoreBusinessPlanSnapshot(s);
|
||||
assert.ok(r);
|
||||
assert.equal(r.monthlyVariableCostPayments, '999');
|
||||
assert.deepEqual(r.supplierAdvances, p.supplierAdvances);
|
||||
assert.deepEqual(forecastBusinessPlan(r), forecastBusinessPlan(p));
|
||||
assert.equal(
|
||||
restoreBusinessPlanSnapshot(s.replace('"version":21', '"version":20')),
|
||||
null,
|
||||
);
|
||||
p.supplierAdvances.operations[0].events.push(
|
||||
event('A', 'refund', '2027-01-02', '1'),
|
||||
);
|
||||
assert.equal(
|
||||
restoreBusinessPlanSnapshot(serializeBusinessPlanSnapshot(p)),
|
||||
null,
|
||||
);
|
||||
assert.ok(
|
||||
restoreBusinessPlanSnapshot(serializeBusinessPlanSnapshot(p), {
|
||||
editable: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
test('F20-B inactive mode preserves every old value and F20-A can coexist only on unselected categories', () => {
|
||||
const p = advanceFixture(),
|
||||
legacy = { ...p, supplierAdvances: undefined };
|
||||
p.supplierAdvances.purchases = p.supplierAdvances.services = false;
|
||||
assert.deepEqual(forecastBusinessPlan(p), forecastBusinessPlan(legacy));
|
||||
p.supplierAdvances.purchases = true;
|
||||
p.dayTerms = {
|
||||
sales: true,
|
||||
purchases: true,
|
||||
services: false,
|
||||
operations: [],
|
||||
};
|
||||
assert.doesNotThrow(() => forecastBusinessPlan(p)); // inactive purchase day agenda isn't added or validated
|
||||
const l = ledger(p);
|
||||
assert.ok(l);
|
||||
assert.equal(forecastBusinessPlan(p).rows[0].variableCostPayments, '0.00');
|
||||
});
|
||||
Reference in New Issue
Block a user