Adiciona totais de rendimentos tributáveis.
[cascardo/declara.git] / lib / gera.c
index bd70fdc..96574ce 100644 (file)
@@ -135,7 +135,7 @@ static void gera_header(struct declaracao *dec, FILE *f)
        fprintf(f, "%08d", 0); /* Data saída */
        fprintf(f, "%-11.11s", ""); /* CPF procurador */
        fprintf(f, "%03d", dec->obrigatoria); /* criterio obrigatoriedade */
-       fprintf(f, "%013lld", totais_get(dec, "RENDPJ")); /* Total tributavel */
+       fprintf(f, "%013lld", totais_get(dec, "RENDTRIB")); /* Total tributavel */
        /* CNPJ previdencia */
        fprintf(f, "%-14.14s", inss_cnpj_ordenado(dec, 0));
        /* CNPJ previdencia 2 */
@@ -277,11 +277,11 @@ static void gera_simples(struct declaracao *dec, FILE *f)
        fprintf(f, "%013lld", totais_get(dec, "EXCLUSIVOSDEP")); /* exclusivos dependentes */
        fprintf(f, "%-13.13s", ""); /* FILLER */
        fprintf(f, "%-13.13s", ""); /* FILLER */
-       fprintf(f, "%013lld", 0); /* TODO: rendimentos PF */
+       fprintf(f, "%013lld", totais_get(dec, "RENDPF")); /* rendimentos PF */
        fprintf(f, "%013lld", 0); /* TODO: rendimentos PF dependentes */
        fprintf(f, "%013lld", 0); /* TODO: rendimentos PF exterior */
        fprintf(f, "%013lld", 0); /* TODO: rendimentos PF ext. depend. */
-       fprintf(f, "%013lld", 0); /* TODO: carnê-leão PF? */
+       fprintf(f, "%013lld", totais_get(dec, "RENDPF")); /* TODO: carnê-leão PF? */
        fprintf(f, "%013lld", 0); /* TODO: carnê-leão dependentes */
        fprintf(f, "%013lld", totais_get(dec, "DEPENDENTES")); /* dedução dependentes */
        fprintf(f, "%013lld", 0); /* TODO: previdência RRA */
@@ -297,7 +297,7 @@ static void gera_totais_simples(struct declaracao *dec, FILE *f)
 {
        fprintf(f, "18");
        fprintf(f, "%s", dec->cpf); /* CPF: 11 dígitos */
-       fprintf(f, "%013lld", totais_get(dec, "RENDPJ")); /* TODO: rendimentos tributáveis */
+       fprintf(f, "%013lld", totais_get(dec, "RENDTRIB")); /* rendimentos tributáveis */
        /* desconto simplificado */
        fprintf(f, "%013lld", totais_get(dec, "DESCONTO"));
         /* base de cálculo */
@@ -305,7 +305,7 @@ static void gera_totais_simples(struct declaracao *dec, FILE *f)
        fprintf(f, "%013lld", dec->devido); /* imposto devido */
        fprintf(f, "%013lld", dec->retido); /* imposto retido */
        fprintf(f, "%013lld", 0); /* TODO: imposto complementar */
-       fprintf(f, "%013lld", 0); /* TODO: carnê-leão */
+       fprintf(f, "%013lld", totais_get(dec, "RENDPF")); /* TODO: carnê-leão */
        fprintf(f, "%013lld", 0); /* TODO: imposto retido Lei 11.033 */
        fprintf(f, "%013lld", dec->restituicao); /* imposto a restituir */
        fprintf(f, "%013lld", dec->pagar); /* imposto pagar */
@@ -383,7 +383,7 @@ static void gera_completa(struct declaracao *dec, FILE *f)
        fprintf(f, "%013lld", 0); /* TODO: 13o dependente */
        fprintf(f, "%05d", totais_get(dec, "DEPSINSTRUCAO")); /* dependentes com instrucao */
        fprintf(f, "%05d", 0); /* TODO: alimentandos com instrucao */
-       fprintf(f, "%013lld", 0); /* TODO: rendimentos PF titular */
+       fprintf(f, "%013lld", totais_get(dec, "RENDPFTIT")); /* TODO: rendimentos PF titular */
        fprintf(f, "%013lld", 0); /* TODO: rendimentos PF dependente */
        fprintf(f, "%013lld", 0); /* TODO: rendimentos PF exterior titular */
        fprintf(f, "%013lld", 0); /* TODO: rendimentos PF exterior dependente */
@@ -404,10 +404,10 @@ static void gera_totais_completa(struct declaracao *dec, FILE *f)
        fprintf(f, "%s", dec->cpf); /* CPF: 11 dígitos */
        /* FIXME: completar campos */
        fprintf(f, "%013lld", totais_get(dec, "RENDPJTIT")); /* rendimentos PJ titular */
-       fprintf(f, "%013lld", 0); /* TODO: rendimentos PF titular */
+       fprintf(f, "%013lld", totais_get(dec, "RENDPFTIT")); /* TODO: rendimentos PF titular */
        fprintf(f, "%013lld", 0); /* TODO: rendimentos PF dependente */
        fprintf(f, "%013lld", 0); /* TODO: resultado atividade rural */
-       fprintf(f, "%013lld", totais_get(dec, "RENDPJ")); /* TODO: total rendimentos tributáveis */
+       fprintf(f, "%013lld", totais_get(dec, "RENDTRIB")); /* total rendimentos tributáveis */
        /* TODO (2016): somar FUNPRESP até o limite */
        fprintf(f, "%013lld", totais_get(dec, "INSS")); /* previdencia oficial */
        /* TODO (2016): somar FUNPRESP acima do limite */
@@ -427,7 +427,7 @@ static void gera_totais_completa(struct declaracao *dec, FILE *f)
        fprintf(f, "%013lld", dec->devido); /* TODO: imposto devido menos patronal */
        fprintf(f, "%013lld", dec->devido); /* TODO: imposto devido mais RRA */
        fprintf(f, "%013lld", dec->retido); /* imposto na fonte */
-       fprintf(f, "%013lld", 0); /* TODO: carne leao */
+       fprintf(f, "%013lld", totais_get(dec, "RENDPF")); /* TODO: carne leao */
 
        fprintf(f, "%013lld", 0); /* TODO: imposto complementar */
        fprintf(f, "%013lld", 0); /* TODO: imposto pago exterior */
@@ -621,7 +621,7 @@ static void gera_recibodetalhe(struct declaracao *dec, FILE *f)
        fprintf(f, "%-4.4s", dec->contribuinte.ddd ?: "");
        fprintf(f, "%-9.9s", dec->contribuinte.telefone ?: "");
        fprintf(f, "%s", dec->retifica ? "S" : "N"); /* Retificadora */
-       fprintf(f, "%013lld", totais_get(dec, "RENDPJ")); /* Total tributavel */
+       fprintf(f, "%013lld", totais_get(dec, "RENDTRIB")); /* Total tributavel */
        fprintf(f, "%013lld", dec->devido); /* Imposto devido */
        fprintf(f, "%013lld", dec->restituicao); /* Imposto a restituir */
        fprintf(f, "%013lld", dec->pagar); /* Imposto a pagar */