From 83cbadfaaa5489962584d2133614a4ece00403ca Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Fri, 25 Sep 2015 07:00:09 -0300 Subject: [PATCH] Deduz reembolsos de pagamentos. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Alguns pagamentos são reembolsados e seu valor não deve ser contabilizado em deduções. --- lib/calcula.c | 3 ++- lib/pagamento.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/calcula.c b/lib/calcula.c index 68ad6f1..50747c9 100644 --- a/lib/calcula.c +++ b/lib/calcula.c @@ -41,7 +41,8 @@ static long long total_deducao(struct declaracao *dec) int i; return totais_get(dec, "DEPENDENTES") + totais_get(dec, "INSS") + - totais_get(dec, "PAGAMENTOS"); + totais_get(dec, "PAGAMENTOS") - + totais_get(dec, "REEMBOLSOS"); } static void total_pago(struct declaracao *dec) diff --git a/lib/pagamento.c b/lib/pagamento.c index 26cb3c0..92ff7ba 100644 --- a/lib/pagamento.c +++ b/lib/pagamento.c @@ -88,6 +88,8 @@ static int run_pagamento(struct declaracao *dec, char **args, int argc) } r = totais_add(dec, "PAGAMENTOS", pagamento->pagamento); r += totais_add(dec, "PAGAMENTOSTIT", pagamento->pagamento); + r += totais_add(dec, "REEMBOLSOS", pagamento->reembolso); + r += totais_add(dec, "REEMBOLSOSTIT", pagamento->reembolso); if (r) { pagamento_free(pagamento); return r; -- 2.20.1