summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>2018-03-04 09:51:29 -0300
committerThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>2018-03-06 17:19:51 -0300
commit25ac7b5b0d53aaa935c8840db75f32ebedae324f (patch)
tree09198c6c6fd98876ea6c4c9c4d53dd7821aac995
parent745c85642649db5b92e26cde382c25df116f2f85 (diff)
Calcula alíquota efetiva.
O IRPF 2018 calcula e utiliza o valor de alíquota efetiva no arquivo gerado.
-rw-r--r--lib/base.c2
-rw-r--r--lib/calcula.c1
-rw-r--r--lib/declaracao.h1
3 files changed, 4 insertions, 0 deletions
diff --git a/lib/base.c b/lib/base.c
index dbf3f49..904026f 100644
--- a/lib/base.c
+++ b/lib/base.c
@@ -74,6 +74,8 @@ static int run_resumo(struct declaracao *dec, char **args, int argc)
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;
}
diff --git a/lib/calcula.c b/lib/calcula.c
index 960449b..ade9be2 100644
--- a/lib/calcula.c
+++ b/lib/calcula.c
@@ -269,6 +269,7 @@ int calcula(struct declaracao *dec)
dec->restituicao = dec->pago - dec->devido;
else
dec->pagar = dec->devido - dec->pago;
+ dec->aliquota_efetiva = dec->devido * 10000 / totais_get(dec, "RENDTRIB");
return 0;
}
diff --git a/lib/declaracao.h b/lib/declaracao.h
index 5ba1a12..1ffd86e 100644
--- a/lib/declaracao.h
+++ b/lib/declaracao.h
@@ -49,6 +49,7 @@ struct declaracao {
long long devido;
long long pagar;
long long restituicao;
+ long long aliquota_efetiva;
int obrigatoria;
int tipo;
char *recibo;