openfisca / openfisca-france-fiscalite-miniere

French mining tax system for OpenFisca
GNU Affero General Public License v3.0
3 stars 2 forks source link

Impossible de calculer la taxe Guyane #24

Closed vmaubert closed 2 years ago

vmaubert commented 2 years ago

Lorsque l’on souhaite calculer la taxe Guyane, on obtient l’erreur suivante :

  File "/usr/local/lib/python3.7/site-packages/openfisca_core/entities.py", line 45, in check_variable_defined_for_entity
    raise ValueError(message)
ValueError: You tried to compute the variable 'categorie' for the entity 'articles';
however the variable 'categorie' is defined for 'titres'.
Learn more about entities in our documentation:
<https://openfisca.org/doc/coding-the-legislation/50_entities.html>.

Voici le payload utilisé :

{
    "articles": {
        "m-ax-lieu-dit-OR-COMMUNE1": {
            "quantite_aurifere_kg": {
                "2021": 1000
            },
            "surface_communale": {
                "2021": 0.5
            },
            "taxe_guyane": {
                "2022": null
            },
            "surface_totale": {
                "2021": 0.5
            }
        },
        "m-ax-lieu-dit-SEL-RAFFINE-COMMUNE1": {
            "quantite_sel_raffine_kt": {
                "2021": 1000
            },
            "surface_totale": {
                "2021": 0.5
            }
        }
    },
    "titres": {
        "m-ax-lieu-dit": {
            "commune_principale_exploitation": {
                "2021": "COMMUNE1"
            },
            "operateur": {
                "2021": "amazon mines SAS"
            },
            "categorie":  {
                "2021": "pme"
            },
            "investissement":  {
                "2021": "4500"
            },
            "articles": [
                "m-ax-lieu-dit-OR-COMMUNE1",
                "m-ax-lieu-dit-SEL-RAFFINE-COMMUNE1"
            ]
        }
    },
    "communes": {
        "COMMUNE1": {
            "articles": [
                "m-ax-lieu-dit-OR-COMMUNE1",
                "m-ax-lieu-dit-SEL-RAFFINE-COMMUNE1"
            ]
        }
    }
}

Merci d’avance 😃