Author Topic: [PATCH] Invoice PDFs: Unify the two PDF creation methods  (Read 1133 times)

reinhold

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 204
[PATCH] Invoice PDFs: Unify the two PDF creation methods
« on: January 06, 2013, 01:42:04 am »
The attached patch for the invoice controller is my first shot at improving the invoice creation. All it does is to change the controller to no longer use Joomla's pdf format for the invoice, but rather call the checkStoreInvoice function to create the PDF on disk and then return that file.

Previously, a click on the invoice icon in the backend caused the PDF to be generated via Joomla's pdf format on the fly (the pdf was never stored on disk!), while the automatically created invoices were created on disk by the checkStoreInvoice function. While there was not a lot of difference, some small inconsistencies between the two caused the two types of invoices to be substantially different under some circumstances.

What do you think of this approach? It is not yet completely finished for pushing (the pdfs created by checkStoreInvoice have some problems compared to the BE-created pdfs, like the missing header etc.).

My further plans are to add a tab to the vendor config that allows the vendor to enter the header/footer/geometry of a vendor letter, which will then be used by the checkStoreInvoice (or rather, there should be a more generic helper function to create a vendor letter, which will then be used by checkStoreInvoice).

Comments?
Reinhold

PS: This patch does not yet work well together with my other patch for delivery notes (https://forum.virtuemart.net/index.php?topic=111519.msg375493#msg375493 ), mainly because the filename needs to be adjusted to use vmdeliverynote instead of vminvoice...

[attachment cleanup by admin]

MihaiDumitrele

  • Beginner
  • *
  • Posts: 9
Re: [PATCH] Invoice PDFs: Unify the two PDF creation methods
« Reply #1 on: February 17, 2013, 11:14:37 am »
Hello Reinhold,

I am new in virtuemart knowledge and I would like to instal your patch but I don't know how to do it.
I would appreciate your help.

thank you

reinhold

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 204
Re: [PATCH] Invoice PDFs: Unify the two PDF creation methods
« Reply #2 on: February 17, 2013, 12:50:48 pm »
I am new in virtuemart knowledge and I would like to instal your patch but I don't know how to do it.
I would appreciate your help.

That patch directly modifies the VirtueMart core files, and I posted it for the core developers for inclusion in the core code. I would not suggest to apply it yourself, but rather wait until Milbo or some other developer includes it in VirtueMart itself.

Reinhold