Hello. My instance of IP at the moment is for a wholesale client. He gives the invoice to the purchaser (corporate) and a packing list to the retailer (store manager). It wasn’t hard to create and here is how I did it if others are interested in it.
Updated Invoice Controller
public function generate_pkgpdf($invoice_id, $stream = true, $invoice_template = 'packingList.php')
{
$this->load->helper('pdf');
generate_invoice_pdf($invoice_id, $stream, $invoice_template, null);
}
duplicated the default invoiceplane template, renamed it to ‘packingList.php’, and stripped the price columns out.
added an additional headerbar option item in the ‘view’ invoice view
–not so clean but does the trick.
//Packing List
public function generate_pkgpdf($invoice_id, $stream = true, $invoice_template = 'PackingList PDF Template')
{
$this->load->helper('pdf');
generate_invoice_pdf($invoice_id, $stream, $invoice_template, null);
}
After the Update to InvoicePlane 1.7.x, InvoicePlane wouldn’t use the right template anymore, but just take the standard InvoicePlane one.
It turns out, while InvoicePlane was previously fine with (or wanted?) the full template including the file extension, from version 1.7 on, you need to leave out the file extension. So instead of $invoice_template = ‘packingList.php’ you now need to use $invoice_template = ‘packingList’
Just for your information: InvoicePlane hasn’t done anything with “packing list”.
It’s good that you give this information, but it’s purely for users using this mod and changing / maintaining this mod every time a new version comes out.
I’ll keep saying this: use at your own risk!
If $invoice_id comes from the url and you type something weird in the url you’ll have a security vulnerability.
Be careful which mod you’re using from anywhere
Something simple: in InvoicePlane’s standards all translation keys are in lowercase.
I mean: it can be changed easily, but just saying…
And now you can easily recognize the mod from a random post in a forum…