Closed abelnexus closed 5 years ago
utilizo esto: use Greenter\Model\Sale\Document; use Greenter\Model\Sale\Invoice; use Greenter\Model\Sale\SaleDetail; use Greenter\Model\Sale\Legend; use Greenter\Ws\Services\SunatEndpoints;
public function generar_comprobante($invoice)
{
$util = Util::getInstance();
// Envio a SUNAT.
$see = $util->getSee(SunatEndpoints::FE_PRODUCCION);
$res = $see->send($invoice);
if ($res->isSuccess()) {
$cdr = $res->getCdrResponse();
$nexus = "|".$util->getResponseFromCdr($cdr);
$this->sms = "correcto".$nexus;
Util::writeXml($invoice, $see->getFactory()->getLastXml());
$pdf = $util->getPdf($invoice);
$util->showPdf($pdf, $invoice->getName().'.pdf');
Util::writeCdr($invoice, $res->getCdrZip());
} else {
$this->sms = $res->getError()->getMessage();
}
return $this->sms;
}
Tienes que habilitar la extension zip.
hola amigo, lo subi al servidor y me da este error: [17-Oct-2018 18:40:20 America/Lima] PHP Fatal error: Class 'ZipArchive' not found in /home/letgeahummhj/public_html/vendor/greenter/ws/src/Zip/ZipFileDecompress.php on line 28 en localhost funciona normal.