def formula_2020_01(articles, period, parameters) -> numpy.ndarray: annee_production = period.last_year params = parameters(period).taxes.guyane investissements = articles("investissement", annee_production) taxes_brutes = articles("taxe_guyane_brute", period) taux_deduction = params.deductions.taux montant_deduction_max = params.deductions.montant # proratisation à la surface pour l'entité article surface_communale = articles("surface_communale", annee_production) surface_totale = articles("surface_totale", annee_production) deduction_toutes_communes = round_( min_( montant_deduction_max, min_(investissements, taxes_brutes * taux_deduction), ), decimals=2, ) deduction = numpy.divide(deduction_toutes_communes * surface_communale, surface_totale, out=numpy.zeros(len(surface_communale)), where=(surface_totale != 0)) return round_(deduction, decimals=2)
def formula(societes, period, parameters) -> numpy.ndarray: annee_production = period.last_year params = parameters(period).taxes.guyane quantites = societes("quantite_aurifere_kg", annee_production) categories = societes("categorie", annee_production).decode() tarifs = (params.categories[categorie.name] for categorie in categories) tarifs = numpy.fromiter(tarifs, dtype = float) return round_(quantites * tarifs, decimals = 2)
def formula(articles, period, parameters) -> numpy.ndarray: annee_production = period.last_year params = parameters(period).taxes.guyane investissements = articles("investissement", annee_production) taxes_brutes = articles("taxe_guyane_brute", period) taux_deduction = params.deductions.taux montant_deduction_max = params.deductions.montant return round_( min_( montant_deduction_max, min_(investissements, taxes_brutes * taux_deduction), ), decimals=2, )
def formula_2020_01(articles, period, parameters) -> numpy.ndarray: annee_production = period.last_year params = parameters(period).taxes.guyane quantites = articles("quantite_aurifere_kg", annee_production) categories = articles("categorie", annee_production).decode() tarifs = (params.categories[categorie.name] for categorie in categories) tarifs = numpy.fromiter(tarifs, dtype=float) # proratisation à la surface pour l'entité article surface_communale = articles("surface_communale", annee_production) surface_totale = articles("surface_totale", annee_production) taxe = numpy.divide((quantites * tarifs) * surface_communale, surface_totale, out=numpy.zeros(len(surface_communale)), where=(surface_totale != 0)) return round_(taxe, decimals=2)
def formula(articles, period, parameters) -> numpy.ndarray: taxes_brutes = articles("taxe_guyane_brute", period) deduction = articles("taxe_guyane_deduction", period) return round_(taxes_brutes - deduction, decimals=2)