commit correcoes
This commit is contained in:
@@ -6,6 +6,22 @@ import {
|
||||
type FiscalFraction,
|
||||
} from './fiscal-rational.ts';
|
||||
|
||||
export type { AdvanceFiscalPeriod } from './irpc-advance-calendar.ts';
|
||||
import {
|
||||
advanceCalendar,
|
||||
type AdvanceFiscalPeriod,
|
||||
} from './irpc-advance-calendar.ts';
|
||||
export function ordinaryAdvancePeriodIssues(
|
||||
period: AdvanceFiscalPeriod | undefined,
|
||||
year: string,
|
||||
component: 'PPC' | 'PEC' | 'PPC/PEC' = 'PPC/PEC',
|
||||
subjectNuit?: string,
|
||||
): string[] {
|
||||
return advanceCalendar(period, year, subjectNuit).pending.map(
|
||||
(message) => component + ': ' + message,
|
||||
);
|
||||
}
|
||||
|
||||
export const ppcObligationVersion = 'IRPC-PPC-obligation/1';
|
||||
export const ppcObligationSource =
|
||||
'RIRPC, Decreto 9/2008, arts.27(1)(a) e28(1–3), BR16/I,16-04-2008,exemplar preservado SHA256 fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee: imposto liquidado no exercício anterior nos termos21(1), líquido das retenções na fonte;80%, dividido em três montantes iguais arredondados por excesso ao milhar de meticais. Maio,Julho,Setembro. Recorte2026,residente geral,actividade comercial/industrial/agrícola,ano civil e exercício anterior completo2025,MZN. Períodos especiais,anualização28(3),dispensas,juros e guias separados.';
|
||||
@@ -57,16 +73,20 @@ export function calculatePpcObligation(
|
||||
subjectNuit: string,
|
||||
year: string,
|
||||
assessment: string,
|
||||
period?: AdvanceFiscalPeriod,
|
||||
) {
|
||||
validatePpcObligation(p);
|
||||
const pending: string[] = [];
|
||||
const calendar = advanceCalendar(period, year, subjectNuit);
|
||||
const noncivilPreparation =
|
||||
calendar.candidate && period?.declaration?.mode === 'annual_non_civil';
|
||||
let base: FiscalFraction | null = null,
|
||||
annualBeforeRounding: FiscalFraction | null = null,
|
||||
instalment: FiscalFraction | null = null;
|
||||
if (
|
||||
p.scope !== 'ordinary_resident' ||
|
||||
assessment !== 'normal' ||
|
||||
p.previousFullCalendarYear !== 'yes' ||
|
||||
p.previousFullCalendarYear !== (noncivilPreparation ? 'no' : 'yes') ||
|
||||
year !== '2026' ||
|
||||
p.year !== year ||
|
||||
p.previousYear !== '2025' ||
|
||||
@@ -74,7 +94,9 @@ export function calculatePpcObligation(
|
||||
p.subjectNuit !== subjectNuit
|
||||
)
|
||||
pending.push(
|
||||
'PPC: confirmar titular,2026,residente geral com actividade comercial/industrial/agrícola e exercício civil completo2025. Outros períodos/regimes e anualização permanecem separados.',
|
||||
noncivilPreparation
|
||||
? 'PPC: confirmar titular2026 e período anterior anual não civil com termo2025;indique Não em ano civil completo e confronte a correspondência documentada.'
|
||||
: 'PPC: confirmar titular,2026,residente geral com actividade comercial/industrial/agrícola e exercício civil completo2025. Outros períodos/regimes e anualização permanecem separados.',
|
||||
);
|
||||
if (!p.assessmentReference.trim() || !p.withholdingReference.trim())
|
||||
pending.push(
|
||||
@@ -88,6 +110,17 @@ export function calculatePpcObligation(
|
||||
pending.push(
|
||||
'PPC: montantes anteriores em MZN desconhecidos ou inválidos; zero deve ser explícito.',
|
||||
);
|
||||
pending.push(
|
||||
...ordinaryAdvancePeriodIssues(period, year, 'PPC', subjectNuit),
|
||||
);
|
||||
if (
|
||||
calendar.mode === 'annual_non_civil' &&
|
||||
(!period?.ppcBasisKey ||
|
||||
period.declaration?.ppcBasisKey !== period.ppcBasisKey)
|
||||
)
|
||||
pending.push(
|
||||
'PPC: montantes ou fontes alterados;reconfira a sua correspondência com o período anterior,sem substituir os valores.',
|
||||
);
|
||||
if (!pending.length) {
|
||||
base = subtractFractions(
|
||||
decimalFraction(p.previousTax),
|
||||
@@ -109,7 +142,25 @@ export function calculatePpcObligation(
|
||||
}
|
||||
return {
|
||||
version: ppcObligationVersion,
|
||||
source: ppcObligationSource,
|
||||
source:
|
||||
calendar.mode === 'annual_non_civil'
|
||||
? ppcObligationSource
|
||||
.replace(
|
||||
'ano civil e exercício anterior completo2025',
|
||||
'períodos anuais completos não civis com termo2026/2025',
|
||||
)
|
||||
.replace(
|
||||
'Maio,Julho,Setembro',
|
||||
'5.º/7.º/9.º mês do período',
|
||||
)
|
||||
.replace(
|
||||
'Períodos especiais,',
|
||||
'Períodos curtos e outros regimes,',
|
||||
) +
|
||||
' ' +
|
||||
calendar.source
|
||||
: ppcObligationSource,
|
||||
nonCivil: calendar.mode === 'annual_non_civil',
|
||||
pending,
|
||||
base,
|
||||
annualBeforeRounding,
|
||||
@@ -121,7 +172,7 @@ export function calculatePpcObligation(
|
||||
)
|
||||
: null,
|
||||
schedule: instalment
|
||||
? ['2026-05', '2026-07', '2026-09'].map((month) => ({
|
||||
? calendar.ppcMonths.map((month) => ({
|
||||
month,
|
||||
amount: instalment,
|
||||
}))
|
||||
@@ -135,8 +186,9 @@ export function ppcObligationReport(
|
||||
subjectNuit: string,
|
||||
year: string,
|
||||
assessment: string,
|
||||
period?: AdvanceFiscalPeriod,
|
||||
): Array<[string, string, string, string]> {
|
||||
const m = calculatePpcObligation(p, subjectNuit, year, assessment),
|
||||
const m = calculatePpcObligation(p, subjectNuit, year, assessment, period),
|
||||
show = (v: FiscalFraction | null) =>
|
||||
v ? fractionPresentation(v).decimal + ' MZN' : 'Indeterminado';
|
||||
return [
|
||||
@@ -157,7 +209,7 @@ export function ppcObligationReport(
|
||||
m.schedule
|
||||
.map((s) => s.month + ': ' + show(s.amount))
|
||||
.join('; ') +
|
||||
'. Previsão de obrigação; não é pagamento nem dedução anual.',
|
||||
'. Estimativa fiscal para viabilidade; não é pagamento nem dedução anual.',
|
||||
p.assessmentReference +
|
||||
'; ' +
|
||||
p.withholdingReference +
|
||||
|
||||
Reference in New Issue
Block a user