需要使用xml请求检索销售订单详细信息到Tally erp 9

时间:2014-10-09 12:46:14

标签: c# xml integration erp

我将开发一个与Tally ERP 9集成的桌面应用程序。我的应用程序使用(' localhost:9000')进行XML Post请求。

我可以使用以下XML发布请求来获取所有销售记录。

<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>

现在,我需要通过传递orderid / referencenumber来检索单个销售订单详细信息。

我在<STATICVARIABLES>中逐个尝试了以下语法,但它失败了,

<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>

如果有人知道正确的XML请求或使用xml请求与各种导出操作相关的任何文档,请告诉我。

3 个答案:

答案 0 :(得分:2)

<?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>

试试这个,我使用这个xml通过键入我需要从提单中获取的凭证的主ID作为凭证ID来从计数中获取特定的凭证数据。

答案 1 :(得分: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>

试试这个,我用

答案 2 :(得分:0)

<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>