veshop Posted January 11, 2015 Share Posted January 11, 2015 (edited) 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 #00005I 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 January 12, 2015 by veshop (see edit history) Link to comment Share on other sites More sharing options...
veshop Posted January 12, 2015 Author Share Posted January 12, 2015 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 More sharing options...
tuk66 Posted January 12, 2015 Share Posted January 12, 2015 1) {$order->invoice_number|string_format:"%05d"} 2) {$order->invoice_date|date_format:"%d/%m/%Y"} Link to comment Share on other sites More sharing options...
veshop Posted January 12, 2015 Author Share Posted January 12, 2015 THANK YOU! Works perfect!Oh, for future reader, my prestashop version is 1.6.0.9. Link to comment Share on other sites More sharing options...
[email protected] Posted December 1, 2016 Share Posted December 1, 2016 *bump* THis helped me alot! Is there a similar way to add the ID of the order slip on the order slip pdf itself? Nothing i've tried seems to work, Thanks! Link to comment Share on other sites More sharing options...
tuk66 Posted December 2, 2016 Share Posted December 2, 2016 Try {$order_slip->id|intval} Link to comment Share on other sites More sharing options...
[email protected] Posted December 2, 2016 Share Posted December 2, 2016 Try {$order_slip->id|intval} Works like a charm, thank alot ! Link to comment Share on other sites More sharing options...
BeatriceM Posted April 13, 2017 Share Posted April 13, 2017 (edited) Hi! How can I add prefix and year to the invoice number on order slip? Thanks in advance! Edited April 13, 2017 by BeatriceM (see edit history) Link to comment Share on other sites More sharing options...
abdamu Posted January 2, 2023 Share Posted January 2, 2023 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now