Jump to content

[SOLVED] Add invoice number in order-slip pdf


veshop

Recommended Posts

Hi there!
How can I add the invoice number in the order-slip .pdf?


Here's what I mean.
If I make a partial refund to a customer, an order-slip with his own progressive number is created and there is no reference to the original invoice (that has his own progressive number).

If I make my first refund, for example of invoice #00005, an order slip with number #00001 is created (the first order-slip ever created). I need that in the pdf of the order slip #00001, appears also the reference to the invoice, in this case #00005


I try to play a little with the code, but I can't program and I don't find a solution.


Hope someone can help me :)

Edited by veshop (see edit history)
Link to comment
Share on other sites

Hi there everyone. I find the solution and will share it.

Just put this code, where you will in /pdf/order-slip.tpl:   {$order->invoice_number}
If date of invoice should add, just put this code where you will:  {$order->invoice_date}
 

But I have just 2 questions.

1) How can I add 0 in front of the invoice number? The generated invoice have for example number 00045, but with my solution, the code display only 45. I try with PHP code but doesn't work, maybe I do something wrong.

2) How can I change the date format from Y/M/D into D/M/Y ?

Thanks in advance,
 
Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...
  • 5 years later...
En 12/1/2015 a las 5:53 PM, tuk66 dijo:

1)

{$order->invoice_number|string_format:"%05d"}

 

2)

{$order->invoice_date|date_format:"%d/%m/%Y"}

Sorry, but for prestashop 1.7.8.x it doesn't work or should I add something else? Thanks in advance

Link to comment
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...