Jump to content

How can I use the current date instead of the invoice number?


5haun

Recommended Posts

Hey Guys

 

How can I use the current date (YYYY-MM-DD) instead of the invoice number?

 

So when customer makes a purchase, it will show the date in the filename of the pdf and the pdf itself.

 

Any ideas?

Thanks :)

Link to comment
Share on other sites

using this date format "YYYY-MM-DD" is not unique, how would you tell the difference between multiple orders on the same date?

 

Yes I agree. What about adding the time? YYYY-MM-DD-TIME (hour-minutes-seconds) ?

Link to comment
Share on other sites

thats up to you, you need to decide how many orders you expect to receive and if 2 of them can come at the same second or not, and if they do, will having the same invoice number be problematic.

 

Now as for the changes you are looking to make, are you looking to hire someone to make these changes for you?  Or are you fluent in php programming?

  • Like 1
Link to comment
Share on other sites

I'm not going to be able to document a coding solution for you here, but i can get you started

 

1) /controllers/admin/AdminPdfController.php is what executes when you generate the PDF invoice from the back office details page.  It also uses the PDF class located in /classes/pdf/PDF.php.  The filename is a variable inside the PDF class

 

2) /classes/pdf/HTMLTemplateInvoice.php generates the invoice # that you see within the PDF

 

Now if you are looking to hire someone, feel free to send me a PM and we can discuss those details

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...