Skip to content

Instantly share code, notes, and snippets.

View aguimaraes's full-sized avatar

Alvaro Guimaraes aguimaraes

  • Modern Milkman LLC
  • Boston, MA, USA
  • 21:59 (UTC -04:00)
View GitHub Profile
<?php
class Simp_Service_Nfe
{
/**
* Se for true, vai encher os logs de merda
* @var bool
*/
protected $debug = false;
/**
begin;
do
$$
declare
u record;
r record;
begin
for u in
select * from users where id = 18 or id = 35 or id = 62
loop
[root@ip-172-31-20-186 storage]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 3.2G 4.5G 42% /
devtmpfs 491M 64K 491M 1% /dev
tmpfs 499M 0 499M 0% /dev/shm
/dev/xvdf 4.8G 1.1G 3.5G 23% /storage/st1
/dev/xvdg 17G 3.2G 13G 20% /storage/st2
begin;
drop table if exists schema_changes;
drop table if exists permissions;
drop table if exists databasechangelog;
drop table if exists databasechangeloglock;
drop table if exists customer_groups;
create table customer_groups (
id serial primary key,
name varchar(255) unique not null
<wsdl:service name="NFeDistribuicaoDFe">
<wsdl:port name="NFeDistribuicaoDFeSoap" binding="tns:NFeDistribuicaoDFeSoap">
<soap:address location="https://hom.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx" />
</wsdl:port>
<wsdl:port name="NFeDistribuicaoDFeSoap12" binding="tns:NFeDistribuicaoDFeSoap12">
<soap12:address location="https://hom.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx" />
</wsdl:port>
</wsdl:service>
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<mdfeCabecMsg xmlns="http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeRetRecepcao">
<cUF>35</cUF>
<versaoDados>1.00</versaoDados>
</mdfeCabecMsg>
</soap12:Header>
<soap12:Body>
<mdfeDadosMsg xmlns="http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeRetRecepcao">
<retConsReciMDFe xmlns="http://www.portalfiscal.inf.br/mdfe" versao="1.00">
<tpAmb>2</tpAmb>
<verAplic>RS20140820165522</verAplic>
<nRec>359000001070513</nRec>
<cStat>598</cStat>
<xMotivo>Rejeição: Usar somente o namespace padrão do MDF-e</xMotivo>
<cUF>35</cUF>
</retConsReciMDFe>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeRetRecepcao">
<env:Header>
<mdfeCabecMsg xmlns="http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeRetRecepcao">
<cUF>35</cUF>
<versaoDados>1.00</versaoDados>
</mdfeCabecMsg>
</env:Header>
<env:Body>
<mdfeDadosMsg xmlns="http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeRetRecepcao">
<retEnviMDFe xmlns="http://www.portalfiscal.inf.br/mdfe" versao="1.00">
<tpAmb>2</tpAmb>
<cUF>35</cUF>
<verAplic>RS20140703103023</verAplic>
<cStat>103</cStat>
<xMotivo>Arquivo recebido com sucesso</xMotivo>
<infRec>
<nRec>359000001070510</nRec>
<dhRecbto>2014-09-17T22:08:08</dhRecbto>
<tMed>1</tMed>
<mdfeDadosMsg xmlns="http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeRecepcao">
<enviMDFe versao="1.00">
<idLote>1</idLote>
<MDFe xmlns="http://www.portalfiscal.inf.br/mdfe">
<infMDFe Id="MDFe35140913583871000127580010000000012000000014" versao="1.00">
<ide>
<cUF>35</cUF>
<tpAmb>2</tpAmb>
<tpEmit>1</tpEmit>
<mod>58</mod>