我已经使用此代码从理货 erp 9.0 中获取数据,
<?php
$requestXML = '<ENVELOPE>'.
'<HEADER>'.
'<TALLYREQUEST>Export Data</TALLYREQUEST>'.
'</HEADER>'.
'<BODY>'.
'<EXPORTDATA>'.
'<REQUESTDESC>'.
'<REPORTNAME>Daybook</REPORTNAME>'.
'<STATICVARIABLES>'.
'<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>'.
'</STATICVARIABLES>'.
'</REQUESTDESC>'.
'</EXPORTDATA>'.
'</BODY>'.
'</ENVELOPE>';
$server = 'LOCALHOST:9000';
$headers = array( "Content-type: text/xml","Content-length:".strlen($requestXML) ,"Connection: close");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $server);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestXML);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = curl_exec($ch);
if(curl_errno($ch)){
print curl_error($ch);
echo " something went wrong..... try later";
}else{
echo " request accepted";
print $data;
curl_close($ch);
}
但我的问题是如何使用 php(curl) 将数据推送(插入)到 Tally ERP 9.0 中。