Commit 2434e363192a36c0ef1953ed083c9a409f3a7674
1 parent
fc291533
Exists in
master
Adicionado campo NIS (PIS/PASEP) no cadastro de pessoa física;
Portabilis/ieducar#148
Showing
3 changed files
with
31 additions
and
3 deletions
Show diff stats
ieducar/intranet/atendidos_cad.php
| @@ -109,6 +109,7 @@ class indice extends clsCadastro | @@ -109,6 +109,7 @@ class indice extends clsCadastro | ||
| 109 | var $zona_localizacao; | 109 | var $zona_localizacao; |
| 110 | var $cor_raca; | 110 | var $cor_raca; |
| 111 | var $sus; | 111 | var $sus; |
| 112 | + var $nis_pis_pasep; | ||
| 112 | 113 | ||
| 113 | var $caminho_det; | 114 | var $caminho_det; |
| 114 | var $caminho_lst; | 115 | var $caminho_lst; |
| @@ -135,7 +136,7 @@ class indice extends clsCadastro | @@ -135,7 +136,7 @@ class indice extends clsCadastro | ||
| 135 | $this->idtlog, $this->sigla_uf, $this->complemento, $this->numero, | 136 | $this->idtlog, $this->sigla_uf, $this->complemento, $this->numero, |
| 136 | $this->bloco, $this->apartamento, $this->andar, $this->zona_localizacao, $this->estado_civil, | 137 | $this->bloco, $this->apartamento, $this->andar, $this->zona_localizacao, $this->estado_civil, |
| 137 | $this->pai_id, $this->mae_id, $this->tipo_nacionalidade, $this->pais_origem, $this->naturalidade, | 138 | $this->pai_id, $this->mae_id, $this->tipo_nacionalidade, $this->pais_origem, $this->naturalidade, |
| 138 | - $this->letra, $this->sus | 139 | + $this->letra, $this->sus, $this->nis_pis_pasep |
| 139 | ) = | 140 | ) = |
| 140 | 141 | ||
| 141 | $objPessoa->queryRapida( | 142 | $objPessoa->queryRapida( |
| @@ -144,7 +145,7 @@ class indice extends clsCadastro | @@ -144,7 +145,7 @@ class indice extends clsCadastro | ||
| 144 | 'tipo', 'sexo', 'cidade', 'bairro', 'logradouro', 'cep', 'idlog', | 145 | 'tipo', 'sexo', 'cidade', 'bairro', 'logradouro', 'cep', 'idlog', |
| 145 | 'idbai', 'idtlog', 'sigla_uf', 'complemento', 'numero', 'bloco', 'apartamento', | 146 | 'idbai', 'idtlog', 'sigla_uf', 'complemento', 'numero', 'bloco', 'apartamento', |
| 146 | 'andar', 'zona_localizacao', 'ideciv', 'idpes_pai', 'idpes_mae', 'nacionalidade', | 147 | 'andar', 'zona_localizacao', 'ideciv', 'idpes_pai', 'idpes_mae', 'nacionalidade', |
| 147 | - 'idpais_estrangeiro', 'idmun_nascimento', 'letra', 'sus' | 148 | + 'idpais_estrangeiro', 'idmun_nascimento', 'letra', 'sus', 'nis_pis_pasep' |
| 148 | ); | 149 | ); |
| 149 | 150 | ||
| 150 | $this->id_federal = is_numeric($this->id_federal) ? int2CPF($this->id_federal) : ''; | 151 | $this->id_federal = is_numeric($this->id_federal) ? int2CPF($this->id_federal) : ''; |
| @@ -330,6 +331,19 @@ class indice extends clsCadastro | @@ -330,6 +331,19 @@ class indice extends clsCadastro | ||
| 330 | 331 | ||
| 331 | $this->inputsHelper()->uf($options, $helperOptions); | 332 | $this->inputsHelper()->uf($options, $helperOptions); |
| 332 | 333 | ||
| 334 | + // Código NIS (PIS/PASEP) | ||
| 335 | + | ||
| 336 | + $options = array( | ||
| 337 | + 'required' => false, | ||
| 338 | + 'label' => 'NIS (PIS/PASEP)', | ||
| 339 | + 'placeholder' => '', | ||
| 340 | + 'value' => $this->nis_pis_pasep, | ||
| 341 | + 'max_length' => 11, | ||
| 342 | + 'size' => 20 | ||
| 343 | + ); | ||
| 344 | + | ||
| 345 | + $this->inputsHelper()->integer('nis_pis_pasep', $options); | ||
| 346 | + | ||
| 333 | // Carteira do SUS | 347 | // Carteira do SUS |
| 334 | 348 | ||
| 335 | $options = array( | 349 | $options = array( |
| @@ -1065,6 +1079,7 @@ class indice extends clsCadastro | @@ -1065,6 +1079,7 @@ class indice extends clsCadastro | ||
| 1065 | $fisica->idpais_estrangeiro = $_REQUEST['pais_origem_id']; | 1079 | $fisica->idpais_estrangeiro = $_REQUEST['pais_origem_id']; |
| 1066 | $fisica->idmun_nascimento = $_REQUEST['naturalidade_id']; | 1080 | $fisica->idmun_nascimento = $_REQUEST['naturalidade_id']; |
| 1067 | $fisica->sus = $this->sus; | 1081 | $fisica->sus = $this->sus; |
| 1082 | + $fisica->nis_pis_pasep = $this->nis_pis_pasep; | ||
| 1068 | 1083 | ||
| 1069 | $sql = "select 1 from cadastro.fisica WHERE idpes = $1 limit 1"; | 1084 | $sql = "select 1 from cadastro.fisica WHERE idpes = $1 limit 1"; |
| 1070 | 1085 |
ieducar/intranet/include/pessoa/clsFisica.inc.php
| @@ -70,6 +70,7 @@ class clsFisica | @@ -70,6 +70,7 @@ class clsFisica | ||
| 70 | var $cpf; | 70 | var $cpf; |
| 71 | var $ref_cod_religiao; | 71 | var $ref_cod_religiao; |
| 72 | var $sus; | 72 | var $sus; |
| 73 | + var $nis_pis_pasep; | ||
| 73 | 74 | ||
| 74 | var $tabela; | 75 | var $tabela; |
| 75 | var $schema; | 76 | var $schema; |
| @@ -334,6 +335,12 @@ class clsFisica | @@ -334,6 +335,12 @@ class clsFisica | ||
| 334 | $valores .= ", '$this->sus'"; | 335 | $valores .= ", '$this->sus'"; |
| 335 | } | 336 | } |
| 336 | 337 | ||
| 338 | + if(is_numeric($this->nis_pis_pasep)) | ||
| 339 | + { | ||
| 340 | + $campos .= ", nis_pis_pasep"; | ||
| 341 | + $valores .= ", $this->nis_pis_pasep"; | ||
| 342 | + } | ||
| 343 | + | ||
| 337 | $db->Consulta( "INSERT INTO {$this->schema}.{$this->tabela} (idpes, origem_gravacao, idsis_cad, data_cad, operacao, idpes_cad $campos) VALUES ( '{$this->idpes}', 'M', 17, NOW(), 'I', '$this->idpes_cad' $valores )" ); | 344 | $db->Consulta( "INSERT INTO {$this->schema}.{$this->tabela} (idpes, origem_gravacao, idsis_cad, data_cad, operacao, idpes_cad $campos) VALUES ( '{$this->idpes}', 'M', 17, NOW(), 'I', '$this->idpes_cad' $valores )" ); |
| 338 | return true; | 345 | return true; |
| 339 | 346 | ||
| @@ -489,6 +496,11 @@ class clsFisica | @@ -489,6 +496,11 @@ class clsFisica | ||
| 489 | $gruda = ", "; | 496 | $gruda = ", "; |
| 490 | } | 497 | } |
| 491 | 498 | ||
| 499 | + if(is_numeric($this->nis_pis_pasep)) { | ||
| 500 | + $set .= "$gruda nis_pis_pasep = {$this->nis_pis_pasep}"; | ||
| 501 | + $gruda = ", "; | ||
| 502 | + } | ||
| 503 | + | ||
| 492 | if(is_numeric($this->ref_cod_sistema) || $this->ref_cod_sistema == "NULL") { | 504 | if(is_numeric($this->ref_cod_sistema) || $this->ref_cod_sistema == "NULL") { |
| 493 | $set .= "$gruda ref_cod_sistema = {$this->ref_cod_sistema}"; | 505 | $set .= "$gruda ref_cod_sistema = {$this->ref_cod_sistema}"; |
| 494 | $gruda = ", "; | 506 | $gruda = ", "; |
| @@ -802,7 +814,7 @@ class clsFisica | @@ -802,7 +814,7 @@ class clsFisica | ||
| 802 | if($this->idpes) | 814 | if($this->idpes) |
| 803 | { | 815 | { |
| 804 | $db = new clsBanco(); | 816 | $db = new clsBanco(); |
| 805 | - $db->Consulta("SELECT idpes, data_nasc, sexo, idpes_mae, idpes_pai, idpes_responsavel, idesco, ideciv, idpes_con, data_uniao, data_obito, nacionalidade, idpais_estrangeiro, data_chegada_brasil, idmun_nascimento, ultima_empresa, idocup, nome_mae, nome_pai, nome_conjuge, nome_responsavel, justificativa_provisorio, cpf , ref_cod_religiao, sus FROM {$this->schema}.{$this->tabela} WHERE idpes = {$this->idpes}"); | 817 | + $db->Consulta("SELECT idpes, data_nasc, sexo, idpes_mae, idpes_pai, idpes_responsavel, idesco, ideciv, idpes_con, data_uniao, data_obito, nacionalidade, idpais_estrangeiro, data_chegada_brasil, idmun_nascimento, ultima_empresa, idocup, nome_mae, nome_pai, nome_conjuge, nome_responsavel, justificativa_provisorio, cpf , ref_cod_religiao, sus, nis_pis_pasep FROM {$this->schema}.{$this->tabela} WHERE idpes = {$this->idpes}"); |
| 806 | if( $db->ProximoRegistro() ) | 818 | if( $db->ProximoRegistro() ) |
| 807 | { | 819 | { |
| 808 | $tupla = $db->Tupla(); | 820 | $tupla = $db->Tupla(); |
ieducar/intranet/include/pessoa/clsPessoaFisica.inc.php
| @@ -297,6 +297,7 @@ class clsPessoaFisica extends clsPessoaFj | @@ -297,6 +297,7 @@ class clsPessoaFisica extends clsPessoaFj | ||
| 297 | $this->cpf = $detalhe_fisica['cpf']; | 297 | $this->cpf = $detalhe_fisica['cpf']; |
| 298 | $this->ref_cod_religiao = $detalhe_fisica['ref_cod_religiao']; | 298 | $this->ref_cod_religiao = $detalhe_fisica['ref_cod_religiao']; |
| 299 | $this->sus = $detalhe_fisica['sus']; | 299 | $this->sus = $detalhe_fisica['sus']; |
| 300 | + $this->nis_pis_pasep = $detalhe_fisica['nis_pis_pasep']; | ||
| 300 | 301 | ||
| 301 | $tupla['idpes'] = $this->idpes; | 302 | $tupla['idpes'] = $this->idpes; |
| 302 | $tupla[] = & $tupla['idpes']; | 303 | $tupla[] = & $tupla['idpes']; |