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

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...

Important Information

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