Created
March 3, 2024 17:35
-
-
Save denismerigoux/912e88be05ccf3209030043e1eee1d62 to your computer and use it in GitHub Desktop.
Calcul impôt revenu R généré par Catala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file has been generated by the Catala compiler, do not edit! | |
library(catalaRuntime) | |
# Enum cases: "Non" ("catala_unit"), "Oui" ("catala_money") | |
setClass( | |
"catala_enum_FraisReels", | |
representation(code = "character", value = "ANY") | |
) | |
# Enum cases: "PensionsRetraitesRentes" ("catala_unit"), "PensionEnCapital_7_5pct" ("catala_unit"), "PensionInvalidite" ("catala_unit"), "PensionEnCapitalPlansEpargneRetraite" ("catala_unit"), "PensionAlimentairePercue" ("catala_unit") | |
setClass( | |
"catala_enum_TypePensionRetraiteRente", | |
representation(code = "character", value = "ANY") | |
) | |
# Enum cases: "Deplafonne" ("catala_unit"), "PlafondStandardOuProratise" ("catala_money") | |
setClass( | |
"catala_enum_SelecteurPlafondAbattementPensionsRetraitesRentes79", | |
representation(code = "character", value = "ANY") | |
) | |
# Enum cases: "Article163_0_A" ("catala_unit"), "Article163_0_A_bis" ("catala_unit") | |
setClass( | |
"catala_enum_RegimeRevenuExceptionnelOuDiffere", | |
representation(code = "character", value = "ANY") | |
) | |
# Enum cases: "RevenuExceptionnel" ("catala_unit"), "RevenuDiffereEcheanceNormale" ("catala_integer") | |
setClass( | |
"catala_enum_EcheanceRevenuExceptionnelOuDiffere", | |
representation(code = "character", value = "ANY") | |
) | |
# Enum cases: "RenteViagereOnereuxMoins49Ans" ("catala_unit"), "RenteViagereOnereuxEntre50Et59Ans" ("catala_unit"), "RenteViagereOnereuxEntre60Et69Ans" ("catala_unit"), "RenteViagereOnereuxPlus70Ans" ("catala_unit") | |
setClass( | |
"catala_enum_CategorieRenteViagereOnereux", | |
representation(code = "character", value = "ANY") | |
) | |
# Enum cases: "Mariees" ("catala_unit"), "Pacsees" ("catala_unit"), "DivorceeSeparees" ("catala_unit"), "Celibataire" ("catala_unit"), "Veuve" ("catala_unit") | |
setClass( | |
"catala_enum_SituationFamiliale", | |
representation(code = "character", value = "ANY") | |
) | |
setClass( | |
"catala_struct_DeclarationBeneficesIndustrielsCommerciaux", | |
representation( | |
plus_values_nettes_court_terme_micro = "catala_money", | |
moins_values_nettes_court_terme_micro = "catala_money", | |
plus_values_nettes_long_terme_micro = "catala_money", | |
moins_values_nettes_long_terme_micro = "catala_money", | |
plus_values_nettes_long_terme_reel = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_BeneficesIndustrielsCommerciauxDeclarant", | |
representation( | |
prelevement_liberatoire_auto_entreprise = "catala_money", | |
prelevement_liberatoire_plus_values_long_terme = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_PlusMoinsValueCourtTermeBeneficesIndustrielsCommerciaux", | |
representation(revenu_brut_global = "catala_money") | |
) | |
setClass( | |
"catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciaux", | |
representation(prelevement_liberatoire = "catala_money") | |
) | |
setClass( | |
"catala_struct_DescriptionFoyerFiscal", | |
representation( | |
nombre_enfants_a_charge_mineurs_et_non_maries = "catala_integer", | |
nombre_enfants_a_charge_mineurs_et_non_maries_invalides = "catala_integer", | |
nombre_enfants_a_charge_residence_alternee = "catala_integer", | |
nombre_enfants_a_charge_residence_alternee_invalides = "catala_integer", | |
nombre_autres_personnes_invalides_vivant_sous_toit = "catala_integer", | |
nombre_enfants_majeurs_celibataires_sans_enfant = "catala_integer", | |
nombre_enfants_majeurs_maries_ou_charges_famille = "catala_decimal", | |
mariees = "logical", celibataire = "logical", | |
pacsees = "logical", divorcee_separees = "logical", | |
veuve = "logical", parent_isole = "logical", | |
celibataire_divorce_veuf_sans_enfant = "logical", | |
titulaire_carte_invalidite_CMI_invalidite_40_pourcent = "logical", | |
conjoint_titulaire_carte_invalidite_CMI_invalidite_40_pourcent = "logical", | |
pensionne_guerre_celibataire_veuf = "logical", | |
pensionne_guerre_marie_pacse = "logical", | |
pensionne_veuve_de_guerre = "logical" | |
) | |
) | |
setClass( | |
"catala_struct_NombreDeParts", | |
representation( | |
nombre_de_parts = "catala_decimal", | |
abattement = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_PensionRetraiteRente", | |
representation( | |
valeur_initiale = "catala_money", | |
type = "catala_enum_TypePensionRetraiteRente" | |
) | |
) | |
setClass( | |
"catala_struct_RenteViagereOnereux", | |
representation( | |
valeur = "catala_money", | |
categorie = "catala_enum_CategorieRenteViagereOnereux" | |
) | |
) | |
# Enum cases: "TraitementsSalaires" ("catala_unit"), "RenteViagereOnereux" ("catala_enum_CategorieRenteViagereOnereux"), "PensionsRetraitesRentes" ("catala_unit"), "MicroBeneficesNonCommerciaux" ("catala_unit") | |
setClass( | |
"catala_enum_CategorieRevenuExceptionnelOuDiffere", | |
representation(code = "character", value = "ANY") | |
) | |
setClass( | |
"catala_struct_RevenuQuotiente", | |
representation( | |
valeur_nette = "catala_money", deduction = "catala_money", | |
coefficient = "catala_integer", | |
categorie = "catala_enum_CategorieRevenuExceptionnelOuDiffere" | |
) | |
) | |
setClass( | |
"catala_struct_RevenuExceptionnelOuDiffere", | |
representation( | |
valeur = "catala_money", | |
regime = "catala_enum_RegimeRevenuExceptionnelOuDiffere", | |
echeance = "catala_enum_EcheanceRevenuExceptionnelOuDiffere", | |
categorie = "catala_enum_CategorieRevenuExceptionnelOuDiffere" | |
) | |
) | |
setClass( | |
"catala_struct_ImputationDeficitSurRevenusQuotientes", | |
representation( | |
revenus_quotientes_categoriels_imputes = "list" # array("list" # array("catala_struct_RevenuQuotiente")) | |
, deficit_categoriel_impute = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_CalculRevenuQuotiente", | |
representation(revenu_quotiente = "catala_struct_RevenuQuotiente") | |
) | |
setClass( | |
"catala_struct_BeneficesNonCommerciauxDeclarant", | |
representation( | |
abattement_forfaitaire_micro_professionnel = "catala_money", | |
revenus_quotientes_professionnels = "list" # array("catala_struct_RevenuQuotiente") | |
, | |
abattement_forfaitaire_micro_non_professionnel = "catala_money", | |
revenus_quotientes_non_professionnels = "list" # array("catala_struct_RevenuQuotiente") | |
, prelevement_liberatoire_auto_entreprise = "catala_money", | |
prelevement_liberatoire_plus_values_long_terme = "catala_money", | |
revenu_brut_global = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_TraitementsSalairesDeclarant", | |
representation( | |
abattement_pensions_retraites_rentes = "catala_money", | |
deduction_frais_professionnels_traitements_salaires = "catala_money", | |
exonerations_81_quater = "catala_money", | |
prelevement_liberatoire = "catala_money", | |
traitements_salaires_avec_deduction_frais_professionnels = "catala_money", | |
revenu_brut_declarant_hors_quotient = "catala_money", | |
revenus_quotientes = "list" # array("catala_struct_RevenuQuotiente") | |
) | |
) | |
setClass( | |
"catala_struct_DeclarationBeneficesNonCommerciaux", | |
representation( | |
revenus_imposables_micro = "catala_money", | |
plus_values_nettes_court_terme_micro = "catala_money", | |
moins_values_nettes_court_terme_micro = "catala_money", | |
plus_values_nettes_long_terme_micro = "catala_money", | |
moins_values_nettes_long_terme_micro = "catala_money", | |
plus_values_nettes_long_terme_reel = "catala_money", | |
revenus_exceptionnels_ou_differes = "list" # array("catala_struct_RevenuExceptionnelOuDiffere") | |
) | |
) | |
setClass( | |
"catala_struct_DeclarationTraitementsSalairesFoyerFiscal", | |
representation( | |
rentes_percues_49moins_ans = "catala_money", | |
rentes_percues_50_59ans = "catala_money", | |
rentes_percues_60_69ans = "catala_money", | |
rentes_percues_70plus_ans = "catala_money", | |
rentes_etrangeres_imputables_percues_49moins_ans = "catala_money", | |
rentes_etrangeres_imputables_percues_50_59ans = "catala_money", | |
rentes_etrangeres_imputables_percues_60_69ans = "catala_money", | |
rentes_etrangeres_imputables_percues_70plus_ans = "catala_money", | |
revenus_exceptionnels_ou_differes = "list" # array("catala_struct_RevenuExceptionnelOuDiffere") | |
, | |
acquisition_d_actions_gratuites_gain_imposable = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_DeclarationTraitementsSalaires", | |
representation( | |
revenu_assistants_maternels_familiaux = "catala_money", | |
revenus_associes_gerants = "catala_money", | |
droits_dauteurs_fonctionnaires_chercheurs = "catala_money", | |
heures_supplementaires_et_rtt_exonerees = "catala_money", | |
frais_reels = "catala_enum_FraisReels", | |
pensions_retraites_rentes = "catala_money", | |
pensions_retraites_en_capital_7_5pct = "catala_money", | |
pensions_en_capital_plans_epargne_retraite = "catala_money", | |
pensions_invalidite = "catala_money", | |
pensions_alimentaires_percues = "catala_money", | |
traitements_salaires = "catala_money", | |
pourboires_exoneres = "catala_money", | |
prime_partage_valeur_exoneree = "catala_money", | |
majoration_seuil_exoneration = "logical", | |
autres_revenus_imposables_chomage_preretraite = "catala_money", | |
rabais_excedentaire_options_sur_titres = "catala_money", | |
gains_de_levee_doptions = "catala_money", | |
salaires_imposables_agent_assurance = "catala_money", | |
indemnites_prejudice_moral_fraction_superieure_million = "catala_money", | |
gains_et_distributions_carried_interest = "catala_money", | |
gains_et_distributions_carried_interest_soumis_contribution_salariale = "catala_money", | |
revenus_exceptionnels_ou_differes = "list" # array("catala_struct_RevenuExceptionnelOuDiffere") | |
, salaires_etrangers_impot_impute = "catala_money", | |
pensions_etrangeres_impots_impute = "catala_money", | |
autre_salaires_imposables_source_etrangere = "catala_money", | |
autre_pensions_imposables_source_etrangere = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_TraitementsSalairesFoyerFiscal", | |
representation( | |
declarations_avec_resultats_traitements_salaires = "list" # array("catala_struct_TraitementsSalairesDeclarant") | |
, rentes_viageres_titre_onereux = "catala_money", | |
revenu_brut_global = "catala_money", | |
deficit_brut_global = "catala_money", | |
revenus_quotientes = "list" # array("catala_struct_RevenuQuotiente") | |
) | |
) | |
setClass( | |
"catala_struct_DeclarationAvecPlafondPensionRetraitesRentesCorrect", | |
representation( | |
revenus = "catala_struct_DeclarationTraitementsSalaires", | |
plafond_abattement_pensions_retraites_rentes = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_ResultatsLiquidationPlafondPensionRetraitesRentes", | |
representation( | |
abattement_pensions_retraites_rentes = "catala_money", | |
revenus = "catala_struct_DeclarationTraitementsSalaires" | |
) | |
) | |
# Enum cases: "PasDeDeclaration" ("catala_unit"), "Declaration" ("catala_struct_DeclarationTraitementsSalaires") | |
setClass( | |
"catala_enum_DeclarationTraitementsSalaires2", | |
representation(code = "character", value = "ANY") | |
) | |
setClass( | |
"catala_struct_TraitementsSalairesDeclarantIn", | |
representation( | |
revenus_in = "catala_struct_DeclarationTraitementsSalaires", | |
annee_revenu_in = "catala_integer", | |
selecteur_plafond_abattement_pensions_retraites_rentes_in = "catala_enum_SelecteurPlafondAbattementPensionsRetraitesRentes79" | |
) | |
) | |
setClass( | |
"catala_struct_TraitementsSalairesFoyerFiscalIn", | |
representation( | |
declarant1_in = "catala_struct_DeclarationTraitementsSalaires", | |
declarant2_in = "catala_enum_DeclarationTraitementsSalaires2", | |
declarations_personnes_a_charge_in = "list" # array("catala_struct_DeclarationTraitementsSalaires") | |
, annee_revenu_in = "catala_integer", | |
revenus_in = "catala_struct_DeclarationTraitementsSalairesFoyerFiscal" | |
) | |
) | |
setClass( | |
"catala_struct_BeneficesNonCommerciauxDeclarantIn", | |
representation( | |
revenus_professionnels_in = "catala_struct_DeclarationBeneficesNonCommerciaux", | |
revenus_non_professionnels_in = "catala_struct_DeclarationBeneficesNonCommerciaux", | |
recettes_prelevement_liberatoire_exonerees_cotisations_in = "catala_money", | |
annee_revenu_in = "catala_integer" | |
) | |
) | |
setClass( | |
"catala_struct_BeneficesIndustrielsCommerciauxDeclarantIn", | |
representation( | |
revenus_professionnels_in = "catala_struct_DeclarationBeneficesIndustrielsCommerciaux", | |
revenus_non_professionnels_in = "catala_struct_DeclarationBeneficesIndustrielsCommerciaux", | |
chiffre_affaires_prelevement_liberatoire_marchandises_exonere_cotisations_in = "catala_money", | |
chiffre_affaires_prelevement_liberatoire_services_exonere_cotisations_in = "catala_money", | |
annee_revenu_in = "catala_integer" | |
) | |
) | |
setClass( | |
"catala_struct_PlusMoinsValueCourtTermeBeneficesIndustrielsCommerciauxIn", | |
representation( | |
plus_values_nettes_in = "catala_money", | |
moins_values_nettes_in = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciauxIn", | |
representation( | |
plus_values_nettes_in = "catala_money", | |
moins_values_nettes_in = "catala_money" | |
) | |
) | |
setClass( | |
"catala_struct_CalculRevenuQuotienteIn", | |
representation( | |
revenu_in = "catala_struct_RevenuExceptionnelOuDiffere", | |
deduction_in = "catala_money", | |
annee_revenu_in = "catala_integer" | |
) | |
) | |
setClass( | |
"catala_struct_ImputationDeficitSurRevenusQuotientesIn", | |
representation( | |
solde_categoriel_a_imputer_in = "catala_money", | |
revenus_quotientes_categoriels_in = "list" # array("list" # array("catala_struct_RevenuQuotiente")) | |
) | |
) | |
setClass( | |
"catala_struct_NombreDePartsIn", | |
representation( | |
foyer_fiscal_in = "catala_struct_DescriptionFoyerFiscal", | |
annee_revenu_in = "catala_integer" | |
) | |
) | |
plus_moins_value_court_terme_benefices_industriels_commerciaux <- function( | |
plus_moins_value_court_terme_benefices_industriels_commerciaux_in # ("catala_struct_PlusMoinsValueCourtTermeBeneficesIndustrielsCommerciauxIn") | |
) { | |
plus_values_nettes <- plus_moins_value_court_terme_benefices_industriels_commerciaux_in@plus_values_nettes_in | |
moins_values_nettes <- plus_moins_value_court_terme_benefices_industriels_commerciaux_in@moins_values_nettes_in | |
revenu_brut_global <- (plus_values_nettes - moins_values_nettes) | |
return(new("catala_struct_PlusMoinsValueCourtTermeBeneficesIndustrielsCommerciaux", | |
revenu_brut_global = revenu_brut_global | |
)) | |
} | |
calcul_revenu_quotiente <- function( | |
calcul_revenu_quotiente_in # ("catala_struct_CalculRevenuQuotienteIn") | |
) { | |
revenu <- calcul_revenu_quotiente_in@revenu_in | |
deduction <- calcul_revenu_quotiente_in@deduction_in | |
annee_revenu <- calcul_revenu_quotiente_in@annee_revenu_in | |
tryCatch( | |
{ | |
temp_decalage_echeance_prise_en_compte <- function(dummy_var # ("catala_unit") | |
) { | |
return(catala_integer_from_numeric(1)) | |
} | |
temp_decalage_echeance_prise_en_compte_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_decalage_echeance_prise_en_compte_2 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_decalage_echeance_prise_en_compte_3 <- function(dummy_var # ("catala_unit") | |
) { | |
return(catala_integer_from_numeric(0)) | |
} | |
temp_decalage_echeance_prise_en_compte_4 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg <- revenu@regime | |
if (match_arg@code == "Article163_0_A") { | |
dummy_var <- match_arg@value | |
return(FALSE) | |
} else if (match_arg@code == "Article163_0_A_bis") { | |
dummy_var <- match_arg@value | |
return(TRUE) | |
} | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 472, start_column = 11, | |
end_line = 472, end_column = 44, | |
law_headings = c( | |
"Revenus quotientés", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_decalage_echeance_prise_en_compte_4, | |
temp_decalage_echeance_prise_en_compte_3 | |
)) | |
} | |
temp_decalage_echeance_prise_en_compte_5 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 472, start_column = 11, end_line = 472, end_column = 44, | |
law_headings = c( | |
"Revenus quotientés", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(temp_decalage_echeance_prise_en_compte_2), | |
temp_decalage_echeance_prise_en_compte_1, | |
temp_decalage_echeance_prise_en_compte | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 472, | |
start_column = 11, | |
end_line = 472, | |
end_column = 44, | |
law_headings = c( | |
"Revenus quotientés", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
decalage_echeance_prise_en_compte <- temp_decalage_echeance_prise_en_compte_5 | |
match_arg_1 <- revenu@echeance | |
if (match_arg_1@code == "RevenuExceptionnel") { | |
dummy_var <- match_arg_1@value | |
temp_revenu_quotiente <- catala_integer_from_numeric(4) | |
} else if (match_arg_1@code == "RevenuDiffereEcheanceNormale") { | |
annee_d_echeance_normale <- match_arg_1@value | |
temp_revenu_quotiente <- ((annee_revenu - annee_d_echeance_normale) + | |
decalage_echeance_prise_en_compte) | |
} | |
revenu_quotiente <- new("catala_struct_RevenuQuotiente", | |
valeur_nette = (revenu@valeur - deduction), deduction = deduction, | |
coefficient = temp_revenu_quotiente, categorie = revenu@categorie | |
) | |
return(new("catala_struct_CalculRevenuQuotiente", | |
revenu_quotiente = revenu_quotiente | |
)) | |
} | |
nombre_de_parts <- function( | |
nombre_de_parts_in # ("catala_struct_NombreDePartsIn") | |
) { | |
foyer_fiscal <- nombre_de_parts_in@foyer_fiscal_in | |
annee_revenu_1 <- nombre_de_parts_in@annee_revenu_in | |
if (!(!(foyer_fiscal@celibataire_divorce_veuf_sans_enfant && | |
!(foyer_fiscal@nombre_enfants_majeurs_maries_ou_charges_famille == | |
catala_decimal_from_fraction(0, 1))))) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 91, | |
start_column = 13, | |
end_line = 92, end_column = 74, | |
law_headings = c( | |
"Case AL", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
if (!(!(foyer_fiscal@celibataire_divorce_veuf_sans_enfant && | |
foyer_fiscal@parent_isole))) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 89, | |
start_column = 13, | |
end_line = 90, end_column = 31, | |
law_headings = c( | |
"Case AL", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
temp__ <- function( | |
case # ("logical") | |
) { | |
return((case == TRUE)) | |
} | |
if (!((catala_integer_from_numeric(1) == | |
catala_list_length(catala_list_filter(temp__, list( | |
foyer_fiscal@mariees, | |
foyer_fiscal@celibataire, foyer_fiscal@pacsees, | |
foyer_fiscal@divorcee_separees, | |
foyer_fiscal@veuve | |
)))))) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 24, | |
start_column = 5, | |
end_line = 31, end_column = 26, | |
law_headings = c( | |
"Cases AM/AD/AO/AC/AV", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
if (foyer_fiscal@mariees) { | |
temp_situation_familiale <- new("catala_enum_SituationFamiliale", | |
code = "Mariees", | |
value = new("catala_unit", v = 0) | |
) | |
} else { | |
if (foyer_fiscal@celibataire) { | |
temp_situation_familiale <- new("catala_enum_SituationFamiliale", | |
code = "Celibataire", | |
value = new("catala_unit", v = 0) | |
) | |
} else { | |
if (foyer_fiscal@pacsees) { | |
temp_situation_familiale <- new("catala_enum_SituationFamiliale", | |
code = "Pacsees", | |
value = new("catala_unit", v = 0) | |
) | |
} else { | |
if (foyer_fiscal@divorcee_separees) { | |
temp_situation_familiale <- new("catala_enum_SituationFamiliale", | |
code = "DivorceeSeparees", | |
value = new("catala_unit", v = 0) | |
) | |
} else { | |
temp_situation_familiale <- new("catala_enum_SituationFamiliale", | |
code = "Veuve", | |
value = new("catala_unit", v = 0) | |
) | |
} | |
} | |
} | |
} | |
situation_familiale <- temp_situation_familiale | |
nombre_enfants_a_charge_mineurs_et_non_maries_invalides <- (foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries_invalides + | |
foyer_fiscal@nombre_autres_personnes_invalides_vivant_sous_toit) | |
tryCatch( | |
{ | |
temp_abattement <- function(dummy_var # ("catala_unit") | |
) { | |
return((catala_money_from_cents(636800) * | |
foyer_fiscal@nombre_enfants_majeurs_maries_ou_charges_famille)) | |
} | |
temp_abattement_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 == catala_integer_from_numeric(2022))) | |
} | |
temp_abattement_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 565, | |
start_column = 12, | |
end_line = 565, end_column = 22, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), | |
temp_abattement_1, | |
temp_abattement | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 565, | |
start_column = 12, | |
end_line = 565, | |
end_column = 22, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
abattement <- temp_abattement_2 | |
if (foyer_fiscal@parent_isole) { | |
match_arg_2 <- situation_familiale | |
if (match_arg_2@code == "Mariees") { | |
dummy_var <- match_arg_2@value | |
temp___1 <- FALSE | |
} else if (match_arg_2@code == "Pacsees") { | |
dummy_var <- match_arg_2@value | |
temp___1 <- FALSE | |
} else if (match_arg_2@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_2@value | |
temp___1 <- TRUE | |
} else if (match_arg_2@code == "Celibataire") { | |
dummy_var <- match_arg_2@value | |
temp___1 <- TRUE | |
} else if (match_arg_2@code == "Veuve") { | |
dummy_var <- match_arg_2@value | |
temp___1 <- FALSE | |
} | |
} else { | |
temp___1 <- TRUE | |
} | |
if (!(temp___1)) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 151, | |
start_column = 14, | |
end_line = 156, | |
end_column = 15, | |
law_headings = c( | |
"Case BT", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
if (foyer_fiscal@pensionne_guerre_marie_pacse) { | |
match_arg_3 <- situation_familiale | |
if (match_arg_3@code == "Mariees") { | |
dummy_var <- match_arg_3@value | |
temp___2 <- TRUE | |
} else if (match_arg_3@code == "Pacsees") { | |
dummy_var <- match_arg_3@value | |
temp___2 <- TRUE | |
} else if (match_arg_3@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_3@value | |
temp___2 <- FALSE | |
} else if (match_arg_3@code == "Celibataire") { | |
dummy_var <- match_arg_3@value | |
temp___2 <- FALSE | |
} else if (match_arg_3@code == "Veuve") { | |
dummy_var <- match_arg_3@value | |
temp___2 <- FALSE | |
} | |
} else { | |
temp___2 <- TRUE | |
} | |
if (!(temp___2)) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 126, | |
start_column = 14, | |
end_line = 131, | |
end_column = 15, | |
law_headings = c( | |
"Case AS", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
if (foyer_fiscal@pensionne_guerre_celibataire_veuf) { | |
match_arg_4 <- situation_familiale | |
if (match_arg_4@code == "Mariees") { | |
dummy_var <- match_arg_4@value | |
temp___3 <- FALSE | |
} else if (match_arg_4@code == "Pacsees") { | |
dummy_var <- match_arg_4@value | |
temp___3 <- FALSE | |
} else if (match_arg_4@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_4@value | |
temp___3 <- TRUE | |
} else if (match_arg_4@code == "Celibataire") { | |
dummy_var <- match_arg_4@value | |
temp___3 <- TRUE | |
} else if (match_arg_4@code == "Veuve") { | |
dummy_var <- match_arg_4@value | |
temp___3 <- TRUE | |
} | |
} else { | |
temp___3 <- TRUE | |
} | |
if (!(temp___3)) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 110, | |
start_column = 14, | |
end_line = 116, | |
end_column = 15, | |
law_headings = c( | |
"Case AW", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
if (foyer_fiscal@celibataire_divorce_veuf_sans_enfant) { | |
match_arg_5 <- situation_familiale | |
if (match_arg_5@code == "Mariees") { | |
dummy_var <- match_arg_5@value | |
temp___4 <- FALSE | |
} else if (match_arg_5@code == "Pacsees") { | |
dummy_var <- match_arg_5@value | |
temp___4 <- FALSE | |
} else if (match_arg_5@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_5@value | |
temp___4 <- TRUE | |
} else if (match_arg_5@code == "Celibataire") { | |
dummy_var <- match_arg_5@value | |
temp___4 <- TRUE | |
} else if (match_arg_5@code == "Veuve") { | |
dummy_var <- match_arg_5@value | |
temp___4 <- TRUE | |
} | |
} else { | |
temp___4 <- TRUE | |
} | |
if (!(temp___4)) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 80, | |
start_column = 14, | |
end_line = 86, end_column = 15, | |
law_headings = c( | |
"Case AL", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
match_arg_6 <- situation_familiale | |
if (match_arg_6@code == "Mariees") { | |
dummy_var <- match_arg_6@value | |
temp___5 <- TRUE | |
} else if (match_arg_6@code == "Pacsees") { | |
dummy_var <- match_arg_6@value | |
temp___5 <- TRUE | |
} else if (match_arg_6@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_6@value | |
temp___5 <- FALSE | |
} else if (match_arg_6@code == "Celibataire") { | |
dummy_var <- match_arg_6@value | |
temp___5 <- FALSE | |
} else if (match_arg_6@code == "Veuve") { | |
dummy_var <- match_arg_6@value | |
temp___5 <- FALSE | |
} | |
if (!(!(foyer_fiscal@pensionne_veuve_de_guerre && | |
temp___5))) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 50, | |
start_column = 13, | |
end_line = 54, end_column = 29, | |
law_headings = c( | |
"Case AG", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
tryCatch( | |
{ | |
temp_nombre_de_parts_base_194 <- function(dummy_var # ("catala_unit") | |
) { | |
if ((foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries == | |
catala_integer_from_numeric(0))) { | |
match_arg_7 <- situation_familiale | |
if (match_arg_7@code == "Mariees") { | |
dummy_var <- match_arg_7@value | |
return(catala_decimal_from_fraction(2, 1)) | |
} else if (match_arg_7@code == "Pacsees") { | |
dummy_var <- match_arg_7@value | |
return(catala_decimal_from_fraction(2, 1)) | |
} else if (match_arg_7@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_7@value | |
return(catala_decimal_from_fraction(1, 1)) | |
} else if (match_arg_7@code == "Celibataire") { | |
dummy_var <- match_arg_7@value | |
return(catala_decimal_from_fraction(1, 1)) | |
} else if (match_arg_7@code == "Veuve") { | |
dummy_var <- match_arg_7@value | |
return(catala_decimal_from_fraction(1, 1)) | |
} | |
} else { | |
if ((foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries == | |
catala_integer_from_numeric(1))) { | |
match_arg_8 <- situation_familiale | |
if (match_arg_8@code == "Mariees") { | |
dummy_var <- match_arg_8@value | |
return(catala_decimal_from_fraction(5, 2)) | |
} else if (match_arg_8@code == "Pacsees") { | |
dummy_var <- match_arg_8@value | |
return(catala_decimal_from_fraction(5, 2)) | |
} else if (match_arg_8@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_8@value | |
return(catala_decimal_from_fraction(3, 2)) | |
} else if (match_arg_8@code == "Celibataire") { | |
dummy_var <- match_arg_8@value | |
return(catala_decimal_from_fraction(3, 2)) | |
} else if (match_arg_8@code == "Veuve") { | |
dummy_var <- match_arg_8@value | |
return(catala_decimal_from_fraction(5, 2)) | |
} | |
} else { | |
if ((foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries == | |
catala_integer_from_numeric(2))) { | |
match_arg_9 <- situation_familiale | |
if (match_arg_9@code == "Mariees") { | |
dummy_var <- match_arg_9@value | |
return(catala_decimal_from_fraction(3, 1)) | |
} else if (match_arg_9@code == "Pacsees") { | |
dummy_var <- match_arg_9@value | |
return(catala_decimal_from_fraction(3, 1)) | |
} else if (match_arg_9@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_9@value | |
return(catala_decimal_from_fraction(2, 1)) | |
} else if (match_arg_9@code == "Celibataire") { | |
dummy_var <- match_arg_9@value | |
return(catala_decimal_from_fraction(2, 1)) | |
} else if (match_arg_9@code == "Veuve") { | |
dummy_var <- match_arg_9@value | |
return(catala_decimal_from_fraction(3, 1)) | |
} | |
} else { | |
match_arg_10 <- situation_familiale | |
if (match_arg_10@code == "Mariees") { | |
dummy_var <- match_arg_10@value | |
return((catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries) + | |
catala_decimal_from_fraction(1, 1))) | |
} else if (match_arg_10@code == "Pacsees") { | |
dummy_var <- match_arg_10@value | |
return((catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries) + | |
catala_decimal_from_fraction(1, 1))) | |
} else if (match_arg_10@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_10@value | |
return(catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries)) | |
} else if (match_arg_10@code == "Celibataire") { | |
dummy_var <- match_arg_10@value | |
return(catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries)) | |
} else if (match_arg_10@code == "Veuve") { | |
dummy_var <- match_arg_10@value | |
return((catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries) + | |
catala_decimal_from_fraction(1, 1))) | |
} | |
} | |
} | |
} | |
} | |
temp_nombre_de_parts_base_194_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= catala_integer_from_numeric(2017))) | |
} | |
temp_nombre_de_parts_base_194_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 555, start_column = 10, end_line = 555, end_column = 18, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), temp_nombre_de_parts_base_194_1, | |
temp_nombre_de_parts_base_194 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 555, | |
start_column = 10, | |
end_line = 555, | |
end_column = 18, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_base_194 <- temp_nombre_de_parts_base_194_2 | |
tryCatch( | |
{ | |
temp_situation_195_1_applicable <- function(dummy_var # ("catala_unit") | |
) { | |
return(FALSE) | |
} | |
temp_situation_195_1_applicable_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_situation_195_1_applicable_2 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_situation_195_1_applicable_3 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_situation_195_1_applicable_4 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_situation_195_1_applicable_5 <- function(dummy_var # ("catala_unit") | |
) { | |
return(((annee_revenu_1 >= | |
catala_integer_from_numeric(2021)) && | |
foyer_fiscal@celibataire_divorce_veuf_sans_enfant)) | |
} | |
temp_situation_195_1_applicable_6 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_situation_195_1_applicable_7 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_situation_195_1_applicable_8 <- function(dummy_var # ("catala_unit") | |
) { | |
return(((annee_revenu_1 >= | |
catala_integer_from_numeric(2021)) && | |
foyer_fiscal@pensionne_veuve_de_guerre)) | |
} | |
temp_situation_195_1_applicable_9 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_situation_195_1_applicable_10 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_situation_195_1_applicable_11 <- function(dummy_var # ("catala_unit") | |
) { | |
return(((annee_revenu_1 >= | |
catala_integer_from_numeric(2021)) && | |
foyer_fiscal@titulaire_carte_invalidite_CMI_invalidite_40_pourcent)) | |
} | |
temp_situation_195_1_applicable_12 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_situation_195_1_applicable_13 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_situation_195_1_applicable_14 <- function(dummy_var # ("catala_unit") | |
) { | |
return(((annee_revenu_1 >= | |
catala_integer_from_numeric(2021)) && | |
foyer_fiscal@pensionne_guerre_celibataire_veuf)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, | |
start_column = 11, | |
end_line = 551, end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), | |
temp_situation_195_1_applicable_14, | |
temp_situation_195_1_applicable_13 | |
)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, | |
start_column = 11, | |
end_line = 551, end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(temp_situation_195_1_applicable_12), | |
temp_situation_195_1_applicable_11, | |
temp_situation_195_1_applicable_10 | |
)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, | |
start_column = 11, | |
end_line = 551, end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(temp_situation_195_1_applicable_9), | |
temp_situation_195_1_applicable_8, | |
temp_situation_195_1_applicable_7 | |
)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, | |
start_column = 11, | |
end_line = 551, end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(temp_situation_195_1_applicable_6), | |
temp_situation_195_1_applicable_5, | |
temp_situation_195_1_applicable_4 | |
)) | |
} | |
temp_situation_195_1_applicable_15 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_situation_195_1_applicable_16 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_situation_195_1_applicable_17 <- function(dummy_var # ("catala_unit") | |
) { | |
return(FALSE) | |
} | |
temp_situation_195_1_applicable_18 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg_11 <- situation_familiale | |
if (match_arg_11@code == "Mariees") { | |
dummy_var <- match_arg_11@value | |
temp_situation_195_1_applicable_19 <- TRUE | |
} else if (match_arg_11@code == "Pacsees") { | |
dummy_var <- match_arg_11@value | |
temp_situation_195_1_applicable_19 <- TRUE | |
} else if (match_arg_11@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_11@value | |
temp_situation_195_1_applicable_19 <- FALSE | |
} else if (match_arg_11@code == "Celibataire") { | |
dummy_var <- match_arg_11@value | |
temp_situation_195_1_applicable_19 <- FALSE | |
} else if (match_arg_11@code == "Veuve") { | |
dummy_var <- match_arg_11@value | |
temp_situation_195_1_applicable_19 <- FALSE | |
} | |
return(((annee_revenu_1 >= | |
catala_integer_from_numeric(2021)) && | |
(temp_situation_195_1_applicable_19 && | |
(foyer_fiscal@titulaire_carte_invalidite_CMI_invalidite_40_pourcent || | |
foyer_fiscal@conjoint_titulaire_carte_invalidite_CMI_invalidite_40_pourcent)))) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, | |
start_column = 11, | |
end_line = 551, end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), | |
temp_situation_195_1_applicable_18, | |
temp_situation_195_1_applicable_17 | |
)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, start_column = 11, | |
end_line = 551, end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(temp_situation_195_1_applicable_16), | |
temp_situation_195_1_applicable_15, | |
temp_situation_195_1_applicable_3 | |
)) | |
} | |
temp_situation_195_1_applicable_20 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, start_column = 11, end_line = 551, end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(temp_situation_195_1_applicable_2), | |
temp_situation_195_1_applicable_1, | |
temp_situation_195_1_applicable | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 551, | |
start_column = 11, | |
end_line = 551, | |
end_column = 37, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
situation_195_1_applicable <- temp_situation_195_1_applicable_20 | |
tryCatch( | |
{ | |
temp_nombre_de_parts_residence_alternee_194 <- function(dummy_var # ("catala_unit") | |
) { | |
if ((foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries == | |
catala_integer_from_numeric(0))) { | |
if ((foyer_fiscal@nombre_enfants_a_charge_residence_alternee <= | |
catala_integer_from_numeric(2))) { | |
temp_nombre_de_parts_residence_alternee_194_1 <- (catala_decimal_from_fraction(1, 4) * | |
catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_residence_alternee)) | |
} else { | |
temp_nombre_de_parts_residence_alternee_194_1 <- ((catala_decimal_from_fraction(2, 1) * | |
catala_decimal_from_fraction(1, 4)) + | |
(catala_decimal_from_fraction(1, 2) * | |
catala_decimal_from_integer((foyer_fiscal@nombre_enfants_a_charge_residence_alternee - | |
catala_integer_from_numeric(2))))) | |
} | |
} else { | |
if ((foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries == | |
catala_integer_from_numeric(1))) { | |
if ((foyer_fiscal@nombre_enfants_a_charge_residence_alternee <= | |
catala_integer_from_numeric(1))) { | |
temp_nombre_de_parts_residence_alternee_194_1 <- (catala_decimal_from_fraction(1, 4) * | |
catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_residence_alternee)) | |
} else { | |
temp_nombre_de_parts_residence_alternee_194_1 <- (catala_decimal_from_fraction(1, 4) + | |
(catala_decimal_from_fraction(1, 2) * | |
catala_decimal_from_integer((foyer_fiscal@nombre_enfants_a_charge_residence_alternee - | |
catala_integer_from_numeric(1))))) | |
} | |
} else { | |
temp_nombre_de_parts_residence_alternee_194_1 <- (catala_decimal_from_fraction(1, 2) * | |
catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_residence_alternee)) | |
} | |
} | |
return((nombre_de_parts_base_194 + | |
temp_nombre_de_parts_residence_alternee_194_1)) | |
} | |
temp_nombre_de_parts_residence_alternee_194_2 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= catala_integer_from_numeric(2017))) | |
} | |
temp_nombre_de_parts_residence_alternee_194_3 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 556, start_column = 10, end_line = 556, end_column = 32, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), | |
temp_nombre_de_parts_residence_alternee_194_2, | |
temp_nombre_de_parts_residence_alternee_194 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 556, | |
start_column = 10, | |
end_line = 556, | |
end_column = 32, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_residence_alternee_194 <- temp_nombre_de_parts_residence_alternee_194_3 | |
tryCatch( | |
{ | |
temp_nombre_de_parts_parent_isole_194 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_nombre_de_parts_parent_isole_194_1 <- function(dummy_var # ("catala_unit") | |
) { | |
if (foyer_fiscal@parent_isole) { | |
if ((foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries >= | |
catala_integer_from_numeric(1))) { | |
temp_nombre_de_parts_parent_isole_194_2 <- catala_decimal_from_fraction(1, 2) | |
} else { | |
if ((foyer_fiscal@nombre_enfants_a_charge_residence_alternee == | |
catala_integer_from_numeric(1))) { | |
temp_nombre_de_parts_parent_isole_194_2 <- catala_decimal_from_fraction(1, 4) | |
} else { | |
if ((foyer_fiscal@nombre_enfants_a_charge_residence_alternee >= | |
catala_integer_from_numeric(2))) { | |
temp_nombre_de_parts_parent_isole_194_2 <- catala_decimal_from_fraction(1, 2) | |
} else { | |
temp_nombre_de_parts_parent_isole_194_2 <- catala_decimal_from_fraction(0, 1) | |
} | |
} | |
} | |
} else { | |
temp_nombre_de_parts_parent_isole_194_2 <- catala_decimal_from_fraction(0, 1) | |
} | |
return((nombre_de_parts_residence_alternee_194 + | |
temp_nombre_de_parts_parent_isole_194_2)) | |
} | |
temp_nombre_de_parts_parent_isole_194_3 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= | |
catala_integer_from_numeric(2017))) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 557, start_column = 10, | |
end_line = 557, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), | |
temp_nombre_de_parts_parent_isole_194_3, | |
temp_nombre_de_parts_parent_isole_194_1 | |
)) | |
} | |
temp_nombre_de_parts_parent_isole_194_4 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_nombre_de_parts_parent_isole_194_5 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_nombre_de_parts_parent_isole_194_6 <- function(dummy_var # ("catala_unit") | |
) { | |
return(catala_decimal_from_fraction(3, 2)) | |
} | |
temp_nombre_de_parts_parent_isole_194_7 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg_12 <- situation_familiale | |
if (match_arg_12@code == "Mariees") { | |
dummy_var <- match_arg_12@value | |
temp_nombre_de_parts_parent_isole_194_8 <- FALSE | |
} else if (match_arg_12@code == "Pacsees") { | |
dummy_var <- match_arg_12@value | |
temp_nombre_de_parts_parent_isole_194_8 <- FALSE | |
} else if (match_arg_12@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_12@value | |
temp_nombre_de_parts_parent_isole_194_8 <- TRUE | |
} else if (match_arg_12@code == "Celibataire") { | |
dummy_var <- match_arg_12@value | |
temp_nombre_de_parts_parent_isole_194_8 <- TRUE | |
} else if (match_arg_12@code == "Veuve") { | |
dummy_var <- match_arg_12@value | |
temp_nombre_de_parts_parent_isole_194_8 <- TRUE | |
} | |
return(((annee_revenu_1 >= | |
catala_integer_from_numeric(2021)) && | |
(temp_nombre_de_parts_parent_isole_194_8 && | |
((foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries == | |
catala_integer_from_numeric(0)) && | |
((foyer_fiscal@nombre_enfants_a_charge_residence_alternee == | |
catala_integer_from_numeric(0)) && | |
situation_195_1_applicable))))) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 557, start_column = 10, | |
end_line = 557, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), | |
temp_nombre_de_parts_parent_isole_194_7, | |
temp_nombre_de_parts_parent_isole_194_6 | |
)) | |
} | |
temp_nombre_de_parts_parent_isole_194_9 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 557, start_column = 10, end_line = 557, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(temp_nombre_de_parts_parent_isole_194_5), | |
temp_nombre_de_parts_parent_isole_194_4, | |
temp_nombre_de_parts_parent_isole_194 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 557, | |
start_column = 10, | |
end_line = 557, | |
end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_parent_isole_194 <- temp_nombre_de_parts_parent_isole_194_9 | |
tryCatch( | |
{ | |
temp_nombre_de_parts_paragraphe_2_195 <- function(dummy_var # ("catala_unit") | |
) { | |
return(((nombre_de_parts_parent_isole_194 + | |
(catala_decimal_from_integer(nombre_enfants_a_charge_mineurs_et_non_maries_invalides) * | |
catala_decimal_from_fraction(1, 2))) + | |
(catala_decimal_from_integer(foyer_fiscal@nombre_enfants_a_charge_residence_alternee_invalides) * | |
catala_decimal_from_fraction(1, 4)))) | |
} | |
temp_nombre_de_parts_paragraphe_2_195_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= catala_integer_from_numeric(2021))) | |
} | |
temp_nombre_de_parts_paragraphe_2_195_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 558, start_column = 10, end_line = 558, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), temp_nombre_de_parts_paragraphe_2_195_1, | |
temp_nombre_de_parts_paragraphe_2_195 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 558, | |
start_column = 10, | |
end_line = 558, | |
end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_paragraphe_2_195 <- temp_nombre_de_parts_paragraphe_2_195_2 | |
tryCatch( | |
{ | |
temp_nombre_de_parts_paragraphe_3_195 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg_13 <- situation_familiale | |
if (match_arg_13@code == "Mariees") { | |
dummy_var <- match_arg_13@value | |
temp_nombre_de_parts_paragraphe_3_195_1 <- TRUE | |
} else if (match_arg_13@code == "Pacsees") { | |
dummy_var <- match_arg_13@value | |
temp_nombre_de_parts_paragraphe_3_195_1 <- TRUE | |
} else if (match_arg_13@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_13@value | |
temp_nombre_de_parts_paragraphe_3_195_1 <- FALSE | |
} else if (match_arg_13@code == "Celibataire") { | |
dummy_var <- match_arg_13@value | |
temp_nombre_de_parts_paragraphe_3_195_1 <- FALSE | |
} else if (match_arg_13@code == "Veuve") { | |
dummy_var <- match_arg_13@value | |
temp_nombre_de_parts_paragraphe_3_195_1 <- FALSE | |
} | |
if ((temp_nombre_de_parts_paragraphe_3_195_1 && | |
(foyer_fiscal@titulaire_carte_invalidite_CMI_invalidite_40_pourcent || | |
foyer_fiscal@conjoint_titulaire_carte_invalidite_CMI_invalidite_40_pourcent))) { | |
temp_nombre_de_parts_paragraphe_3_195_2 <- catala_decimal_from_fraction(1, 2) | |
} else { | |
temp_nombre_de_parts_paragraphe_3_195_2 <- catala_decimal_from_fraction(0, 1) | |
} | |
return((nombre_de_parts_paragraphe_2_195 + | |
temp_nombre_de_parts_paragraphe_3_195_2)) | |
} | |
temp_nombre_de_parts_paragraphe_3_195_3 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= catala_integer_from_numeric(2021))) | |
} | |
temp_nombre_de_parts_paragraphe_3_195_4 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 559, start_column = 10, end_line = 559, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), temp_nombre_de_parts_paragraphe_3_195_3, | |
temp_nombre_de_parts_paragraphe_3_195 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 559, | |
start_column = 10, | |
end_line = 559, | |
end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_paragraphe_3_195 <- temp_nombre_de_parts_paragraphe_3_195_4 | |
tryCatch( | |
{ | |
temp_nombre_de_parts_paragraphe_4_195 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg_14 <- situation_familiale | |
if (match_arg_14@code == "Mariees") { | |
dummy_var <- match_arg_14@value | |
temp_nombre_de_parts_paragraphe_4_195_1 <- TRUE | |
} else if (match_arg_14@code == "Pacsees") { | |
dummy_var <- match_arg_14@value | |
temp_nombre_de_parts_paragraphe_4_195_1 <- TRUE | |
} else if (match_arg_14@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_14@value | |
temp_nombre_de_parts_paragraphe_4_195_1 <- FALSE | |
} else if (match_arg_14@code == "Celibataire") { | |
dummy_var <- match_arg_14@value | |
temp_nombre_de_parts_paragraphe_4_195_1 <- FALSE | |
} else if (match_arg_14@code == "Veuve") { | |
dummy_var <- match_arg_14@value | |
temp_nombre_de_parts_paragraphe_4_195_1 <- FALSE | |
} | |
if ((temp_nombre_de_parts_paragraphe_4_195_1 && | |
(foyer_fiscal@titulaire_carte_invalidite_CMI_invalidite_40_pourcent && | |
foyer_fiscal@conjoint_titulaire_carte_invalidite_CMI_invalidite_40_pourcent))) { | |
temp_nombre_de_parts_paragraphe_4_195_2 <- catala_decimal_from_fraction(1, 2) | |
} else { | |
temp_nombre_de_parts_paragraphe_4_195_2 <- catala_decimal_from_fraction(0, 1) | |
} | |
return((nombre_de_parts_paragraphe_3_195 + | |
temp_nombre_de_parts_paragraphe_4_195_2)) | |
} | |
temp_nombre_de_parts_paragraphe_4_195_3 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= catala_integer_from_numeric(2021))) | |
} | |
temp_nombre_de_parts_paragraphe_4_195_4 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 560, start_column = 10, end_line = 560, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), temp_nombre_de_parts_paragraphe_4_195_3, | |
temp_nombre_de_parts_paragraphe_4_195 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 560, | |
start_column = 10, | |
end_line = 560, | |
end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_paragraphe_4_195 <- temp_nombre_de_parts_paragraphe_4_195_4 | |
tryCatch( | |
{ | |
temp_nombre_de_parts_paragraphe_5_195 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg_15 <- situation_familiale | |
if (match_arg_15@code == "Mariees") { | |
dummy_var <- match_arg_15@value | |
temp_nombre_de_parts_paragraphe_5_195_1 <- FALSE | |
} else if (match_arg_15@code == "Pacsees") { | |
dummy_var <- match_arg_15@value | |
temp_nombre_de_parts_paragraphe_5_195_1 <- FALSE | |
} else if (match_arg_15@code == "DivorceeSeparees") { | |
dummy_var <- match_arg_15@value | |
temp_nombre_de_parts_paragraphe_5_195_1 <- TRUE | |
} else if (match_arg_15@code == "Celibataire") { | |
dummy_var <- match_arg_15@value | |
temp_nombre_de_parts_paragraphe_5_195_1 <- TRUE | |
} else if (match_arg_15@code == "Veuve") { | |
dummy_var <- match_arg_15@value | |
temp_nombre_de_parts_paragraphe_5_195_1 <- TRUE | |
} | |
if ((temp_nombre_de_parts_paragraphe_5_195_1 && | |
(((foyer_fiscal@nombre_enfants_a_charge_residence_alternee + | |
foyer_fiscal@nombre_enfants_a_charge_mineurs_et_non_maries) >= | |
catala_integer_from_numeric(1)) && | |
(foyer_fiscal@pensionne_veuve_de_guerre || | |
foyer_fiscal@titulaire_carte_invalidite_CMI_invalidite_40_pourcent)))) { | |
temp_nombre_de_parts_paragraphe_5_195_2 <- catala_decimal_from_fraction(1, 2) | |
} else { | |
temp_nombre_de_parts_paragraphe_5_195_2 <- catala_decimal_from_fraction(0, 1) | |
} | |
return((nombre_de_parts_paragraphe_4_195 + | |
temp_nombre_de_parts_paragraphe_5_195_2)) | |
} | |
temp_nombre_de_parts_paragraphe_5_195_3 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= catala_integer_from_numeric(2021))) | |
} | |
temp_nombre_de_parts_paragraphe_5_195_4 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 561, start_column = 10, end_line = 561, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), temp_nombre_de_parts_paragraphe_5_195_3, | |
temp_nombre_de_parts_paragraphe_5_195 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 561, | |
start_column = 10, | |
end_line = 561, | |
end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_paragraphe_5_195 <- temp_nombre_de_parts_paragraphe_5_195_4 | |
tryCatch( | |
{ | |
temp_nombre_de_parts_paragraphe_6_195 <- function(dummy_var # ("catala_unit") | |
) { | |
if (foyer_fiscal@pensionne_guerre_marie_pacse) { | |
temp_nombre_de_parts_paragraphe_6_195_1 <- catala_decimal_from_fraction(1, 2) | |
} else { | |
temp_nombre_de_parts_paragraphe_6_195_1 <- catala_decimal_from_fraction(0, 1) | |
} | |
return((nombre_de_parts_paragraphe_5_195 + | |
temp_nombre_de_parts_paragraphe_6_195_1)) | |
} | |
temp_nombre_de_parts_paragraphe_6_195_2 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_1 >= catala_integer_from_numeric(2021))) | |
} | |
temp_nombre_de_parts_paragraphe_6_195_3 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 562, start_column = 10, end_line = 562, end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
), list(), temp_nombre_de_parts_paragraphe_6_195_2, | |
temp_nombre_de_parts_paragraphe_6_195 | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 562, | |
start_column = 10, | |
end_line = 562, | |
end_column = 26, | |
law_headings = c( | |
"Calcul du nombre de parts", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
nombre_de_parts_paragraphe_6_195 <- temp_nombre_de_parts_paragraphe_6_195_3 | |
nombre_de_parts_article_196__b <- (nombre_de_parts_paragraphe_6_195 + | |
(catala_decimal_from_integer(foyer_fiscal@nombre_enfants_majeurs_celibataires_sans_enfant) * | |
catala_decimal_from_fraction(1, 2))) | |
return(new("catala_struct_NombreDeParts", | |
nombre_de_parts = nombre_de_parts_article_196__b, | |
abattement = abattement | |
)) | |
} | |
plafond <- function( | |
valeur # ("catala_money") | |
, | |
plafond # ("catala_money") | |
) { | |
if ((valeur > plafond)) { | |
plafond_1 <- plafond | |
} else { | |
plafond_1 <- valeur | |
} | |
return(plafond_1) | |
} | |
plancher <- function( | |
valeur_1 # ("catala_money") | |
, | |
plancher # ("catala_money") | |
) { | |
if ((valeur_1 < plancher)) { | |
plancher_1 <- plancher | |
} else { | |
plancher_1 <- valeur_1 | |
} | |
return(plancher_1) | |
} | |
imputation_deficit_sur_revenus_quotientes <- function( | |
imputation_deficit_sur_revenus_quotientes_in # ("catala_struct_ImputationDeficitSurRevenusQuotientesIn") | |
) { | |
solde_categoriel_a_imputer <- imputation_deficit_sur_revenus_quotientes_in@solde_categoriel_a_imputer_in | |
revenus_quotientes_categoriels <- imputation_deficit_sur_revenus_quotientes_in@revenus_quotientes_categoriels_in | |
temp_base_d_imputation_deficit_categoriel <- function( | |
revenus_quotientes_categoriels_declarant # ("list" # array("catala_struct_RevenuQuotiente")) | |
) { | |
temp_base_d_imputation_deficit_categoriel_1 <- function(revenu_quotiente_categoriel # ("catala_struct_RevenuQuotiente") | |
) { | |
return(revenu_quotiente_categoriel@valeur_nette) | |
} | |
temp_base_d_imputation_deficit_categoriel_2 <- function(sum1 # ("catala_money") | |
, sum2 # ("catala_money") | |
) { | |
return((sum1 + sum2)) | |
} | |
return(catala_list_reduce( | |
temp_base_d_imputation_deficit_categoriel_2, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_base_d_imputation_deficit_categoriel_1, | |
revenus_quotientes_categoriels_declarant | |
) | |
)) | |
} | |
temp_base_d_imputation_deficit_categoriel_3 <- function( | |
sum1_1 # ("catala_money") | |
, sum2_1 # ("catala_money") | |
) { | |
return((sum1_1 + sum2_1)) | |
} | |
base_d_imputation_deficit_categoriel <- catala_list_reduce( | |
temp_base_d_imputation_deficit_categoriel_3, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_base_d_imputation_deficit_categoriel, | |
revenus_quotientes_categoriels | |
) | |
) | |
if ((solde_categoriel_a_imputer < | |
catala_money_from_cents(0))) { | |
temp_deficit_categoriel_impute <- plafond( | |
-solde_categoriel_a_imputer, | |
base_d_imputation_deficit_categoriel | |
) | |
} else { | |
temp_deficit_categoriel_impute <- catala_money_from_cents(0) | |
} | |
deficit_categoriel_impute <- temp_deficit_categoriel_impute | |
temp_revenus_quotientes_categoriels_imputes <- function( | |
revenus_quotientes_categoriels_declarant_1 # ("list" # array("catala_struct_RevenuQuotiente")) | |
) { | |
temp_revenus_quotientes_categoriels_imputes_1 <- function(revenu_quotiente_categoriel_1 # ("catala_struct_RevenuQuotiente") | |
) { | |
return(new("catala_struct_RevenuQuotiente", | |
valeur_nette = (revenu_quotiente_categoriel_1@valeur_nette - | |
catala_money_round((deficit_categoriel_impute * | |
(revenu_quotiente_categoriel_1@valeur_nette / | |
base_d_imputation_deficit_categoriel)))), | |
deduction = revenu_quotiente_categoriel_1@deduction, | |
coefficient = revenu_quotiente_categoriel_1@coefficient, | |
categorie = revenu_quotiente_categoriel_1@categorie | |
)) | |
} | |
return(catala_list_map( | |
temp_revenus_quotientes_categoriels_imputes_1, | |
revenus_quotientes_categoriels_declarant_1 | |
)) | |
} | |
revenus_quotientes_categoriels_imputes <- catala_list_map( | |
temp_revenus_quotientes_categoriels_imputes, | |
revenus_quotientes_categoriels | |
) | |
return(new("catala_struct_ImputationDeficitSurRevenusQuotientes", | |
revenus_quotientes_categoriels_imputes = revenus_quotientes_categoriels_imputes, | |
deficit_categoriel_impute = deficit_categoriel_impute | |
)) | |
} | |
plus_moins_value_long_terme_benefices_industriels_commerciaux <- function( | |
plus_moins_value_long_terme_benefices_industriels_commerciaux_in # ("catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciauxIn") | |
) { | |
plus_values_nettes_1 <- plus_moins_value_long_terme_benefices_industriels_commerciaux_in@plus_values_nettes_in | |
moins_values_nettes_1 <- plus_moins_value_long_terme_benefices_industriels_commerciaux_in@moins_values_nettes_in | |
prelevement_liberatoire_base <- (plancher( | |
(plus_values_nettes_1 - | |
moins_values_nettes_1), | |
catala_money_from_cents(0) | |
) * | |
catala_decimal_from_fraction(16, 125)) | |
prelevement_liberatoire_arrondissement <- catala_money_round(prelevement_liberatoire_base) | |
return(new("catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciaux", | |
prelevement_liberatoire = prelevement_liberatoire_arrondissement | |
)) | |
} | |
traitements_salaires_declarant <- function( | |
traitements_salaires_declarant_in # ("catala_struct_TraitementsSalairesDeclarantIn") | |
) { | |
revenus <- traitements_salaires_declarant_in@revenus_in | |
annee_revenu_2 <- traitements_salaires_declarant_in@annee_revenu_in | |
selecteur_plafond_abattement_pensions_retraites_rentes <- traitements_salaires_declarant_in@selecteur_plafond_abattement_pensions_retraites_rentes_in | |
temp_abattement_selon_158_5_a <- function( | |
type_retraite # ("catala_enum_TypePensionRetraiteRente") | |
) { | |
tryCatch( | |
{ | |
temp_abattement_selon_158_5_a_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_abattement_selon_158_5_a_2 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_abattement_selon_158_5_a_3 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_abattement_selon_158_5_a_4 <- function(dummy_var # ("catala_unit") | |
) { | |
return(FALSE) | |
} | |
temp_abattement_selon_158_5_a_5 <- function(dummy_var # ("catala_unit") | |
) { | |
return((type_retraite == | |
new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionEnCapitalPlansEpargneRetraite", | |
value = new("catala_unit", v = 0) | |
))) | |
} | |
temp_abattement_selon_158_5_a_6 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_abattement_selon_158_5_a_7 <- function(dummy_var # ("catala_unit") | |
) { | |
return(FALSE) | |
} | |
temp_abattement_selon_158_5_a_8 <- function(dummy_var # ("catala_unit") | |
) { | |
return((type_retraite == | |
new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionEnCapital_7_5pct", | |
value = new("catala_unit", v = 0) | |
))) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 212, | |
start_column = 11, | |
end_line = 212, end_column = 35, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_abattement_selon_158_5_a_8, | |
temp_abattement_selon_158_5_a_7 | |
)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 212, | |
start_column = 11, | |
end_line = 212, end_column = 35, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(temp_abattement_selon_158_5_a_6), | |
temp_abattement_selon_158_5_a_5, | |
temp_abattement_selon_158_5_a_4 | |
)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 212, start_column = 11, | |
end_line = 212, end_column = 35, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(temp_abattement_selon_158_5_a_3), | |
temp_abattement_selon_158_5_a_2, | |
temp_abattement_selon_158_5_a_1 | |
)) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 212, | |
start_column = 11, | |
end_line = 212, | |
end_column = 35, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
} | |
abattement_selon_158_5_a <- temp_abattement_selon_158_5_a | |
temp_calcul_abattement_pensions_retraites_rentes_base <- function( | |
pension_retraite_rente # ("catala_money") | |
) { | |
return((pension_retraite_rente * catala_decimal_from_fraction(1, 10))) | |
} | |
calcul_abattement_pensions_retraites_rentes_base <- temp_calcul_abattement_pensions_retraites_rentes_base | |
temp_calcul_deduction_frais_professionnels <- function( | |
assiette # ("catala_money") | |
) { | |
return((assiette * catala_decimal_from_fraction(1, 10))) | |
} | |
calcul_deduction_frais_professionnels <- temp_calcul_deduction_frais_professionnels | |
temp___6 <- function( | |
acc # ("logical") | |
, | |
revenu_exceptionnel_ou_differe # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_16 <- revenu_exceptionnel_ou_differe@categorie | |
if (match_arg_16@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_16@value | |
temp___7 <- TRUE | |
} else if (match_arg_16@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_16@value | |
temp___7 <- FALSE | |
} else if (match_arg_16@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_16@value | |
temp___7 <- TRUE | |
} else if (match_arg_16@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_16@value | |
temp___7 <- FALSE | |
} | |
return((acc && temp___7)) | |
} | |
if (!(catala_list_fold_left( | |
temp___6, TRUE, | |
revenus@revenus_exceptionnels_ou_differes | |
))) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 178, | |
start_column = 13, | |
end_line = 183, | |
end_column = 28, | |
law_headings = c( | |
"Case 0XX", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
traitements_salaires_avec_deduction_frais_professionnels_base <- revenus@traitements_salaires | |
prelevement_liberatoire <- ((revenus@pensions_retraites_en_capital_7_5pct - | |
(revenus@pensions_retraites_en_capital_7_5pct * | |
catala_decimal_from_fraction(1, 10))) * | |
catala_decimal_from_fraction(3, 40)) | |
assiette_exonerations_81_quater_art_81_quater <- revenus@heures_supplementaires_et_rtt_exonerees | |
pensions_retraites_rentes_79_art79 <- list( | |
new("catala_struct_PensionRetraiteRente", | |
valeur_initiale = revenus@pensions_retraites_rentes, | |
type = new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionsRetraitesRentes", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_PensionRetraiteRente", | |
valeur_initiale = revenus@pensions_retraites_en_capital_7_5pct, | |
type = new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionEnCapital_7_5pct", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_PensionRetraiteRente", | |
valeur_initiale = revenus@pensions_en_capital_plans_epargne_retraite, | |
type = new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionEnCapitalPlansEpargneRetraite", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_PensionRetraiteRente", | |
valeur_initiale = revenus@pensions_invalidite, | |
type = new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionInvalidite", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_PensionRetraiteRente", | |
valeur_initiale = revenus@pensions_alimentaires_percues, | |
type = new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionAlimentairePercue", | |
value = new("catala_unit", v = 0) | |
) | |
) | |
) | |
if (revenus@majoration_seuil_exoneration) { | |
temp_exoneration_prime_partage_valeur <- plafond( | |
revenus@prime_partage_valeur_exoneree, | |
catala_money_from_cents(600000) | |
) | |
} else { | |
temp_exoneration_prime_partage_valeur <- plafond( | |
revenus@prime_partage_valeur_exoneree, | |
catala_money_from_cents(300000) | |
) | |
} | |
exoneration_prime_partage_valeur <- temp_exoneration_prime_partage_valeur | |
tryCatch( | |
{ | |
temp_minimum_abattement_pensions_retraites_rentes <- function(dummy_var # ("catala_unit") | |
) { | |
return(catala_money_from_cents(42200)) | |
} | |
temp_minimum_abattement_pensions_retraites_rentes_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_2 == catala_integer_from_numeric(2022))) | |
} | |
temp_minimum_abattement_pensions_retraites_rentes_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 214, start_column = 11, end_line = 214, end_column = 55, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_minimum_abattement_pensions_retraites_rentes_1, | |
temp_minimum_abattement_pensions_retraites_rentes | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 214, | |
start_column = 11, | |
end_line = 214, | |
end_column = 55, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
minimum_abattement_pensions_retraites_rentes <- temp_minimum_abattement_pensions_retraites_rentes_2 | |
tryCatch( | |
{ | |
temp_minimum_deduction_frais_professionnels <- function(dummy_var # ("catala_unit") | |
) { | |
return(catala_money_from_cents(47200)) | |
} | |
temp_minimum_deduction_frais_professionnels_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_2 == catala_integer_from_numeric(2022))) | |
} | |
temp_minimum_deduction_frais_professionnels_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 205, start_column = 11, end_line = 205, end_column = 49, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_minimum_deduction_frais_professionnels_1, | |
temp_minimum_deduction_frais_professionnels | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 205, | |
start_column = 11, | |
end_line = 205, | |
end_column = 49, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
minimum_deduction_frais_professionnels <- temp_minimum_deduction_frais_professionnels_2 | |
tryCatch( | |
{ | |
temp_plafond_deduction_frais_professionnels <- function(dummy_var # ("catala_unit") | |
) { | |
return(catala_money_from_cents(1352200)) | |
} | |
temp_plafond_deduction_frais_professionnels_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_2 == catala_integer_from_numeric(2022))) | |
} | |
temp_plafond_deduction_frais_professionnels_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 204, start_column = 11, end_line = 204, end_column = 49, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_plafond_deduction_frais_professionnels_1, | |
temp_plafond_deduction_frais_professionnels | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 204, | |
start_column = 11, | |
end_line = 204, | |
end_column = 49, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
plafond_deduction_frais_professionnels <- temp_plafond_deduction_frais_professionnels_2 | |
temp_calcul_abattement_pensions_retraites_rentes_arrondissement <- function( | |
pension_retraite_rente_1 # ("catala_money") | |
) { | |
return(catala_money_round(calcul_abattement_pensions_retraites_rentes_base( | |
pension_retraite_rente_1 | |
))) | |
} | |
calcul_abattement_pensions_retraites_rentes_arrondissement <- temp_calcul_abattement_pensions_retraites_rentes_arrondissement | |
traitements_salaires_avec_deduction_frais_professionnels_art62 <- (traitements_salaires_avec_deduction_frais_professionnels_base + | |
revenus@revenus_associes_gerants) | |
assiette_exonerations_81_quater_art_5_lfr_2022 <- (assiette_exonerations_81_quater_art_81_quater + | |
revenus@pourboires_exoneres) | |
pensions_retraites_rentes_79_convention_internationale <- (pensions_retraites_rentes_79_art79 + | |
list(new("catala_struct_PensionRetraiteRente", | |
valeur_initiale = revenus@pensions_etrangeres_impots_impute, | |
type = new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionsRetraitesRentes", | |
value = new("catala_unit", v = 0) | |
) | |
))) | |
temp_calcul_abattement_pensions_retraites_rentes_plancher <- function( | |
pension_retraite_rente_2 # ("catala_money") | |
) { | |
return(plancher( | |
calcul_abattement_pensions_retraites_rentes_arrondissement( | |
pension_retraite_rente_2 | |
), | |
minimum_abattement_pensions_retraites_rentes | |
)) | |
} | |
calcul_abattement_pensions_retraites_rentes_plancher <- temp_calcul_abattement_pensions_retraites_rentes_plancher | |
traitements_salaires_avec_deduction_frais_professionnels_art93_1bis <- (traitements_salaires_avec_deduction_frais_professionnels_art62 + | |
revenus@droits_dauteurs_fonctionnaires_chercheurs) | |
tryCatch( | |
{ | |
temp_exonerations_81_quater <- function(dummy_var # ("catala_unit") | |
) { | |
return(plafond( | |
assiette_exonerations_81_quater_art_5_lfr_2022, | |
catala_money_from_cents(750000) | |
)) | |
} | |
temp_exonerations_81_quater_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_2 >= catala_integer_from_numeric(2022))) | |
} | |
temp_exonerations_81_quater_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 259, | |
start_column = 12, | |
end_line = 259, end_column = 34, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_exonerations_81_quater_1, | |
temp_exonerations_81_quater | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 259, | |
start_column = 12, | |
end_line = 259, | |
end_column = 34, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
exonerations_81_quater <- temp_exonerations_81_quater_2 | |
pensions_retraites_rentes_79_art204c <- (pensions_retraites_rentes_79_convention_internationale + | |
list(new("catala_struct_PensionRetraiteRente", | |
valeur_initiale = revenus@autre_pensions_imposables_source_etrangere, | |
type = new("catala_enum_TypePensionRetraiteRente", | |
code = "PensionsRetraitesRentes", | |
value = new("catala_unit", v = 0) | |
) | |
))) | |
temp_calcul_abattement_pensions_retraites_rentes_maximisation <- function( | |
pension_retraite_rente_3 # ("catala_money") | |
) { | |
return(plafond(calcul_abattement_pensions_retraites_rentes_plancher( | |
pension_retraite_rente_3 | |
), pension_retraite_rente_3)) | |
} | |
calcul_abattement_pensions_retraites_rentes_maximisation <- temp_calcul_abattement_pensions_retraites_rentes_maximisation | |
traitements_salaires_avec_deduction_frais_professionnels_art158_5_a_b <- (traitements_salaires_avec_deduction_frais_professionnels_art93_1bis + | |
revenus@autres_revenus_imposables_chomage_preretraite) | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne <- function( | |
r_quotiente # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_17 <- r_quotiente@categorie | |
if (match_arg_17@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_17@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_17@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_17@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_17@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_17@value | |
return(calcul_abattement_pensions_retraites_rentes_maximisation( | |
r_quotiente@valeur | |
)) | |
} else if (match_arg_17@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_17@value | |
return(catala_money_from_cents(0)) | |
} | |
} | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne_1 <- function( | |
sum1_2 # ("catala_money") | |
, sum2_2 # ("catala_money") | |
) { | |
return((sum1_2 + sum2_2)) | |
} | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne_2 <- function( | |
p # ("catala_struct_PensionRetraiteRente") | |
) { | |
if (abattement_selon_158_5_a(p@type)) { | |
return(calcul_abattement_pensions_retraites_rentes_maximisation( | |
p@valeur_initiale | |
)) | |
} else { | |
return(catala_money_from_cents(0)) | |
} | |
} | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne_3 <- function( | |
sum1_3 # ("catala_money") | |
, sum2_3 # ("catala_money") | |
) { | |
return((sum1_3 + sum2_3)) | |
} | |
abattement_pensions_retraites_rentes_total_non_plafonne <- (catala_list_reduce( | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne_3, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne_2, | |
pensions_retraites_rentes_79_art204c | |
) | |
) + | |
catala_list_reduce( | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_abattement_pensions_retraites_rentes_total_non_plafonne, | |
revenus@revenus_exceptionnels_ou_differes | |
) | |
)) | |
traitements_salaires_avec_deduction_frais_professionnels_art_81_quater <- ((traitements_salaires_avec_deduction_frais_professionnels_art158_5_a_b + | |
assiette_exonerations_81_quater_art_5_lfr_2022) - exonerations_81_quater) | |
match_arg_18 <- selecteur_plafond_abattement_pensions_retraites_rentes | |
if (match_arg_18@code == "Deplafonne") { | |
dummy_var <- match_arg_18@value | |
temp_abattement_pensions_retraites_rentes_total_plafonne <- abattement_pensions_retraites_rentes_total_non_plafonne | |
} else if (match_arg_18@code == "PlafondStandardOuProratise") { | |
plafond_standard_ou_proratise <- match_arg_18@value | |
temp_abattement_pensions_retraites_rentes_total_plafonne <- plafond( | |
abattement_pensions_retraites_rentes_total_non_plafonne, | |
plafond_standard_ou_proratise | |
) | |
} | |
abattement_pensions_retraites_rentes_total_plafonne <- temp_abattement_pensions_retraites_rentes_total_plafonne | |
traitements_salaires_avec_deduction_frais_professionnels_loi_2022_1158 <- ((traitements_salaires_avec_deduction_frais_professionnels_art_81_quater + | |
revenus@prime_partage_valeur_exoneree) - | |
exoneration_prime_partage_valeur) | |
temp_calcul_abattement_proratise_revenus_quotiente_pensions_retraites_base <- function( | |
revenu_quotiente_1 # ("catala_money") | |
) { | |
return((calcul_abattement_pensions_retraites_rentes_maximisation( | |
revenu_quotiente_1 | |
) * | |
(abattement_pensions_retraites_rentes_total_plafonne / | |
abattement_pensions_retraites_rentes_total_non_plafonne))) | |
} | |
calcul_abattement_proratise_revenus_quotiente_pensions_retraites_base <- temp_calcul_abattement_proratise_revenus_quotiente_pensions_retraites_base | |
traitements_salaires_avec_deduction_frais_professionnels_art80 <- (traitements_salaires_avec_deduction_frais_professionnels_loi_2022_1158 + | |
revenus@indemnites_prejudice_moral_fraction_superieure_million) | |
temp_calcul_abattement_proratise_revenus_quotiente_pensions_retraites_arrondissement <- function( | |
revenu_quotiente_2 # ("catala_money") | |
) { | |
return(catala_money_round(calcul_abattement_proratise_revenus_quotiente_pensions_retraites_base( | |
revenu_quotiente_2 | |
))) | |
} | |
calcul_abattement_proratise_revenus_quotiente_pensions_retraites_arrondissement <- temp_calcul_abattement_proratise_revenus_quotiente_pensions_retraites_arrondissement | |
traitements_salaires_avec_deduction_frais_professionnels_art80_bis_1 <- (traitements_salaires_avec_deduction_frais_professionnels_art80 + | |
revenus@gains_de_levee_doptions) | |
traitements_salaires_avec_deduction_frais_professionnels_art80_bis_2 <- (traitements_salaires_avec_deduction_frais_professionnels_art80_bis_1 + | |
revenus@rabais_excedentaire_options_sur_titres) | |
traitements_salaires_avec_deduction_frais_professionnels_art80_sexies <- (traitements_salaires_avec_deduction_frais_professionnels_art80_bis_2 + | |
revenus@revenu_assistants_maternels_familiaux) | |
traitements_salaires_avec_deduction_frais_professionnels_art80_quindecies <- ((traitements_salaires_avec_deduction_frais_professionnels_art80_sexies + | |
revenus@gains_et_distributions_carried_interest) + | |
revenus@gains_et_distributions_carried_interest_soumis_contribution_salariale) | |
traitements_salaires_avec_deduction_frais_professionnels_art93_1ter <- (traitements_salaires_avec_deduction_frais_professionnels_art80_quindecies + | |
revenus@salaires_imposables_agent_assurance) | |
traitements_salaires_avec_deduction_frais_professionnels_convention_internationale <- (traitements_salaires_avec_deduction_frais_professionnels_art93_1ter + | |
revenus@salaires_etrangers_impot_impute) | |
traitements_salaires_avec_deduction_frais_professionnels_art204c <- (traitements_salaires_avec_deduction_frais_professionnels_convention_internationale + | |
revenus@autre_salaires_imposables_source_etrangere) | |
deduction_frais_professionnels_traitements_salaires_avant_prorata_forfaitaire <- calcul_deduction_frais_professionnels( | |
traitements_salaires_avec_deduction_frais_professionnels_art204c | |
) | |
deduction_frais_professionnels_traitements_salaires_avant_prorata_arrondissement <- catala_money_round(deduction_frais_professionnels_traitements_salaires_avant_prorata_forfaitaire) | |
if ((deduction_frais_professionnels_traitements_salaires_avant_prorata_arrondissement < | |
minimum_deduction_frais_professionnels)) { | |
if ((minimum_deduction_frais_professionnels > | |
traitements_salaires_avec_deduction_frais_professionnels_art204c)) { | |
temp_deduction_frais_professionnels_traitements_salaires_avant_prorata_plancher_83_3_3 <- traitements_salaires_avec_deduction_frais_professionnels_art204c | |
} else { | |
temp_deduction_frais_professionnels_traitements_salaires_avant_prorata_plancher_83_3_3 <- minimum_deduction_frais_professionnels | |
} | |
} else { | |
temp_deduction_frais_professionnels_traitements_salaires_avant_prorata_plancher_83_3_3 <- deduction_frais_professionnels_traitements_salaires_avant_prorata_arrondissement | |
} | |
deduction_frais_professionnels_traitements_salaires_avant_prorata_plancher_83_3_3 <- temp_deduction_frais_professionnels_traitements_salaires_avant_prorata_plancher_83_3_3 | |
temp_deduction_frais_professionnels_totale_non_plafonnee_83_3_2 <- function( | |
r_quotiente_1 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_19 <- r_quotiente_1@categorie | |
if (match_arg_19@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_19@value | |
return(calcul_deduction_frais_professionnels(r_quotiente_1@valeur)) | |
} else if (match_arg_19@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_19@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_19@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_19@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_19@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_19@value | |
return(catala_money_from_cents(0)) | |
} | |
} | |
temp_deduction_frais_professionnels_totale_non_plafonnee_83_3_2_1 <- function( | |
sum1_4 # ("catala_money") | |
, sum2_4 # ("catala_money") | |
) { | |
return((sum1_4 + sum2_4)) | |
} | |
deduction_frais_professionnels_totale_non_plafonnee_83_3_2 <- (catala_list_reduce( | |
temp_deduction_frais_professionnels_totale_non_plafonnee_83_3_2_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_deduction_frais_professionnels_totale_non_plafonnee_83_3_2, | |
revenus@revenus_exceptionnels_ou_differes | |
) | |
) + | |
deduction_frais_professionnels_traitements_salaires_avant_prorata_plancher_83_3_3) | |
if ((deduction_frais_professionnels_totale_non_plafonnee_83_3_2 >= | |
plafond_deduction_frais_professionnels)) { | |
temp_deduction_frais_professionnels_totale_plafonnee_83_3_2 <- plafond_deduction_frais_professionnels | |
} else { | |
temp_deduction_frais_professionnels_totale_plafonnee_83_3_2 <- deduction_frais_professionnels_totale_non_plafonnee_83_3_2 | |
} | |
deduction_frais_professionnels_totale_plafonnee_83_3_2 <- temp_deduction_frais_professionnels_totale_plafonnee_83_3_2 | |
match_arg_20 <- revenus@frais_reels | |
if (match_arg_20@code == "Non") { | |
dummy_var <- match_arg_20@value | |
temp_application_frais_reels <- new("catala_enum_FraisReels", | |
code = "Non", | |
value = new("catala_unit", v = 0) | |
) | |
} else if (match_arg_20@code == "Oui") { | |
montant_frais_reels <- match_arg_20@value | |
if ((montant_frais_reels < | |
deduction_frais_professionnels_totale_plafonnee_83_3_2)) { | |
temp_application_frais_reels <- new("catala_enum_FraisReels", | |
code = "Non", | |
value = new("catala_unit", v = 0) | |
) | |
} else { | |
temp_application_frais_reels <- new("catala_enum_FraisReels", | |
code = "Oui", | |
value = montant_frais_reels | |
) | |
} | |
} | |
application_frais_reels <- temp_application_frais_reels | |
match_arg_21 <- application_frais_reels | |
if (match_arg_21@code == "Non") { | |
dummy_var <- match_arg_21@value | |
temp_deduction_frais_professionnels_totale_plafonnee_83_3_2_avec_frais_reels <- deduction_frais_professionnels_totale_plafonnee_83_3_2 | |
} else if (match_arg_21@code == "Oui") { | |
montant_frais_reels_1 <- match_arg_21@value | |
temp_deduction_frais_professionnels_totale_plafonnee_83_3_2_avec_frais_reels <- montant_frais_reels_1 | |
} | |
deduction_frais_professionnels_totale_plafonnee_83_3_2_avec_frais_reels <- temp_deduction_frais_professionnels_totale_plafonnee_83_3_2_avec_frais_reels | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base <- function( | |
revenu_quotiente_3 # ("catala_money") | |
) { | |
tryCatch( | |
{ | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((calcul_deduction_frais_professionnels(revenu_quotiente_3) * | |
(deduction_frais_professionnels_totale_plafonnee_83_3_2 / | |
deduction_frais_professionnels_totale_non_plafonnee_83_3_2))) | |
} | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_2 <- function(dummy_var # ("catala_unit") | |
) { | |
return(TRUE) | |
} | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_3 <- function(dummy_var # ("catala_unit") | |
) { | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_4 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg_22 <- application_frais_reels | |
if (match_arg_22@code == "Non") { | |
dummy_var <- match_arg_22@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_22@code == "Oui") { | |
montant_frais_reels_2 <- match_arg_22@value | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_5 <- function(autre_revenu_quotiente # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_23 <- autre_revenu_quotiente@categorie | |
if (match_arg_23@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_23@value | |
return(autre_revenu_quotiente@valeur) | |
} else if (match_arg_23@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_23@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_23@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_23@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_23@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_23@value | |
return(catala_money_from_cents(0)) | |
} | |
} | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_6 <- function(sum1_5 # ("catala_money") | |
, sum2_5 # ("catala_money") | |
) { | |
return((sum1_5 + sum2_5)) | |
} | |
return(plafond( | |
catala_money_round((montant_frais_reels_2 * | |
(revenu_quotiente_3 / | |
(traitements_salaires_avec_deduction_frais_professionnels_art204c + | |
catala_list_reduce( | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_6, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_5, | |
revenus@revenus_exceptionnels_ou_differes | |
) | |
))))), | |
revenu_quotiente_3 | |
)) | |
} | |
} | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_7 <- function(dummy_var # ("catala_unit") | |
) { | |
match_arg_24 <- application_frais_reels | |
if (match_arg_24@code == "Non") { | |
dummy_var <- match_arg_24@value | |
return(FALSE) | |
} else if (match_arg_24@code == "Oui") { | |
dummy_var <- match_arg_24@value | |
return(TRUE) | |
} | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 237, | |
start_column = 10, | |
end_line = 237, end_column = 14, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_7, | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_4 | |
)) | |
} | |
return(catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 237, start_column = 10, | |
end_line = 237, end_column = 14, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_3), | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_2, | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base_1 | |
)) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 237, | |
start_column = 10, | |
end_line = 237, | |
end_column = 14, | |
law_headings = c( | |
"Pour un déclarant", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
} | |
calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base <- temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base | |
temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_arrondissement <- function( | |
revenu_quotiente_4 # ("catala_money") | |
) { | |
return(catala_money_round(calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_base( | |
revenu_quotiente_4 | |
))) | |
} | |
calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_arrondissement <- temp_calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_arrondissement | |
temp_revenus_quotientes <- function( | |
revenu_1 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_25 <- revenu_1@categorie | |
if (match_arg_25@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_25@value | |
temp_revenus_quotientes_1 <- calcul_deduction_proratisee_revenus_quotientes_traitements_salaires_arrondissement( | |
revenu_1@valeur | |
) | |
} else if (match_arg_25@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_25@value | |
temp_revenus_quotientes_1 <- catala_money_from_cents(0) | |
} else if (match_arg_25@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_25@value | |
temp_revenus_quotientes_1 <- calcul_abattement_proratise_revenus_quotiente_pensions_retraites_arrondissement( | |
revenu_1@valeur | |
) | |
} else if (match_arg_25@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_25@value | |
temp_revenus_quotientes_1 <- catala_money_from_cents(0) | |
} | |
return(calcul_revenu_quotiente(new("catala_struct_CalculRevenuQuotienteIn", | |
revenu_in = revenu_1, | |
deduction_in = temp_revenus_quotientes_1, | |
annee_revenu_in = annee_revenu_2 | |
))@revenu_quotiente) | |
} | |
revenus_quotientes <- catala_list_map( | |
temp_revenus_quotientes, | |
revenus@revenus_exceptionnels_ou_differes | |
) | |
temp_deduction_frais_professionnels_traitements_salaires <- function( | |
r_quotiente_2 # ("catala_struct_RevenuQuotiente") | |
) { | |
match_arg_26 <- r_quotiente_2@categorie | |
if (match_arg_26@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_26@value | |
return(r_quotiente_2@deduction) | |
} else if (match_arg_26@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_26@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_26@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_26@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_26@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_26@value | |
return(catala_money_from_cents(0)) | |
} | |
} | |
temp_deduction_frais_professionnels_traitements_salaires_1 <- function( | |
sum1_6 # ("catala_money") | |
, sum2_6 # ("catala_money") | |
) { | |
return((sum1_6 + sum2_6)) | |
} | |
deduction_frais_professionnels_traitements_salaires <- (deduction_frais_professionnels_totale_plafonnee_83_3_2_avec_frais_reels - | |
catala_list_reduce( | |
temp_deduction_frais_professionnels_traitements_salaires_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_deduction_frais_professionnels_traitements_salaires, | |
revenus_quotientes | |
) | |
)) | |
temp_abattement_pensions_retraites_rentes <- function( | |
r_quotiente_3 # ("catala_struct_RevenuQuotiente") | |
) { | |
match_arg_27 <- r_quotiente_3@categorie | |
if (match_arg_27@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_27@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_27@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_27@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_27@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_27@value | |
return(r_quotiente_3@deduction) | |
} else if (match_arg_27@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_27@value | |
return(catala_money_from_cents(0)) | |
} | |
} | |
temp_abattement_pensions_retraites_rentes_1 <- function( | |
sum1_7 # ("catala_money") | |
, sum2_7 # ("catala_money") | |
) { | |
return((sum1_7 + sum2_7)) | |
} | |
abattement_pensions_retraites_rentes <- (abattement_pensions_retraites_rentes_total_plafonne - | |
catala_list_reduce( | |
temp_abattement_pensions_retraites_rentes_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_abattement_pensions_retraites_rentes, | |
revenus_quotientes | |
) | |
)) | |
revenu_brut_declarant_hors_quotient <- ((((((revenus@pensions_retraites_rentes + | |
revenus@pensions_alimentaires_percues) + revenus@pensions_invalidite) - | |
abattement_pensions_retraites_rentes) + | |
revenus@pensions_en_capital_plans_epargne_retraite) + | |
traitements_salaires_avec_deduction_frais_professionnels_art204c) - | |
deduction_frais_professionnels_traitements_salaires) | |
return(new("catala_struct_TraitementsSalairesDeclarant", | |
abattement_pensions_retraites_rentes = abattement_pensions_retraites_rentes, | |
deduction_frais_professionnels_traitements_salaires = deduction_frais_professionnels_traitements_salaires, | |
exonerations_81_quater = exonerations_81_quater, | |
prelevement_liberatoire = prelevement_liberatoire, | |
traitements_salaires_avec_deduction_frais_professionnels = traitements_salaires_avec_deduction_frais_professionnels_art204c, | |
revenu_brut_declarant_hors_quotient = revenu_brut_declarant_hors_quotient, | |
revenus_quotientes = revenus_quotientes | |
)) | |
} | |
benefices_industriels_commerciaux_declarant <- function( | |
benefices_industriels_commerciaux_declarant_in # ("catala_struct_BeneficesIndustrielsCommerciauxDeclarantIn") | |
) { | |
revenus_professionnels <- benefices_industriels_commerciaux_declarant_in@revenus_professionnels_in | |
revenus_non_professionnels <- benefices_industriels_commerciaux_declarant_in@revenus_non_professionnels_in | |
chiffre_affaires_prelevement_liberatoire_marchandises_exonere_cotisations <- benefices_industriels_commerciaux_declarant_in@chiffre_affaires_prelevement_liberatoire_marchandises_exonere_cotisations_in | |
chiffre_affaires_prelevement_liberatoire_services_exonere_cotisations <- benefices_industriels_commerciaux_declarant_in@chiffre_affaires_prelevement_liberatoire_services_exonere_cotisations_in | |
annee_revenu_3 <- benefices_industriels_commerciaux_declarant_in@annee_revenu_in | |
prelevement_liberatoire_plus_values_long_terme <- (plus_moins_value_long_terme_benefices_industriels_commerciaux( | |
new("catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciauxIn", | |
plus_values_nettes_in = (revenus_professionnels@plus_values_nettes_long_terme_micro + | |
revenus_non_professionnels@plus_values_nettes_long_terme_micro), | |
moins_values_nettes_in = (revenus_professionnels@moins_values_nettes_long_terme_micro + | |
revenus_non_professionnels@moins_values_nettes_long_terme_micro) | |
) | |
)@prelevement_liberatoire + | |
plus_moins_value_long_terme_benefices_industriels_commerciaux(new("catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciauxIn", | |
plus_values_nettes_in = revenus_non_professionnels@plus_values_nettes_long_terme_reel, | |
moins_values_nettes_in = catala_money_from_cents(0) | |
))@prelevement_liberatoire) | |
tryCatch( | |
{ | |
temp_prelevement_liberatoire_auto_entreprise_marchandises <- function(dummy_var # ("catala_unit") | |
) { | |
return((chiffre_affaires_prelevement_liberatoire_marchandises_exonere_cotisations * | |
catala_decimal_from_fraction(1, 100))) | |
} | |
temp_prelevement_liberatoire_auto_entreprise_marchandises_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_3 == catala_integer_from_numeric(2022))) | |
} | |
temp_prelevement_liberatoire_auto_entreprise_marchandises_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 443, start_column = 10, end_line = 443, end_column = 22, | |
law_headings = c( | |
"Bénéfices Industriels et Commerciaux", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_prelevement_liberatoire_auto_entreprise_marchandises_1, | |
temp_prelevement_liberatoire_auto_entreprise_marchandises | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 443, | |
start_column = 10, | |
end_line = 443, | |
end_column = 22, | |
law_headings = c( | |
"Bénéfices Industriels et Commerciaux", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
prelevement_liberatoire_auto_entreprise_marchandises <- temp_prelevement_liberatoire_auto_entreprise_marchandises_2 | |
tryCatch( | |
{ | |
temp_prelevement_liberatoire_auto_entreprise_services <- function(dummy_var # ("catala_unit") | |
) { | |
return((prelevement_liberatoire_auto_entreprise_marchandises + | |
(chiffre_affaires_prelevement_liberatoire_services_exonere_cotisations * | |
catala_decimal_from_fraction(17, 1000)))) | |
} | |
temp_prelevement_liberatoire_auto_entreprise_services_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_3 == catala_integer_from_numeric(2022))) | |
} | |
temp_prelevement_liberatoire_auto_entreprise_services_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 444, start_column = 10, end_line = 444, end_column = 18, | |
law_headings = c( | |
"Bénéfices Industriels et Commerciaux", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_prelevement_liberatoire_auto_entreprise_services_1, | |
temp_prelevement_liberatoire_auto_entreprise_services | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 444, | |
start_column = 10, | |
end_line = 444, | |
end_column = 18, | |
law_headings = c( | |
"Bénéfices Industriels et Commerciaux", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
prelevement_liberatoire_auto_entreprise_services <- temp_prelevement_liberatoire_auto_entreprise_services_2 | |
prelevement_liberatoire_auto_entreprise_arrondissement <- catala_money_round(prelevement_liberatoire_auto_entreprise_services) | |
return(new("catala_struct_BeneficesIndustrielsCommerciauxDeclarant", | |
prelevement_liberatoire_auto_entreprise = prelevement_liberatoire_auto_entreprise_arrondissement, | |
prelevement_liberatoire_plus_values_long_terme = prelevement_liberatoire_plus_values_long_terme | |
)) | |
} | |
benefices_non_commerciaux_declarant <- function( | |
benefices_non_commerciaux_declarant_in # ("catala_struct_BeneficesNonCommerciauxDeclarantIn") | |
) { | |
revenus_professionnels_1 <- benefices_non_commerciaux_declarant_in@revenus_professionnels_in | |
revenus_non_professionnels_1 <- benefices_non_commerciaux_declarant_in@revenus_non_professionnels_in | |
recettes_prelevement_liberatoire_exonerees_cotisations <- benefices_non_commerciaux_declarant_in@recettes_prelevement_liberatoire_exonerees_cotisations_in | |
annee_revenu_4 <- benefices_non_commerciaux_declarant_in@annee_revenu_in | |
prelevement_liberatoire_plus_values_long_terme_1 <- (plus_moins_value_long_terme_benefices_industriels_commerciaux( | |
new("catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciauxIn", | |
plus_values_nettes_in = (revenus_professionnels_1@plus_values_nettes_long_terme_micro + | |
revenus_non_professionnels_1@plus_values_nettes_long_terme_micro), | |
moins_values_nettes_in = (revenus_professionnels_1@moins_values_nettes_long_terme_micro + | |
revenus_non_professionnels_1@moins_values_nettes_long_terme_micro) | |
) | |
)@prelevement_liberatoire + | |
plus_moins_value_long_terme_benefices_industriels_commerciaux(new("catala_struct_PlusMoinsValueLongTermeBeneficesIndustrielsCommerciauxIn", | |
plus_values_nettes_in = revenus_non_professionnels_1@plus_values_nettes_long_terme_reel, | |
moins_values_nettes_in = catala_money_from_cents(0) | |
))@prelevement_liberatoire) | |
temp_asiette_abattement_forfaitaire_micro_total <- function( | |
revenu_exceptionnel_ou_differe_1 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_28 <- revenu_exceptionnel_ou_differe_1@categorie | |
if (match_arg_28@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_28@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_28@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_28@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_28@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_28@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_28@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_28@value | |
return(revenu_exceptionnel_ou_differe_1@valeur) | |
} | |
} | |
temp_asiette_abattement_forfaitaire_micro_total_1 <- function( | |
sum1_8 # ("catala_money") | |
, sum2_8 # ("catala_money") | |
) { | |
return((sum1_8 + sum2_8)) | |
} | |
temp_asiette_abattement_forfaitaire_micro_total_2 <- function( | |
revenu_exceptionnel_ou_differe_2 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_29 <- revenu_exceptionnel_ou_differe_2@categorie | |
if (match_arg_29@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_29@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_29@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_29@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_29@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_29@value | |
return(catala_money_from_cents(0)) | |
} else if (match_arg_29@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_29@value | |
return(revenu_exceptionnel_ou_differe_2@valeur) | |
} | |
} | |
temp_asiette_abattement_forfaitaire_micro_total_3 <- function( | |
sum1_9 # ("catala_money") | |
, sum2_9 # ("catala_money") | |
) { | |
return((sum1_9 + sum2_9)) | |
} | |
asiette_abattement_forfaitaire_micro_total <- (((revenus_professionnels_1@revenus_imposables_micro + | |
catala_list_reduce( | |
temp_asiette_abattement_forfaitaire_micro_total_3, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_asiette_abattement_forfaitaire_micro_total_2, | |
revenus_professionnels_1@revenus_exceptionnels_ou_differes | |
) | |
)) + | |
revenus_non_professionnels_1@revenus_imposables_micro) + | |
catala_list_reduce( | |
temp_asiette_abattement_forfaitaire_micro_total_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_asiette_abattement_forfaitaire_micro_total, | |
revenus_non_professionnels_1@revenus_exceptionnels_ou_differes | |
) | |
)) | |
tryCatch( | |
{ | |
temp_prelevement_liberatoire_auto_entreprise_base <- function(dummy_var # ("catala_unit") | |
) { | |
return((recettes_prelevement_liberatoire_exonerees_cotisations * | |
catala_decimal_from_fraction(11, 500))) | |
} | |
temp_prelevement_liberatoire_auto_entreprise_base_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_4 == catala_integer_from_numeric(2022))) | |
} | |
temp_prelevement_liberatoire_auto_entreprise_base_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 392, start_column = 10, end_line = 392, end_column = 14, | |
law_headings = c( | |
"Bénéfices non commerciaux", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_prelevement_liberatoire_auto_entreprise_base_1, | |
temp_prelevement_liberatoire_auto_entreprise_base | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 392, | |
start_column = 10, | |
end_line = 392, | |
end_column = 14, | |
law_headings = c( | |
"Bénéfices non commerciaux", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
prelevement_liberatoire_auto_entreprise_base <- temp_prelevement_liberatoire_auto_entreprise_base_2 | |
abattement_forfaitaire_micro_total_base <- (asiette_abattement_forfaitaire_micro_total * | |
catala_decimal_from_fraction(17, 50)) | |
prelevement_liberatoire_auto_entreprise_arrondissement_1 <- catala_money_round(prelevement_liberatoire_auto_entreprise_base) | |
abattement_forfaitaire_micro_total_arrondissement <- catala_money_round(abattement_forfaitaire_micro_total_base) | |
abattement_forfaitaire_micro_total_plancher <- plafond( | |
plancher( | |
abattement_forfaitaire_micro_total_arrondissement, | |
catala_money_from_cents(30500) | |
), | |
asiette_abattement_forfaitaire_micro_total | |
) | |
temp_revenus_quotientes_non_professionnels <- function( | |
revenu_2 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_30 <- revenu_2@categorie | |
if (match_arg_30@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_30@value | |
temp_revenus_quotientes_non_professionnels_1 <- catala_money_from_cents(0) | |
} else if (match_arg_30@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_30@value | |
temp_revenus_quotientes_non_professionnels_1 <- catala_money_from_cents(0) | |
} else if (match_arg_30@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_30@value | |
temp_revenus_quotientes_non_professionnels_1 <- catala_money_from_cents(0) | |
} else if (match_arg_30@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_30@value | |
temp_revenus_quotientes_non_professionnels_1 <- catala_money_round((abattement_forfaitaire_micro_total_plancher * | |
(revenu_2@valeur / asiette_abattement_forfaitaire_micro_total))) | |
} | |
return(calcul_revenu_quotiente(new("catala_struct_CalculRevenuQuotienteIn", | |
revenu_in = revenu_2, | |
deduction_in = temp_revenus_quotientes_non_professionnels_1, | |
annee_revenu_in = annee_revenu_4 | |
))@revenu_quotiente) | |
} | |
revenus_quotientes_non_professionnels <- catala_list_map( | |
temp_revenus_quotientes_non_professionnels, | |
revenus_non_professionnels_1@revenus_exceptionnels_ou_differes | |
) | |
temp_revenus_quotientes_professionnels <- function( | |
revenu_3 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_31 <- revenu_3@categorie | |
if (match_arg_31@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_31@value | |
temp_revenus_quotientes_professionnels_1 <- catala_money_from_cents(0) | |
} else if (match_arg_31@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_31@value | |
temp_revenus_quotientes_professionnels_1 <- catala_money_from_cents(0) | |
} else if (match_arg_31@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_31@value | |
temp_revenus_quotientes_professionnels_1 <- catala_money_from_cents(0) | |
} else if (match_arg_31@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_31@value | |
temp_revenus_quotientes_professionnels_1 <- catala_money_round((abattement_forfaitaire_micro_total_plancher * | |
(revenu_3@valeur / asiette_abattement_forfaitaire_micro_total))) | |
} | |
return(calcul_revenu_quotiente(new("catala_struct_CalculRevenuQuotienteIn", | |
revenu_in = revenu_3, | |
deduction_in = temp_revenus_quotientes_professionnels_1, | |
annee_revenu_in = annee_revenu_4 | |
))@revenu_quotiente) | |
} | |
revenus_quotientes_professionnels <- catala_list_map( | |
temp_revenus_quotientes_professionnels, | |
revenus_professionnels_1@revenus_exceptionnels_ou_differes | |
) | |
abattement_forfaitaire_micro_professionnel <- catala_money_round((abattement_forfaitaire_micro_total_plancher * | |
(revenus_professionnels_1@revenus_imposables_micro / | |
asiette_abattement_forfaitaire_micro_total))) | |
temp_abattement_forfaitaire_micro_non_professionnel <- function( | |
revenu_quotiente_5 # ("catala_struct_RevenuQuotiente") | |
) { | |
return(revenu_quotiente_5@deduction) | |
} | |
temp_abattement_forfaitaire_micro_non_professionnel_1 <- function( | |
sum1_10 # ("catala_money") | |
, sum2_10 # ("catala_money") | |
) { | |
return((sum1_10 + sum2_10)) | |
} | |
temp_abattement_forfaitaire_micro_non_professionnel_2 <- function( | |
revenu_quotiente_6 # ("catala_struct_RevenuQuotiente") | |
) { | |
return(revenu_quotiente_6@deduction) | |
} | |
temp_abattement_forfaitaire_micro_non_professionnel_3 <- function( | |
sum1_11 # ("catala_money") | |
, sum2_11 # ("catala_money") | |
) { | |
return((sum1_11 + sum2_11)) | |
} | |
abattement_forfaitaire_micro_non_professionnel <- (((abattement_forfaitaire_micro_total_plancher - | |
abattement_forfaitaire_micro_professionnel) - | |
catala_list_reduce( | |
temp_abattement_forfaitaire_micro_non_professionnel_3, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_abattement_forfaitaire_micro_non_professionnel_2, | |
revenus_quotientes_professionnels | |
) | |
)) - | |
catala_list_reduce( | |
temp_abattement_forfaitaire_micro_non_professionnel_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_abattement_forfaitaire_micro_non_professionnel, | |
revenus_quotientes_non_professionnels | |
) | |
)) | |
revenu_brut_global_revenus_imposables <- (((revenus_professionnels_1@revenus_imposables_micro - | |
abattement_forfaitaire_micro_professionnel) + | |
revenus_non_professionnels_1@revenus_imposables_micro) - | |
abattement_forfaitaire_micro_non_professionnel) | |
revenu_brut_global_plus_moins_value_court_terme <- (revenu_brut_global_revenus_imposables + | |
plus_moins_value_court_terme_benefices_industriels_commerciaux(new("catala_struct_PlusMoinsValueCourtTermeBeneficesIndustrielsCommerciauxIn", | |
plus_values_nettes_in = (revenus_professionnels_1@plus_values_nettes_court_terme_micro + | |
revenus_non_professionnels_1@plus_values_nettes_court_terme_micro), | |
moins_values_nettes_in = (revenus_professionnels_1@moins_values_nettes_court_terme_micro + | |
revenus_non_professionnels_1@moins_values_nettes_court_terme_micro) | |
))@revenu_brut_global) | |
return(new("catala_struct_BeneficesNonCommerciauxDeclarant", | |
abattement_forfaitaire_micro_professionnel = abattement_forfaitaire_micro_professionnel, | |
revenus_quotientes_professionnels = revenus_quotientes_professionnels, | |
abattement_forfaitaire_micro_non_professionnel = abattement_forfaitaire_micro_non_professionnel, | |
revenus_quotientes_non_professionnels = revenus_quotientes_non_professionnels, | |
prelevement_liberatoire_auto_entreprise = prelevement_liberatoire_auto_entreprise_arrondissement_1, | |
prelevement_liberatoire_plus_values_long_terme = prelevement_liberatoire_plus_values_long_terme_1, | |
revenu_brut_global = revenu_brut_global_plus_moins_value_court_terme | |
)) | |
} | |
traitements_salaires_foyer_fiscal <- function( | |
traitements_salaires_foyer_fiscal_in # ("catala_struct_TraitementsSalairesFoyerFiscalIn") | |
) { | |
declarant1 <- traitements_salaires_foyer_fiscal_in@declarant1_in | |
declarant2 <- traitements_salaires_foyer_fiscal_in@declarant2_in | |
declarations_personnes_a_charge <- traitements_salaires_foyer_fiscal_in@declarations_personnes_a_charge_in | |
annee_revenu_5 <- traitements_salaires_foyer_fiscal_in@annee_revenu_in | |
revenus_1 <- traitements_salaires_foyer_fiscal_in@revenus_in | |
temp_calcul_deduction_rente_viageres_titre_onereux <- function( | |
rente_viagere # ("catala_struct_RenteViagereOnereux") | |
) { | |
match_arg_32 <- rente_viagere@categorie | |
if (match_arg_32@code == "RenteViagereOnereuxMoins49Ans") { | |
dummy_var <- match_arg_32@value | |
temp_calcul_deduction_rente_viageres_titre_onereux_1 <- (catala_decimal_from_fraction(1, 1) - | |
catala_decimal_from_fraction(7, 10)) | |
} else if (match_arg_32@code == "RenteViagereOnereuxEntre50Et59Ans") { | |
dummy_var <- match_arg_32@value | |
temp_calcul_deduction_rente_viageres_titre_onereux_1 <- (catala_decimal_from_fraction(1, 1) - | |
catala_decimal_from_fraction(1, 2)) | |
} else if (match_arg_32@code == "RenteViagereOnereuxEntre60Et69Ans") { | |
dummy_var <- match_arg_32@value | |
temp_calcul_deduction_rente_viageres_titre_onereux_1 <- (catala_decimal_from_fraction(1, 1) - | |
catala_decimal_from_fraction(2, 5)) | |
} else if (match_arg_32@code == "RenteViagereOnereuxPlus70Ans") { | |
dummy_var <- match_arg_32@value | |
temp_calcul_deduction_rente_viageres_titre_onereux_1 <- (catala_decimal_from_fraction(1, 1) - | |
catala_decimal_from_fraction(3, 10)) | |
} | |
return((rente_viagere@valeur * | |
temp_calcul_deduction_rente_viageres_titre_onereux_1)) | |
} | |
calcul_deduction_rente_viageres_titre_onereux <- temp_calcul_deduction_rente_viageres_titre_onereux | |
match_arg_33 <- declarant2 | |
if (match_arg_33@code == "PasDeDeclaration") { | |
dummy_var <- match_arg_33@value | |
temp_declarations_revenus <- list() | |
} else if (match_arg_33@code == "Declaration") { | |
declarant2_1 <- match_arg_33@value | |
temp_declarations_revenus <- list(declarant2_1) | |
} | |
declarations_revenus <- ((list(declarant1) + temp_declarations_revenus) + | |
declarations_personnes_a_charge) | |
tryCatch( | |
{ | |
temp_plafond_abattement_pensions_retraites_rentes <- function(dummy_var # ("catala_unit") | |
) { | |
return(catala_money_from_cents(412300)) | |
} | |
temp_plafond_abattement_pensions_retraites_rentes_1 <- function(dummy_var # ("catala_unit") | |
) { | |
return((annee_revenu_5 == catala_integer_from_numeric(2022))) | |
} | |
temp_plafond_abattement_pensions_retraites_rentes_2 <- catala_handle_default( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 309, start_column = 11, end_line = 309, end_column = 55, | |
law_headings = c( | |
"Pour l'ensemble du foyer fiscal", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
), list(), | |
temp_plafond_abattement_pensions_retraites_rentes_1, | |
temp_plafond_abattement_pensions_retraites_rentes | |
) | |
}, | |
catala_empty_error = function(dummy__arg) { | |
stop(catala_no_value_provided_error( | |
catala_position( | |
filename = "sources/prologue.catala_fr", | |
start_line = 309, | |
start_column = 11, | |
end_line = 309, | |
end_column = 55, | |
law_headings = c( | |
"Pour l'ensemble du foyer fiscal", | |
"Détermination du revenu fiscal de référence", | |
"Prologue" | |
) | |
) | |
)) | |
} | |
) | |
plafond_abattement_pensions_retraites_rentes <- temp_plafond_abattement_pensions_retraites_rentes_2 | |
temp___8 <- function( | |
acc_1 # ("logical") | |
, | |
revenu_exceptionnel_ou_differe_3 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_34 <- revenu_exceptionnel_ou_differe_3@regime | |
if (match_arg_34@code == "Article163_0_A") { | |
dummy_var <- match_arg_34@value | |
temp___9 <- TRUE | |
} else if (match_arg_34@code == "Article163_0_A_bis") { | |
dummy_var <- match_arg_34@value | |
temp___9 <- FALSE | |
} | |
match_arg_35 <- revenu_exceptionnel_ou_differe_3@categorie | |
if (match_arg_35@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_35@value | |
temp___10 <- FALSE | |
} else if (match_arg_35@code == "RenteViagereOnereux") { | |
dummy_var <- match_arg_35@value | |
temp___10 <- TRUE | |
} else if (match_arg_35@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_35@value | |
temp___10 <- FALSE | |
} else if (match_arg_35@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_35@value | |
temp___10 <- FALSE | |
} | |
return((acc_1 && (temp___10 && temp___9))) | |
} | |
if (!(catala_list_fold_left( | |
temp___8, TRUE, | |
revenus_1@revenus_exceptionnels_ou_differes | |
))) { | |
stop(catala_assertion_failure(catala_position( | |
filename = "sources/vérifications.catala_fr", | |
start_line = 186, | |
start_column = 13, | |
end_line = 193, | |
end_column = 33, | |
law_headings = c( | |
"Case 0XX", | |
"Déclaration 2042", | |
"Vérification des saisies" | |
) | |
))) | |
} | |
temp_revenus_quotientes_2 <- function( | |
revenu_4 # ("catala_struct_RevenuExceptionnelOuDiffere") | |
) { | |
match_arg_36 <- revenu_4@categorie | |
if (match_arg_36@code == "TraitementsSalaires") { | |
dummy_var <- match_arg_36@value | |
temp_revenus_quotientes_3 <- catala_money_from_cents(0) | |
} else if (match_arg_36@code == "RenteViagereOnereux") { | |
categorie_rente_viagere <- match_arg_36@value | |
temp_revenus_quotientes_3 <- calcul_deduction_rente_viageres_titre_onereux( | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenu_4@valeur, | |
categorie = categorie_rente_viagere | |
) | |
) | |
} else if (match_arg_36@code == "PensionsRetraitesRentes") { | |
dummy_var <- match_arg_36@value | |
temp_revenus_quotientes_3 <- catala_money_from_cents(0) | |
} else if (match_arg_36@code == "MicroBeneficesNonCommerciaux") { | |
dummy_var <- match_arg_36@value | |
temp_revenus_quotientes_3 <- catala_money_from_cents(0) | |
} | |
return(calcul_revenu_quotiente(new("catala_struct_CalculRevenuQuotienteIn", | |
revenu_in = revenu_4, | |
deduction_in = temp_revenus_quotientes_3, | |
annee_revenu_in = annee_revenu_5 | |
))@revenu_quotiente) | |
} | |
revenus_quotientes_1 <- catala_list_map( | |
temp_revenus_quotientes_2, | |
revenus_1@revenus_exceptionnels_ou_differes | |
) | |
temp_rentes_viageres_titre_onereux_base <- function( | |
rente_viagere_1 # ("catala_struct_RenteViagereOnereux") | |
) { | |
return((rente_viagere_1@valeur - | |
calcul_deduction_rente_viageres_titre_onereux(rente_viagere_1))) | |
} | |
temp_rentes_viageres_titre_onereux_base_1 <- function( | |
sum1_12 # ("catala_money") | |
, sum2_12 # ("catala_money") | |
) { | |
return((sum1_12 + sum2_12)) | |
} | |
rentes_viageres_titre_onereux_base <- catala_list_reduce( | |
temp_rentes_viageres_titre_onereux_base_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_rentes_viageres_titre_onereux_base, | |
list( | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_percues_49moins_ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxMoins49Ans", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_percues_50_59ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxEntre50Et59Ans", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_percues_60_69ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxEntre60Et69Ans", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_percues_70plus_ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxPlus70Ans", | |
value = new("catala_unit", v = 0) | |
) | |
) | |
) | |
) | |
) | |
temp_resultats_liquidations_plafond_pensions_retraites_rentes <- function( | |
declaration_revenus # ("catala_struct_DeclarationTraitementsSalaires") | |
) { | |
result <- traitements_salaires_declarant(new("catala_struct_TraitementsSalairesDeclarantIn", | |
revenus_in = declaration_revenus, | |
annee_revenu_in = annee_revenu_5, | |
selecteur_plafond_abattement_pensions_retraites_rentes_in = new("catala_enum_SelecteurPlafondAbattementPensionsRetraitesRentes79", | |
code = "Deplafonne", | |
value = new("catala_unit", v = 0) | |
) | |
)) | |
return(new("catala_struct_ResultatsLiquidationPlafondPensionRetraitesRentes", | |
abattement_pensions_retraites_rentes = new("catala_struct_TraitementsSalairesDeclarant", | |
abattement_pensions_retraites_rentes = result@abattement_pensions_retraites_rentes, | |
deduction_frais_professionnels_traitements_salaires = result@deduction_frais_professionnels_traitements_salaires, | |
exonerations_81_quater = result@exonerations_81_quater, | |
prelevement_liberatoire = result@prelevement_liberatoire, | |
traitements_salaires_avec_deduction_frais_professionnels = result@traitements_salaires_avec_deduction_frais_professionnels, | |
revenu_brut_declarant_hors_quotient = result@revenu_brut_declarant_hors_quotient, | |
revenus_quotientes = result@revenus_quotientes | |
)@abattement_pensions_retraites_rentes, | |
revenus = declaration_revenus | |
)) | |
} | |
resultats_liquidations_plafond_pensions_retraites_rentes <- catala_list_map( | |
temp_resultats_liquidations_plafond_pensions_retraites_rentes, | |
declarations_revenus | |
) | |
temp_rentes_viageres_titre_onereux_etrangeres_imputables <- function( | |
rente_viagere_2 # ("catala_struct_RenteViagereOnereux") | |
) { | |
return((rente_viagere_2@valeur - | |
calcul_deduction_rente_viageres_titre_onereux(rente_viagere_2))) | |
} | |
temp_rentes_viageres_titre_onereux_etrangeres_imputables_1 <- function( | |
sum1_13 # ("catala_money") | |
, sum2_13 # ("catala_money") | |
) { | |
return((sum1_13 + sum2_13)) | |
} | |
rentes_viageres_titre_onereux_etrangeres_imputables <- (rentes_viageres_titre_onereux_base + | |
catala_list_reduce( | |
temp_rentes_viageres_titre_onereux_etrangeres_imputables_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_rentes_viageres_titre_onereux_etrangeres_imputables, | |
list( | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_etrangeres_imputables_percues_49moins_ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxMoins49Ans", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_etrangeres_imputables_percues_50_59ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxEntre50Et59Ans", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_etrangeres_imputables_percues_60_69ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxEntre60Et69Ans", | |
value = new("catala_unit", v = 0) | |
) | |
), | |
new("catala_struct_RenteViagereOnereux", | |
valeur = revenus_1@rentes_etrangeres_imputables_percues_70plus_ans, | |
categorie = new("catala_enum_CategorieRenteViagereOnereux", | |
code = "RenteViagereOnereuxPlus70Ans", | |
value = new("catala_unit", v = 0) | |
) | |
) | |
) | |
) | |
)) | |
temp_abbattement_total_deplafonne_pensions_retraites_rentes <- function( | |
resultats # ("catala_struct_ResultatsLiquidationPlafondPensionRetraitesRentes") | |
) { | |
return(resultats@abattement_pensions_retraites_rentes) | |
} | |
temp_abbattement_total_deplafonne_pensions_retraites_rentes_1 <- function( | |
sum1_14 # ("catala_money") | |
, sum2_14 # ("catala_money") | |
) { | |
return((sum1_14 + sum2_14)) | |
} | |
abbattement_total_deplafonne_pensions_retraites_rentes <- catala_list_reduce( | |
temp_abbattement_total_deplafonne_pensions_retraites_rentes_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_abbattement_total_deplafonne_pensions_retraites_rentes, | |
resultats_liquidations_plafond_pensions_retraites_rentes | |
) | |
) | |
temp_declarations_avec_plafond_pensions_retraites_rentes_correct <- function( | |
resultats_1 # ("catala_struct_ResultatsLiquidationPlafondPensionRetraitesRentes") | |
) { | |
if ((abbattement_total_deplafonne_pensions_retraites_rentes < | |
plafond_abattement_pensions_retraites_rentes)) { | |
temp_declarations_avec_plafond_pensions_retraites_rentes_correct_1 <- plafond_abattement_pensions_retraites_rentes | |
} else { | |
temp_declarations_avec_plafond_pensions_retraites_rentes_correct_1 <- catala_money_round((plafond_abattement_pensions_retraites_rentes * | |
(resultats_1@abattement_pensions_retraites_rentes / | |
abbattement_total_deplafonne_pensions_retraites_rentes))) | |
} | |
return(new("catala_struct_DeclarationAvecPlafondPensionRetraitesRentesCorrect", | |
revenus = resultats_1@revenus, | |
plafond_abattement_pensions_retraites_rentes = temp_declarations_avec_plafond_pensions_retraites_rentes_correct_1 | |
)) | |
} | |
declarations_avec_plafond_pensions_retraites_rentes_correct <- catala_list_map( | |
temp_declarations_avec_plafond_pensions_retraites_rentes_correct, | |
resultats_liquidations_plafond_pensions_retraites_rentes | |
) | |
temp_declarations_avec_resultats_traitements_salaires_avant_deficit_quotient <- function( | |
declaration_avec_plafond_correct # ("catala_struct_DeclarationAvecPlafondPensionRetraitesRentesCorrect") | |
) { | |
result_1 <- traitements_salaires_declarant(new("catala_struct_TraitementsSalairesDeclarantIn", | |
revenus_in = declaration_avec_plafond_correct@revenus, | |
annee_revenu_in = annee_revenu_5, | |
selecteur_plafond_abattement_pensions_retraites_rentes_in = new("catala_enum_SelecteurPlafondAbattementPensionsRetraitesRentes79", | |
code = "PlafondStandardOuProratise", | |
value = declaration_avec_plafond_correct@plafond_abattement_pensions_retraites_rentes | |
) | |
)) | |
return(new("catala_struct_TraitementsSalairesDeclarant", | |
abattement_pensions_retraites_rentes = result_1@abattement_pensions_retraites_rentes, | |
deduction_frais_professionnels_traitements_salaires = result_1@deduction_frais_professionnels_traitements_salaires, | |
exonerations_81_quater = result_1@exonerations_81_quater, | |
prelevement_liberatoire = result_1@prelevement_liberatoire, | |
traitements_salaires_avec_deduction_frais_professionnels = result_1@traitements_salaires_avec_deduction_frais_professionnels, | |
revenu_brut_declarant_hors_quotient = result_1@revenu_brut_declarant_hors_quotient, | |
revenus_quotientes = result_1@revenus_quotientes | |
)) | |
} | |
declarations_avec_resultats_traitements_salaires_avant_deficit_quotient <- catala_list_map( | |
temp_declarations_avec_resultats_traitements_salaires_avant_deficit_quotient, | |
declarations_avec_plafond_pensions_retraites_rentes_correct | |
) | |
temp_solde_revenu_brut_global_hors_quotient_avant_deficit_quotient <- function( | |
resultats_2 # ("catala_struct_TraitementsSalairesDeclarant") | |
) { | |
return(resultats_2@revenu_brut_declarant_hors_quotient) | |
} | |
temp_solde_revenu_brut_global_hors_quotient_avant_deficit_quotient_1 <- function( | |
sum1_15 # ("catala_money") | |
, sum2_15 # ("catala_money") | |
) { | |
return((sum1_15 + sum2_15)) | |
} | |
solde_revenu_brut_global_hors_quotient_avant_deficit_quotient <- ((catala_list_reduce( | |
temp_solde_revenu_brut_global_hors_quotient_avant_deficit_quotient_1, | |
catala_money_from_cents(0), | |
catala_list_map( | |
temp_solde_revenu_brut_global_hors_quotient_avant_deficit_quotient, | |
declarations_avec_resultats_traitements_salaires_avant_deficit_quotient | |
) | |
) + | |
rentes_viageres_titre_onereux_etrangeres_imputables) + | |
revenus_1@acquisition_d_actions_gratuites_gain_imposable) | |
imputation_deficit_sur_revenus_quotientes_dot_solde_categoriel_a_imputer <- solde_revenu_brut_global_hors_quotient_avant_deficit_quotient | |
temp_imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels <- function( | |
resultats_traitements_salaires # ("catala_struct_TraitementsSalairesDeclarant") | |
) { | |
temp_imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels_1 <- function(traitement_salaire_quotiente # ("catala_struct_RevenuQuotiente") | |
) { | |
return(traitement_salaire_quotiente) | |
} | |
return(catala_list_map( | |
temp_imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels_1, | |
resultats_traitements_salaires@revenus_quotientes | |
)) | |
} | |
imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels <- catala_list_map( | |
temp_imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels, | |
declarations_avec_resultats_traitements_salaires_avant_deficit_quotient | |
) | |
result_2 <- imputation_deficit_sur_revenus_quotientes(new("catala_struct_ImputationDeficitSurRevenusQuotientesIn", | |
solde_categoriel_a_imputer_in = imputation_deficit_sur_revenus_quotientes_dot_solde_categoriel_a_imputer, | |
revenus_quotientes_categoriels_in = imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels | |
)) | |
imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels_imputes <- result_2@revenus_quotientes_categoriels_imputes | |
imputation_deficit_sur_revenus_quotientes_dot_deficit_categoriel_impute <- result_2@deficit_categoriel_impute | |
revenu_brut_global_1 <- plancher( | |
solde_revenu_brut_global_hors_quotient_avant_deficit_quotient, | |
catala_money_from_cents(0) | |
) | |
deficit_brut_global <- plafond( | |
(solde_revenu_brut_global_hors_quotient_avant_deficit_quotient + | |
imputation_deficit_sur_revenus_quotientes_dot_deficit_categoriel_impute), | |
catala_money_from_cents(0) | |
) | |
temp_declarations_avec_resultats_traitements_salaires <- function( | |
nouveaux_revenus_quotientes # ("list" # array("catala_struct_RevenuQuotiente")) | |
, | |
resultats_traitements_salaires_1 # ("catala_struct_TraitementsSalairesDeclarant") | |
) { | |
nouveaux_revenus_quotientes_resultats_traitements_salaires <- list( | |
nouveaux_revenus_quotientes, resultats_traitements_salaires_1 | |
) | |
return(new("catala_struct_TraitementsSalairesDeclarant", | |
abattement_pensions_retraites_rentes = (nouveaux_revenus_quotientes_resultats_traitements_salaires)[1]@abattement_pensions_retraites_rentes, | |
deduction_frais_professionnels_traitements_salaires = (nouveaux_revenus_quotientes_resultats_traitements_salaires)[1]@deduction_frais_professionnels_traitements_salaires, | |
exonerations_81_quater = (nouveaux_revenus_quotientes_resultats_traitements_salaires)[1]@exonerations_81_quater, | |
prelevement_liberatoire = (nouveaux_revenus_quotientes_resultats_traitements_salaires)[1]@prelevement_liberatoire, | |
traitements_salaires_avec_deduction_frais_professionnels = (nouveaux_revenus_quotientes_resultats_traitements_salaires)[1]@traitements_salaires_avec_deduction_frais_professionnels, | |
revenu_brut_declarant_hors_quotient = (nouveaux_revenus_quotientes_resultats_traitements_salaires)[1]@revenu_brut_declarant_hors_quotient, | |
revenus_quotientes = (nouveaux_revenus_quotientes_resultats_traitements_salaires)[0] | |
)) | |
} | |
declarations_avec_resultats_traitements_salaires <- catala_list_map2( | |
temp_declarations_avec_resultats_traitements_salaires, | |
imputation_deficit_sur_revenus_quotientes_dot_revenus_quotientes_categoriels_imputes, | |
declarations_avec_resultats_traitements_salaires_avant_deficit_quotient | |
) | |
return(new("catala_struct_TraitementsSalairesFoyerFiscal", | |
declarations_avec_resultats_traitements_salaires = declarations_avec_resultats_traitements_salaires, | |
rentes_viageres_titre_onereux = rentes_viageres_titre_onereux_etrangeres_imputables, | |
revenu_brut_global = revenu_brut_global_1, | |
deficit_brut_global = deficit_brut_global, | |
revenus_quotientes = revenus_quotientes_1 | |
)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment