Free Invoice Template

[size=5][color=#FF0000]UPDATED 5th March 2014[/color][/size]

I have created a new invoice template that I think looks better than the standard CS-Cart ones so I thought I would share them…we all need to help each other and share what we have done to personalise our installations so everyone can benefit. Cs-Cart uses two different invoice.tpl template files to email a copy of the invoice to both the Customer and to Admin plus they are used to view online by both the Customer and the Admin. These templates are for CS-Cart v4.1.2 (possibly for v4.? but not tested).



[attachment=7769:1.gif] [attachment=7804:inv.gif] [attachment=7766:3.gif]



Both templates files are named the same (invoice.tpl) however they are located in 2 different places in your CS-Cart installation:

Customer (Customer.zip): \design\themes\basic\mail\templates\orders

Admin (Admin.zip): \design\backend\mail\templates\orders



The templates can be used just as they are or below are some steps that you may like to do that will enhance the templates even further



So to start with, dowload and unzip the attached 2 new template files:

Customer.zip

Admin.zip



1. Install new templates as they are

a.) Rename your current invoice.tpl templates that are located as above to invoice.BAK as backups

b.) Simply copy both new invoice.tpl files to the locations as above



2. Add Company Number

OPTION 1. Add Company Number by using new language entry

In Australia you have to display your Company or Business Number on your Invoice and perhaps other countries as well. If so then this OPTION OR OPTION 2 below (your choice) will display that number just below the “Invoice” text at the top right corner of your invoice.

a.) Add a new entry in Administration → Languages → Translations, with the following:

Language variable: company_number

Value: (your company number)

b.) Edit both Customer and Admin templates by replacing the {* Company No *} in the templates with:

{if __("company_number") !=""}


{__("company_number")}

{/if}




OPTION 2. Add Company/Tax Number by using the Tax field Registration Number

If you only have one Tax Registration Number and like in Australia, it is your Business Number, it is pointless having the Tax Number displayed at the bottom of the invoice with the Tax amount instead it can be removed from there and placed under the “Invoice” text at the top right corner of your invoice…this is where most Australian businesses place it.

a.) Edit both Customer and Admin templates by replacing the {* Company No *} in the templates with:

```php



{if $order_info.taxes}

{foreach from=$order_info.taxes item=tax_data}

{if $tax_data.regnumber}({$tax_data.regnumber}){/if}

{/foreach}

{/if}

```
b.) To remove the tax number from also displaying in the subtotal section of the invoice find {* Tax Number *} and remove the following line:
```php {if $tax_data.regnumber} ({$tax_data.regnumber}){/if}:  ```

[b]3. Banking Details (or payment details of a different kind)[/b]
We have a payment method called "Direct Deposit" set up in our shop which is the first payment method in the database (i.e. payment_id 1). So if a customer selects "Direct Deposit" as their payment method, we include our bank details on the invoice to make it easy for them to make their payment. If you also have a similar situation then then this may be of help.
a.) Look in the cscart_payments table in your database for the payment_id you have for direct deposit
b.) In the Customer invoice.tpl template, replace {* Bank details *} with:
```php {if $order_info.payment_id == 1}
{* Bank details *}

























Bank Details for Direct Deposit:
Reference: Inv No {$order_info.order_id}
A/c Name: (insert bank account name)
Bank: (insert bank name)
BSB: (insert bank branch identifier)
A/c No: (insert bank account number)


{* /Bank details *}
{/if} ```
c.) Replace the number 1 in the above code with the payment_id number that you got from your cscart_payments table in your database
d.) Replace the (insert...) places of the code with your own banking details

[b]4. Add Office Use Only section in the Admin copy of the invoice[/b]
We like to have some Office Use Only printed fields on the invoice copy that we get emailed to ascertain the costs etc of that invoice before it gets files away. This addition adds those fields to the invoice instead of us having to stamp each one.
a.) In the Admin invoice.tpl template replace {* Admin Fields *} with the following code:
```php {* Admin only *}





























Admin Only:
Total Paid: _____________
Product Cost: _____________
Shipping Cost: _____________
Bank Cost: _____________
Total Cost: _____________
Gross Profit: _____________


{* /Admin only *} ```

[b]5. Extra Profile Fields[/b]
I like the customer to have the ability to add different companies for themself, a Bill To Company and a Shipping To Company, all as options. However, the built in CS-Cart ability to display these extra profile fields on an invoice is hampered as the template they use includes paragraph tags that adds spaces as well as field names. So this extra bit cleans that up so I can allow my customers to use the extra Company fields without hindering the display of the invoice. So my Administration -> Profile Fields look like this (note the fields I have ticked):

[attachment=7768:5.gif]

To provide for the extra Company(s) on the invoice, you need to add an extra profile field called Company by this screen shot:

[attachment=7767:4.gif]

a.) Download and unzip the attached file Profile Fields.zip and then place that template into these two locations:
- \design\backend\mail\templates\profiles
- \design\themes\basic\mail\templates\profiles
b.) In both Customer and Admin invoice.tpl templates replace the {* Extra Invoice Fields B *} with the following code:
```php {include file="profiles/extra_invoice_fields.tpl" fields=$profile_fields.B} ```
c.) In both Customer and Admin invoice.tpl templates replace the {* Extra Invoice Fields S *} with the following code:
```php {include file="profiles/extra_invoice_fields.tpl" fields=$profile_fields.S} ```

[b]6. That is all[/b]
After you have completed any changes to the invoice.tpl templates, upload them to their respective directories as in Step 1 and TEST

Hope this helps someone. If I get time soon I will be creating an MS Access front end that hooks into the CS-Cart tables so I can manage all the orders, inventory and costings (profit etc per order), and I will release that here for free if anyone wants that...but give me some time

admin.zip

5.gif

4.gif

3.gif

1.gif

Profile Fields.zip

customer.zip

inv.gif

thanks for sharing

Pretty cool. Never thought about redoing the invoice.

HI ibaker

Thanks for sharing, We are running MV version 4.1.2 and the company number shown below “INVOICE” shows text[font=Tahoma,Arial][size=2]

b[/b][/size][/font]

were should this information be filled in and can it be done per vendor.



Alan

Hi Allan

see point 1 of the opening post

[quote name='Takestock' timestamp='1393586207' post='178506']

HI ibaker

Thanks for sharing, We are running MV version 4.1.2 and the company number shown below “INVOICE” shows text[font=Tahoma,Arial][size=2]

b[/b][/size][/font]

were should this information be filled in and can it be done per vendor.



Alan

[/quote]

Hi Ibaker

Thanks for the reply, I worded my question very badly,

What I wanted to know as we have MV and the invoices come from many vendors. were would I pull this info for the various company numbers and how would I implement this.

If this is asking a bit much, I will remove as per you point No1.



Alan

Alan, I don't have the Multi Vendor version so I am not sure how you would be able to define a company number per vendor. I use a new language entry for the company number and I doubt there would be a seperate language per vendor.



Is there an extra company details field that is unique per vendor that could be used and referenced in the template?

Does each vendor have their own invoice template?..if so then you could define a separate language entry per vendor.

In MV can you define an extra company field?



Failing the above then I think the only thing you could do would be to remove the company number line in the template.



Are you an Australian company that has to have the company number shown by law? If so let me know and perhaps we could contact each other offline and see what I could do to help

[quote name='ibaker' timestamp='1393792905' post='178595']

Alan, I don't have the Multi Vendor version so I am not sure how you would be able to define a company number per vendor. I use a new language entry for the company number and I doubt there would be a seperate language per vendor.



Is there an extra company details field that is unique per vendor that could be used and referenced in the template?

Does each vendor have their own invoice template?..if so then you could define a separate language entry per vendor.

In MV can you define an extra company field?



Failing the above then I think the only thing you could do would be to remove the company number line in the template.



Are you an Australian company that has to have the company number shown by law? If so let me know and perhaps we could contact each other offline and see what I could do to help

[/quote]



Hi Ibaker

Thanks for the answer, No spare field in the vendor profile.

I have already changed the only spare from ZIP Code to Vat Number, and this worked perfectly.

We are an Irish company, So while we currently have no Post or Zip Codes, they are being introduced in a few months. So I will lose the above change.

There is a legal requirement in most EU country to have the company number, directors, etc. On all company paperwork. but it's never enforced.

I will have to search the forum to see if anyone has managed to add extra fields the the vendor profile in 4x.



Alan

If I could get my hands on a demo copy of the MV version I could create an “IF” statement that could pull the company number (and VAT number) from a language entry for you…it w3ould just need an IF statement that says “if vendor =1 then show this number OR if vendor=2 then show that number” etc

[quote name='ibaker' timestamp='1393831231' post='178612']

If I could get my hands on a demo copy of the MV version I could create an “IF” statement that could pull the company number (and VAT number) from a language entry for you…it w3ould just need an IF statement that says “if vendor =1 then show this number OR if vendor=2 then show that number” etc

[/quote]

HI Ibaker

Thank you for the extremely kind offer,

But I try and keep everything as automated as possible and the only true way of doing this is to find a way of adding the extra fields into the vendor profile and calling the information from there.

It should be a standard feature on CS and I see quite a few posts referring to this in one way or another, but no solution to date.



Alan

The Opening Post of this thread has been UPDATED with an easier method of installing and an extra feature of adding a Company Number to your invoices

Hey, don't show me the Extra Profile Fields. You can help me? .

Is there an easy to add an additional header to the invoice? Example there is invoice, credit memo and order. I like to add another type… Like purchase order or something and have it selectable in order status. I got the language variable created, but not sure where else I need to update in the template.



suggestions?

[quote name='carterj' timestamp='1396201730' post='180435']

Is there an easy to add an additional header to the invoice? Example there is invoice, credit memo and order. I like to add another type… Like purchase order or something and have it selectable in order status. I got the language variable created, but not sure where else I need to update in the template.



suggestions?

[/quote]

Would the status of it be something like Purchase Order? If so you could use an if statement where the Invoice language is called in the template to say something like if status = x use invoice language, if not then use PO language.

I would like to have My company logo on the Header with Left alignment and the company address on the right allignment of the Header in the Invoice.



Secondly I wish to add my Bank account details on the bottom on the invoice, in the Footer section



Please help me

Thanks in advance

Hi,

this will work in version 3.x ?



Thank you

F. Majer

I've tried this with version 4.2 but it hasn't made any difference. I would have thought I'd get some error message if it was not compatible with v4.2 so may be I have done something incorrect (quite likely as I am a beginner). If anyone else finds it works with v4.2 I'd be interested to know.

Attached is what I am using for v4.2.2 and works ok:

[attachment=8475:1.jpg]



With the attached templates I am using the extra profile fields for Company. Before you do anything ensure you have done the opening post part for the extra profile fields. Next open the attached invoice.tpl file and edit the bank details that start from around line 250.



Copy the invoice.tpl to:

/public_html/design/themes/YOUR THEME/mail/templates/orders/ (replace existing invoice.tpl)

/public_html/design/backend/mail/templates/orders/ (replace existing invoice.tpl)



Then copy the extra_invoice_fields.tpl to:

/public_html/design/themes/YOUR THEME/mail/templates/profiles/

/public_html/design/backend/mail/templates/profiles/



Finally clear the var/cache files…I normally just go on to my server at /public_html/var/cache/ and delete all 3 folders in there called misc, registry and templates



That is what I have and all works perfectly…deleting the cache files is very important

1.jpg

Invoice.zip

Thank you for the awesome invoice template! Works 100%, the only thing i would change it make Order number area float more right to match the left :)



Otherwise thank you very much

Works great on 4.2.4. Thanks a lot!