#include "rendimento.h"
#include "pagamento.h"
#include "bem.h"
+#include "isento.h"
+#include "dependente.h"
+#include "conjuge.h"
+#include "sistema.h"
+#include "totais.h"
#include "util.h"
SET_INT(ano);
if (dec->pagar > 0)
printf("a pagar: %lld.%02d\n", reais(dec->pagar),
centavos(dec->pagar));
+ printf("base de cálculo: %lld.%02d\n",
+ reais(totais_get(dec, "BASE")),
+ centavos(totais_get(dec, "BASE")));
+ printf("isentos: %lld.%02d\n",
+ reais(totais_get(dec, "ISENTOS")),
+ centavos(totais_get(dec, "ISENTOS")));
+ printf("exclusivos: %lld.%02d\n",
+ reais(totais_get(dec, "EXCLUSIVOS")),
+ centavos(totais_get(dec, "EXCLUSIVOS")));
+ printf("hash: %010ld\n", dec->hash);
+ return 0;
+}
+
+static int run_verbose(struct declaracao *dec, char **args, int argc)
+{
+ if (argc != 1)
+ return -EINVAL;
+ dec->verbose = 1;
return 0;
}
rendimento_salva(dec, f);
pagamento_salva(dec, f);
bem_salva(dec, f);
+ isento_salva(dec, f);
+ dependente_salva(dec, f);
+ conjuge_salva(dec, f);
+ sistema_salva(dec, f);
}
static int run_salva(struct declaracao *dec, char **args, int argc)
return 0;
}
+static int run_simples(struct declaracao *dec, char **args, int argc)
+{
+ if (argc != 1)
+ return -EINVAL;
+ dec->tipo = FORCA_SIMPLES;
+ return 0;
+}
+
+static int run_completa(struct declaracao *dec, char **args, int argc)
+{
+ if (argc != 1)
+ return -EINVAL;
+ dec->tipo = FORCA_COMPLETA;
+ return 0;
+}
+
static struct cmd cmd_salva = {
.name = "salva",
.run = run_salva,
.run = run_resumo,
};
+static struct cmd cmd_verbose = {
+ .name = "verbose",
+ .run = run_verbose,
+};
+
+static struct cmd cmd_simples = {
+ .name = "simples",
+ .run = run_simples,
+};
+
+static struct cmd cmd_completa = {
+ .name = "completa",
+ .run = run_completa,
+};
+
int base_cmd_init(void)
{
cmd_add(&cmd_salva);
cmd_add(&cmd_contacorrente);
cmd_add(&cmd_dvconta);
+ cmd_add(&cmd_verbose);
+ cmd_add(&cmd_simples);
+ cmd_add(&cmd_completa);
+
return 0;
}