Jump to content

Problema para ver/generar facturas ERROR 500


Recommended Posts

Hola buenos días, como están? 

Les vengo a pedir ayudar, tengo prestashop 1.7.6.9 instalado hace 2 años y funcionando correctamente en una web.

Me lo baje a local (Wampserver) para hacer algunos cambios y probar un modulo nuevo.

Me funciona todo menos la generación de la factura, no puedo ver ni las facturas que ya estaban generadas.

Me da error 500.

Me faltara configurar algo, alguna extensión php? ya borre cache, cambie versión de PHP y nada.

 

Versión PHP: 7.2.34

 

Active el modo debug y me muestra esto:

Symfony\Component\Debug\Exception\UndefinedMethodException

in override\classes\pdf\HTMLTemplateInvoice.php (line 153)

                'total_taxes' => $total_taxes,

                'total_paid_tax_excl' => $this->order_invoice->total_paid_tax_excl,

                'total_paid_tax_incl' => $this->order_invoice->total_paid_tax_incl,

            ];

            foreach ($footer as $key => $value) {

                $footer[$key] = Tools::ps_round($value, Context::getContext()->getComputingPrecision(), $this->order->round_mode);

            }

            /**

             * Need the $round_mode for the tests.

             */

            $round_type = null;

HTMLTemplateInvoice->getContent()in classes\pdf\PDF.php (line 128)

            $template->assignHookData($object);

            $this->pdf_renderer->createHeader($template->getHeader());

            $this->pdf_renderer->createFooter($template->getFooter());

            $this->pdf_renderer->createPagination($template->getPagination());

            $this->pdf_renderer->createContent($template->getContent());

            $this->pdf_renderer->writePage();

            $render = true;

            unset($template);

        }

PDFCore->render()in src\Adapter\PDF\PDFGenerator.php (line 67)

     * {@inheritdoc}

     */

    public function generatePDF(array $objectCollection)

    {

        $pdf = new PDF($objectCollection, $this->templateTypeProvider->getPDFTemplateType(), $this->smarty);

        $pdf->render();

    }

}

PDFGenerator->generatePDF(array(object(OrderInvoice), object(OrderInvoice), object(OrderInvoice), object(OrderInvoice), object(OrderInvoice), object(OrderInvoice), object(OrderInvoice), object(OrderInvoice), object(OrderInvoice), object(OrderInvoice)))in src\PrestaShopBundle\Form\Admin\Sell\Order\Invoices\InvoiceByStatusFormHandler.php (line 102)

                'domain' => 'Admin.Orderscustomers.Notification',

                'parameters' => [],

            ];

        } else {

            // Generate PDF out of found invoices

            $this->pdfGenerator->generatePDF($invoiceCollection);

        }

        return $errors;

    }

}

InvoiceByStatusFormHandler->save(array('generate_by_status' => array('order_states' => array('8'))))in src\PrestaShopBundle\Controller\Admin\Sell\Order\InvoicesController.php (line 138)

    {

        $form = $formHandler->getForm();

        $form->submit($request->request->get($form->getName()));

        if ($form->isSubmitted()) {

            if ($errors = $formHandler->save($form->getData())) {

                $this->flashErrors($errors);

                return false;

            }

        }

InvoicesController->processForm(object(InvoiceByStatusFormHandler), object(Request))in src\PrestaShopBundle\Controller\Admin\Sell\Order\InvoicesController.php (line 99)

     * @return RedirectResponse

     */

    public function generatePdfByStatusAction(Request $request)

    {

        $formHandler = $this->get('prestashop.admin.order.invoices.by_status.form_handler');

        $this->processForm($formHandler, $request);

        return $this->redirectToRoute('admin_order_invoices');

    }

    /**

InvoicesController->generatePdfByStatusAction(object(Request))in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php (line 151)

        $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);

        $controller = $event->getController();

        $arguments = $event->getArguments();

        // call controller

        $response = \call_user_func_array($controller, $arguments);

        // view

        if (!$response instanceof Response) {

            $event = new GetResponseForControllerResultEvent($this, $request, $type, $response);

            $this->dispatcher->dispatch(KernelEvents::VIEW, $event);

HttpKernel->handleRaw(object(Request), 1)in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php (line 68)

    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)

    {

        $request->headers->set('X-Php-Ob-Level', ob_get_level());

        try {

            return $this->handleRaw($request, $type);

        } catch (\Exception $e) {

            if ($e instanceof RequestExceptionInterface) {

                $e = new BadRequestHttpException($e->getMessage(), $e);

            }

            if (false === $catch) {

HttpKernel->handle(object(Request), 1, false)in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php (line 200)

        $this->boot();

        ++$this->requestStackSize;

        $this->resetServices = true;

        try {

            return $this->getHttpKernel()->handle($request, $type, $catch);

        } finally {

            --$this->requestStackSize;

        }

    }

Kernel->handle(object(Request), 1, false)in admin655oxqeae\index.php (line 86)

$request = Request::createFromGlobals();

Request::setTrustedProxies([], Request::HEADER_X_FORWARDED_ALL);

try {

    require_once __DIR__.'/../autoload.php';

    $response = $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);

    $response->send();

    $kernel->terminate($request, $response);

} catch (NotFoundHttpException $exception) {

    define('ADMIN_LEGACY_CONTEXT', true);

    // correct Apache charset (except if it's too late)

 

 

error factura 1.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...