X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=lib%2Fgera.c;h=f4766278b068855e1dc2ee30809cebbbd5311def;hb=3d8989b4080bc97feaa4d2f2a227f5c97ab2919c;hp=eac97ea558cda9752dc436bd6bc9da0c3a09b644;hpb=28758bdce393fac0a8366a1d51b9947321c86b10;p=cascardo%2Fdeclara.git diff --git a/lib/gera.c b/lib/gera.c index eac97ea..f476627 100644 --- a/lib/gera.c +++ b/lib/gera.c @@ -88,10 +88,10 @@ static void gera_header(struct declaracao *dec, FILE *f) fprintf(f, " "); /* RRA4 */ fprintf(f, "%-11.11s", ""); /* CPF RRA4 */ fprintf(f, "0000000000000"); /* TODO: Doacao ECA */ - fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 0)); /* TODO: CNPJ maior */ - fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 1)); /* TODO: CNPJ maior 2 */ - fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 2)); /* TODO: CNPJ maior 3 */ - fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 3)); /* TODO: CNPJ maior 4 */ + fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 0)); /* CNPJ maior */ + fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 1)); /* CNPJ maior 2 */ + fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 2)); /* CNPJ maior 3 */ + fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 3)); /* CNPJ maior 4 */ fprintf(f, "%-11.11s", ""); /* CPF Dependente 1 */ fprintf(f, "%-8.8s", ""); /* DN Dependente 1 */ fprintf(f, "%-11.11s", ""); /* CPF Dependente 2 */ @@ -182,7 +182,7 @@ static void gera_contribuinte(struct declaracao *dec, FILE *f) fprintf(f, "%-13.13s", dec->contribuinte.titulo_eleitor); fprintf(f, "%03d", dec->contribuinte.ocupacao_principal); fprintf(f, "%02d", dec->contribuinte.natureza_ocupacao); - fprintf(f, "0"); /* TODO: qnt quotas */ + fprintf(f, "%d", dec->pagar ? 1 : 0); /* TODO/FIXME: qnt quotas */ fprintf(f, "%s", dec->tipo == COMPLETA ? "S" : "N"); fprintf(f, "%s", dec->retifica ? "S" : "N"); fprintf(f, "S"); /* GERADO */ @@ -254,11 +254,11 @@ static void gera_totais_simples(struct declaracao *dec, FILE *f) 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 */ - fprintf(f, "%d", 0); /* TODO: quotas */ - fprintf(f, "%013lld", 0); /* TODO: valor quota */ + fprintf(f, "%d", dec->pagar ? 1 : 0); /* TODO/FIXME: quotas */ + fprintf(f, "%013lld", dec->pagar); /* TODO: valor quota */ fprintf(f, "%013lld", totais_get(dec, "ISENTOS")); /* rendimentos isentos */ fprintf(f, "%013lld", totais_get(dec, "EXCLUSIVOS")); /* rendimentos tributação exclusiva */ - fprintf(f, "%013lld", dec->conjuge.total); /* TODO: conjuge */ + fprintf(f, "%013lld", dec->conjuge.total); /* conjuge */ fprintf(f, "%013lld", 0); /* TODO: rendimento PJ dependente */ fprintf(f, "%013lld", 0); /* TODO: imposto retido dependente */ fprintf(f, "%013lld", 0); /* TODO: imposto ganhos de capital */ @@ -440,8 +440,8 @@ static void gera_recibodetalhe(struct declaracao *dec, FILE *f) fprintf(f, "%013lld", dec->devido); /* Imposto devido */ fprintf(f, "%013lld", dec->restituicao); /* Imposto a restituir */ fprintf(f, "%013lld", dec->pagar); /* Imposto a pagar */ - fprintf(f, "%d", 0); /* TODO: quotas */ - fprintf(f, "%013lld", 0); /* TODO: valor quota */ + fprintf(f, "%d", dec->pagar ? 1 : 0); /* TODO/FIXME: quotas */ + fprintf(f, "%013lld", dec->pagar); /* TODO: valor quota */ fprintf(f, "%-3.3s", dec->banco ? : "000"); /* numero banco */ fprintf(f, "%-4.4s", dec->agencia ? : "0000"); /* numero agencia */ fprintf(f, " "); /* FILLER */