#include <string.h>
#include <errno.h>
#include "rendimento.h"
+#include "carne.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"
printf("completa\n");
break;
}
- printf("pago: %lld.%02d\n", reais(dec->pago), centavos(dec->pago));
- printf("retido: %lld.%02d\n", reais(dec->retido),
- centavos(dec->retido));
- printf("devido: %lld.%02d\n", reais(dec->devido),
- centavos(dec->devido));
+ printf("pago: "FMT_R"\n", R(dec->pago));
+ printf("retido: "FMT_R"\n", R(dec->retido));
+ printf("devido: "FMT_R"\n", R(dec->devido));
if (dec->restituicao > 0)
- printf("restituicao: %lld.%02d\n", reais(dec->restituicao),
- centavos(dec->restituicao));
+ printf("restituicao: "FMT_R"\n", R(dec->restituicao));
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("a pagar: "FMT_R"\n", R(dec->pagar));
+ printf("base de cálculo: "FMT_R"\n",
+ R(totais_get(dec, "BASE")));
+ printf("isentos: "FMT_R"\n",
+ R(totais_get(dec, "ISENTOS")));
+ printf("exclusivos: "FMT_R"\n",
+ R(totais_get(dec, "EXCLUSIVOS")));
+ printf("bens: "FMT_R"\n",
+ R(totais_get(dec, "BENS")));
+ printf("bens: "FMT_R"\n",
+ R(totais_get(dec, "BENSANTERIOR")));
+ printf("aliquota efetiva: "FMT_R"%%\n",
+ R(dec->aliquota_efetiva));
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;
+}
+
static void salva(struct declaracao *dec, FILE *f)
{
fprintf(f, "ano %d\n", dec->ano);
fprintf(f, "dvconta \"%s\"\n", dec->dvconta);
contribuinte_salva(dec, f);
rendimento_salva(dec, f);
+ carne_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)
.run = run_resumo,
};
+static struct cmd cmd_verbose = {
+ .name = "verbose",
+ .run = run_verbose,
+};
+
static struct cmd cmd_simples = {
.name = "simples",
.run = run_simples,
cmd_add(&cmd_contacorrente);
cmd_add(&cmd_dvconta);
+ cmd_add(&cmd_verbose);
cmd_add(&cmd_simples);
cmd_add(&cmd_completa);