Jump to content

Invoice number in PDF invoice


fast
 Share

Recommended Posts

Hi there,

 

I would like to change my pdf invoice layout. I'd need a (smarty) variable containing the invoice number as defined in the backend. You can set a prefix there and select the starting number.

 

So far I can show the internal ID of the invoice which outputs something like "70" or so:

 

<span style="font-size: 10pt; color: #000;">Invoice number: {$order->id} </span></td>

 

As you can see I am using the germaNext module' date=' my Prestashop version is 1.5.3.1.

 

The name of the pdf file generated and attached to the email is btw exactly what I would want inside the pdf. It looks like INV00001.pdf.

 

 

I have already tried to add the value in the PaymentModule.php file but with no success unfortunately :(.

 

Can anyone point me to the right direction?

 

Thank you!

fast

Edited by fast (see edit history)

Share this post


Link to post
Share on other sites

Thanks for the hint!

 

I have combined it with using string_format from smarty and now I've got what I initially wanted:

 

<span style="font-size: 10pt; color: #000;">Invoice number: {$order->invoice_number|string_format:"S%06d"} </span>

 

It outputs "INV000569" for the invoice number :) .

 

It does not work in modules/germanext/mails/de/order_conf.html though, it just literally outputs my smarty string there…

 

 

fast

Edited by fast (see edit history)

Share this post


Link to post
Share on other sites

  • 2 months later...
  • 1 year later...

A few years later, but maybe useful for someone. To output invoice prefix in smarty (in PDF template):

 

{Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id)}

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More