+}
+
+static void gera_isentos(struct declaracao *dec, FILE *f)
+{
+ fprintf(f, "23");
+ fprintf(f, "%-11.11s", dec->cpf);
+ fprintf(f, "%013lld", 0); /* TODO: bolsa de estudo */
+ fprintf(f, "%013lld", 0); /* TODO: pecúlio de previdência privada */
+ fprintf(f, "%013lld", 0); /* TODO: FGTS, aviso prévio indenizado */
+ fprintf(f, "%013lld", 0); /* TODO: ganho de capital isento */
+ fprintf(f, "%013lld", 0); /* TODO: lucros e dividendos */
+ fprintf(f, "%013lld", 0); /* TODO: atividade rural */
+ fprintf(f, "%013lld", 0); /* TODO: contribuintes com 65 anos ou mais */
+ fprintf(f, "%013lld", 0); /* TODO: pensão por invalidez */
+ fprintf(f, "%013lld", totais_get(dec, "POUPANCA"));
+ fprintf(f, "%013lld", 0); /* TODO: sócio ou titular de empresa */
+ fprintf(f, "%013lld", 0); /* TODO: herança, transferências patrimoniais */
+ fprintf(f, "%013lld", 0); /* TODO: outros rendimentos isentos */
+ fprintf(f, "%-60.60s", ""); /* FILLER1 */
+ fprintf(f, "%-13.13s", ""); /* FILLER2 */
+ fprintf(f, "%013lld", 0); /* TODO: alienação bens pequeno valor */
+ fprintf(f, "%013lld", 0); /* TODO: alienação único imóvel */
+ fprintf(f, "%013lld", 0); /* TODO: redução ganho capital */
+ fprintf(f, "%013lld", 0); /* TODO: total bens pequeno valor, transportado GC */
+ fprintf(f, "%013lld", 0); /* TODO: alienção único imóvel, transportado GC */
+ fprintf(f, "%013lld", 0); /* TODO: redução ganho capital, transportado GC */
+ fprintf(f, "%013lld", 0); /* TODO: ganho capital - moeda estrangeira */
+ fprintf(f, "%013lld", 0); /* TODO: ganho capital - moeda estrangeira, transportado */
+ fprintf(f, "%013lld", 0); /* TODO: GC total informado */
+ fprintf(f, "%013lld", 0); /* TODO: GC total transportado */
+ fprintf(f, "%013lld", 0); /* TODO: imposto renda anos anteriores */
+ fprintf(f, "%013lld", 0); /* TODO: rencimentos assalariados moeda estrangeira */
+ fprintf(f, "%013lld", 0); /* TODO: bonificações ações */
+ fprintf(f, "%013lld", 0); /* TODO: médicos residentes */
+ fprintf(f, "%013lld", 0); /* TODO: volutários da Copa */
+ fprintf(f, "%013lld", 0); /* TODO: meação e dissolução */
+ fprintf(f, "%013lld", 0); /* TODO: ganhos líquidos com ações */
+ fprintf(f, "%013lld", 0); /* TODO: ganhos de capital com ouro */
+ fprintf(f, "%013lld", 0); /* TODO: recuperação prejuízos na bolsa */
+ fprintf(f, "%013lld", 0); /* TODO: transportador de cargas */
+ fprintf(f, "%013lld", 0); /* TODO: transportador de passageiros */
+ fprintf(f, "%013lld", 0); /* TODO: retistuição imposto anos anteriores */
+}
+
+static void gera_exclusivos(struct declaracao *dec, FILE *f)
+{
+ fprintf(f, "24");
+ fprintf(f, "%-11.11s", dec->cpf);
+ fprintf(f, "%013lld", totais_get(dec, "DECIMOTERCEIRO"));
+ fprintf(f, "%013lld", 0); /* TODO: ganho de capital */
+ fprintf(f, "%013lld", 0); /* TODO: ganho líquido renda variável */
+ fprintf(f, "%013lld", totais_get(dec, "APLICACOES")); /* TODO: aplicações financeiras */
+ fprintf(f, "%013lld", 0); /* TODO: outros */
+ fprintf(f, "%-60.60s", ""); /* FILLER1 */
+ fprintf(f, "%013lld", 0); /* TODO: ganhos de capital alienação de bens */
+ fprintf(f, "%013lld", 0); /* TODO: ganhos de capital moeda estrangeira */
+ fprintf(f, "%013lld", 0); /* TODO: décimo terceiro dependentes */
+ fprintf(f, "%-13.13s", ""); /* FILLER2 */
+ fprintf(f, "%-60.60s", ""); /* FILLER3 */
+ fprintf(f, "%013lld", 0); /* TODO: RRA */
+ fprintf(f, "%013lld", 0); /* TODO: RRA dependentes */
+ fprintf(f, "%013lld", 0); /* TODO: Juros capital próprio */
+ fprintf(f, "%013lld", totais_get(dec, "PLR"));
+}
+
+static void gera_conjuge(struct declaracao *dec, FILE *f)
+{
+ fprintf(f, "29");
+ fprintf(f, "%-11.11s", dec->cpf);
+ fprintf(f, "%-11.11s", dec->conjuge.cpf);
+ fprintf(f, "%013lld", dec->conjuge.base);
+ fprintf(f, "%013lld", dec->conjuge.imposto);
+ fprintf(f, "%013lld", dec->conjuge.isento);
+ fprintf(f, "%013lld", dec->conjuge.exclusivo);
+ fprintf(f, "%013lld", dec->conjuge.rendpj_exigibilidade_suspensa);
+ fprintf(f, "%013lld", dec->conjuge.total);
+ fprintf(f, "%c", dec->conjuge.entregou ? 'S' : 'N');