From: Thadeu Lima de Souza Cascardo Date: Sat, 14 Jan 2017 12:24:26 +0000 (-0200) Subject: Adiciona valores para cálculo referente a exercício 2017. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fdeclara.git;a=commitdiff_plain;h=7e23a845d3862f8e54e02b99b42276b435ea5247 Adiciona valores para cálculo referente a exercício 2017. Os valores foram obtidos a partir de [1], com exceção do valor de obrigatoriedade, que foi obtido a partir da Instrução Normativa 1671 de 2016. O comando "gera" ainda não suporta o ano de 2017. [1] http://idg.receita.fazenda.gov.br/acesso-rapido/tributos/irpf-imposto-de-renda-pessoa-fisica --- diff --git a/help/ano.txt b/help/ano.txt index 618c93d..be4f4cb 100644 --- a/help/ano.txt +++ b/help/ano.txt @@ -9,5 +9,5 @@ em 2016, deve executar o seguinte comando. ano 2016 -Os anos suportados no momento são 2015 e 2016. Se outro ano for +Os anos suportados no momento são 2015, 2016 e 2017. Se outro ano for utilizado, o comando calcula retornará um erro. diff --git a/lib/ano.h b/lib/ano.h index 65ac852..a46fd9c 100644 --- a/lib/ano.h +++ b/lib/ano.h @@ -20,7 +20,7 @@ #define _ANO_H #define PRIMEIRO_ANO 2015 -#define ULTIMO_ANO 2016 +#define ULTIMO_ANO 2017 #define MAX_ANOS (ULTIMO_ANO + 1) #define ANO(ano) (ano - PRIMEIRO_ANO) #define ANO_VALIDO(ano) (ANO(ano) >= 0 && ANO(ano) < ANO(MAX_ANOS)) diff --git a/lib/calcula.c b/lib/calcula.c index 79a395c..47548b3 100644 --- a/lib/calcula.c +++ b/lib/calcula.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2016 Thadeu Lima de Souza Cascardo + * Copyright (C) 2015-2017 Thadeu Lima de Souza Cascardo * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,11 +31,13 @@ static const long long dependente[ANO(MAX_ANOS)] = { [ANO(2015)] = 215652, [ANO(2016)] = 227508, + [ANO(2017)] = 227508, }; static const long long instrucao[ANO(MAX_ANOS)] = { [ANO(2015)] = 337583, [ANO(2016)] = 356150, + [ANO(2017)] = 356150, }; long long deducao_dependente(struct declaracao *dec) @@ -147,19 +149,31 @@ static struct taxtable table2016[] = { { 9999999999999LL, 0, 0, }, }; +static struct taxtable table2017[] = { + { 0, 0, 0, }, + { 2284777, 750, 171358, }, + { 3391981, 1500, 425757, }, + { 4501261, 2250, 763351, }, + { 5597616, 2750, 1043232, }, + { 9999999999999LL, 0, 0, }, +}; + static struct taxtable *table[ANO(MAX_ANOS)] = { [ANO(2015)] = table2015, [ANO(2016)] = table2016, + [ANO(2017)] = table2017, }; static const long long simples[ANO(MAX_ANOS)] = { [ANO(2015)] = 1588089, [ANO(2016)] = 1675434, + [ANO(2017)] = 1675434, }; static const long long obrigatoriedade[ANO(MAX_ANOS)] = { [ANO(2015)] = 2681655, [ANO(2016)] = 2812391, + [ANO(2017)] = 2855970, /* De acordo com IN 1671/2016 */ }; static long long imposto(struct taxtable *tt, long long tr, int verbose)