D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreLerFaturaConferencia.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreLerFatura * * @copyright (c) year, Carlos Marques - CM */ class GreLerFaturaConferencia { private $Resultado; private $Dados; public function lerFat() { $this->Dados = filter_input_array(INPUT_GET, FILTER_DEFAULT); $lerFat = new \App\adms\Models\helper\AdmsRead(); $lerFat->fullRead("SELECT concat(:id_user,cabfat.docto,'_',filial.nome_fantasia,'_',replace(trim(resid.apelido),' ','_')) nome_arq, fat.*, cabfat.gre_forma_pagto_id, forma.nome forma_nome, filial.nome_fantasia filial_nome, contr.nome contr_nome, contr.email contr_email, resid.nome resid_nome, gfat.nome gfat_nome, cabfat.gre_status_fat_id gre_status_id, DATE_FORMAT(STR_TO_DATE( cabfat.vencimento, '%Y-%m-%d'), '%d/%m/%Y') vencimento, stat.nome stat_nome, lpad(banco.numero,3,0) banco_id, banco.nome banco_nome, bol.agencia banco_agencia, concat(bol.conta,'-',dv_conta) banco_conta, MASK(filial.cnpj, '##.###.###/####-##') cnpj FROM gre_cab_fatura cabfat left join gre_dados_boleto bol on bol.gre_empr_princ_id = cabfat.gre_empr_princ_id and bol.gre_filial_id = cabfat.gre_filial_id and bol.gre_forma_pagto_id = cabfat.gre_forma_pagto_id left join gre_bancos banco on banco.id = bol.gre_banco_id left join gre_fatura fat on fat.docto = cabfat.docto left join gre_forma_pagamento forma on forma.id = cabfat.gre_forma_pagto_id join gre_filial filial on filial.id = fat.gre_filial_id join gre_residente resid on resid.id = fat.gre_residente_id join gre_contratante contr on contr.id = resid.gre_contratante_id join gre_grupo_fatura gfat on gfat.id = fat.gre_grupo_fatura INNER JOIN gre_status_fat stat ON stat.id= cabfat.gre_status_fat_id WHERE fat.docto = :id order by gre_grupo_fatura, fat.prod_nome, fat.descricao", "id_user={$_SESSION['id_user']}&id={$this->Dados['id']}"); $this->Resultado= $lerFat->getResultado(); return $this->Resultado; } }