This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
GROUP_CONCAT(us.id_usuario, ' - ', us.nome_usuario SEPARATOR ';') AS 'usuario', p.id_pessoa AS cliente, | |
p.nome_pessoa AS 'razao_social', p.nome_tratamento AS 'fantasia', | |
p.cpf_cnpj, pj.inscricao_estadual, | |
pe.endereco_cidade AS 'cidade', pe.endereco_logradouro AS 'endereco', | |
IFNULL(pe.endereco_complemento, '') AS 'complemento', | |
pe.endereco_cep AS 'cep', pe.endereco_bairro AS 'bairro', | |
pe.endereco_uf AS 'uf', lower(p.email) AS 'email', | |
pe.ddd_telefone_residencial AS ddd, | |
pe.telefone_residencial AS telefone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
GROUP_CONCAT(us.id_usuario, ' - ', us.nome_usuario SEPARATOR ';') AS 'usuario', p.id_pessoa AS cliente, | |
p.nome_pessoa AS 'razao_social', p.nome_tratamento AS 'fantasia', | |
p.cpf_cnpj, pj.inscricao_estadual, | |
pe.endereco_cidade AS 'cidade', pe.endereco_logradouro AS 'endereco', | |
IFNULL(pe.endereco_complemento, '') AS 'complemento', | |
pe.endereco_cep AS 'cep', pe.endereco_bairro AS 'bairro', | |
pe.endereco_uf AS 'uf', lower(p.email) AS 'email', | |
pe.ddd_telefone_residencial AS ddd, pe.telefone_residencial AS telefone | |
FROM webpdv.usuarios us |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
xa.storeno AS Loja, | |
date_format(xa.date, '%m/%Y') AS Mes, | |
CONCAT(xa.empno, ' - ', pre.nome) AS Vendedor, | |
pre.cpf_cnpj AS CPF, | |
ROUND(SUM(qtty / 1000)) AS Quantidade, | |
REPLACE(ROUND(sum(price / 100 * xa.qtty / 1000), 2), '.', ',') AS 'Valor Total' | |
FROM sqldados.xalog2 xa | |
INNER JOIN sqlpdv.pxa pxa ON (pxa.storeno = xa.storeno AND pxa.pdvno = xa.pdvno AND pxa.xano = xa.xano) | |
INNER JOIN sqldados.eord eo ON (eo.storeno = pxa.storeno AND eo.pdvno = pxa.pdvno AND eo.ordno = pxa.eordno) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Db_webpdv_PedidosEntregas::buscarNotasDeTransferenciadeMercadoriasParaEcommerce */ | |
SELECT | |
GROUP_CONCAT(pe.id_pedido_entrega SEPARATOR ', ') AS pedidos, pe.storeno, pe.ordno, | |
lce.storeno_faturamento, '' AS id_carga, '' AS nota_fiscal_id, | |
nf.id AS nf, nf.nNF AS no, nfvo.storeno_origem as loja, nfvo.storeno_destino AS loja_destino, | |
nf.dEmi AS data_entrada, nf.hEmi AS hora_emissao, | |
(i.grossamt / 100) AS valor_total, (i.netamt / 100) AS base_calculo, (i.icm / 100) AS icms, 'Venda Ordem' as tipo | |
FROM webpdv.pedidos_entregas pe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: cesar | |
* Date: 06/05/16 | |
* Time: 09:15 | |
*/ | |
require(dirname(__FILE__) . "/../includes/funcoes.inc.php"); | |
require(dirname(__FILE__) . "/../includes/geral.class.php"); | |
include(dirname(__FILE__) . "/../includes/global.php"); |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2;PH;PINHEIROS | |
3;MT;MONTANHA | |
4;PB;PONTO BELO | |
6;BE;BOA ESPERANÇA | |
7;LD;PINHEIROS | |
8;CB;CONCEIÇÃO DA BARRA | |
9;BR;BRAÇO DO RIO | |
10;LH;LINHARES | |
11;JG;JAGUARÉ | |
12;PC;PEDRO CANÁRIO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Db_webpdv_FilialTipo::buscarPeriodoRankingAtacadoPrestador */ | |
SELECT t1.storeno, t1.pdvno, t1.xano, t1.date, t1.valor_total, | |
t1.xatype, t1.metodo_pagamento, t1.tipo_transacao, t1.id_pessoa, | |
t1.nome_pessoa, t1.ddd_telefone, t1.telefone | |
FROM ( | |
SELECT xalog2.storeno, xalog2.pdvno, xalog2.xano, xalog2.date, | |
SUM(xalog2.qtty/1000 * xalog2.price) AS valor_total, | |
xalog2.xatype, | |
IF(xalog2.qtty <0, 1, 0) AS troca_devolucao, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT xalog2.storeno, xalog2.pdvno, xalog2.xano, xalog2.date, | |
SUM(xalog2.qtty/1000 * xalog2.price) AS valor_total, | |
xalog2.xatype, | |
IF(xalog2.qtty <0, 1, 0) AS troca_devolucao, | |
paym.name AS metodo_pagamento, | |
IF(xalog2.price > 0, 'Venda', | |
IF(xalog2.price < 0 AND xalog2.xatype = 11, 'Devolução', 'Troca') | |
) as tipo_transacao, p.id_pessoa, p.nome_pessoa, p.ddd_telefone, p.telefone | |
FROM sqldados.xalog2 | |
LEFT JOIN sqldados.paym |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
background-color: firebrick; | |
color: white; | |
-webkit-box-shadow: 2px 4px 14px -1px rgba(0,0,0,0.75); | |
-moz-box-shadow: 2px 4px 14px -1px rgba(0,0,0,0.75); | |
box-shadow: 2px 4px 14px -1px rgba(0,0,0,0.75); | |
border-radius: 5px 5px 5px 5px; | |
-moz-border-radius: 5px 5px 5px 5px; | |
-webkit-border-radius: 5px 5px 5px 5px; | |
border: 0px solid #000000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PSR-0 | |
* Auto loading | |
PSR-1 | |
* Tags que devem ser usadas <?php // ?> e no caso de echo na tela <?= '//' ?> | |
* Nomes das classes devem ser do estilo StudyCaps | |
* Nomes dos métodos em camelCase | |
* Constantes devem ser escritas em maiúsculo e palavras separadas por undeline |