Commit 5812bfac8b2f13b15e602a02dbccf4313f61304a
1 parent
bcbadc01
Exists in
master
Alterado cancelamento de matrícula
Ao cancelar uma matrícula oriunda de uma transferência interna, retorna matrícula anterior para "Em andamento" portabilis/ieducar#48
Showing
2 changed files
with
33 additions
and
0 deletions
Show diff stats
ieducar/intranet/educar_matricula_cad.php
... | ... | @@ -595,6 +595,24 @@ class indice extends clsCadastro |
595 | 595 | NULL, $ref_cod_serie, NULL, NULL, NULL, NULL, NULL, NULL, 1 |
596 | 596 | ); |
597 | 597 | |
598 | + // Coloca as matrículas anteriores em andamento | |
599 | + $obj_transferencia_antiga = new clsPmieducarTransferenciaSolicitacao(); | |
600 | + $lista_transferencia = $obj_transferencia_antiga->lista(null,null,null,null,null,$this->cod_matricula); | |
601 | + if (is_array($lista_transferencia))){ | |
602 | + foreach ($lista_transferencia as $transf) { | |
603 | + | |
604 | + $obj_mat = new clsPmieducarMatricula($transf['ref_cod_matricula_saida']); | |
605 | + $obj_mat = $obj_mat->detalhe(); | |
606 | + if ($obj_mat['aprovado']==4){ | |
607 | + $obj_mat = new clsPmieducarMatricula($transf['ref_cod_matricula_saida'],null,null | |
608 | + ,null,$this->pessoa_logada,null,null,3); | |
609 | + $obj_mat->edita(); | |
610 | + $obj_transf = new clsPmieducarTransferenciaSolicitacao($transf['cod_transferencia_solicitacao']); | |
611 | + $obj_transf->desativaEntradaTransferencia(); | |
612 | + } | |
613 | + } | |
614 | + } | |
615 | + | |
598 | 616 | // Verifica se a série da matrícula cancelada é sequência de alguma outra série |
599 | 617 | if (is_array($lst_sequencia)) { |
600 | 618 | $det_sequencia = array_shift($lst_sequencia); | ... | ... |
ieducar/intranet/include/pmieducar/clsPmieducarTransferenciaSolicitacao.inc.php
... | ... | @@ -429,6 +429,21 @@ class clsPmieducarTransferenciaSolicitacao |
429 | 429 | return false; |
430 | 430 | } |
431 | 431 | |
432 | + /** | |
433 | + * | |
434 | + * Apaga os registros de uma matricula em uma escola que foi a aceitação da transferencia | |
435 | + * | |
436 | + * @return boolean | |
437 | + */ | |
438 | + function desativaEntradaTransferencia(){ | |
439 | + if (is_numeric($this->cod_transferencia_solicitacao)){ | |
440 | + $db = new clsBanco(); | |
441 | + $db->Consulta( "UPDATE {$this->_tabela} SET ref_cod_matricula_entrada = NULL, data_transferencia = NULL,ref_usuario_exc = NULL, data_exclusao = NULL WHERE cod_transferencia_solicitacao = '{$this->cod_transferencia_solicitacao}'" ); | |
442 | + return true; | |
443 | + } | |
444 | + return false; | |
445 | + } | |
446 | + | |
432 | 447 | /** |
433 | 448 | * Retorna uma lista filtrados de acordo com os parametros |
434 | 449 | * | ... | ... |