Skip to content

Commit

Permalink
[UPD] Inclusão das novas opções de contingência SVC-AN e SVC-RS
Browse files Browse the repository at this point in the history
  • Loading branch information
robmachado committed Apr 10, 2014
1 parent 959ed09 commit bb43600
Show file tree
Hide file tree
Showing 2 changed files with 1,350 additions and 1,014 deletions.
26 changes: 17 additions & 9 deletions exemplos/testaNFeStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,35 @@
$nfe = new ToolsNFePHP;
header('Content-type: text/html; charset=UTF-8');
$sUF = 'AC;AL;AM;AP;BA;CE;DF;ES;GO;MA;MG;MS;MT;PA;PB;PE;PI;PR;RJ;RN;RO;RR;RS;SC;SE;SP;TO';
//$sUF = 'PR'; //falha ao utilizar PR com SOAP nativo
$sUF = 'SP'; //falha ao utilizar PR com SOAP nativo

//determina o tipo de conector 1-SOAP ou 2-cURL
$modSOAP = '2';
//determina o ambiente 1-produção 2-homologação
$tpAmb= '2';
//habilita uso do scan
//$nfe->enableSCAN = true;

$aUF = explode(';',$sUF);
//habilita uso da contingência
//$nfe->enableSCAN = true;
//$nfe->enableSVCAN = true;
//$nfe->enableSVCRS = true;

if($tpAmb == 1){
$aUF = explode(';', $sUF);
if ($tpAmb == 1) {
$sAmb='Produção';
} else {
$sAmb='Homologação';
}
foreach ($aUF as $UF){
if ($nfe->enableSCAN) {
$cont = ' Contingencia SCAN ';
} elseif ($nfe->enableSVCAN) {
$cont = ' Contingencia SVC-AN ';
} elseif ($nfe->enableSVCRS) {
$cont = ' Contingencia SVC-RS ';
}
foreach ($aUF as $UF) {
echo '<BR><HR/><BR>';
echo $UF . '[' . $sAmb . '] - modSOAP = ' . $modSOAP . '<BR>';
$resp = $nfe->statusServico($UF,$tpAmb,$modSOAP);
echo $UF . '[' . $sAmb . ''.$cont.'] - modSOAP = ' . $modSOAP . '<BR>';
$resp = $nfe->statusServico($UF, $tpAmb, $modSOAP);

echo print_r($resp);
echo '<BR>';
Expand All @@ -34,4 +43,3 @@
echo $UF . '[' . $sAmb . '] - ' . $resp['xMotivo'] . '<BR><BR><HR/><BR>';
flush();
}
?>
Loading

0 comments on commit bb43600

Please sign in to comment.