Comentário sobre número de dependentes com instrução
[cascardo/declara.git] / lib / calcula.c
index 607ff9d..cb0c357 100644 (file)
@@ -73,6 +73,7 @@ static void calculo_instrucao(struct declaracao *dec)
                        }
                }
                if (instrucao_dependente) {
+                       /* Conta número de dependentes com instrução. */
                        totais_add(dec, "DEPSINSTRUCAO", 1);
                        if (dec->verbose) {
                                printf("Dependente %s (%d) tem instrução\n", d->nome, i);
@@ -193,7 +194,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 +215,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 +235,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;