Cria dicionĂ¡rio de totais.
[cascardo/declara.git] / calcula.c
index 80f6c6d..d5daf76 100644 (file)
--- a/calcula.c
+++ b/calcula.c
  */
 
 #include "calcula.h"
+#include <errno.h>
+#include <stdio.h>
 #include "declaracao.h"
 #include "cmd.h"
 #include "rendimento.h"
-#include <errno.h>
-#include <stdio.h>
+#include "totais.h"
 
 static void total_rendimento(struct declaracao *dec)
 {
-       long long tr = 0;
-       struct rendimento *rendimento;
-       int i;
-       for (i = 0; rendimento = list_get(dec->rendimento, i); i++) {
-               tr += rendimento->rendimento;
-       }
-       dec->totalrendimento = tr;
+       dec->totalrendimento = totais_get(dec, "RENDPJTIT");
 }
 
 static long long total_deducao(struct declaracao *dec)