projects
/
cascardo
/
declara.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Deduções pode ser maiores que rendimentos tributáveis.
[cascardo/declara.git]
/
lib
/
calcula.c
diff --git
a/lib/calcula.c
b/lib/calcula.c
index
fdf3b83
..
c928a02
100644
(file)
--- a/
lib/calcula.c
+++ b/
lib/calcula.c
@@
-135,6
+135,8
@@
static long long imposto_simples(struct declaracao *dec)
td = simples[ANO(dec->ano)];
totais_add(dec, "DESCONTO", td);
tr -= td;
td = simples[ANO(dec->ano)];
totais_add(dec, "DESCONTO", td);
tr -= td;
+ if (tr < 0)
+ tr = 0;
totais_add(dec, "BASESIMPLES", tr);
if (dec->verbose) {
printf("Desconto simplificado é "FMT_R"\n", R(td));
totais_add(dec, "BASESIMPLES", tr);
if (dec->verbose) {
printf("Desconto simplificado é "FMT_R"\n", R(td));
@@
-151,6
+153,8
@@
static long long imposto_completa(struct declaracao *dec)
td = total_deducao(dec);
totais_add(dec, "DEDUCOES", td);
tr -= td;
td = total_deducao(dec);
totais_add(dec, "DEDUCOES", td);
tr -= td;
+ if (tr < 0)
+ tr = 0;
totais_add(dec, "BASECOMPLETA", tr);
if (dec->verbose) {
printf("Desconto completa é "FMT_R"\n", R(td));
totais_add(dec, "BASECOMPLETA", tr);
if (dec->verbose) {
printf("Desconto completa é "FMT_R"\n", R(td));