From c540b75fc3b5fd7299a6916dadcb92124fdf552f Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sun, 19 Jul 2015 11:36:58 -0300 Subject: [PATCH] =?utf8?q?Inclui=20imposto=20sobre=20d=C3=A9cimo=20terceir?= =?utf8?q?o=20no=20rendimento?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit O arquivo de declaração inclui esse valor na linha sobre rendimentos de PJ. --- rendimento.c | 12 +++++++----- rendimento.h | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rendimento.c b/rendimento.c index f4ab9b2..80311db 100644 --- a/rendimento.c +++ b/rendimento.c @@ -45,17 +45,19 @@ static struct rendimento * rendimento_new(char **args) rendimento = malloc(sizeof(*rendimento)); rendimento->cnpj = strdup(args[1]); rendimento->nome = strdup(args[2]); - rendimento->saida = strdup(args[7]); + rendimento->saida = strdup(args[8]); r += set_llong(args[3], &rendimento->rendimento); r += set_llong(args[4], &rendimento->previdencia); r += set_llong(args[5], &rendimento->decimoterceiro); r += set_llong(args[6], &rendimento->imposto); + r += set_llong(args[7], &rendimento->imposto_13o); if (!rendimento->cnpj || !rendimento->nome || !rendimento->saida) { rendimento_free(rendimento); return NULL; } if (r < 0 || rendimento->rendimento < 0 || rendimento->previdencia < 0 || - rendimento->decimoterceiro < 0 || rendimento->imposto < 0) { + rendimento->decimoterceiro < 0 || rendimento->imposto < 0 || + rendimento->imposto_13o < 0) { rendimento_free(rendimento); return NULL; } @@ -66,7 +68,7 @@ static int run_rendimento(struct declaracao *dec, char **args, int argc) { struct rendimento *rendimento; int r; - if (argc != 8) + if (argc != 9) return -EINVAL; rendimento = rendimento_new(args); if (!rendimento) @@ -84,9 +86,9 @@ void rendimento_salva(struct declaracao *dec, FILE *f) int i; struct rendimento *j; for (i = 0; j = list_get(dec->rendimento, i); i++) - fprintf(f, "rendimento \"%s\" \"%s\" %lld %lld %lld %lld \"%s\"\n", + fprintf(f, "rendimento \"%s\" \"%s\" %lld %lld %lld %lld %lld \"%s\"\n", j->cnpj, j->nome, j->rendimento, j->previdencia, - j->decimoterceiro, j->imposto, j->saida); + j->decimoterceiro, j->imposto, j->imposto_13o, j->saida); } static struct cmd cmd_rendimento = { diff --git a/rendimento.h b/rendimento.h index 11fc0ab..0f183a7 100644 --- a/rendimento.h +++ b/rendimento.h @@ -29,6 +29,7 @@ struct rendimento { long long previdencia; long long decimoterceiro; long long imposto; + long long imposto_13o; char *saida; }; -- 2.20.1