Source code for aeat.domain.calculations.registry._applicability_payer_facts
"""Payer-fact predicates for modelo applicability rules.Each :class:`TaxpayerProfile` boolean answers one payer or trade fact used bythe modelo applicability rule table."""from__future__importannotationsfromenumimportStrEnumfrom...deadlines.taxpayer_modelimportTaxpayerProfile__all__=["PayerFact","payer_fact_holds"]
[docs]classPayerFact(StrEnum):"""A withholding-payer / trade fact a modelo's applicability needs."""PAYS_WITHHELD_INCOME="pays_withheld_income"PAYS_RENT_WITH_RETENCION="pays_rent_with_retencion"TRADES_INTRACOMMUNITY="trades_intracommunity"EXCEEDS_THIRD_PARTY_THRESHOLD="exceeds_third_party_threshold"BIENES_EXTRANJERO_ABOVE_THRESHOLD="bienes_extranjero_above_threshold"MONEDAS_VIRTUALES_EXTRANJERO_ABOVE_THRESHOLD="monedas_virtuales_extranjero_above_threshold"PAYS_CAPITAL_INCOME_WITH_RETENCION="pays_capital_income_with_retencion"IVA_GROUP_MEMBER="iva_group_member"IVA_GROUP_DOMINANT_ENTITY="iva_group_dominant_entity"OSS_ENROLLED="oss_enrolled"
[docs]defpayer_fact_holds(profile:TaxpayerProfile,fact:PayerFact)->bool:"""Return whether ``profile`` positively declares the payer ``fact``. The supplied :class:`TaxpayerProfile` provides the boolean field backing the requested :class:`PayerFact`. """matchfact:casePayerFact.PAYS_WITHHELD_INCOME:returnprofile.has_employeesorprofile.pays_professionals_with_retencioncasePayerFact.PAYS_RENT_WITH_RETENCION:returnprofile.pays_rent_with_retencioncasePayerFact.TRADES_INTRACOMMUNITY:returnprofile.does_intracomunitariocasePayerFact.EXCEEDS_THIRD_PARTY_THRESHOLD:returnprofile.third_party_transactions_above_347_thresholdcasePayerFact.BIENES_EXTRANJERO_ABOVE_THRESHOLD:returnprofile.bienes_extranjero_above_thresholdcasePayerFact.MONEDAS_VIRTUALES_EXTRANJERO_ABOVE_THRESHOLD:returnprofile.monedas_virtuales_extranjero_above_thresholdcasePayerFact.PAYS_CAPITAL_INCOME_WITH_RETENCION:returnprofile.pays_capital_income_with_retencioncasePayerFact.IVA_GROUP_MEMBER:returnprofile.iva.group_member_enrolledcasePayerFact.IVA_GROUP_DOMINANT_ENTITY:returnprofile.iva.group_dominant_entity_enrolledcasePayerFact.OSS_ENROLLED:returnprofile.iva.oss_enrolled