2016-04-13 69 views
2

我正在開發理貨應用程序。現在我想與Tally融合。 如果我將數據導入Tally,我得到這樣的錯誤。理貨不從XML導入數據

Importing Data from 'New.xml' on 13-Apr-2016 at 14:11:51 

Importing Data to company: 'Technologies Pvt Ltd' 

ERROR: Voucher: ID:<REMOTEID:face3a8f-f920-4781-a14b-ed095d0b0145-00000006>,  Voucher Type: Payment, Source Voucher Number: 203, Voucher Number: , Date: 

Import Summary 
Created : 0 
Altered : 0 
Deleted : 0 
Combined: 0 
Ignored : 0 
Errors : 1 
---------------------------------------------- 

這是我的XML文件。

<ENVELOPE> 
<HEADER> 
<TALLYREQUEST>Import Data</TALLYREQUEST> 
</HEADER> 
<BODY> 
<IMPORTDATA> 
<REQUESTDESC> 
<REPORTNAME>Vouchers</REPORTNAME> 
<STATICVARIABLES> 
<SVCURRENTCOMPANY>Technologies Pvt Ltd</SVCURRENTCOMPANY> 
</STATICVARIABLES> 
</REQUESTDESC> 
<REQUESTDATA> 
<TALLYMESSAGE xmlns:UDF="TallyUDF"> 
<VOUCHER REMOTEID="face3a8f-f920-4781-a14b-ed095d0b0145-00000006" VCHKEY="face3a8f-f920-4781-a14b-ed095d0b0145-0000a748:000000061" VCHTYPE="Payment" ACTION="Create" OBJVIEW="Accounting Voucher View"> 
<OLDAUDITENTRYIDS.LIST TYPE="Number"> 
<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS> 
</OLDAUDITENTRYIDS.LIST> 
<DATE>20160413</DATE> 
<GUID>face3a8f-f920-4781-a14b-ed095d0b0145-00000006</GUID> 
<NARRATION>100</NARRATION> 
<VOUCHERTYPENAME>Payment</VOUCHERTYPENAME> 
<VOUCHERNUMBER>203</VOUCHERNUMBER> 
<PARTYLEDGERNAME>Cash</PARTYLEDGERNAME> 
<CSTFORMISSUETYPE/> 
<CSTFORMRECVTYPE/> 
<FBTPAYMENTTYPE>Default</FBTPAYMENTTYPE> 
<PERSISTEDVIEW>Accounting Voucher View</PERSISTEDVIEW> 
<VCHGSTCLASS/> 
<DIFFACTUALQTY>No</DIFFACTUALQTY> 
<ISMSTFROMSYNC>No</ISMSTFROMSYNC> 
<ASORIGINAL>No</ASORIGINAL> 
<AUDITED>No</AUDITED> 
<FORJOBCOSTING>No</FORJOBCOSTING> 
<ISOPTIONAL>No</ISOPTIONAL> 
<EFFECTIVEDATE>20170331</EFFECTIVEDATE> 
<USEFOREXCISE>No</USEFOREXCISE> 
<ISFORJOBWORKIN>No</ISFORJOBWORKIN> 
<ALLOWCONSUMPTION>No</ALLOWCONSUMPTION> 
<USEFORINTEREST>No</USEFORINTEREST> 
<USEFORGAINLOSS>No</USEFORGAINLOSS> 
<USEFORGODOWNTRANSFER>No</USEFORGODOWNTRANSFER> 
<USEFORCOMPOUND>No</USEFORCOMPOUND> 
<USEFORSERVICETAX>No</USEFORSERVICETAX> 
<ISEXCISEVOUCHER>No</ISEXCISEVOUCHER> 
<EXCISETAXOVERRIDE>No</EXCISETAXOVERRIDE> 
<USEFORTAXUNITTRANSFER>No</USEFORTAXUNITTRANSFER> 
<EXCISEOPENING>No</EXCISEOPENING> 
<USEFORFINALPRODUCTION>No</USEFORFINALPRODUCTION> 
<ISTDSOVERRIDDEN>No</ISTDSOVERRIDDEN> 
<ISTCSOVERRIDDEN>No</ISTCSOVERRIDDEN> 
<ISTDSTCSCASHVCH>No</ISTDSTCSCASHVCH> 
<INCLUDEADVPYMTVCH>No</INCLUDEADVPYMTVCH> 
<ISSUBWORKSCONTRACT>No</ISSUBWORKSCONTRACT> 
<ISVATOVERRIDDEN>No</ISVATOVERRIDDEN> 
<IGNOREORIGVCHDATE>No</IGNOREORIGVCHDATE> 
<ISSERVICETAXOVERRIDDEN>No</ISSERVICETAXOVERRIDDEN> 
<ISISDVOUCHER>No</ISISDVOUCHER> 
<ISEXCISEOVERRIDDEN>No</ISEXCISEOVERRIDDEN> 
<ISEXCISESUPPLYVCH>No</ISEXCISESUPPLYVCH> 
<ISVATPRINCIPALACCOUNT>No</ISVATPRINCIPALACCOUNT> 
<ISSHIPPINGWITHINSTATE>No</ISSHIPPINGWITHINSTATE> 
<ISCANCELLED>No</ISCANCELLED> 
<HASCASHFLOW>Yes</HASCASHFLOW> 
<ISPOSTDATED>No</ISPOSTDATED> 
<USETRACKINGNUMBER>No</USETRACKINGNUMBER> 
<ISINVOICE>No</ISINVOICE> 
<MFGJOURNAL>No</MFGJOURNAL> 
<HASDISCOUNTS>No</HASDISCOUNTS> 
<ASPAYSLIP>No</ASPAYSLIP> 
<ISCOSTCENTRE>No</ISCOSTCENTRE> 
<ISSTXNONREALIZEDVCH>No</ISSTXNONREALIZEDVCH> 
<ISEXCISEMANUFACTURERON>No</ISEXCISEMANUFACTURERON> 
<ISBLANKCHEQUE>No</ISBLANKCHEQUE> 
<ISVOID>No</ISVOID> 
<ISONHOLD>No</ISONHOLD> 
<ORDERLINESTATUS>No</ORDERLINESTATUS> 
<VATISAGNSTCANCSALES>No</VATISAGNSTCANCSALES> 
<VATISPURCEXEMPTED>No</VATISPURCEXEMPTED> 
<ISVATRESTAXINVOICE>No</ISVATRESTAXINVOICE> 
<ISDELETED>No</ISDELETED> 
<CHANGEVCHMODE>No</CHANGEVCHMODE> 
<ALTERID/> 
<MASTERID/> 
<VOUCHERKEY>183927679483912</VOUCHERKEY> 
<EXCLUDEDTAXATIONS.LIST/> 
<OLDAUDITENTRIES.LIST/> 
<ACCOUNTAUDITENTRIES.LIST/> 
<AUDITENTRIES.LIST/> 
<DUTYHEADDETAILS.LIST/> 
<SUPPLEMENTARYDUTYHEADDETAILS.LIST/> 
<INVOICEDELNOTES.LIST/> 
<INVOICEORDERLIST.LIST/> 
<INVOICEINDENTLIST.LIST/> 
<ATTENDANCEENTRIES.LIST/> 
<ORIGINVOICEDETAILS.LIST/> 
<INVOICEEXPORTLIST.LIST/> 
<ALLLEDGERENTRIES.LIST> 
<OLDAUDITENTRYIDS.LIST TYPE="Number"> 
<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS> 
</OLDAUDITENTRYIDS.LIST> 
<LEDGERNAME>WATER EXP</LEDGERNAME> 
<GSTCLASS/> 
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE> 
<LEDGERFROMITEM>No</LEDGERFROMITEM> 
<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES> 
<ISPARTYLEDGER>No</ISPARTYLEDGER> 
<ISLASTDEEMEDPOSITIVE>Yes</ISLASTDEEMEDPOSITIVE> 
<AMOUNT>-100.00</AMOUNT> 
<SERVICETAXDETAILS.LIST/> 
<BANKALLOCATIONS.LIST/> 
<BILLALLOCATIONS.LIST/> 
<INTERESTCOLLECTION.LIST/> 
<OLDAUDITENTRIES.LIST/> 
<ACCOUNTAUDITENTRIES.LIST/> 
<AUDITENTRIES.LIST/> 
<INPUTCRALLOCS.LIST/> 
<DUTYHEADDETAILS.LIST/> 
<EXCISEDUTYHEADDETAILS.LIST/> 
<SUMMARYALLOCS.LIST/> 
<STPYMTDETAILS.LIST/> 
<EXCISEPAYMENTALLOCATIONS.LIST/> 
<TAXBILLALLOCATIONS.LIST/> 
<TAXOBJECTALLOCATIONS.LIST/> 
<TDSEXPENSEALLOCATIONS.LIST/> 
<VATSTATUTORYDETAILS.LIST/> 
<COSTTRACKALLOCATIONS.LIST/> 
<REFVOUCHERDETAILS.LIST/> 
<INVOICEWISEDETAILS.LIST/> 
<VATITCDETAILS.LIST/> 
</ALLLEDGERENTRIES.LIST> 
<ALLLEDGERENTRIES.LIST> 
<OLDAUDITENTRYIDS.LIST TYPE="Number"> 
<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS> 
</OLDAUDITENTRYIDS.LIST> 
<LEDGERNAME>Cash</LEDGERNAME> 
<GSTCLASS/> 
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE> 
<LEDGERFROMITEM>No</LEDGERFROMITEM> 
<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES> 
<ISPARTYLEDGER>Yes</ISPARTYLEDGER> 
<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE> 
<AMOUNT>100.00</AMOUNT> 
<SERVICETAXDETAILS.LIST/> 
<BANKALLOCATIONS.LIST> 
<DATE>20170331</DATE> 
<INSTRUMENTDATE>20170331</INSTRUMENTDATE> 
<NAME>d29faa3c-2cb8-429e-9d50-cb4243b68a8d</NAME> 
<TRANSACTIONTYPE>Cheque</TRANSACTIONTYPE> 
<PAYMENTFAVOURING>Water Exp</PAYMENTFAVOURING> 
<CHEQUECROSSCOMMENT>A/c Payee</CHEQUECROSSCOMMENT> 
<UNIQUEREFERENCENUMBER>3CODSsNV01ippV7T</UNIQUEREFERENCENUMBER> 
<STATUS>No</STATUS> 
<PAYMENTMODE>Transacted</PAYMENTMODE> 
<BANKPARTYNAME>Water Exp</BANKPARTYNAME> 
<ISCONNECTEDPAYMENT>No</ISCONNECTEDPAYMENT> 
<ISSPLIT>No</ISSPLIT> 
<ISCONTRACTUSED>No</ISCONTRACTUSED> 
<AMOUNT>1000.00</AMOUNT> 
<CONTRACTDETAILS.LIST/> 
</BANKALLOCATIONS.LIST> 
<BILLALLOCATIONS.LIST/> 
<INTERESTCOLLECTION.LIST/> 
<OLDAUDITENTRIES.LIST/> 
<ACCOUNTAUDITENTRIES.LIST/> 
<AUDITENTRIES.LIST/> 
<INPUTCRALLOCS.LIST/> 
<DUTYHEADDETAILS.LIST/> 
<EXCISEDUTYHEADDETAILS.LIST/> 
<SUMMARYALLOCS.LIST/> 
<STPYMTDETAILS.LIST/> 
<EXCISEPAYMENTALLOCATIONS.LIST/> 
<TAXBILLALLOCATIONS.LIST/> 
<TAXOBJECTALLOCATIONS.LIST/> 
<TDSEXPENSEALLOCATIONS.LIST/> 
<VATSTATUTORYDETAILS.LIST/> 
<COSTTRACKALLOCATIONS.LIST/> 
<REFVOUCHERDETAILS.LIST/> 
<INVOICEWISEDETAILS.LIST/> 
<VATITCDETAILS.LIST/> 
</ALLLEDGERENTRIES.LIST> 
<PAYROLLMODEOFPAYMENT.LIST></PAYROLLMODEOFPAYMENT.LIST> 
<ATTDRECORDS.LIST></ATTDRECORDS.LIST> 
</VOUCHER> 
</TALLYMESSAGE> 
</REQUESTDATA> 
</IMPORTDATA> 
</BODY> 
</ENVELOPE> 

在我的xml文件中是否有任何錯誤, 請幫幫我。網上沒有足夠的文件。

+0

沒有身體可以幫助我 –

回答

0

嘗試通過無效的XML數據是這樣的:<![CDATA[ {INVALID XML}]]>

0

我看到這個帖子的時候,我想你在做同樣的工作,希望分享出頭我所做的解決,這可能是它會幫助你進一步進行..

java代碼是如波紋管

TallyRequest.java

package tallyrequest; 

import java.io.BufferedReader; 
import java.io.ByteArrayInputStream; 
import java.io.ByteArrayOutputStream; 
import java.io.IOException; 
import java.io.InputStream; 
import java.io.InputStreamReader; 
import java.io.OutputStream; 
import java.net.HttpURLConnection; 
import java.net.URL; 
import java.net.URLConnection; 

public class TallyRequest { 

    public String CreateRequest() { 
     String TXML = null; 

     TXML = "<ENVELOPE>" 
       + "<HEADER><TALLYREQUEST>Import Data</TALLYREQUEST></HEADER>" 
       + "<BODY>" 
       + "<IMPORTDATA>" 
       + "<REQUESTDESC><REPORTNAME>Vouchers</REPORTNAME><STATICVARIABLES><SVCURRENTCOMPANY>Crane</SVCURRENTCOMPANY></STATICVARIABLES></REQUESTDESC>" 
       + "<REQUESTDATA>" 
       + "<TALLYMESSAGE xmlns:UDF=\"TallyUDF\">" 
       + "<VOUCHER REMOTEID=\"00000001\" VCHTYPE=\"Receipt\" ACTION=\"Create\" OBJVIEW=\"Accounting Voucher View\">"  
       + "<DATE>20160701</DATE>" 
       + "<VOUCHERTYPENAME>Receipt</VOUCHERTYPENAME>" 
       + "<VOUCHERNUMBER>3</VOUCHERNUMBER>" 
       + "<PARTYLEDGERNAME>Cash</PARTYLEDGERNAME>" 
       + "<PERSISTEDVIEW>Accounting Voucher View</PERSISTEDVIEW>"  
       + "<ALLLEDGERENTRIES.LIST>" 
       + "<LEDGERNAME>Mahes</LEDGERNAME>" 
       + "<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>" 
       + "<AMOUNT>0</AMOUNT>"  
       + "</ALLLEDGERENTRIES.LIST>" 
       + "<ALLLEDGERENTRIES.LIST>"  
       + "<LEDGERNAME>Cash</LEDGERNAME>" 
       + "<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>" 
       + "<AMOUNT>-150000.00</AMOUNT>"   
       + "</ALLLEDGERENTRIES.LIST>"  
       + "</VOUCHER>" 
       + "</TALLYMESSAGE>" 
       + "</REQUESTDATA>" 
       + "</IMPORTDATA>" 
       + "</BODY>" 
       + "</ENVELOPE>"; 
     return TXML; 
    } 

    public void SendToTally() throws Exception { 
     String Url = "http://127.0.0.1:9000/"; 

     String SOAPAction = ""; 

     String Voucher = this.CreateRequest(); 

     // Create the connection where we're going to send the file. 
     URL url = new URL(Url); 
     URLConnection connection = url.openConnection(); 
     HttpURLConnection httpConn = (HttpURLConnection) connection; 

     ByteArrayInputStream bin = new ByteArrayInputStream(Voucher.getBytes()); 
     ByteArrayOutputStream bout = new ByteArrayOutputStream(); 

     // Copy the SOAP file to the open connection. 

     copy(bin, bout); 

     byte[] b = bout.toByteArray(); 

     // Set the appropriate HTTP parameters. 
     httpConn.setRequestProperty("Content-Length", String.valueOf(b.length)); 
     httpConn.setRequestProperty("Content-Type", "text/xml; charset=utf-8"); 
     httpConn.setRequestProperty("SOAPAction", SOAPAction); 
     httpConn.setRequestMethod("POST"); 
     httpConn.setDoOutput(true); 
     httpConn.setDoInput(true); 

     // Everything's set up; send the XML that was read in to b. 
     OutputStream out = httpConn.getOutputStream(); 
     out.write(b); 
     out.close(); 

     // Read the response and write it to standard out. 

     InputStreamReader isr = new InputStreamReader(httpConn.getInputStream()); 
     BufferedReader in = new BufferedReader(isr); 

     String inputLine; 

     while ((inputLine = in.readLine()) != null) { 
      System.out.println(inputLine); 
     } 

     in.close(); 
    } 

    public static void copy(InputStream in, OutputStream out) 
      throws IOException { 

     // do not allow other threads to read from the 
     // input or write to the output while copying is 
     // taking place 

     synchronized (in) { 
      synchronized (out) { 

       byte[] buffer = new byte[256]; 
       while (true) { 
        int bytesRead = in.read(buffer); 
        if (bytesRead == -1) { 
         break; 
        } 
        out.write(buffer, 0, bytesRead); 
       } 
      } 
     } 
    } 

    public static void main(String[] args) throws Exception { 
     TallyRequest r = new TallyRequest(); 
     r.SendToTally(); 
    } 
} 

這裏只需發送XML輸出的波紋管

XML消息如下

<ENVELOPE> 
    <HEADER> 
     <TALLYREQUEST>Import Data</TALLYREQUEST> 
    </HEADER> 
     <BODY> 
     <IMPORTDATA> 
      <REQUESTDESC> 
       <REPORTNAME>Vouchers</REPORTNAME> 
       <STATICVARIABLES> 
        <SVCURRENTCOMPANY>Crane</SVCURRENTCOMPANY> 
       </STATICVARIABLES> 
      </REQUESTDESC> 
      <REQUESTDATA> 
       <TALLYMESSAGE xmlns:UDF="TallyUDF"> 
        <VOUCHER REMOTEID="00000001" VCHTYPE="Receipt" ACTION="Create" OBJVIEW="Accounting Voucher View"> 
         <DATE>20160701</DATE> 
         <VOUCHERTYPENAME>Receipt</VOUCHERTYPENAME> 
         <VOUCHERNUMBER>3</VOUCHERNUMBER> 
         <PARTYLEDGERNAME>Cash</PARTYLEDGERNAME> 
         <PERSISTEDVIEW>Accounting Voucher View</PERSISTEDVIEW> 
         <ALLLEDGERENTRIES.LIST> 
          <LEDGERNAME>Mahes</LEDGERNAME> 
          <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE> 
          <AMOUNT>0</AMOUNT> 
         </ALLLEDGERENTRIES.LIST> 
         <ALLLEDGERENTRIES.LIST> 
          <LEDGERNAME>Cash</LEDGERNAME> 
          <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE> 
          <AMOUNT>-150000.00</AMOUNT> 
         </ALLLEDGERENTRIES.LIST> 
        </VOUCHER> 
       </TALLYMESSAGE> 
      </REQUESTDATA> 
     </IMPORTDATA> 
    </BODY> 
</ENVELOPE> 

上面的代碼將顯示總賬和從Java傳遞給理貨公司名稱的議案,當XML消息被傳遞到計數器,確保計數器具有相同的參數,這些參數在必要時被傳遞或修改,否則消息將不會通過,並且會在java Console中看到一個錯誤,以及tally.imp file在Tally.ERP9 root folde河如果您對Tally XML消息結構存在疑問,只需獲取Ledger的備份或任何其他您需要發送數據以獲取格式的備份或引用對我有用的鏈接,以發送正確格式的XML 。

Full reference to Tally and Java integration based on SOAP

Architecture Reference

如需進一步奎雷斯高興做評論闡述您的需求,這樣我會盡力幫助你!

0

@shimbu shambu,我也面臨同樣的問題,並通過更改DATE標記中的日期值來解決它。由於xml傳遞日期和Tally中當前日期的變化,此問題發生。如果您使用的是Tally的教育版本,則無法更改Tally中的日期。你必須在xml文件中改變它。