D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreGravaReprocessaDia.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GrsFecharFatura * * @copyright (c) year, Carlos Marques - CM */ class GreGravaReprocessaDia { private $DadosId; private $Resultado; private $Dados; function getResultado() { return $this->Resultado; } public function grvrepr(array $DadosId) { $this->DadosId = $DadosId; if($this->DadosId['tipo_fechamento'] == 1){ $this->DadosId['data_inicio'] = "'". $this->DadosId['data_inicio']."'"; $this->DadosId['data_ult_fechamento'] = "'". $this->DadosId['data_ult_fechamento']."'"; $this->DadosId['data_prox_fechamento'] = "'". $this->DadosId['data_prox_fechamento']."'"; $upAltCabFatura = new \App\adms\Models\helper\AdmsProcedure5(); $upAltCabFatura->exeProcedure("lanca_dia_v", $_SESSION['id_user'], $this->DadosId['gre_filial_id'], $this->DadosId['data_inicio'], $this->DadosId['data_ult_fechamento'], $this->DadosId['data_prox_fechamento']); if ($upAltCabFatura->getResultado()) { $_SESSION['msg'] = "<div class='alert alert-success' role='alert'> Abrir mês realizado com sucesso! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = true; }else{ $_SESSION['msg'] = "<div class='alert alert-danger' role='alert'> Erro: Não encontrei nenhum mês para abrir fechamento! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = false; } }else{ // $this->DadosId['data_inicio'] = "'". $this->DadosId['data_inicio']."'"; // var_dump($this->DadosId); //var_dump("sel_repr_dia_contr".' Empr: '. $_SESSION['id_user'].' filial: '.$this->DadosId['gre_filial_id'].' Inicio: '. $this->DadosId['data_inicio']); // die; $upAltCabFatura = new \App\adms\Models\helper\AdmsProcedure2(); $upAltCabFatura->exeProcedure("sel_repr_dia_contr",$_SESSION['id_user'],$this->DadosId['data_inicio']); if ($upAltCabFatura->getResultado()) { $_SESSION['msg'] = "<div class='alert alert-success' role='alert'> Reprocesamento realizado com sucesso! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = true; } else { $_SESSION['msg'] = "<div class='alert alert-danger' role='alert'> Erro: Reprocessamento não foi realizado! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = false; } } } }