Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

soap - how to filter tally xml response based on voucher number?

I am trying to retrieve only the sales records of specific 'Voucher Number' =5 by using below XML post request to tally.

<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>data</TYPE>
<ID>voucher register</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVCURRENTCOMPANY>Headers Software Solutions Pvt  Ltd</SVCURRENTCOMPANY>
<VoucherTypeName>Sales</VoucherTypeName>
<VoucherNumber>5</VoucherNumber>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>

In XML Response I am receiving entire sales record from Voucher Number 1 to 600.

<ENVELOPE>
<HEADER>
    <VERSION>1</VERSION>
    <STATUS>1</STATUS>
</HEADER>
<BODY>
    <DESC>
        <STATICVARIABLES>
            <SVCURRENTCOMPANY>Headers Software Solutions Pvt  Ltd</SVCURRENTCOMPANY>
        </STATICVARIABLES>
    </DESC>
    <DATA>
        <TALLYMESSAGE xmlns:UDF="TallyUDF">
            <VOUCHER REMOTEID="eedb4478-88d5-4d8f-8444-9f852c2e8eca-00000001" VCHKEY="eedb4478-88d5-4d8f-8444-9f852c2e8eca-0000a7d0:00000008" VCHTYPE="Sales" ACTION="Create" OBJVIEW="Invoice Voucher View">
                <ADDRESS.LIST TYPE="String">
                    <ADDRESS>No. P-35, Kaligambal Nagar, Thirumullaivoyal</ADDRESS>
                    <ADDRESS>Chennai-600062</ADDRESS>
                </ADDRESS.LIST>
                <BASICBUYERADDRESS.LIST TYPE="String">
                    <BASICBUYERADDRESS>No. P-35, Kaligambal Nagar, Thirumullaivoyal</BASICBUYERADDRESS>
                    <BASICBUYERADDRESS>Chennai-600062</BASICBUYERADDRESS>
                </BASICBUYERADDRESS.LIST>
                <OLDAUDITENTRYIDS.LIST TYPE="Number">
                    <OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>
                </OLDAUDITENTRYIDS.LIST>
                <DATE>20170814</DATE>
                <GUID>eedb4478-88d5-4d8f-8444-9f852c2e8eca-00000001</GUID>
                <STATENAME>Tamil Nadu</STATENAME>
                <PARTYGSTIN>33AASCS5559D1Z1</PARTYGSTIN>
                <PARTYNAME>Shri Pavithra Auto Products Private Limited</PARTYNAME>
                <VOUCHERTYPENAME>Sales</VOUCHERTYPENAME>
                <REFERENCE>145355345</REFERENCE>
                <VOUCHERNUMBER>1</VOUCHERNUMBER>
                <PARTYLEDGERNAME>Shri Pavithra Auto Products Private Limited</PARTYLEDGERNAME>
                <BASICBASEPARTYNAME>Shri Pavithra Auto Products Private Limited</BASICBASEPARTYNAME>
                .
                .
                .
                .
                .
            </VOUCHER>
        </TALLYMESSAGE>
        .
        .
        .
        .
        .
        .
        .
        .
        <TALLYMESSAGE xmlns:UDF="TallyUDF">
            <VOUCHER REMOTEID="eedb4478-88d5-4d8f-8444-9f852c2e8eca-0000006d" VCHKEY="eedb4478-88d5-4d8f-8444-9f852c2e8eca-0000a851:00000008" VCHTYPE="Sales" ACTION="Create" OBJVIEW="Invoice Voucher View">
                <ADDRESS.LIST TYPE="String">
                    <ADDRESS>Plot No.3(SP), III Main Road, Ambattur Industrial Estate,Chennai-600058</ADDRESS>
                </ADDRESS.LIST>
                <BASICBUYERADDRESS.LIST TYPE="String">
                    <BASICBUYERADDRESS>Plot No.3(SP), III Main Road, Ambattur Industrial Estate,Chennai-600058</BASICBUYERADDRESS>
                </BASICBUYERADDRESS.LIST>
                <OLDAUDITENTRYIDS.LIST TYPE="Number">
                    <OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>
                </OLDAUDITENTRYIDS.LIST>
                <DATE>20171221</DATE>
                <GUID>eedb4478-88d5-4d8f-8444-9f852c2e8eca-0000006d</GUID>
                <STATENAME>Tamil Nadu</STATENAME>
                <PARTYNAME>WABCO INDIA LIMITED-Ambattur</PARTYNAME>
                <VOUCHERTYPENAME>Sales</VOUCHERTYPENAME>
                <REFERENCE>4900017337</REFERENCE>
                <VOUCHERNUMBER>600</VOUCHERNUMBER>
                <PARTYLEDGERNAME>WABCO INDIA LIMITED-Ambattur</PARTYLEDGERNAME>
                <BASICBASEPARTYNAME>WABCO INDIA LIMITED-Ambattur</BASICBASEPARTYNAME>
                .
                .
                .
                .
                .
                .
           </VOUCHER>
        </TALLYMESSAGE>

        <TALLYMESSAGE xmlns:UDF="TallyUDF">
            <COMPANY>
                <REMOTECMPINFO.LIST MERGE="Yes">
                    <NAME>eedb4478-88d5-4d8f-8444-9f852c2e8eca</NAME>
                    <REMOTECMPNAME>Headers Software Solutions Pvt  Ltd</REMOTECMPNAME>
                    <REMOTECMPSTATE>TamilNadu</REMOTECMPSTATE>
                </REMOTECMPINFO.LIST>
            </COMPANY>
        </TALLYMESSAGE>
    </DATA>
</BODY>

How do I apply filter condition in XML request to retrieve only the specific voucher number details?

These links doesn't help me.

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

Tally Ledger Voucher XML Export

Please help me. Thanks in Advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

XML request to Export vouchers from Tally ERP 9 for a specified VoucherNumber and VoucherType.

TODO: You must specify the VoucherNumber and VoucherType in the XML as marked with TODO.

<ENVELOPE>  
  <HEADER>  
    <VERSION>1</VERSION>  
    <TALLYREQUEST>  EXPORT</TALLYREQUEST>  
    <TYPE>COLLECTION</TYPE>  
    <ID>  RTSAllVouchers_FilterForVchNoAndVchType</ID>  
  </HEADER>  
  <BODY>  
    <DESC>  
      <STATICVARIABLES>  
        <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>  
        <!-- TODO : Specify the VoucherNo -->  
        <RTS_KEY>VCH-INV-1</RTS_KEY>  
        <!-- TODO : Specify the VoucherType here -->  
        <RTS_VOUCHERTYPENAME>Sales</RTS_VOUCHERTYPENAME>  
      </STATICVARIABLES>  
      <TDL>  
        <TDLMESSAGE>  
          <!-- Retrieve all Vouchers for specified VoucherNo and VoucherType -->  
          <COLLECTION NAME="RTSAllVouchers_FilterForVchNoAndVchType" ISINITIALIZE="Yes">  
              <TYPE>Voucher</TYPE>  
              <FETCH>ALLLEDGERENTRIES.*</FETCH>  
              <FETCH>ALLINVENTORYENTRIES.*</FETCH>  
              <FILTER>RTS_FilterForVchNoAndVchType</FILTER>  
          </COLLECTION>  
          <VARIABLE NAME="RTS_KEY">  
            <TYPE> String</TYPE>  
          </VARIABLE>  
          <VARIABLE NAME="RTS_VOUCHERTYPENAME">  
            <TYPE>String</TYPE>  
          </VARIABLE>  
          <SYSTEM TYPE="FORMULAE" NAME="RTS_FilterForVchNoAndVchType">  
            $VoucherNumber = $$String:##RTS_KEY and $VoucherTypeName = $$String:##RTS_VOUCHERTYPENAME
          </SYSTEM>  
        </TDLMESSAGE>  
      </TDL>  
    </DESC>  
  </BODY>  
</ENVELOPE>  

Remarks:
The filter condition is applied using the TDL variables which are enclosed with the TDLMESSAGE tag. The variables are RTS_KEY and RTS_VOUCHERTYPENAME.

XML tags to fetch / export data from Tally ERP 9
https://www.rtslink.com/articles/tally-xml-tags-export/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...