Mostra outras deduções no modo verboso
[cascardo/declara.git] / lib / calcula.c
index 47548b3..8aa0cc1 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);
@@ -100,6 +101,8 @@ static long long total_deducao(struct declaracao *dec)
                printf("\tDependentes: "FMT_R"\n", R(totais_get(dec, "DEPENDENTES")));
                printf("\tINSS: "FMT_R"\n", R(totais_get(dec, "INSS")));
                printf("\tInstrução: "FMT_R"\n", R(totais_get(dec, "INSTRUCAO")));
+               printf("\tMédicas: "FMT_R"\n", R(totais_get(dec, "MEDICAS")));
+               printf("\tPrevidência: "FMT_R"\n", R(totais_get(dec, "PREVIDENCIA")));
                printf("\tPagamentos: "FMT_R"\n", R(totais_get(dec, "PAGAMENTOS")));
                printf("\tReembolsos: -"FMT_R"\n", R(totais_get(dec, "REEMBOLSOS")));
        }
@@ -193,7 +196,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 +217,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;
@@ -231,15 +234,15 @@ int calcula(struct declaracao *dec)
 {
        long long i_simples, i_completa;
        if (!ANO_VALIDO(dec->ano)) {
-               dec_set_error(dec, "Ano %d não suportado.\n", dec->ano);
+               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;