feat: support public-payer treaty exemption and exact economic adjustments
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -27,6 +27,8 @@ export type InternationalTaxProof = AnnualPpc & {
|
||||
exerciseReference: string;
|
||||
};
|
||||
export type PtMzRoyaltyPreparation = {
|
||||
governmentPayer?: '' | 'state' | 'subdivision' | 'local';
|
||||
governmentPayerReference?: string;
|
||||
capitalDefinition?: '' | 'yes' | 'no';
|
||||
governmentInterestExemption?: '' | 'yes' | 'no';
|
||||
gross: string;
|
||||
@@ -244,6 +246,13 @@ export function validateInternational(c: InternationalCredits) {
|
||||
);
|
||||
},
|
||||
)) ||
|
||||
(p.treatyPreparation?.governmentPayer !== undefined &&
|
||||
!['', 'state', 'subdivision', 'local'].includes(
|
||||
p.treatyPreparation.governmentPayer,
|
||||
)) ||
|
||||
(p.treatyPreparation?.governmentPayerReference !== undefined &&
|
||||
typeof p.treatyPreparation.governmentPayerReference !==
|
||||
'string') ||
|
||||
!evidenceValid(p.previousUse) ||
|
||||
!Array.isArray(p.payments)
|
||||
)
|
||||
@@ -408,13 +417,25 @@ export function ptMzTreatyLimit(p: InternationalPosition) {
|
||||
throw Error(
|
||||
'Definição convencional de dividendos/juros por documentar.',
|
||||
);
|
||||
if (
|
||||
p.treatyMethod === 'ptMzInterest' &&
|
||||
q.governmentInterestExemption !== 'no'
|
||||
)
|
||||
throw Error(
|
||||
'Juros abrangidos ou por corresponder à isenção governamental11(3) exigem tratamento próprio; não presumir limite ordinário.',
|
||||
);
|
||||
let governmentExemption: {
|
||||
payer: 'state' | 'subdivision' | 'local';
|
||||
reference: string;
|
||||
} | null = null;
|
||||
if (p.treatyMethod === 'ptMzInterest') {
|
||||
if (q.governmentInterestExemption === 'yes') {
|
||||
if (!q.governmentPayer || !q.governmentPayerReference?.trim())
|
||||
throw Error(
|
||||
'Isenção11(3)a exige devedor documentado: Estado português, subdivisão política/administrativa ou autarquia; beneficiários/acordos11(3)b permanecem separados.',
|
||||
);
|
||||
governmentExemption = {
|
||||
payer: q.governmentPayer,
|
||||
reference: q.governmentPayerReference,
|
||||
};
|
||||
} else if (q.governmentInterestExemption !== 'no')
|
||||
throw Error(
|
||||
'Corresponda a aplicação ou não aplicação da isenção11(3); desconhecido não significa limite ordinário10%.',
|
||||
);
|
||||
}
|
||||
if (
|
||||
!validDate(q.from) ||
|
||||
!validDate(q.to) ||
|
||||
@@ -433,33 +454,44 @@ export function ptMzTreatyLimit(p: InternationalPosition) {
|
||||
'Rendimento bruto inferior à parcela líquida incluída; reconcilie custos/perdas e base.',
|
||||
);
|
||||
return {
|
||||
version:
|
||||
p.treatyMethod === 'ptMzRoyalty'
|
||||
? 'IRPC-PT-MZ-royalty-credit/1'
|
||||
: 'IRPC-PT-MZ-capital-credit/1',
|
||||
version: governmentExemption
|
||||
? 'IRPC-PT-MZ-government-interest/1'
|
||||
: p.treatyMethod === 'ptMzRoyalty'
|
||||
? 'IRPC-PT-MZ-royalty-credit/1'
|
||||
: 'IRPC-PT-MZ-capital-credit/1',
|
||||
...(p.treatyMethod !== 'ptMzRoyalty' ? { nature: p.treatyMethod } : {}),
|
||||
gross,
|
||||
rate: '10',
|
||||
limit: fraction(
|
||||
BigInt(gross.numerator),
|
||||
BigInt(gross.denominator) * 10n,
|
||||
),
|
||||
...(governmentExemption ? { governmentExemption } : {}),
|
||||
rate: governmentExemption ? '0' : '10',
|
||||
limit: governmentExemption
|
||||
? zero()
|
||||
: fraction(
|
||||
BigInt(gross.numerator),
|
||||
BigInt(gross.denominator) * 10n,
|
||||
),
|
||||
from: q.from,
|
||||
to: q.to,
|
||||
reference: q.reference,
|
||||
source:
|
||||
p.treatyMethod === 'ptMzRoyalty'
|
||||
? 'CDT PT–MZ, RAR36/1992 art12(2/4–6),PDF13–14 e23(3)a,PDF21; Protocolo RAR36/2009 arts1/7,PDF1–2; CIRPC65(2). Royalties ordinárias não digitais, sem EP/instalação fixa ligada nem excesso por relações especiais. Não confundir com retenção L5 paga por devedor moçambicano; sem isenção ou tax sparing presumidos.'
|
||||
: 'CDT PT–MZ, RAR36/1992 art23(3)a,PDF21; CIRPC65(2). ' +
|
||||
(p.treatyMethod === 'ptMzDividend'
|
||||
? 'Dividendos10(2–4),PDF10; taxa10% actualizada pelo Protocolo RAR36/2009 art6,PDF2; IRPC/art2 actualizado pelo art1.'
|
||||
: p.treatyMethod === 'ptMzInterest'
|
||||
? 'Juros11(2–7),PDF11–12, excluída a isenção11(3); IRPC/art2 actualizado pelo Protocolo RAR36/2009 art1.'
|
||||
: 'Royalties12(2/4–6),PDF13–14; definição actualizada pelo Protocolo RAR36/2009 art7,PDF2; IRPC/art2 actualizado pelo art1. Recorte ordinário não digital.') +
|
||||
(p.treatyMethod === 'ptMzDividend'
|
||||
? ' Sem EP/instalação fixa ligada.'
|
||||
: ' Sem EP/instalação fixa ligada ou excesso convencional por relações especiais.') +
|
||||
' Não confundir com retenção L5 de devedor moçambicano; sem isenção ou tax sparing presumidos.',
|
||||
reference: governmentExemption
|
||||
? q.reference +
|
||||
'; devedor ' +
|
||||
governmentExemption.payer +
|
||||
'; ' +
|
||||
governmentExemption.reference
|
||||
: q.reference,
|
||||
source: governmentExemption
|
||||
? 'CDT PT–MZ, RAR36/1992 art11(3)a,PDF11, e23(3)a,PDF21; CIRPC65(2). Devedor Estado português/subdivisão/autarquia documentado. Juros isentos no Estado da fonte; limite convencional zero, sem crédito ou reembolso do imposto indevidamente pago pelo portal. Art11(3)b e demais situações permanecem separados.'
|
||||
: p.treatyMethod === 'ptMzRoyalty'
|
||||
? 'CDT PT–MZ, RAR36/1992 art12(2/4–6),PDF13–14 e23(3)a,PDF21; Protocolo RAR36/2009 arts1/7,PDF1–2; CIRPC65(2). Royalties ordinárias não digitais, sem EP/instalação fixa ligada nem excesso por relações especiais. Não confundir com retenção L5 paga por devedor moçambicano; sem isenção ou tax sparing presumidos.'
|
||||
: 'CDT PT–MZ, RAR36/1992 art23(3)a,PDF21; CIRPC65(2). ' +
|
||||
(p.treatyMethod === 'ptMzDividend'
|
||||
? 'Dividendos10(2–4),PDF10; taxa10% actualizada pelo Protocolo RAR36/2009 art6,PDF2; IRPC/art2 actualizado pelo art1.'
|
||||
: p.treatyMethod === 'ptMzInterest'
|
||||
? 'Juros11(2–7),PDF11–12, excluída a isenção11(3); IRPC/art2 actualizado pelo Protocolo RAR36/2009 art1.'
|
||||
: 'Royalties12(2/4–6),PDF13–14; definição actualizada pelo Protocolo RAR36/2009 art7,PDF2; IRPC/art2 actualizado pelo art1. Recorte ordinário não digital.') +
|
||||
(p.treatyMethod === 'ptMzDividend'
|
||||
? ' Sem EP/instalação fixa ligada.'
|
||||
: ' Sem EP/instalação fixa ligada ou excesso convencional por relações especiais.') +
|
||||
' Não confundir com retenção L5 de devedor moçambicano; sem isenção ou tax sparing presumidos.',
|
||||
};
|
||||
}
|
||||
export function internationalPosition(
|
||||
|
||||
Reference in New Issue
Block a user