addCancelamento() public method

addCancelamento Adiciona a tga de cancelamento a uma NFe já autorizada NOTA: não é requisito da SEFAZ, mas auxilia na identificação das NFe que foram canceladas
public addCancelamento ( string $pathNFefile = '', string $pathCancfile = '', boolean $saveFile = false ) : string
$pathNFefile string
$pathCancfile string
$saveFile boolean
return string
示例#1
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once '../../bootstrap.php';
use NFePHP\NFe\ToolsNFe;
$nfe = new ToolsNFe('../../config/config.json');
$aResposta = array();
$pathNFefile = '/var/www/nfe/homologacao/enviadas/aprovadas/201501/35150158716523000119550010000000071000000076-protNFe.xml';
$pathProtfile = '/var/www/nfe/homologacao/temporarias/201501/35150158716523000119550010000000071000000076-CancNFe-retEnvEvento.xml';
$saveFile = true;
$retorno = $nfe->addCancelamento($pathNFefile, $pathProtfile, $saveFile);
echo '<br><br><PRE>';
echo htmlspecialchars($retorno);
echo '</PRE><BR>';
echo "<br>";