Jump to content

Invoice Templates


AlanHogg

Recommended Posts

Hello,

 

When I generate a pdf invoice it shows an invoice no. that goes up in increments of 1 for each invoice generated. So if an invoice isn't generated for a certain order the next one generated is out of sync (i.e. dosent match the order id in the back office).

 

Is there a simple way to pull in the order id as the invoice no. on the template so the invoice number is the same as the order id??

 

I understand it will involve changing the invoice.tpl and header.tpl files, I just don't know what to change the 'call' to?!

 

If anyone can help it will be massively appreciated!!

Link to comment
Share on other sites

Your are correct. I think it would be header.tpl for your invoice.

There you can replace

 

{$title|escape:'html':'UTF-8'}

 

with

 

{$order->id}

 

The corresponding title should be around line 43 within that file. However, If you intend to do the change within header.tpl it is possible, that the full order information is not available at that point. If you don't get a value, you have to change the file

 

HTMLTemplate.php

 

which is located in the path /classes/pdf

 

There, you have to enhande the function assignCommonHeaderData() to load the full order object.

 

I probably wouln't go this approach. Instead, you could transfer the contents of your header.tpl to the files invoice.tpl and delivery-slip.tpl.

So header.tpl would be an empty file and the header comes directly from the two other involved sources.

 

Why:
In the body part (invoice.tpl or delivery-slip.tpl) you have access to almost all data available for orders. That is the difference to the header-function which only loads a very small part of smarty variables.

So a change of the HTMLTemplate.php should not be necessary.

 

Good luck.

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

Scully, don't mean to be cheeky but...

 

Do you know the 'call' to bring in the order id into order history (history.tpl) to replace the order reference.

 

We are trying to achieve the same result as with the pdf invoices previously.

 

Many thanks for your time

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...