Docs

Log in to read the version of docs relevant to your site, or use the dropdown versions

How do I customize the Chargebee invoice template for better readability?

  • How to add a discount percentage column to invoices?
  • How to display amounts excluding GST on invoices?
  • How to show specific totals like Sub Total excluding GST, GST Amount, and Amount Due including GST?

Solution

Customizing the Chargebee invoice template can enhance readability and ensure that all necessary information is clearly presented to your customers. This guide will walk you through the steps to add a discount percentage column, display amounts excluding GST, and show specific totals such as Sub Total excluding GST, GST Amount, credits/payments deducted, and Amount Due including GST.

  1. Access Invoice Template Settings:

    • Navigate to Settings > Configure Chargebee > Invoices.
    • Click Edit Template to open the HTML editor for your invoice template.
  2. Add a Discount Percentage Column:

    • Locate the section in the HTML where the line items are displayed.
    • Insert a new column header for the discount percentage.
    • Use the following code snippet to display the discount percentage:
      <th>Discount %</th>
      <td>{{ line_item.discount_percentage }}</td>
      
    • Ensure the new column aligns with existing columns in the table.
  3. Display Amounts Excluding GST:

    • Identify the section of the template where amounts are shown.
    • Modify the code to calculate and display amounts excluding GST using Chargebee's templating language:
      <td>{{ line_item.amount_excluding_gst }}</td>
      
    • Verify that the calculations are correct and reflect the desired format.
  4. Show Specific Totals:

    • Add sections for Sub Total excluding GST, GST Amount, and Amount Due including GST.
    • Use the following code snippets:
      <tr>
        <td>Sub Total (Excl. GST)</td>
        <td>{{ invoice.sub_total_excluding_gst }}</td>
      </tr>
      <tr>
        <td>GST Amount</td>
        <td>{{ invoice.gst_amount }}</td>
      </tr>
      <tr>
        <td>Amount Due (Incl. GST)</td>
        <td>{{ invoice.amount_due_including_gst }}</td>
      </tr>
      
    • Ensure these totals are correctly calculated and displayed at the bottom of the invoice.
  5. Preview and Save Changes:

    • Use the Preview option to see how the changes appear on the invoice.
    • Once satisfied, click Save to apply the changes.

Important Notes

  • Ensure you have the necessary permissions to edit invoice templates.
  • Test the changes with a sample invoice to verify accuracy before sending to customers.
  • Consider consulting with a developer if you encounter complex HTML or templating issues.
  • Regularly update your templates to reflect any changes in tax regulations or business requirements.

Was this article helpful?