#include "declaracao.h"
#include "cmd.h"
#include "rendimento.h"
+#include "dependente.h"
#include "totais.h"
+static const long long dependente2015 = 215652;
+
/* 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)
{
- return totais_get(dec, "INSS") + totais_get(dec, "PAGAMENTOS");
+ int i;
+ long long dependentes = 0;
+ struct dependente *dependente;
+ for (i = 0; (dependente = list_get(dec->dependentes, i)); i++) {
+ dependentes += dependente2015;
+ }
+ return dependentes +
+ totais_get(dec, "INSS") +
+ totais_get(dec, "PAGAMENTOS");
}
static void total_pago(struct declaracao *dec)