D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreLerCliniEstLanc.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreLerCliniEstLanc * * @copyright (c) year, Carlos Marques - CM */ class GreLerCliniEstLanc { private $Resultado; private $Dados; public function lerLanc($DadosId = null) { $this->Dados = $DadosId; //var_dump( $this->Dados); $lerLanc = new \App\adms\Models\helper\AdmsRead(); $lerLanc->fullRead("SELECT mov.id mov_id, mov.gre_produto_id prod_id, mov.descricao descricao, resid.nome resid_nome, mov.gre_filial_id, mov.gre_empr_princ_id, DATE_FORMAT(mov.data,'%d/%m/%Y') data, DATE_FORMAT(mov.data,'%H:%i:%s') hora, FORMAT(mov.qtde, 0, 'de_DE') qtde, FORMAT(mov.estoque , 0, 'de_DE') estoque, FORMAT(mov.valor_total, 2, 'de_DE') valor_total, grup.sigla, filial.nome_fantasia filial_nome, case when usu.usuario is null then 'Lançamento Prescrição' else usu.usuario end usuario FROM gre_est_mov_clinica mov join gre_filial filial on filial.id = mov.gre_filial_id join gre_est_grupo_lancamento grup on grup.id = mov.gre_grupo_lancamento_id and grup.gre_origem_id = 2 left join adms_usuarios usu on usu.id = mov.gre_usuario_id join gre_produto prod on mov.gre_produto_id = prod.id and mov.gre_empr_princ_id = prod.gre_empr_princ_id left join gre_residente resid on resid.id = mov.gre_residente_id WHERE date_format(mov.data, '%Y-%m-%d') >= :datai and date_format(mov.data, '%Y-%m-%d') <= :dataf and mov.gre_produto_id = :prod_id and mov.gre_empr_princ_id = :empr_princ_id and mov.gre_filial_id = :filial_id order by mov.data , mov.id, mov.gre_grupo_lancamento_id", "datai={$this->Dados['datai']}&dataf={$this->Dados['dataf']}&prod_id={$this->Dados['gre_produto_id']}&empr_princ_id={$this->Dados['gre_empr_princ_id']}&filial_id={$this->Dados['gre_filial_id']}"); $this->Resultado= $lerLanc->getResultado(); return $this->Resultado; } }