Exemplo n.º 1
0
    $nProc = $proc[0];
    $indProc = $proc[1];
    $resp = $nfe->tagprocRef($nProc, $indProc);
}
//dados exportação
$UFSaidaPais = 'SP';
$xLocExporta = 'Maritimo';
$xLocDespacho = 'Porto Santos';
$resp = $nfe->tagexporta($UFSaidaPais, $xLocExporta, $xLocDespacho);
//dados de compras
$xNEmp = '';
$xPed = '12345';
$xCont = 'A342212';
$resp = $nfe->tagcompra($xNEmp, $xPed, $xCont);
//dados da colheita de cana
$safra = '2014';
$ref = '01/2014';
$resp = $nfe->tagcana($safra, $ref);
$aForDia = array(array('1', '100', '1400', '1000', '1400'), array('2', '100', '1400', '1000', '1400'), array('3', '100', '1400', '1000', '1400'), array('4', '100', '1400', '1000', '1400'), array('5', '100', '1400', '1000', '1400'), array('6', '100', '1400', '1000', '1400'), array('7', '100', '1400', '1000', '1400'), array('8', '100', '1400', '1000', '1400'), array('9', '100', '1400', '1000', '1400'), array('10', '100', '1400', '1000', '1400'), array('11', '100', '1400', '1000', '1400'), array('12', '100', '1400', '1000', '1400'), array('13', '100', '1400', '1000', '1400'), array('14', '100', '1400', '1000', '1400'));
foreach ($aForDia as $forDia) {
    $dia = $forDia[0];
    $qtde = $forDia[1];
    $qTotMes = $forDia[2];
    $qTotAnt = $forDia[3];
    $qTotGer = $forDia[4];
    $resp = $nfe->tagforDia($dia, $qtde, $qTotMes, $qTotAnt, $qTotGer);
}
//monta a NFe e retorna na tela
$xml = $nfe->montaNFe();
header('Content-type: text/xml; charset=UTF-8');
echo $xml;