Needs to retrieve sales order details using xml request to Tally erp 9

喜夏-厌秋 提交于 2020-01-06 08:46:12

问题


I am going to develop a desktop application for Integration with Tally ERP 9. My application uses ('localhost:9000') for XML Post request.

I can get all Sales Records by using below XML post request to tally.

<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Sales Orders Book</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<EXPLODEFLAG>Yes</EXPLODEFLAG>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<SVFROMDATE>01/04/2006</SVFROMDATE>
<SVTODATE>31/03/2013</SVTODATE>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<REPORT NAME="Sales Orders Book">
</REPORT>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>

Now, I need to retrieve single sales order details by passing orderid/referencenumber.

I tried below syntaxes one by one in <STATICVARIABLES> but it fails,

<SVGUID>91209900-f40c-4222-b605-79462be5b1cf-00000043</SVGUID>
<SVREMOTEID>91209900-f40c-4222-b605-79462be5b1cf-00000043</SVREMOTEID>
<SVVCHKEY>91209900-f40c-4222-b605-79462be5b1cf-0000a46d:00000078</SVVCHKEY>
<SVMASTERID>67</SVMASTERID>

Please let me know if anyone knows the proper XML request or any documentation related to various export operation using xml request.


回答1:


<?xml version="1.0" encoding="UTF-8"?>
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>Object</TYPE>
<SUBTYPE>VOUCHER</SUBTYPE>
<ID TYPE="Name">ID:{{voucherId}}</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<SVCURRENTCOMPANY>{{companyName}}</SVCURRENTCOMPANY>
</STATICVARIABLES>
<FETCHLIST>
    <FETCH>Date</FETCH>
    <FETCH>VoucherTypeName</FETCH>
    <FETCH>VoucherNumber</FETCH>
</FETCHLIST>
</DESC>
</BODY>
</ENVELOPE>

Try this, i used this xml to get particular voucher data from tally by keying the master id of the voucher i need to fetch from tally as voucher id.




回答2:


    <ENVELOPE>
    <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>EXPORT</TALLYREQUEST>
    <TYPE>DATA</TYPE>
    <ID>Voucher Register</ID>
    </HEADER>
    <BODY>
    <DESC>
    <STATICVARIABLES>
    <VoucherTypeName>Sales</VoucherTypeName>
    <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
    <SVFROMDATE TYPE="Date">20170331</SVFROMDATE>
    <SVTODATE TYPE="Date">20170331</SVTODATE>
    </STATICVARIABLES>
    </DESC>
    </BODY>
    </ENVELOPE>

Try this, i use




回答3:


<ENVELOPE>
        <HEADER>
        <TALLYREQUEST>Export Data</TALLYREQUEST>
        </HEADER>
        <BODY>
        <EXPORTDATA>
        <REQUESTDESC>
        <STATICVARIABLES>

        <SVCURRENTCOMPANY>$etca_name</SVCURRENTCOMPANY>

        <SVFROMDATE>20130401</SVFROMDATE>
                <SVTODATE>20143031</SVTODATE>

        <!--Theis will show the User name who created Voucher-->
        <SHOWCREATEDBY>YES</SHOWCREATEDBY>
        <SHOWPARTYNAME>Yes</SHOWPARTYNAME>

        <!--Specify the Voucher Type here-->
        <!-- Ex . Sales/Sale Export -->

        <VOUCHERTYPENAME>Sales Order</VOUCHERTYPENAME>
        </STATICVARIABLES>

        <!--Specify the Report Name here-->
        <REPORTNAME>Voucher Register</REPORTNAME>
        <STATICVARIABLES>
            <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
        </STATICVARIABLES>

        </REQUESTDESC>
        </EXPORTDATA>
        </BODY>
        </ENVELOPE>


来源:https://stackoverflow.com/questions/26278805/needs-to-retrieve-sales-order-details-using-xml-request-to-tally-erp-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!