Utiliza o dicionário de totais para o cabeçalho.
authorThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Sun, 2 Aug 2015 01:54:10 +0000 (22:54 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Sun, 2 Aug 2015 01:54:10 +0000 (22:54 -0300)
Os totais de rendimentos isentos e tributados exclusivamente na fonte e
o total de pagamentos estão presentes no cabeçalho.

gera.c

diff --git a/gera.c b/gera.c
index 4b1c0fe..829de46 100644 (file)
--- a/gera.c
+++ b/gera.c
@@ -115,9 +115,12 @@ static void gera_header(struct declaracao *dec, FILE *f)
        fprintf(f, "%-14.14s", pagamento_cnpj_ordenado(dec, 36, 0));
        /* CNPJ previdencia 2 */
        fprintf(f, "%-14.14s", pagamento_cnpj_ordenado(dec, 36, 1));
-       fprintf(f, "%013lld", 0); /* TODO: Total isentos */
-       fprintf(f, "%013lld", 0); /* TODO: Total exclusivo */
-       fprintf(f, "%013lld", 0); /* TODO: Total pagamentos */
+       /* Total isentos */
+       fprintf(f, "%013lld", totais_get(dec, "ISENTOS"));
+       /* Total exclusivo */
+       fprintf(f, "%013lld", totais_get(dec, "EXCLUSIVOS"));
+       /* Total pagamentos */
+       fprintf(f, "%013lld", totais_get(dec, "PAGAMENTOS"));
        fprintf(f, "%-13.13s", dec->contacorrente); /* numero conta */
        fprintf(f, "%-2.2s", dec->dvconta); /* DV conta */
        fprintf(f, "0"); /* TODO: revalidar DV conta */