Пример #1
0
<?php

require '../vendor/autoload.php';
require 'config.php';
use NfeFocus\Nfse;
use NfeFocus\Enviroment;
use NfeFocus\Issuer;
use NfeFocus\Receiver;
use NfeFocus\Address;
use NfeFocus\Items\Item;
use NfeFocus\Items\ItemContainer;
use NfeFocus\Transaction\InsertTransaction;
try {
    $issuer = new Issuer();
    $issuer->setCompanyDocument(CNPJ);
    $issuer->setCompanyName('DIN DIGITAL WEB LTDA ME');
    $issuer->setTradingName('DIN DIGITAL');
    $issuer->setStateRegistration(IE);
    $issuerAddress = new Address();
    $issuerAddress->setStreet('Rua Bernardino de Campos');
    $issuerAddress->setNumber('31, Sala 501');
    $issuerAddress->setNeighborhood('Centro');
    $issuerAddress->setCity('Santo André');
    $issuerAddress->setState('SP');
    $issuerAddress->setZipCode('09015-010');
    $issuer->setAddress($issuerAddress);
    $receiver = new Receiver();
    $receiver->setDocument('446.441.646-23');
    $receiver->setName('NF-E EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL');
    $receiver->setEmail('*****@*****.**');
    $receiverAddress = new Address();
Пример #2
0
 public function __construct(DateTime $datetime, Issuer $issuer, Receiver $receiver, Items\ItemContainer $items, Duplicatas\DuplicatasContainer $duplicatas = null)
 {
     $this->_nfse = array("natureza_operacao" => 'Remessa de Produtos', "forma_pagamento" => 0, "data_emissao" => $datetime->format(DateTime::ATOM), "tipo_documento" => 1, "finalidade_emissao" => 1, "cnpj_emitente" => $issuer->getCompanyDocument(), "nome_emitente" => $issuer->getCompanyName(), "nome_fantasia_emitente" => $issuer->getTradingName(), "logradouro_emitente" => $issuer->getAddress()->getStreet(), "numero_emitente" => $issuer->getAddress()->getNumber(), "bairro_emitente" => $issuer->getAddress()->getNeighborhood(), "municipio_emitente" => $issuer->getAddress()->getCity(), "uf_emitente" => $issuer->getAddress()->getState(), "cep_emitente" => $issuer->getAddress()->getZipCode(), "telefone_emitente" => '', "inscricao_estadual_emitente" => $issuer->getStateRegistration(), "nome_destinatario" => $receiver->getName(), "cnpj_destinatario" => $receiver->getDocumentCNPJ(), "cpf_destinatario" => $receiver->getDocumentCPF(), "inscricao_estadual_destinatario" => $receiver->getStateRegistration(), "telefone_destinatario" => '', "email_destinatario" => $receiver->getEmail(), "logradouro_destinatario" => $receiver->getAddress()->getStreet(), "numero_destinatario" => $receiver->getAddress()->getNumber(), "bairro_destinatario" => $receiver->getAddress()->getNeighborhood(), "municipio_destinatario" => $receiver->getAddress()->getCity(), "uf_destinatario" => $receiver->getAddress()->getState(), "pais_destinatario" => 'Brasil', "cep_destinatario" => $receiver->getAddress()->getZipCode(), "icms_base_calculo" => '0', "icms_valor_total" => '0', "icms_base_calculo_st" => '0', "icms_valor_total_st" => '0', "icms_modalidade_base_calculo" => '0', "icms_valor" => '0', "valor_frete" => '0', "valor_seguro" => '0', "valor_total" => $items->getTotal(), "valor_produtos" => $items->getTotal(), "valor_ipi" => '0', "modalidade_frete" => '0', "informacoes_adicionais_contribuinte" => '', "items" => $items->getItems());
     if (!is_null($duplicatas) && $duplicatas->count()) {
         $this->_nfse['duplicatas'] = $duplicatas->getDuplicatas();
     }
 }