Docs

Log into read the version of docs relevant to your site.

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

You can customize the Chargebee invoice template to add a discount percentage column, display amounts excluding GST, and show totals such as Sub Total excluding GST, GST Amount, credits/payments deducted, and Amount Due including GST.

Configuration steps

Step 1: Access invoice template settings

  1. Go to Settings > Configure Chargebee > Invoices.
  2. Click Edit Template to open the HTML editor for your invoice template.

Step 2: Add a discount percentage column

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

Step 3: Display amounts excluding GST

  1. Find the section where amounts are shown.
  2. Modify the code to display amounts excluding GST:
    <td>{{ line_item.amount_excluding_gst }}</td>
    
  3. Verify the calculations and format are correct.

Step 4: Show specific totals

  1. Add sections for Sub Total excluding GST, GST Amount, and Amount Due including GST.
  2. 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>
    
  3. Ensure these totals are correctly calculated and displayed at the bottom of the invoice.

Step 5: Preview and save changes

  1. Use Preview to see how the changes appear on the invoice.
  2. 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 before sending to customers.
  • Consider consulting a developer if you encounter complex HTML or templating issues.
  • Update your templates when tax regulations or business requirements change.

Was this article helpful?