Gera outros totais de declaração simplificada.
[cascardo/declara.git] / rendimento.c
index caa7a64..508a6fb 100644 (file)
@@ -25,6 +25,7 @@
 #include "cmd.h"
 #include "list.h"
 #include "util.h"
+#include "totais.h"
 
 void rendimento_free(void *pointer)
 {
@@ -90,6 +91,16 @@ static int run_rendimento(struct declaracao *dec, char **args, int argc)
                rendimento_free(rendimento);
                return r;
        }
+       r = totais_add(dec, "RENDPJ", rendimento->rendimento);
+       r += totais_add(dec, "RENDPJTIT", rendimento->rendimento);
+       r += totais_add(dec, "INSS", rendimento->previdencia);
+       r += totais_add(dec, "DECIMOTERCEIRO", rendimento->decimoterceiro);
+       r += totais_add(dec, "EXCLUSIVOS", rendimento->decimoterceiro);
+       r += totais_add(dec, "EXCLUSIVOSTIT", rendimento->decimoterceiro);
+       if (r) {
+               rendimento_free(rendimento);
+               return r;
+       }
        return 0;
 }