Playing with Tally software

Posted on 1 July, 2010

28


I was playing around a bit with Tally ERP software. I like it for its simplicity. This is from the perspective of a software developer who wants to integrate with Tally, and not as a user of Tally. I am not competent to talk about that.
My intention was to understand what it takes to integrate with Tally; write a piece of Java code to query for information from within Tally, and to update information within Tally. Decided to use their XML/HTTP interface to try this out.

In essence, these are the steps for that – first install the software, then configure it, and finally try the XML/HTTP interface to interact with it.

Install

  • Download Tally. I tried the “Educational Version”.
  • Double-click the installable to install it.
  • Once you start Tally, create a default “Company” in it. Also enable the Payroll module, so that you can perform CRUD operations on Employee information.
  • The documentation or a web search can help you with these steps, in case you falter.

Configure

  • To initiate XML interaction over HTTP with Tally, the server port has to be enabled in Tally. Click on “Configurations” or F3-> “Advanced Configurations”, and then select the following options: I set the “Tally is acting as” to “Both”, and “Port” to “9002″. Save, and exit. Restart Tally.
  • Open a browser, and enter http://localhost:9002 in the address bar. You should see a message “<RESPONSE>Tally.ERP 9 Server is Running</RESPONSE>”. Now you are good to go. Else, have a look at the documentation.

Integration using XML over HTTP

  • Tally requires the client (the one which is integrating with Tally) to HTTP-POST XML documents. The XML documents contain the action to be performed, and details of the Tally Data on which this action needs to be performed.
  • I searched for some sample XMLs with which I could experiment with this interaction. I came across some useful ones on the RTSLink site: http://www.rtslink.com/download-tally-xml-tags.html.
  • Used cURL command line tool to try this out:
curl -X POST localhost:9002 --data @all_inventory_master.xml
  • The structure of all_inventory_master.xml is as follows:
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Export Data</TALLYREQUEST>
</HEADER>
<BODY>
<EXPORTDATA>
<REQUESTDESC>
<REPORTNAME>List of Accounts</REPORTNAME>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<ACCOUNTTYPE>All Inventory Masters</ACCOUNTTYPE>
</STATICVARIABLES>
</REQUESTDESC>
</EXPORTDATA>
</BODY>
</ENVELOPE>
  • The next option was to insert an Employee’s information into Tally.
  • curl -X POST localhost:9002 –data @payrollEnvelope.xml
  • The structure of payrollEnvelope.xml is as follows:
<ENVELOPE>
 <HEADER>
 <TALLYREQUEST>Import Data</TALLYREQUEST>
 </HEADER>
 <BODY>
 <IMPORTDATA>
 <REQUESTDESC>
 <REPORTNAME>All Masters</REPORTNAME>
 <STATICVARIABLES>
 <SVCURRENTCOMPANY>MyCompany</SVCURRENTCOMPANY>
 </STATICVARIABLES>
 </REQUESTDESC>
 <REQUESTDATA>
 <TALLYMESSAGE xmlns:UDF="TallyUDF">
 <COSTCENTRE NAME="ImportPSOFT" RESERVEDNAME="">
 <ADDRESS.LIST TYPE="String">
 <ADDRESS>Bangalore</ADDRESS>
 </ADDRESS.LIST>
 <MAILINGNAME.LIST TYPE="String">
 <MAILINGNAME>10</MAILINGNAME>
 </MAILINGNAME.LIST>
 <CATEGORY>Primary Cost Category</CATEGORY>
 <LOCATION>Bangalore</LOCATION>
 <DESIGNATION>Software Engineer</DESIGNATION>
 <BLOODGROUP>O Positive</BLOODGROUP>
 <AFFECTSSTOCK>No</AFFECTSSTOCK>
 <FORPAYROLL>Yes</FORPAYROLL>
 <FORJOBCOSTING>No</FORJOBCOSTING>
 <ISEMPLOYEEGROUP>No</ISEMPLOYEEGROUP>
 <SORTPOSITION> 1000</SORTPOSITION>
 <DEFAULTLANGUAGE>0</DEFAULTLANGUAGE>
 <LANGUAGENAME.LIST>
 <NAME.LIST TYPE="String">
 <NAME>Kiran Subbaraman</NAME>
 </NAME.LIST>
 <LANGUAGEID> 1033</LANGUAGEID>
 </LANGUAGENAME.LIST>
 </COSTCENTRE>
 </TALLYMESSAGE>
 </REQUESTDATA>
 </IMPORTDATA>
 </BODY>
</ENVELOPE>
  • This should insert a new employee record, in Tally.

References

Use this Tally Integration Guide (pdf) to better understand what goes into the various integration options that Tally supports.

Good luck, and let me know if this works for you.

Advertisement
Posted in: code, interests