Adiciona totais de rendimentos tributáveis.
[cascardo/declara.git] / lib / calcula.c
index 607ff9d..ac2ed73 100644 (file)
@@ -193,7 +193,7 @@ static long long imposto_simples(struct declaracao *dec)
        struct taxtable *tt;
        long long tr, td;
        tt = table[ANO(dec->ano)];
-       tr = totais_get(dec, "RENDPJ");
+       tr = totais_get(dec, "RENDTRIB");
        if (tr / 5 < simples[ANO(dec->ano)])
                td = tr / 5;
        else
@@ -214,7 +214,7 @@ static long long imposto_completa(struct declaracao *dec)
        struct taxtable *tt;
        long long tr, td;
        tt = table[ANO(dec->ano)];
-       tr = totais_get(dec, "RENDPJ");
+       tr = totais_get(dec, "RENDTRIB");
        td = total_deducao(dec);
        totais_add(dec, "DEDUCOES", td);
        tr -= td;
@@ -234,12 +234,12 @@ int calcula(struct declaracao *dec)
                dec_set_error(dec, "Ano %d não suportado.", dec->ano);
                return -EINVAL;
        }
-       if (totais_get(dec, "RENDPJ") > obrigatoriedade[ANO(dec->ano)]) {
+       if (totais_get(dec, "RENDTRIB") > obrigatoriedade[ANO(dec->ano)]) {
                if (dec->verbose) {
                        printf("Declaracao obrigatoria pois rendimento e"
                                "maior que mínimo para declaracao: "
                                FMT_R" > "FMT_R"\n",
-                               R(totais_get(dec, "RENDPJ")),
+                               R(totais_get(dec, "RENDTRIB")),
                                R(obrigatoriedade[ANO(dec->ano)]));
                }
                dec->obrigatoria = 1;