[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