Permite definir outros dados do contribuinte.
authorThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Sun, 3 May 2015 22:23:20 +0000 (22:23 +0000)
committerThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Mon, 11 May 2015 01:10:39 +0000 (01:10 +0000)
A maior parte dos dados é relacionada ao endereço. No momento, não há
suporte para pessoas vivendo fora do Brasil.

Makefile.am
contribuinte.c [new file with mode: 0644]
contribuinte.h [new file with mode: 0644]
declara.c
declaracao.h

index 93997f5..1d671b8 100644 (file)
@@ -6,4 +6,5 @@ declara_SOURCES = declara.c declaracao.c declaracao.h \
        base.c base.h \
        list.c list.h \
        util.c util.h \
+       contribuinte.c contribuinte.h \
        rendimento.c rendimento.h
diff --git a/contribuinte.c b/contribuinte.c
new file mode 100644 (file)
index 0000000..10899ef
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ *  Copyright (C) 2015  Thadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
+ *
+ *  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
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "cmd.h"
+#include "declaracao.h"
+#include "contribuinte.h"
+#include "util.h"
+
+#define SET_INT_CONTRIBUINTE(attr) \
+       SET_INT_(attr, attr, contribuinte.attr)
+
+#define SET_STRING_CONTRIBUINTE(attr) \
+       SET_STRING_(attr, attr, contribuinte.attr)
+
+SET_STRING_CONTRIBUINTE(uf);
+SET_INT_CONTRIBUINTE(cd_municipio);
+SET_STRING_CONTRIBUINTE(municipio);
+SET_STRING_CONTRIBUINTE(cep);
+SET_STRING_CONTRIBUINTE(bairro);
+SET_STRING_CONTRIBUINTE(tipo_logradouro);
+SET_STRING_CONTRIBUINTE(logradouro);
+SET_STRING_CONTRIBUINTE(numero);
+SET_STRING_CONTRIBUINTE(complemento);
+SET_STRING_CONTRIBUINTE(titulo_eleitor);
+SET_STRING_CONTRIBUINTE(dn);
+SET_STRING_CONTRIBUINTE(ddd);
+SET_STRING_CONTRIBUINTE(telefone);
+SET_INT_CONTRIBUINTE(natureza_ocupacao);
+SET_INT_CONTRIBUINTE(ocupacao_principal);
+
+void contribuinte_dump(struct declaracao *dec)
+{
+}
+
+int contribuinte_cmd_init(void)
+{
+       cmd_add(&cmd_uf);
+       cmd_add(&cmd_cd_municipio);
+       cmd_add(&cmd_municipio);
+       cmd_add(&cmd_cep);
+       cmd_add(&cmd_bairro);
+       cmd_add(&cmd_tipo_logradouro);
+       cmd_add(&cmd_logradouro);
+       cmd_add(&cmd_numero);
+       cmd_add(&cmd_complemento);
+       cmd_add(&cmd_titulo_eleitor);
+       cmd_add(&cmd_dn);
+       cmd_add(&cmd_ddd);
+       cmd_add(&cmd_telefone);
+       cmd_add(&cmd_natureza_ocupacao);
+       cmd_add(&cmd_ocupacao_principal);
+       return 0;
+}
diff --git a/contribuinte.h b/contribuinte.h
new file mode 100644 (file)
index 0000000..b276b6c
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ *  Copyright (C) 2015  Thadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
+ *
+ *  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
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _CONTRIBUINTE_H
+#define _CONTRIBUINTE_H
+
+struct declaracao;
+
+struct contribuinte {
+       char *uf;
+       int cd_municipio;
+       char *municipio;
+       char *cep;
+       char *bairro;
+       char *tipo_logradouro;
+       char *logradouro;
+       char *numero;
+       char *complemento;
+       char *titulo_eleitor;
+       char *dn;
+       char *ddd;
+       char *telefone;
+       int natureza_ocupacao;
+       int ocupacao_principal;
+};
+
+void contribuinte_dump(struct declaracao *dec);
+
+int contribuinte_cmd_init(void);
+
+#endif
index b134079..bbb6ad8 100644 (file)
--- a/declara.c
+++ b/declara.c
@@ -26,6 +26,7 @@
 #include "declaracao.h"
 #include "cmd.h"
 #include "base.h"
+#include "contribuinte.h"
 #include "rendimento.h"
 #include "calcula.h"
 
@@ -86,6 +87,7 @@ int main(int argc, char **argv)
 
        cmd_init();
        base_cmd_init();
+       contribuinte_cmd_init();
        rendimento_cmd_init();
        calcula_cmd_init();
 
index ac16397..24d0b25 100644 (file)
@@ -20,6 +20,7 @@
 #define _DECLARACAO_H
 
 #include "list.h"
+#include "contribuinte.h"
 
 enum {
        SIMPLES,
@@ -31,6 +32,7 @@ struct declaracao {
        char *cpf;
        char *nome;
        struct list *rendimento;
+       struct contribuinte contribuinte;
        long long totalrendimento;
        long long pago;
        long long devido;