Selectable PDF template for customer, quote, invoice, group

Hi,

I’m looking for the possibility to define/select a specific (invoice) PDF template before downloading it.

Current status in InvoicePlane

  • Customise two different PDF templates Templ1 (template1.php) and Templ2 (template2.php) in /application/views/invoice_templates/pdf/
  • Define Templ1 as default PDF template under Settings :arrow_right: Invoices :arrow_right: Invoice Template
  • Downloading an invoice results in using the template1.php for invoice layout.
  • To use Templ2 as PDF template change default template under Settings :arrow_right: Invoices :arrow_right: Invoice Template to Templ2.
  • Invoice downloads from now on use template2.php for invoice layout.

Work around (not tested)

  • Default PDF template is set to Templ1.
  • Go to Invoices.
  • Click button [Options] of the respective invoice.
  • Choose Send Email
  • Enter your own email address as recipient.
  • Under PDF Template choose Templ2
  • Click [Send].
  • Received email should have attached the invoice with Templ2 layout irrespective of Templ1 as default PDF template.

Nice to have (in the long run)

  • Define Templ1 as default PDF template under Settings :arrow_right: Invoices :arrow_right: Invoice Template

  • Add new customer.

  • New field Default PDF Template is pre-set with setting’s configuration (Templ1). Change it to Templ2 if necessary.

  • Save new customer.

  • Add new invoice for customer.

  • New field Default PDF Template is pre-set with customer’s default setting (Templ2). Change it if necessary.

  • Save new invoice.

  • Downloading this invoice results in using its PDF template setting.

Nice to have (low hanging fruits)

  • Use the PDF template chosing mechanism from the Send Email dialogue before downloading the invoice PDF.

Edit: Though I only need this feature for invoices it probably would be nice for quotes, too… :wink:

Last Update: 02.12.2017

This is working!! So I think that it can be easy for a dev to set up the same code in the “edit invoice page” and enable the possibility to set it from there.

Then, in the long run, it could be awesome to have the possibility to link PDF/Guest Templates to Invoice/Guest views group/family. Setting template from here: /index.php/invoice_groups/index

Hello,

Nothing is easy for a dev haha :wink:
Without some jokes, to be honest at the moment there is a lot of bug fixes/new features for the next minor version. But as we’re all giving time for free (including @Kovah) it takes more time than expected but the project is still alive.

For me to be honest I’m waiting for the next release version to fix eventually bugs that occur with the new release and then work on new features, so if the feature is approved by @Kovah then maybe for the 1.5.7 or 1.6.0 (there is also some cool features for 1.6.0 and a new calculation process in progress)

Regards,

1 Like

Hello. I ask a create Azerbaijani language for contribute. But don’t get answer.

@Orkhan I added the language. https://crowdin.com/project/fusioninvoice/az

@dev_invoiceplane of course! But as I was able to adapt and “implement” it on a 1.5.5 installation (the code is already on the linked below PR) I think that a dev (I’m not) can implement it easily and meanwhile check if is using standards.

IMHO this PR miss only a thing, pre-setting the selected template in the “Send Mail” overlay.

Nice work @FooLab.

it’s not my work but @dantefff 's :blush:

1 Like

here’s another PR (by @749) about that feature request:

3 Likes

wow, very nice!

10 application/modules/guest/controllers/Payment_handler.php

5 application/modules/invoices/controllers/Invoices.php

29 application/modules/invoices/views/view.php

6 application/modules/quotes/controllers/Quotes.php

24 application/modules/quotes/views/view.php

11 assets/core/scss/_core.scss