projects
/
cascardo
/
declara.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Corrige geração do código do ano.
[cascardo/declara.git]
/
lib
/
isento.c
diff --git
a/lib/isento.c
b/lib/isento.c
index
25512f1
..
ab023d7
100644
(file)
--- a/
lib/isento.c
+++ b/
lib/isento.c
@@
-39,16
+39,26
@@
static int isento_totais_update(struct declaracao *dec, struct isento *isento)
isento->exclusivo = 0;
r = totais_add(dec, "INDENIZACOES", isento->valor);
break;
isento->exclusivo = 0;
r = totais_add(dec, "INDENIZACOES", isento->valor);
break;
+ case 11:
case 96:
isento->exclusivo = 1;
r = totais_add(dec, "PLR", isento->valor);
break;
case 97:
case 96:
isento->exclusivo = 1;
r = totais_add(dec, "PLR", isento->valor);
break;
case 97:
+ case 26:
+ isento->exclusivo = 0;
+ r = totais_add(dec, "OUTROSISENTOS", isento->valor);
break;
break;
+ case 12:
case 98:
isento->exclusivo = 0;
r = totais_add(dec, "POUPANCA", isento->valor);
break;
case 98:
isento->exclusivo = 0;
r = totais_add(dec, "POUPANCA", isento->valor);
break;
+ case 13:
+ isento->exclusivo = 0;
+ r = totais_add(dec, "LUCROME", isento->valor);
+ break;
+ case 6:
case 99:
isento->exclusivo = 1;
r = totais_add(dec, "APLICACOES", isento->valor);
case 99:
isento->exclusivo = 1;
r = totais_add(dec, "APLICACOES", isento->valor);
@@
-104,6
+114,7
@@
static struct isento * isento_new(char **args, int argc)
int r = 0;
isento = malloc(sizeof(*isento));
int r = 0;
isento = malloc(sizeof(*isento));
+ isento->exclusivo = 0;
if (!strcmp(args[0], "exclusivo")) {
isento->exclusivo = 1;
}
if (!strcmp(args[0], "exclusivo")) {
isento->exclusivo = 1;
}
@@
-151,13
+162,13
@@
static int run_isento(struct declaracao *dec, char **args, int argc)
isento_free(isento);
return -EINVAL;
}
isento_free(isento);
return -EINVAL;
}
- r =
list_insert_ordered(&dec->isentos, isento, isento_cmp
);
- if (r
< 0
) {
+ r =
isento_totais_update(dec, isento
);
+ if (r) {
isento_free(isento);
return r;
}
isento_free(isento);
return r;
}
- r =
isento_totais_update(dec
, isento);
- if (r) {
+ r =
list_add(&dec->isentos
, isento);
+ if (r
< 0
) {
isento_free(isento);
return r;
}
isento_free(isento);
return r;
}