From: Thadeu Lima de Souza Cascardo Date: Sat, 1 Aug 2015 14:58:42 +0000 (-0300) Subject: Soma total do INSS durante processamento de rendimentos. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fdeclara.git;a=commitdiff_plain;h=ae7d1cdda9a71ffb6f7210562cdedfa8d7995e08 Soma total do INSS durante processamento de rendimentos. Utiliza o total de INSS nas deduções, fazendo a soma e armazenamento do total durante o processamento de rendimentos. --- 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;