Jump to content

Error when trying to generate new invoice pdf

Recommended Posts


i created a new class called OrderInvoiceCustom but when i try to generate the new pdf i get this error :

Catchable fatal error: Argument 1 passed to HTMLTemplateInvoiceCore::__construct() must be an instance of OrderInvoice, instance of OrderInvoiceCustom given, called in /newpresta/classes/pdf/PDF.php on line 127 and defined in /newpresta/classes/pdf/HTMLTemplateInvoice.php on line 41

The code is :

$oic->id_supplier = $id_supplier;
$order_invoice_list = $oic->getInvoicesCollectionBySupplier($id_order,$id_supplier);
$order_invoice_list2 = $order->getInvoicesCollection();
Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list));

$pdf = new PDF($order_invoice_list, 'InvoiceCustom', $context->smarty);

If you get any ideas i'm really interesting.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More