TallyPrime Release 7.1+ supports multiple invoice print templates. In this guide, we register an invoice format called OTS Simple GST Invoice and make it available in the invoice print view.
Test this TDL in TallyPrime Developer with a backup company. The supporting definitions
VPC TMPL InvoiceFormatDocs, VPC TMPL Sales and OTS Simple GST Invoice Object Map must be available for your release.Complete TDL code
;; =========================================================
;; OTS Simple GST Invoice Template
;; TallyPrime Release 7.1+
;; =========================================================
[#Collection: VPC TMPL Custom Formats]
Object : OTS Simple GST Invoice Template
[Object: OTS Simple GST Invoice Template]
Use : VPC TMPL InvoiceFormatDocs
Country : @@TMPLCountryIndia
ViewName : "OTSSimpleGST"
UserViewName : "OTS Simple GST Invoice"
VarProfile : "OTS Simple GST Invoice Object Map"
CarouselTitle : "OTS Simple GST Invoice"
IsDefaultAppView : No
IsDefaultCmpView : Yes
[!Form: OTS Simple GST Invoice Form]
Use : VPC TMPL Sales
[#Form: Printed Invoice]
Add : Switch : At Beginning : OTSInvoiceSwitch : OTS Simple GST Invoice Form : +@@VPCTMPLSVPrintViewName = "OTSSimpleGST"How the code works
1. Register the format: VPC TMPL Custom Formats makes the custom invoice format available to TallyPrime.
2. Define the template: The object assigns the internal view name OTSSimpleGST and the display name OTS Simple GST Invoice.
3. Map the variables: VarProfile connects the format to OTS Simple GST Invoice Object Map.
4. Use the sales form: The custom form inherits VPC TMPL Sales.
5. Switch the print view: The Printed Invoice switch activates this form when the current print view equals OTSSimpleGST.
How to load and test
- Open TallyPrime Developer and create a separate TDL file.
- Paste the complete code without changing the internal names.
- Confirm that the supporting template definitions and object map are loaded.
- Load the TDL in a test company.
- Open a Sales voucher and select Print Preview.
- Look for OTS Simple GST Invoice in the print-template or print-view options.
- Test the company, buyer, invoice number, date, items, HSN/SAC, GST values and totals.
- Test local GST, interstate GST, credit notes, multiple items and multi-page invoices.
Create additional invoice designs
Use unique names for every design. For example: OTSCompactGST, OTSModernGST and OTSRetailGST. Each design should have its own ViewName, UserViewName, CarouselTitle, VarProfile and switch condition.
Add a logo, GSTIN, buyer and shipping details, HSN/SAC, quantity, rate, discount, CGST, SGST, IGST, round-off, amount in words, bank details, terms and an authorised-signatory section.
Troubleshooting
- Template does not appear: confirm that the object is added to
VPC TMPL Custom Formatsand that the TDL loaded successfully. - Default invoice still prints: verify that the active print view is
OTSSimpleGSTand that the Printed Invoice switch is evaluated. - Fields are blank: check the object map and supporting field mappings.
- Errors appear after an upgrade: compare the VPC TMPL definitions with the current TallyPrime release.
- Multiple templates conflict: use unique object, form, switch, view and profile names.
Conclusion
This method adds a named custom invoice template while keeping TallyPrime's default format available. Test the template in Developer mode first, then build additional designs as separate template objects. Always keep a backup of each working TDL version.