T

TechIdea

Ecosystem

Tally & ERP12 min readUpdated July 2, 2026

How to Create Custom Invoices in Tally Prime using TDL (2026 Guide)

Learn how to customize Tally Prime invoices using Tally Definition Language (TDL). Add custom fields, dynamic QR codes, logos, and custom formats easily.

By Pradeep Ray

A highly customized digital invoice generated inside Tally Prime showing brand elements
A highly customized digital invoice generated inside Tally Prime showing brand elements

Quick answer

What to do first

To create custom invoices in Tally Prime, write a TDL script altering the default 'Sales Invoice' report. Use the '[#Form: Comprehensive Invoice]' definition to inject new 'Parts' and 'Lines'. Load your .txt or .tcp file via 'F1: Help > TDL & Add-Ons'. Use our provided code snippets to add basic custom titles and terms.

Key takeaways

Start with one clear reader problem.

Use short paragraphs and practical examples.

Add internal links to related tools and guides.

Finish with a simple next step.

Why You Must Customize Your Tally Invoices

The default invoice format provided by Tally Prime is incredibly functional and legally compliant for basic billing.

However, in today's competitive landscape, your invoice is often the primary touchpoint between your business and your client. A generic invoice says nothing about your brand.

Furthermore, specialized businesses often require specific data fields—like batch numbers, expiry dates, custom tax structures, or dynamic UPI QR codes—that the default format simply does not accommodate.

This is where Tally Definition Language (TDL) becomes your most powerful asset. TDL allows you to completely deconstruct and rebuild the invoice layout to match your precise operational requirements.

Understanding the TDL Hierarchy

Before writing any code, it is critical to understand that TDL is a hierarchical, declarative language. You do not write procedural execution steps; you define the structure of UI elements. The hierarchy for printing works like this:

  • Report: The main container (e.g., the entire invoice).
  • Form: The printable canvas inside the report.
  • Part: Sections of the form (Top, Body, Bottom).
  • Line: Horizontal rows within a part.
  • Field: The actual data elements (text, numbers, variables) inside a line.

Step 1: Writing Your First TDL Customization

Let’s start with a practical example. We want to add a custom bold title to the very top of our invoice and add specific company terms at the bottom.

Create a plain text file on your computer and name it custom-invoice-techidea.txt. Open it in Notepad or VS Code and paste the following snippet:


;; 1. Altering the Default Form
[#Form: Comprehensive Invoice]
  ;; Adding a new Part at the top
  Add : Top Part : Before : EXPINV Top : TechIdea Custom Title
  
  ;; Adding a new Part at the bottom
  Add : Bottom Part : After : EXPINV Bottom : TechIdea Custom Terms

;; 2. Defining the Top Title Part
[Part: TechIdea Custom Title]
  Line : TechIdea Title Line

[Line: TechIdea Title Line]
  Field : Simple Field
  Local : Field : Simple Field : Info : "TAX INVOICE - CUSTOMIZED BY TECHIDEA"
  Local : Field : Simple Field : Style : Large Bold
  Local : Field : Simple Field : Align : Center
  Local : Field : Simple Field : Full Width : Yes

;; 3. Defining the Bottom Terms Part
[Part: TechIdea Custom Terms]
  Line : TechIdea Terms Line 1, TechIdea Terms Line 2

[Line: TechIdea Terms Line 1]
  Field : Simple Field
  Local : Field : Simple Field : Info : "TERMS: Payment due within 15 days."

[Line: TechIdea Terms Line 2]
  Field : Simple Field
  Local : Field : Simple Field : Info : "Thank you for your business!"
      

Step 2: Loading the TDL File in Tally Prime

Once your code is written, you need to execute it within Tally Prime:

  1. Open your Tally Prime application.
  2. Navigate to the top menu and click on F1: Help, then select TDL & Add-Ons.
  3. Press F4 (Manage Local TDLs).
  4. Change the option "Load selected TDL files on startup" to Yes.
  5. In the list below, enter the exact file path to your custom-invoice-techidea.txt file.
  6. Press Enter to save and accept the screen.

Now, open any Sales Voucher and press Ctrl+P to print. You will see your custom title beautifully centered at the top and your custom terms at the bottom!

Advanced Use Cases: Why Hire an Expert?

While the snippet above is great for learning, real-world business requirements are vastly more complex. What if you need to fetch specific Ledger Alias names?

What if you need to generate a dynamic UPI QR Code based on the invoice total?

What if you need complex calculations for multi-tier salesperson commissions printed directly on the copy?

With over 13 years of hardcore TDL experience, TechIdea specializes in these exact complex implementations. If you are struggling with TDL or need a robust, error-free module tailored to your exact workflow, explore our Tally Customization Services and book a free technical consultation today.

Simple process

What to do next

Follow these steps in order. Keep each change small, check the result, then move to the next one.

1

Understand the reader problem

Write down what the reader wants to solve before adding extra sections.

2

Give the short answer early

Add a quick answer near the top so readers know they are in the right place.

3

Support with examples

Use one practical example, checklist, or table so the advice is easier to apply.

4

Offer a helpful next step

Link to one related tool, guide, or course that helps the reader continue.

Publishing checklist

  • The title clearly tells readers what they will learn.
  • The meta description is specific and written for clicks.
  • The content has original examples, not only generic advice.
  • Related tools, posts, and learning pages are linked naturally.
  • Tables, FAQs, images, and buttons work well on mobile.

Mistakes to avoid

  • - Writing the same introduction on many posts instead of explaining the real problem.
  • - Publishing long paragraphs that are hard to read on mobile.
  • - Adding too many CTAs before the reader gets a useful answer.

Continue exploring

Useful links from TechIdea

More Tally & ERP articles

Frequently asked questions

Can I customize Tally invoices without knowing TDL?

Tally Prime allows very basic configuration (like enabling/disabling standard columns) via the F12 configuration menu. However, to add new fields, custom text, or rearrange the layout, writing TDL code is absolutely mandatory.

Will my TDL customizations break when Tally Prime updates?

Poorly written TDL can break during version updates if it completely overrides default forms rather than 'altering' them. At TechIdea, we write modular TDL code that hooks into existing structures, drastically reducing the chance of breakage during software updates.

Can TDL be used to add a dynamic UPI QR code to invoices?

Yes! Using advanced TDL, we can generate a dynamic UPI QR Code that embeds the exact invoice amount and your UPI ID directly onto the printed invoice, allowing customers to scan and pay instantly without manual entry.

How much does a custom Tally invoice design cost?

Basic layout tweaks are inexpensive, while highly complex invoices with custom calculations, barcodes, and automated emailing capabilities require dedicated development time. Contact us for a precise quote based on your requirements.

Editorial Integrity

Fact Checked
P

Written By

Pradeep Ray

Written by Pradeep Ray, Founder of TechIdea. 13+ years of experience in Tally Customization and advanced ERP integration. View full profile.

T

Reviewed By

TechIdea Editorial Panel

Technical accuracy verified by our expert engineering panel.

Why Trust TechIdea?

This guide was created to help developers globally learn practical skills. We focus on real-world examples, objective analysis, and safe coding practices. Our content is regularly updated and subjected to strict human oversight. Read our Editorial Policy.

Last updated: July 2, 2026

Share or save this article

Send it to someone who can use the checklist.

Share:

Was this helpful?

Comments

Thoughtful comments are welcome. New comments stay pending until approved by admin.

Login or sign up to comment on this post.

Growth Newsletter

Get practical AI tools, SEO tips, and growth guides weekly.

Join creators, students, and businesses scaling with TechIdea.