Configuring invoices
Invoices (receipts) are commercial documents that you issue to the customers to indicate purchase-related details:
- Products
- Quantities
- Prices
- Other purchase-related details
The Kentico E-commerce Solution allows you to customize the invoice design. After configuring invoices, you can work with them while editing an order in the Orders application on the Invoice tab.
Setting up the invoice number pattern
With the default invoice number pattern, the system displays the invoice number equal to the order number. If you want to change the format of the invoice number, change the corresponding setting:
Open the Store configuration application (if you want to set up the invoice number pattern for the current site) or the Multistore configuration application (if you want to set up the invoice globally).
If you are not sure what to choose, see Choosing site or global e-commerce configuration. If you are not sure about specifics of configuring in these applications, see Configuring e-commerce settings for a specific site or globally.
In the Invoice number pattern field in the Invoice category, type the required pattern.
You can use macros. For example, the default pattern is: {% Order.OrderID %}
- If you are in the Store configuration application, clear the Inherit from global settings option first.
Click Save.
The system generates new invoices with their numbers formatted according to the specified setting.
Setting up the appearance of invoices
You can configure the invoice template in the Store configuration application (if you want to set up the invoice for the current site) or in the Multistore configuration (if you want to set up the invoice globally) on the Invoice tab.
This configuration sets only the invoice which is displayed in the administration user interface and which you can print. If you want to send the invoice via email, configure the corresponding email notification.
Use HTML markup for the basic formatting, and add macros to insert dynamic parts of the invoice. For example, you can use the {% Order.OrderInvoiceNumber %} expression to insert the invoice number.
Macro examples
The following table contains macro examples that you can use in the invoice template.
Macro |
Description and examples |
Prices |
|
{%Currency.<property>%} |
Displays a value from a column in the currency database table (COM_Currency).
|
{%GrandTotal%} |
Displays the order’s final overall price.
|
{%TotalShipping%} |
Displays the order’s shipping price.
|
{%TotalTax%} |
Displays the total sum of all taxes that apply to the order. |
{%TaxSummary%} |
Returns a collection of taxes (tax classes) that apply to the order (products and shipping). To format the appearance of the taxes, use one of the following options:
For example, the following HTML code and macros display a basic table of tax class names and values:
|
Order data |
|
{%ContentTable%} |
Returns a collection of the ordered products. To format the appearance of the products, use one of the following options:
For example, the following HTML code and macros display a basic table of product data:
|
{%Order.<property>%} |
Displays a value from a column in the order database table (COM_Order).
|
{%OrderStatus.<property>%} |
Displays a value from a column in the order status database table (COM_OrderStatus).
|
{%ShippingOption.<property>%} |
Displays a value from a column in the shipping option database table (COM_ShippingOption).
|
{%PaymentOption.<property>%} |
Displays a value from a column in the payment method database table (COM_PaymentOption).
|
{%ShoppingCart.<property>%} |
Displays a value from a column in the shopping cart database table (COM_ShoppingCart). With the shopping cart, you can get to any other mentioned macro, for example:
|
Order discounts and gift cards |
|
{%OrderDiscount%} |
Displays the total value of all applied order discounts.
|
{%OrderDiscountSummary%} |
Returns a collection of the order discounts applied to the order. To format the appearance of the order discounts, use one of the following options:
|
{%OtherPayments%} |
Displays the total value of applied gift cards.
|
{%OtherPaymentsSummary%} |
Returns a collection of the gift cards applied to the order. To format the appearance of the gift cards, use one of the following options:
|
Customer data |
|
{%Customer.<property>%} |
Displays a value from a column in the customer database table (COM_Customer).
|
{%BillingAddress.<property>%} |
Displays a value from a column in the billing address database table (COM_OrderAddress).
|
{%BillingAddress.Country.<property>%} |
Displays a value from a column in the billing address country database table (CMS_Country).
|
{%BillingAddress.State.<property>%} |
Displays a value from a column in the billing address state database table (CMS_State).
|
{%ShippingAddress.<property>%} |
Displays a value from a column in the shipping address database table (COM_OrderAddress).
|
{%ShippingAddress.Country.<property>%} |
Displays a value from a column in the shipping address country database table (CMS_Country).
|
{%ShippingAddress.State.<property>%} |
Displays a value from a column in the shipping address state database table (CMS_State).
|
Learn more about macros in Macro expressions.