i have fetch data from tally erp 9.0 using this code,
<?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);
}
But my problem is how to push(insert) data into Tally ERP 9.0 using php(curl).
instead of
$server = 'LOCALHOST:9000';
give
$server = '10.0.0.155:9000';
use tally to generate xml format, and use same format to insert data back in to tally for eg. to create sale voucher, get the xml from tally i.e
GatewayOfTAlly-->Display-->Account Books--> Sales Register-->chhose month-->ctl+E to export the voucher,
Now you got the xml format, you are good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With