Valores iguais a anos anteriores e suporte inicial a novos campos nas linhas
principais. Testado com declaração simples.
#define _ANO_H
#define PRIMEIRO_ANO 2015
#define _ANO_H
#define PRIMEIRO_ANO 2015
#define MAX_ANOS (ULTIMO_ANO + 1)
#define ANO(ano) (ano - PRIMEIRO_ANO)
#define ANO_VALIDO(ano) (ANO(ano) >= 0 && ANO(ano) < ANO(MAX_ANOS))
#define MAX_ANOS (ULTIMO_ANO + 1)
#define ANO(ano) (ano - PRIMEIRO_ANO)
#define ANO_VALIDO(ano) (ANO(ano) >= 0 && ANO(ano) < ANO(MAX_ANOS))
[ANO(2017)] = 227508,
[ANO(2018)] = 227508,
[ANO(2019)] = 227508,
[ANO(2017)] = 227508,
[ANO(2018)] = 227508,
[ANO(2019)] = 227508,
};
static const long long instrucao[ANO(MAX_ANOS)] = {
};
static const long long instrucao[ANO(MAX_ANOS)] = {
[ANO(2017)] = 356150,
[ANO(2018)] = 356150,
[ANO(2019)] = 356150,
[ANO(2017)] = 356150,
[ANO(2018)] = 356150,
[ANO(2019)] = 356150,
};
long long deducao_dependente(struct declaracao *dec)
};
long long deducao_dependente(struct declaracao *dec)
[ANO(2017)] = table2017,
[ANO(2018)] = table2017,
[ANO(2019)] = table2017,
[ANO(2017)] = table2017,
[ANO(2018)] = table2017,
[ANO(2019)] = table2017,
+ [ANO(2020)] = table2017,
};
static const long long simples[ANO(MAX_ANOS)] = {
};
static const long long simples[ANO(MAX_ANOS)] = {
[ANO(2017)] = 1675434,
[ANO(2018)] = 1675434,
[ANO(2019)] = 1675434,
[ANO(2017)] = 1675434,
[ANO(2018)] = 1675434,
[ANO(2019)] = 1675434,
};
static const long long obrigatoriedade[ANO(MAX_ANOS)] = {
};
static const long long obrigatoriedade[ANO(MAX_ANOS)] = {
[ANO(2017)] = 2855970, /* De acordo com IN 1671/2016 */
[ANO(2018)] = 2855970,
[ANO(2019)] = 2855970,
[ANO(2017)] = 2855970, /* De acordo com IN 1671/2016 */
[ANO(2018)] = 2855970,
[ANO(2019)] = 2855970,
};
static long long imposto(struct taxtable *tt, long long tr, int verbose)
};
static long long imposto(struct taxtable *tt, long long tr, int verbose)
fprintf(f, "2800"); /* Código */
else if (dec->ano == 2019)
fprintf(f, "2900"); /* Código */
fprintf(f, "2800"); /* Código */
else if (dec->ano == 2019)
fprintf(f, "2900"); /* Código */
+ else if (dec->ano == 2020)
+ fprintf(f, "3000");
fprintf(f, "%s", dec->retifica ? "1" : "0"); /* Retificadora */
fprintf(f, "%s", dec->cpf); /* CPF: 11 dígitos */
fprintf(f, " "); /* Filler */
fprintf(f, "%s", dec->retifica ? "1" : "0"); /* Retificadora */
fprintf(f, "%s", dec->cpf); /* CPF: 11 dígitos */
fprintf(f, " "); /* Filler */
fprintf(f, "160"); /* Versão IRPF */
else if (dec->ano == 2019)
fprintf(f, "150"); /* Versão IRPF */
fprintf(f, "160"); /* Versão IRPF */
else if (dec->ano == 2019)
fprintf(f, "150"); /* Versão IRPF */
+ else if (dec->ano == 2020)
+ fprintf(f, "180"); /* Versão IRPF */
fprintf(f, "%-60.60s", dec->nome);
fprintf(f, "%-2.2s", dec->contribuinte.uf ?: "");
fprintf(f, "%s", "0000000000"); /* FIXME: hash */
fprintf(f, "%-60.60s", dec->nome);
fprintf(f, "%-2.2s", dec->contribuinte.uf ?: "");
fprintf(f, "%s", "0000000000"); /* FIXME: hash */
fprintf(f, " "); /* RRA4 */
fprintf(f, "%-11.11s", ""); /* CPF RRA4 */
fprintf(f, "0000000000000"); /* TODO: Doacao ECA */
fprintf(f, " "); /* RRA4 */
fprintf(f, "%-11.11s", ""); /* CPF RRA4 */
fprintf(f, "0000000000000"); /* TODO: Doacao ECA */
+ fprintf(f, "0000000000000"); /* TODO: Doacao Idoso */
fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 0)); /* CNPJ maior */
fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 1)); /* CNPJ maior 2 */
fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 2)); /* CNPJ maior 3 */
fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 0)); /* CNPJ maior */
fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 1)); /* CNPJ maior 2 */
fprintf(f, "%-14.14s", rendimento_cnpj_ordenado(dec, 2)); /* CNPJ maior 3 */
/* Fim das mudanças de 2016 */
/* Fim das mudanças de 2016 */
+ if (dec->ano >= 2020)
+ fprintf(f, "%-13.13s", dec->contribuinte.titulo_eleitor ?: "");
+
fprintf(f, " "); /* Teste PGD, FILLER2 */
}
fprintf(f, " "); /* Teste PGD, FILLER2 */
}
if (dec->ano <= 2017) {
fprintf(f, "%-4.4s", dec->contribuinte.ddd ?: "");
fprintf(f, "%-9.9s", dec->contribuinte.telefone ?: "");
if (dec->ano <= 2017) {
fprintf(f, "%-4.4s", dec->contribuinte.ddd ?: "");
fprintf(f, "%-9.9s", dec->contribuinte.telefone ?: "");
+ } else if (dec->ano >= 2020) {
+ fprintf(f, "%-4.4s", dec->contribuinte.ddd ?: "");
+ fprintf(f, "%-9.9s", "");
} else {
fprintf(f, "%-13.13s", ""); /* FILLER */
}
} else {
fprintf(f, "%-13.13s", ""); /* FILLER */
}
fprintf(f, "%-11.11s", dec->contribuinte.celular ?: ""); /* celular */
fprintf(f, "%s", dec->conjuge.cpf ? "S" : "N");
}
fprintf(f, "%-11.11s", dec->contribuinte.celular ?: ""); /* celular */
fprintf(f, "%s", dec->conjuge.cpf ? "S" : "N");
}
- if (dec->ano >= 2018) {
+ if (dec->ano >= 2020) {
+ fprintf(f, "%-11.11s", dec->contribuinte.telefone ?: "");
+ } else if (dec->ano >= 2018) {
fprintf(f, "%-2.2s%-9.9s", dec->contribuinte.ddd ?: "", dec->contribuinte.telefone ?: "");
}
}
fprintf(f, "%-2.2s%-9.9s", dec->contribuinte.ddd ?: "", dec->contribuinte.telefone ?: "");
}
}
fprintf(f, "%-100.100s", ""); /* FILLER */
fprintf(f, "%-4.4s", ""); /* FILLER */
fprintf(f, "%-8.8s", ""); /* FILLER */
fprintf(f, "%-100.100s", ""); /* FILLER */
fprintf(f, "%-4.4s", ""); /* FILLER */
fprintf(f, "%-8.8s", ""); /* FILLER */
- if (dec->ano >= 2018) {
+ if (dec->ano >= 2020) {
+ fprintf(f, "%-4.4s", dec->contribuinte.ddd ?: "");
+ fprintf(f, "%-9.9s", "");
+ } else if (dec->ano >= 2018) {
fprintf(f, "%-13.13s", "");
} else {
fprintf(f, "%-4.4s", dec->contribuinte.ddd ?: "");
fprintf(f, "%-13.13s", "");
} else {
fprintf(f, "%-4.4s", dec->contribuinte.ddd ?: "");
fprintf(f, "%-13.13s", dec->contacorrente ? : ""); /* numero conta */
fprintf(f, "%-2.2s", dec->dvconta ? : ""); /* DV conta */
fprintf(f, "%013lld", 0); /* TODO: imposto alienacao moeda estrangeira em especie */
fprintf(f, "%-13.13s", dec->contacorrente ? : ""); /* numero conta */
fprintf(f, "%-2.2s", dec->dvconta ? : ""); /* DV conta */
fprintf(f, "%013lld", 0); /* TODO: imposto alienacao moeda estrangeira em especie */
- if (dec->ano >= 2018) {
+ if (dec->ano >= 2020) {
+ fprintf(f, "%-11.11s", dec->contribuinte.telefone ?: "");
+ } else if (dec->ano >= 2018) {
fprintf(f, "%-2.2s%-9.9s", dec->contribuinte.ddd ?: "", dec->contribuinte.telefone ?: "");
}
}
fprintf(f, "%-2.2s%-9.9s", dec->contribuinte.ddd ?: "", dec->contribuinte.telefone ?: "");
}
}