From ae7d1cdda9a71ffb6f7210562cdedfa8d7995e08 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sat, 1 Aug 2015 11:58:42 -0300 Subject: [PATCH] Soma total do INSS durante processamento de rendimentos. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Utiliza o total de INSS nas deduções, fazendo a soma e armazenamento do total durante o processamento de rendimentos. --- calcula.c | 11 ++++------- rendimento.c | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/calcula.c b/calcula.c index 44a3bf9..a78d1c8 100644 --- a/calcula.c +++ b/calcula.c @@ -24,15 +24,12 @@ #include "rendimento.h" #include "totais.h" +/* Alguns totais precisam ser limitados. Portanto, um total de decuções + * precisa ser ajustado para tais limites. Esta função considerará tais + * limites no futuro. */ static long long total_deducao(struct declaracao *dec) { - long long td = 0; - struct rendimento *rendimento; - int i; - for (i = 0; rendimento = list_get(dec->rendimento, i); i++) { - td += rendimento->previdencia; - } - return td; + return totais_get(dec, "INSS"); } static void total_pago(struct declaracao *dec) diff --git a/rendimento.c b/rendimento.c index 3a3de23..1f6cb82 100644 --- a/rendimento.c +++ b/rendimento.c @@ -93,6 +93,7 @@ static int run_rendimento(struct declaracao *dec, char **args, int argc) } r = totais_add(dec, "RENDPJ", rendimento->rendimento); r += totais_add(dec, "RENDPJTIT", rendimento->rendimento); + r += totais_add(dec, "INSS", rendimento->previdencia); if (r) { rendimento_free(rendimento); return r; -- 2.20.1