thegreenter / demo

Ejemplos utilizando Greenter (UBL 2.1, SOAP, Firma digital, PDF, QR)
https://greenter-sample.herokuapp.com
MIT License
60 stars 51 forks source link

Error al generar zip, Class 'ZipArchive' not found #37

Closed abelnexus closed 5 years ago

abelnexus commented 5 years ago

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.

abelnexus commented 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;
}
giansalex commented 5 years ago

Tienes que habilitar la extension zip.