-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83b9c2b
commit 920b8d0
Showing
20 changed files
with
593 additions
and
434 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
<?php | ||
|
||
error_reporting(E_ALL); | ||
ini_set('display_errors', 'On'); | ||
require_once('../../libs/NFe/DanfeNFCeNFePHP.class.php'); | ||
|
||
require_once(dirname(__FILE__).'/../../libs/NFe/DanfeNFCeNFePHP.class.php'); | ||
|
||
$saida = $_REQUEST['o']; | ||
|
||
if (!isset($_REQUEST['o'])) { | ||
|
||
$saida = 'pdf'; | ||
|
||
} | ||
|
||
$arq = '../xml/exemploNFCe.xml'; | ||
$arq = dirname(__FILE__).'/../xml/exemploNFCe.xml'; | ||
|
||
if (is_file($arq)) { | ||
|
||
$docxml = file_get_contents($arq); | ||
$danfe = new DanfeNFCeNFePHP($docxml, '../../images/logo.jpg', 0); | ||
$id = $danfe->montaDANFE(false); | ||
$teste = $danfe->printDANFE($saida, $id.'.pdf', 'I'); | ||
$danfe = new DanfeNFCeNFePHP($docxml, dirname(__FILE__).'/../../images/logo.jpg', 0); | ||
$id = $danfe->montaDANFE(false); | ||
$teste = $danfe->printDANFE($saida, $id.'.pdf', 'I'); | ||
|
||
} | ||
exit(); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,49 @@ | ||
<?php | ||
require_once('../../libs/NFe/ToolsNFePHP.class.php'); | ||
$nfe = new ToolsNFePHP('',1,false); | ||
|
||
require_once(dirname(__FILE__).'/../../libs/NFe/ToolsNFePHP.class.php'); | ||
|
||
$nfe = new ToolsNFePHP('', 1, false); | ||
$modSOAP = '2'; //usando cURL | ||
$tpAmb = '2';//usando produção | ||
$chNFe = '<chave de 44 digitos>'; | ||
$tpAmb = '2';//usando produção | ||
$chNFe = '<chave de 44 digitos>'; | ||
|
||
/* | ||
$tpEvento = '210200';//Confirmacao da Operacao //confirma a operação e o recebimento da mercadoria (para as operações com circulação de mercadoria) | ||
//Após a Confirmação da Operação pelo destinatário, a empresa emitente fica automaticamente impedida de cancelar a NF-e | ||
$tpEvento = '210210'; //Ciencia da Operacao //encrenca !!! Não usar | ||
//O evento de “Ciência da Operação” é um evento opcional e pode ser evitado | ||
//Após um período determinado, todas as operações com “Ciência da Operação” deverão | ||
//obrigatoriamente ter a manifestação final do destinatário declarada em um dos eventos de | ||
//Confirmação da Operação, Desconhecimento ou Operação não Realizada | ||
$tpEvento = '210220'; //Desconhecimento da Operacao | ||
//Uma empresa pode ficar sabendo das operações destinadas a um determinado CNPJ | ||
//consultando o “Serviço de Consulta da Relação de Documentos Destinados” ao seu CNPJ. | ||
//O evento de “Desconhecimento da Operação” permite ao destinatário informar o seu | ||
//desconhecimento de uma determinada operação que conste nesta relação, por exemplo | ||
$tpEvento = '210240'; //Operacao nao Realizada | ||
$tpEvento = '210240'; //Operacao nao Realizada | ||
//não aceitação no recebimento que antes se fazia com apenas um carimbo na NF | ||
*/ | ||
*/ | ||
|
||
$tpEvento = '210200'; | ||
$resp = ''; | ||
if (!$xml = $nfe->manifDest($chNFe,$tpEvento,'',$tpAmb,$modSOAP,$resp)){ | ||
$resp = ''; | ||
|
||
if (!$xml = $nfe->manifDest($chNFe, $tpEvento, '', $tpAmb, $modSOAP, $resp)) { | ||
|
||
header('Content-type: text/html; charset=UTF-8'); | ||
|
||
echo "Houve erro !! $nfe->errMsg"; | ||
echo '<br><br><PRE>'; | ||
echo '<br><br><pre>'; | ||
echo htmlspecialchars($nfe->soapDebug); | ||
echo '</PRE><BR>'; | ||
echo '</pre><br>'; | ||
|
||
} else { | ||
|
||
header('Content-type: text/xml; charset=UTF-8'); | ||
print_r($xml); | ||
//echo '<BR><BR><BR><BR><BR>'; | ||
//echo '<br><br><br><br><br>'; | ||
//print_r($resp); | ||
} | ||
|
||
?> | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
<?php | ||
require_once('../../libs/NFe/ToolsNFePHP.class.php'); | ||
$nfe = new ToolsNFePHP; | ||
$nfefile = $nfe->envDir.'35130471780456000160550010000000411000000410-nfe.xml'; | ||
|
||
require_once(dirname(__FILE__).'/../../libs/NFe/ToolsNFePHP.class.php'); | ||
|
||
$nfe = new ToolsNFePHP; | ||
$nfefile = $nfe->envDir.'35130471780456000160550010000000411000000410-nfe.xml'; | ||
$protfile = $nfe->temDir.'35130471780456000160550010000000411000000410-prot.xml'; | ||
if ($xml = $nfe->addProt($nfefile, $protfile)){ | ||
|
||
if ($xml = $nfe->addProt($nfefile, $protfile)) { | ||
|
||
file_put_contents($nfe->aprDir.'35130471780456000160550010000000411000000410-procNfe.xml', $xml); | ||
} | ||
|
||
?> | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
<?php | ||
require_once('../../libs/NFe/ToolsNFePHP.class.php'); | ||
$nfe = new ToolsNFePHP('',1); | ||
$UF = 'SP'; | ||
$CNPJ = '43651066000154'; | ||
$IE = ''; | ||
$CPF = ''; | ||
$tpAmb = '2'; | ||
|
||
require_once(dirname(__FILE__).'/../../libs/NFe/ToolsNFePHP.class.php'); | ||
|
||
$nfe = new ToolsNFePHP('', 1); | ||
$UF = 'SP'; | ||
$CNPJ = '43651066000154'; | ||
$IE = ''; | ||
$CPF = ''; | ||
$tpAmb = '2'; | ||
$modSOAP = '2'; | ||
|
||
if ($resposta = $nfe->consultaCadastro($UF, $CNPJ, $IE, $CPF, $tpAmb, $modSOAP) ){ | ||
if ($resposta = $nfe->consultaCadastro($UF, $CNPJ, $IE, $CPF, $tpAmb, $modSOAP)) { | ||
|
||
print_r($resposta); | ||
echo '<PRE>'; | ||
echo '<pre>'; | ||
echo htmlspecialchars($nfe->soapDebug); | ||
echo '</PRE><BR>'; | ||
echo '</pre><br>'; | ||
|
||
} else { | ||
|
||
echo "Houve erro !! $nfe->errMsg"; | ||
echo '<PRE>'; | ||
echo '<pre>'; | ||
echo htmlspecialchars($nfe->soapDebug); | ||
echo '</PRE><BR>'; | ||
} | ||
echo '</pre><br>'; | ||
|
||
?> | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
<?php | ||
|
||
require_once('../../libs/NFe/ConvertNFePHP.class.php'); | ||
require_once(dirname(__FILE__).'/../../libs/NFe/ConvertNFePHP.class.php'); | ||
|
||
$arq = 'xml/0008.txt'; | ||
$dir = dirname(__FILE__).'/../xml/'; | ||
$arq = '0008.txt'; | ||
|
||
//instancia a classe | ||
$nfe = new ConvertNFePHP(); | ||
|
||
if (is_file($arq)) { | ||
|
||
if ( is_file($arq) ){ | ||
$xml = $nfe->nfetxt2xml($arq); | ||
$xml = $xml[0]; | ||
|
||
if ($xml != ''){ | ||
echo '<PRE>'; | ||
if ($xml != '') { | ||
|
||
echo '<pre>'; | ||
echo htmlspecialchars($xml); | ||
echo '</PRE><BR>'; | ||
if (!file_put_contents('0008-nfe.xml',$xml)){ | ||
echo '</pre><br>'; | ||
|
||
if (!file_put_contents($dir.'0008-nfe.xml', $xml)) { | ||
|
||
echo "ERRO na gravação"; | ||
|
||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
?> | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.