Tally XML Integration ...从计数器中导出员工信息

时间:2018-01-31 19:15:00

标签: integration tally

任何人都可以建议从计数器中导出员工详细信息的xml结构。

1 个答案:

答案 0 :(得分:3)

<?php   
  /*
  PHP Code to Export Employee Master data from Tally ERP 9  
  Task : Export Exmployee masters from Tally  
  */    
  ini_set('display_errors', 1);

  $data =   
    "<ENVELOPE>" .  
    "<HEADER>" .   
    "<TALLYREQUEST>Export Data</TALLYREQUEST>" .  
    "</HEADER>" .  
    "<BODY>" .  
    "<EXPORTDATA>" .  
    "<REQUESTDESC>" .  
    "<REPORTNAME>List of Accounts</REPORTNAME>" .  
    "<STATICVARIABLES>" .  
    "<SVEXPORTFORMAT>\$\$SysName:XML</SVEXPORTFORMAT>" .  
    "<ACCOUNTTYPE>Employees</ACCOUNTTYPE>" .  
    "<!--Other possible values for ACCOUNTTYPE tag are given below-->" .  
    "<!--All Acctg. Masters, All Inventory Masters,All Statutory Masters-->" .  
    "<!--Ledgers,Groups,Cost Categories,Cost Centres-->" .  
    "<!--Units,Godowns,Stock Items,Stock Groups,Stock Categories-->" .  
    "<!--Voucher types,Currencies,Employees,Budgets & Scenarios-->" .  
    "</STATICVARIABLES>" .  
    "</REQUESTDESC>" .  
    "</EXPORTDATA>" .  
    "</BODY>" .  
    "</ENVELOPE>";    

  $ch = curl_init();  
  curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9000/');  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
  curl_setopt($ch, CURLOPT_POST, true);  
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data ); //$data = "XML data"  
  $response = curl_exec ($ch);  
  if(curl_errno($ch)){  
    echo curl_error($ch);  
  }  
  else{  
    print "<pre lang='xml'>" . htmlspecialchars($response) . "</pre>";  
    curl_close($ch);  
  }    
  return "";  

 ?>  

注意:
您可以从此处获取有关Tally XML标记的更多信息:

从Tally出口数据 https://www.rtslink.com/articles/tally-xml-tags-export/

将数据导入Tally
https://www.rtslink.com/articles/tally-xml-tags-import/