X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fcalcula.c;h=40c05364cdc2de15a2377f90ff658aeb1ebdf5cc;hb=0b5b872844e21b234afd9b4e93b38294631589c2;hp=e5778236eef36123106968b84e1467eeb720ca1e;hpb=3ab90b9c8b165ea73bf052166baa5cb1593b858e;p=cascardo%2Fdeclara.git diff --git a/lib/calcula.c b/lib/calcula.c index e577823..40c0536 100644 --- a/lib/calcula.c +++ b/lib/calcula.c @@ -33,6 +33,9 @@ static const long long dependente[ANO(MAX_ANOS)] = { [ANO(2016)] = 227508, [ANO(2017)] = 227508, [ANO(2018)] = 227508, + [ANO(2019)] = 227508, + [ANO(2020)] = 227508, + [ANO(2021)] = 227508, }; static const long long instrucao[ANO(MAX_ANOS)] = { @@ -40,6 +43,9 @@ static const long long instrucao[ANO(MAX_ANOS)] = { [ANO(2016)] = 356150, [ANO(2017)] = 356150, [ANO(2018)] = 356150, + [ANO(2019)] = 356150, + [ANO(2020)] = 356150, + [ANO(2021)] = 356150, }; long long deducao_dependente(struct declaracao *dec) @@ -169,6 +175,9 @@ static struct taxtable *table[ANO(MAX_ANOS)] = { [ANO(2016)] = table2016, [ANO(2017)] = table2017, [ANO(2018)] = table2017, + [ANO(2019)] = table2017, + [ANO(2020)] = table2017, + [ANO(2021)] = table2017, }; static const long long simples[ANO(MAX_ANOS)] = { @@ -176,6 +185,9 @@ static const long long simples[ANO(MAX_ANOS)] = { [ANO(2016)] = 1675434, [ANO(2017)] = 1675434, [ANO(2018)] = 1675434, + [ANO(2019)] = 1675434, + [ANO(2020)] = 1675434, + [ANO(2021)] = 1675434, }; static const long long obrigatoriedade[ANO(MAX_ANOS)] = { @@ -183,6 +195,9 @@ static const long long obrigatoriedade[ANO(MAX_ANOS)] = { [ANO(2016)] = 2812391, [ANO(2017)] = 2855970, /* De acordo com IN 1671/2016 */ [ANO(2018)] = 2855970, + [ANO(2019)] = 2855970, + [ANO(2020)] = 2855970, + [ANO(2021)] = 2855970, }; static long long imposto(struct taxtable *tt, long long tr, int verbose) @@ -239,6 +254,7 @@ static long long imposto_completa(struct declaracao *dec) int calcula(struct declaracao *dec) { long long i_simples, i_completa; + long long isentos; if (!ANO_VALIDO(dec->ano)) { dec_set_error(dec, "Ano %d não suportado.", dec->ano); return -EINVAL; @@ -253,6 +269,16 @@ int calcula(struct declaracao *dec) } dec->obrigatoria += 1; } + isentos = totais_get(dec, "ISENTOS") + totais_get(dec, "EXCLUSIVOS"); + if (isentos > 4000000) { + if (dec->verbose) { + printf("Declaracao obrigatoria pois rendimentos " + "isentos e exclusivos maior que minimo para " + "declaracao: " FMT_R" > "FMT_R"\n", + R(isentos), R(4000000)); + } + dec->obrigatoria += 2; + } if (totais_get(dec, "BENS") > 30000000) { if (dec->verbose) { printf("Declaracao obrigatoria pois bens e direitos e"