D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Models
/
Filename :
ModMixGenericoFilial.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of ModRupCompProd * * @copyright (c) year, Carlos Marques - CM */ class ModMixGenericoFilial { private $Resultado; private $Dados; private $DcbId; private $ApresId; public function listMixFil($Dados = null) { $this->Dados = $Dados; // var_dump($this->Dados); $lerLanc = new \App\adms\Models\helper\AdmsRead(); $lerLanc->fullRead("select d.id dcb_id, :tipo tipo, d.nome dcb_nome, a.nome apres, s.filial_id, f.nome filial_nome, s.dias dias, date_format(p.data_inclusao,'%m/%y') data_inclusao, p.id produto_id, m.nome marca_nome, p.nome produto_nome, s.qtde_estoque estoque, s.qtde_total qtde_venda, round(s.qtde_total / dias,4) qtde_dia, cus_total custo_total, s.ven_total venda_total, p.preco_max, p.preco_fabr, round(((1-(s.ven_total/ s.qtde_total) / p.preco_max)*100),2) desconto, round((s.ven_total/ s.qtde_total), 2) preco_de_venda_medio, round((s.ven_total - s.cus_total ),2) mb, round(((s.ven_total - s.cus_total ) * 100) / s.ven_total,2) lb_i, format(round(((s.ven_total - s.cus_total ) * 100) / s.ven_total,2), 2, 'de_DE') lb from ro_venda_semestre s inner join ro_produto p on s.produto_id = p.id inner join ro_marca m on m.id = p.marca_id inner join ro_apresentacao a on a.produto_id = p.id inner join ro_dcb d on d.id = p.dcb_id inner join ro_filial f on f.id = s.filial_id where p.dcb_id = :dcb_id and a.nome = :apres and s.produto_id = :prod_id and p.situacao_id = 1 and p.status_compras_id = 1 group by f.id,p.id order by s.filial_id ", "dcb_id={$this->Dados['dcb_id']}&apres={$this->Dados['apres']}&prod_id={$this->Dados['prod_id']}&tipo={$this->Dados['tipo']}"); $this->Resultado = $lerLanc->getResultado(); //var_dump($this->Resultado); return $this->Resultado; } }