feat: qualify treaty interest under governmental financing agreements
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -27,6 +27,14 @@ export type InternationalTaxProof = AnnualPpc & {
|
||||
exerciseReference: string;
|
||||
};
|
||||
export type PtMzRoyaltyPreparation = {
|
||||
governmentBasis?: '' | 'payer' | 'agreement';
|
||||
institutionRecipient?: '' | 'yes' | 'no';
|
||||
financingGranted?: '' | 'yes' | 'no';
|
||||
bilateralAgreement?: '' | 'yes' | 'no';
|
||||
institutionReference?: string;
|
||||
financingReference?: string;
|
||||
agreementReference?: string;
|
||||
|
||||
governmentPayer?: '' | 'state' | 'subdivision' | 'local';
|
||||
governmentPayerReference?: string;
|
||||
capitalDefinition?: '' | 'yes' | 'no';
|
||||
@@ -253,6 +261,41 @@ export function validateInternational(c: InternationalCredits) {
|
||||
(p.treatyPreparation?.governmentPayerReference !== undefined &&
|
||||
typeof p.treatyPreparation.governmentPayerReference !==
|
||||
'string') ||
|
||||
(p.treatyPreparation?.governmentBasis !== undefined &&
|
||||
!['', 'payer', 'agreement'].includes(
|
||||
p.treatyPreparation.governmentBasis,
|
||||
)) ||
|
||||
(p.treatyPreparation &&
|
||||
[
|
||||
'institutionRecipient',
|
||||
'financingGranted',
|
||||
'bilateralAgreement',
|
||||
].some((k) => {
|
||||
const v = (
|
||||
p.treatyPreparation as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>
|
||||
)[k];
|
||||
return (
|
||||
v !== undefined &&
|
||||
(typeof v !== 'string' || !yesNo.includes(v))
|
||||
);
|
||||
})) ||
|
||||
(p.treatyPreparation &&
|
||||
[
|
||||
'institutionReference',
|
||||
'financingReference',
|
||||
'agreementReference',
|
||||
].some((k) => {
|
||||
const v = (
|
||||
p.treatyPreparation as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>
|
||||
)[k];
|
||||
return v !== undefined && typeof v !== 'string';
|
||||
})) ||
|
||||
!evidenceValid(p.previousUse) ||
|
||||
!Array.isArray(p.payments)
|
||||
)
|
||||
@@ -417,20 +460,53 @@ export function ptMzTreatyLimit(p: InternationalPosition) {
|
||||
throw Error(
|
||||
'Definição convencional de dividendos/juros por documentar.',
|
||||
);
|
||||
let governmentExemption: {
|
||||
payer: 'state' | 'subdivision' | 'local';
|
||||
reference: string;
|
||||
} | null = null;
|
||||
let governmentExemption:
|
||||
| { payer: 'state' | 'subdivision' | 'local'; reference: string }
|
||||
| {
|
||||
basis: 'agreement';
|
||||
recipient: 'institution';
|
||||
reference: string;
|
||||
financingReference: string;
|
||||
agreementReference: string;
|
||||
}
|
||||
| null = null;
|
||||
if (p.treatyMethod === 'ptMzInterest') {
|
||||
if (q.governmentInterestExemption === 'yes') {
|
||||
if (!q.governmentPayer || !q.governmentPayerReference?.trim())
|
||||
if (q.governmentBasis === 'agreement') {
|
||||
if (
|
||||
q.institutionRecipient !== 'yes' ||
|
||||
q.financingGranted !== 'yes' ||
|
||||
q.bilateralAgreement !== 'yes' ||
|
||||
!q.institutionReference?.trim() ||
|
||||
!q.financingReference?.trim() ||
|
||||
!q.agreementReference?.trim()
|
||||
)
|
||||
throw Error(
|
||||
'Art11(3)b: instituição/organismo beneficiário corrente, financiamento por ele concedido e acordo entre os governos PT–MZ exigem correspondência documental própria.',
|
||||
);
|
||||
governmentExemption = {
|
||||
basis: 'agreement',
|
||||
recipient: 'institution',
|
||||
reference: q.institutionReference,
|
||||
financingReference: q.financingReference,
|
||||
agreementReference: q.agreementReference,
|
||||
};
|
||||
} else if (
|
||||
q.governmentBasis === undefined ||
|
||||
q.governmentBasis === 'payer'
|
||||
) {
|
||||
if (!q.governmentPayer || !q.governmentPayerReference?.trim())
|
||||
throw Error(
|
||||
'Isenção11(3)a exige devedor Estado português/subdivisão/autarquia documentado; para11(3)b escolha e documente o fundamento próprio.',
|
||||
);
|
||||
governmentExemption = {
|
||||
payer: q.governmentPayer,
|
||||
reference: q.governmentPayerReference,
|
||||
};
|
||||
} else
|
||||
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.',
|
||||
'Escolha o fundamento da isenção; uma selecção limpa não reutiliza a decisão anterior.',
|
||||
);
|
||||
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%.',
|
||||
@@ -455,7 +531,9 @@ export function ptMzTreatyLimit(p: InternationalPosition) {
|
||||
);
|
||||
return {
|
||||
version: governmentExemption
|
||||
? 'IRPC-PT-MZ-government-interest/1'
|
||||
? 'basis' in governmentExemption
|
||||
? 'IRPC-PT-MZ-agreement-interest/1'
|
||||
: 'IRPC-PT-MZ-government-interest/1'
|
||||
: p.treatyMethod === 'ptMzRoyalty'
|
||||
? 'IRPC-PT-MZ-royalty-credit/1'
|
||||
: 'IRPC-PT-MZ-capital-credit/1',
|
||||
@@ -473,13 +551,22 @@ export function ptMzTreatyLimit(p: InternationalPosition) {
|
||||
to: q.to,
|
||||
reference: governmentExemption
|
||||
? q.reference +
|
||||
'; devedor ' +
|
||||
governmentExemption.payer +
|
||||
'; ' +
|
||||
governmentExemption.reference
|
||||
('payer' in governmentExemption
|
||||
? '; devedor ' +
|
||||
governmentExemption.payer +
|
||||
'; ' +
|
||||
governmentExemption.reference
|
||||
: '; instituição ' +
|
||||
governmentExemption.reference +
|
||||
'; financiamento ' +
|
||||
governmentExemption.financingReference +
|
||||
'; acordo PT–MZ ' +
|
||||
governmentExemption.agreementReference)
|
||||
: 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.'
|
||||
? 'basis' in governmentExemption
|
||||
? 'CDT PT–MZ, RAR36/1992 art11(3)b,PDF11, e23(3)a,PDF21; CIRPC65(2). Instituição/organismo beneficiário corrente, financiamento por ele concedido no âmbito de acordo entre governos PT–MZ documentados. Juros isentos na fonte, limite0; não gera crédito ou reembolso no portal de imposto pago em desconformidade. Outros beneficiários/regimes mantêm correspondência própria.'
|
||||
: '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). ' +
|
||||
|
||||
Reference in New Issue
Block a user