Utiliza CNPJ de previdência privada no cabeçalho.
[cascardo/declara.git] / gera.c
diff --git a/gera.c b/gera.c
index 3f0b4b6..4b1c0fe 100644 (file)
--- a/gera.c
+++ b/gera.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include "totais.h"
 
 static void gera_header(struct declaracao *dec, FILE *f)
 {
@@ -96,8 +97,10 @@ static void gera_header(struct declaracao *dec, FILE *f)
        fprintf(f, "%-8.8s", ""); /* DN Dependente 5 */
        fprintf(f, "%-11.11s", ""); /* CPF Dependente 6 */
        fprintf(f, "%-8.8s", ""); /* DN Dependente 6 */
-       fprintf(f, "%-14.14s", ""); /* TODO: medico maior */
-       fprintf(f, "%-14.14s", ""); /* TODO: medico maior 2 */
+       /* medico maior, TODO: outros códigos */
+       fprintf(f, "%-14.14s", pagamento_cnpj_ordenado(dec, 26, 0));
+       /* medico maior 2, TODO: outros códigos */
+       fprintf(f, "%-14.14s", pagamento_cnpj_ordenado(dec, 26, 1));
        fprintf(f, "%-11.11s", ""); /* CPF pensao */
        fprintf(f, "%-11.11s", ""); /* CPF inventariante */
        fprintf(f, "%-40.40s", dec->contribuinte.municipio);
@@ -108,8 +111,10 @@ static void gera_header(struct declaracao *dec, FILE *f)
        fprintf(f, "%-11.11s", ""); /* CPF procurador */
        fprintf(f, "%03d", dec->obrigatoria); /* criterio obrigatoriedade */
        fprintf(f, "%013lld", totais_get(dec, "RENDPJ")); /* Total tributavel */
-       fprintf(f, "%-14.14s", ""); /* TODO: CNPJ previdencia */
-       fprintf(f, "%-14.14s", ""); /* TODO: CNPJ previdencia 2 */
+       /* CNPJ previdencia */
+       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 */