php xml tally integration

Discussion in 'Tally Integration' started by narayana, Jan 17, 2014.

    
  1. narayana

    narayana New Member


    Respected all,

    i am writing a php program to getting tally details as xml format. i am very new to tally programming can you help me some budy to how to integrate tally to php web application i am sending XML request to tally it is giving xml responce but my questing to i want to get all voucher details in single XML all values, can any budy explam he how to use tally schema :)

    Thanks in Advanced
    Regards,
    Narayana reddy gurrala.
     


  2. A.Baradharajan

    A.Baradharajan New Member


    I am using the following php file for the last 3 or 4 years - study the file - customize it to your needs

    <?
    include_once "../cheque/../common/inc/phpscripts.php";
    //@import_request_variables("gpc");
    ob_start();
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // rfc2616 - Section 14.21
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
    header('Pragma: no-cache'); // HTTP/1.0
    setlocale(LC_ALL,'en-gb');
    $linkid = db_connect();
    //dumparray($_POST);exit;
    if(!isset($fromdate)){
    $fromdate = date("1-n-Y");
    $todate = date("j-n-Y");
    $curdate = $todate;
    $repname = "Ledger Vouchers";
    //$repname = "Group Vouchers";
    //$repname = "Day Book";
    //$repname = "Voucher Register";
    //$repname="Trial Balance";
    //$repname = "Ledger";
    //$repname = "Vouchers";
    //$repname = "Ledger Daily";
    //$repname = "Ledger Monthly Summary";

    $ledgername = "TDS on contracters";
    $groupname = "Cash-in-Hand";

    $vhrtype = '$$SysName:$$VchTypeJournal';
    $vhrtype = "Journal";
    echo <<<XXX
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Tally Reports</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <meta name="generator" content="HAPedit 3.1">
    <link rel="StyleSheet" href="../cheque/css/general.css" type="text/css">
    <Style>
    .odbctable{
    border: 1px solid black;
    spacing:4px;
    cell-padding:4px;
    margin:4px;
    font-name: Arial;
    font-size:9pt;
    border-collapse:collapse;
    }


    body,input{
    font-size:9pt;

    }
    td{
    border:4px double Red;
    }
    .rgtbox{
    text-align: right;

    }
    </Style>
    <script>
    var curobj = "";
    </script>
    XXX;

    $tallyprimarygroups= Array(
    " Primary"=>"Liability",
    "NULL"=>"Liability",
    "Bank Accounts"=>"Asset",
    "Branch/Divisions"=>"Asset",
    "Cash-in-hand"=>"Asset",
    "Current Assets"=>"Asset",
    "Deposits (Asset)"=>"Asset",
    "Integrated Accounts-cum-Inventory"=>"Asset",
    "Investments"=>"Asset",
    "Loans & Advances (Asset)"=>"Asset",
    "Loans and Advances (Asset) group."=>"Asset",
    "Miscellaneous Expenses (Asset)"=>"Asset",
    "Non-integrated Accounts-cum-Inventory"=>"Asset",
    "Stock-in-hand"=>"Asset",
    "Sundry Debtors"=>"Asset",
    "Fixed Assets"=>"Asset",
    "Direct Expenses"=>"Expense",
    "Indirect Expenses"=>"Expense",
    "Purchase Account"=>"Expense",
    "Direct Incomes"=>"Income",
    "Indirect Incomes"=>"Income",
    "Sales Accounts"=>"Income",
    "Bank OCC A/c"=>"Liability",
    "Bank OD Accounts"=>"Liability",
    "Capital Account"=>"Liability",
    "Current Liabilities"=>"Liability",
    "Duties and Taxes"=>"Liability",
    "Loans (Liability)"=>"Liability",
    "Profit & Loss Account"=>"Liability",
    "Provisions"=>"Liability",
    "Reserves and Surplus"=>"Liability",
    "Secured Loans"=>"Liability",
    "Sundry Creditors"=>"Liability",
    "Suspense Account"=>"Liability",
    "Unsecured Loans"=>"Liability",
    "Duties & Taxes"=>"Liability",
    "Bank OD A/c"=>"Liability",
    "Branch / Divisions"=>"Asset",
    "Misc. Expenses (ASSET)"=>"Asset",
    "Purchase Accounts"=>"Expense",
    "Reserves & Surplus"=>"Liability",
    "Suspense A/c"=>"Asset"
    );


    echo <<<XXX
    </head>
    <body >
    <form action = TallyRequest.php method=post autocomplete=off id=myform target=tallytalk>
    <h2>Tally Reports</h2>
    <table border=1 cellpadding = 3 cellspacing = 3
    style="border-collapse:collapse;border:4px double Red;padding:3;margin:0;">
    <tr>
    <td >
    Debug mode ?<input type=checkbox name=debugmode id=debugmode value=1 ><br>
    Totals Line ?<input type=checkbox name=totals id=totals value=1 ><br>
    Explode Levels ?<input type=checkbox name=explode id=explode value=1 ><br>
    Filter for Specific Account ?<input type=checkbox name=filterac id=filterac value=1 ><br>
    Date-From <br> <input type=text id=fromdate name=fromdate value="$fromdate" onclick="this.select();" size=12>
    To <input type=text id=todate name=todate value="$todate" onclick="this.select();" size=12>
    </td>
    <td>
    <input type=text id=repname name=repname value="Voucher Register" onclick="this.select();" size=38>
    <br>Report Name <br>
    <select size=6 name="selrepname" id="selrepname" style="width:100%" onchange="repname.value=this.value;">
    XXX;

    $listarray = Array(
    'Ledger Vouchers',
    'Select Ledger Vouchers',
    'Group Vouchers',
    'Group summary',
    'Voucher Register',
    'Voucher Party Register',
    'Day Book',
    'List of Accounts',
    'List of Groups',
    'Vouchers'
    );

    foreach($listarray as $v){
    $selected = "";
    if ($v=="Voucher Register")$selected = " Selected ";
    echo <<<XXX
    <option value="$v" $selected> $v</option>
    XXX;
    }
    echo <<<XXX
    </td>
    </tr>
    <tr>
    <td>

    <input type=text id=ledgername name=ledgername value="Caution deposit Hostel" onclick="this.select();curobj=this;" size=38>
    <br>Account Name <br>
    <select id=selectac name=selectac style="width:100%" onchange="ledgername.value=this.value;" size=5>
    XXX;

    $listarray=array(
    "Amount Payable",
    "Cash@Hand",
    "Imprest Account",
    "Caution Depsosit General",
    "Caution Deposit Hostel",
    "Emd/Security Deposit",
    "Hostel Rent",
    "TDS on Contracters",
    "TDS on Rent 15.45%",
    "TDS Salary IT",
    "Service Tax Consultancy @ 12.36%",
    "Service Tax Course Fee @ 12.36%",
    "Service Tax on Consultancy Service (Credit)",
    "Service Tax on Courses(Credit)",
    "TA Advance",
    "Temporary Advance",
    );

    foreach($listarray as $v){
    $selected = "";
    if ($v=="Caution Depsosit General")$selected = " Selected ";
    echo <<<XXX
    <option value="$v" $selected> $v</option>
    XXX;
    }

    echo <<<XXX
    </select>
    </td>

    <td>

    <input type=text id=groupname name=groupname value="Misc Receipts" onclick="this.select();curobj=this;" size=38>
    <br>Group Name <br>
    <select id=selectgp name=selectgp style="width:100%" onchange="groupname.value=this.value;" size=5>
    XXX;
    $listarray = Array(
    "IT TDS Contracters",
    "Fixed Assets",
    "Cash-in-Hand",
    "Deposits Received",
    "Loans & Advances (Asset)",
    "TATemp Advance",
    "Cost Value"
    );

    foreach($listarray as $v){
    $selected = "";
    if ($v=="Deposits Received")$selected = " Selected ";
    echo <<<XXX
    <option value="$v" $selected> $v</option>
    XXX;
    }

    echo <<<XXX
    </select>
    </td>
    </tr>
    <tr>
    <td>
    <input type=text id=vhrtype name=vhrtype value="" onclick="this.select();" size=38>
    <br>Vhr Type<br>
    <select size=6 name="selvhrtype" id="selvhrtype" style="width:100%" onchange="vhrtype.value=this.value;">

    XXX;
    $listarray = Array(
    "",
    "Receipt",
    "Payment",
    "Journal",
    "DD-Adj" ,
    "Contra" ,
    );




    foreach($listarray as $v){
    $selected = "";
    if ($v=="")$selected = " Selected ";
    echo <<<XXX
    <option value="$v" $selected> $v</option>
    XXX;
    }

    echo <<<XXX
    </select>
    </td>
    <td>
    <input type=text id=acttype name=acttype value="All Masters" onclick="this.select();" size=38>
    <br>Acct Type<br>
    <select size=6 name="selacttype" id="selacttype" style="width:100%" onchange="acttype.value=this.value;">

    XXX;
    $listarray = Array("All Masters",
    "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");

    foreach($listarray as $v){
    $selected = "";
    if ($v=="Ledgers")$selected = " Selected ";
    echo <<<XXX
    <option value="$v" $selected> $v</option>
    XXX;
    }

    echo <<<XXX
    </select>
    </td>
    </tr>
    <tr>
    <td colspan=2>
    <input type=submit value="Submit" style=" width:100%;height:60px;font-weight:bold;" id=btngen name=btngen >
    </tr>
    </table>

    <br> List of Accounts
    <div style="overflow:scroll;height:300px;width:500px;position:relative;top:25px;" >
    <br>
    <table border=1 cellpadding=3 cellspacing=3
    style = "border-collapse:collapse;" class=odbctable>
    XXX;
    $conn = odbc_pconnect( "DRIVER={Tally ODBC Driver};SERVER=(local);PORT=10000;" , "Abr" , "abr1967" ) or die(odbc_errormsg());
    $sql = 'select $_PrimaryGroup,$parent,$name from ledger order by $name';
    $tablestyle = 'class=odbctable cellpadding=4 cellspacing=4';
    $odbcresult = odbc_exec($conn, $sql) or die(odbc_errormsg());
    $i = 0;
    while( odbc_fetch_row( $odbcresult )){
    $primarygroup=odbc_result($odbcresult,1);
    $acname = odbc_result($odbcresult,3);
    if (!$primarygroup)$category = "Liability";
    else
    $category = $tallyprimarygroups[$primarygroup];
    $listacs[$i]["acname"]=$acname;
    $listacs[$i]["primarygroup"]=$primarygroup;
    $listacs[$i]["category"]=$category;
    $i++;
    }

    //////////////sorting the list
    foreach ($listacs as $key => $row) {
    $cat[$key] = $row["category"];
    $pri[$key] = $row["primarygroup"];
    $ac[$key] = $row["acname"];
    }
    array_multisort($cat, SORT_DESC,$pri, SORT_ASC,$ac, SORT_ASC, $listacs);
    ///////////////

    for($r=0;$r<$i;$r++){
    $acname=$listacs[$r]["acname"];
    $primarygroup=$listacs[$r]["primarygroup"];
    $category=$listacs[$r]["category"];
    switch($category){
    case "Liability":
    $bgcolor="#EEFF98";
    break;
    case "Asset":
    $bgcolor="#D2D6FF";
    break;

    case "Income":
    $bgcolor="#CEFFCE";
    break;

    case "Expense":
    $bgcolor="#FFD8D8";
    break;

    default:
    $bgcolor="white";
    }




    echo <<<XXX
    <tr bgcolor="$bgcolor" onmouseover="this.style.backgroundColor='yellow'" onmouseout="this.style.backgroundColor='$bgcolor';"
    onclick="curobj.value = ((this.children[0].innerText));" >
    <td>$acname</td>
    <td>$primarygroup</td>
    <td>$category</td>
    </tr>
    XXX;
    }
    /////list of groups

    echo <<<XXX
    </table>

    </div>

    <br><br><br>
    List of Groups
    <div style="overflow:scroll;height:300px;width:500px;position:relative;top:25px;" >
    <br>
    <table border=1 cellpadding=3 cellspacing=3
    style = "border-collapse:collapse;" class=odbctable>
    XXX;
    $conn = odbc_pconnect( "DRIVER={Tally ODBC Driver};SERVER=(local);PORT=10000;" , "" , "" ) or die(odbc_errormsg());
    $sql = 'select $_PrimaryGroup,$parent,$name from Groups order by $name';
    $tablestyle = 'class=odbctable cellpadding=4 cellspacing=4';
    $odbcresult = odbc_exec($conn, $sql) or die(odbc_errormsg());
    $i = 0;
    while( odbc_fetch_row( $odbcresult )){
    $primarygroup=odbc_result($odbcresult,1);
    $acname = odbc_result($odbcresult,3);
    if (!$primarygroup)$category = "Liability";
    else
    $category = $tallyprimarygroups[$primarygroup];
    $listacs[$i]["acname"]=$acname;
    $listacs[$i]["primarygroup"]=$primarygroup;
    $listacs[$i]["category"]=$category;
    $i++;
    }

    //////////////sorting the list
    foreach ($listacs as $key => $row) {
    $cat[$key] = $row["category"];
    $pri[$key] = $row["primarygroup"];
    $ac[$key] = $row["acname"];
    }
    array_multisort($cat, SORT_DESC,$pri, SORT_ASC,$ac, SORT_ASC, $listacs);
    ///////////////

    for($r=0;$r<$i;$r++){
    $acname=$listacs[$r]["acname"];
    $primarygroup=$listacs[$r]["primarygroup"];
    $category=$listacs[$r]["category"];
    switch($category){
    case "Liability":
    $bgcolor="#EEFF98";
    break;
    case "Asset":
    $bgcolor="#D2D6FF";
    break;

    case "Income":
    $bgcolor="#CEFFCE";
    break;

    case "Expense":
    $bgcolor="#FFD8D8";
    break;

    default:
    $bgcolor="white";
    }




    echo <<<XXX
    <tr bgcolor="$bgcolor" onmouseover="this.style.backgroundColor='yellow'" onmouseout="this.style.backgroundColor='$bgcolor';"
    onclick="curobj.value = ((this.children[0].innerText));" >
    <td>$acname</td>
    <td>$primarygroup</td>
    <td>$category</td>
    </tr>
    XXX;
    }

    odbc_close( $conn);
    ///
    echo <<<XXX
    </table>
    </div>
    </form>
    </body>
    </html>
    XXX;
    exit;
    }
    $curdate = $todate;
    $explodeflag="Yes";
    $explodealllevels="Yes";
    $dspexplvchnumber="Yes";
    $explodenum="Yes";
    $explodenarrflag="Yes";
    $accounttype="";
    $oldrepname = $repname;
    switch($repname)
    {
    case "Group Summary":
    case "Group Vouchers":
    case "Select Ledger Vouchers":
    case "Ledger Vouchers":
    $explodeflag="No";
    $explodealllevels="No";
    $dspexplvchnumber="No";
    $explodenarrflag="No";
    break;
    case "List of Accounts":
    $groupname="";
    $accounttype = "Ledgers";
    $explodeflag="No";
    $explodealllevels="No";
    $dspexplvchnumber="No";
    $explodenarrflag="No";
    break;
    case "List of Groups":
    $repname = "List of Accounts";
    $groupname="";
    $accounttype = "Groups";
    $explodeflag="No";
    $explodealllevels="No";
    $dspexplvchnumber="No";
    $explodenarrflag="No";
    break;
    case "Voucher Party Register":
    $repname = "Voucher Register";
    case "Voucher Register":
    case "Day Book":
    default:
    $explodeflag="Yes";
    $explodealllevels="Yes";
    $dspexplvchnumber="Yes";
    $explodenum="Yes";
    $explodenarrflag="Yes";
    }


    $sendXML=<<<XXX
    <ENVELOPE>
    <HEADER>
    <TALLYREQUEST>Export Data</TALLYREQUEST>
    </HEADER>
    <BODY>
    <EXPORTDATA>
    <REQUESTDESC>
    <REPORTNAME >$repname</REPORTNAME>
    <STATICVARIABLES>
    XXX;

    $sendXML .= '<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>';
    $sendXML .= <<<XXX
    <ACCOUNTTYPE>$acttype</ACCOUNTTYPE>
    <LedgerName>$ledgername</LedgerName>
    <GroupName>$groupname</GroupName>
    <SVLedgerName>$ledgername</SVLedgerName>

    <DSPVCHTYPE>$vhrtype</DSPVCHTYPE>
    <VoucherTypeName >$vhrtype</VoucherTypeName>
    <SVVoucherType>$vhrtype</SVVoucherType>


    <Filtered type="bool">No</Filtered>
    <FamilyVoucherFlag type="bool">yes</FamilyVoucherFlag>
    <ParentIsMenu>No</ParentIsMenu>
    <DSPNameStyle>@@NS_AliasName</DSPNameStyle>
    <DSPWithOpening type="bool">yes</DSPWithOpening>
    <DSPShowOpening type="bool">yes</DSPShowOpening>
    <DSPShowClosing type="bool">yes</DSPShowClosing>
    <DayBookFilter> </DayBookFilter>
    <SVAccounts type="bool">yes</SVAccounts>
    <DSPShowTrans type="bool">yes</DSPShowTrans>
    <DSPShowMonthly type="bool">No</DSPShowMonthly>

    <Date type="date">$curdate</Date>
    <DSPVCHDATE type="date">$todate</DSPVCHDATE>
    <DyBkFromDate type="date">$fromdate</DyBkFromDate>
    <DyBkToDate type="date">$todate</DyBkToDate>
    <SVFromDate type="date">$fromdate</SVFromDate>
    <SVToDate type="date">$todate</SVToDate>
    <SVCurrentDate type="date">$curdate</SVCurrentDate>
    <SVCurDate type="date">$curdate</SVCurDate>




    <IsLedgerWise type="bool">yes</IsLedgerWise>
    <IsGrpBkup type="bool">yes</IsGrpBkup>

    <ExplodeFlag type="bool">$explodeflag</ExplodeFlag>
    <ExplodeAllLevels type="bool">$explodealllevels</ExplodeAllLevels>
    <DSPEXPLVCHNUMBER type="bool">$dspexplvchnumber</DSPEXPLVCHNUMBER>
    <ExplodeVNum type="bool">$explodenum</ExplodeVNum>
    <ExplodeNarrFlag type="bool">$explodenarrflag</ExplodeNarrFlag>
    <Accounttype>$accounttype</Accounttype>
    XXX;
    /*

    <VOUCHERTYPENAME>BP CA 10401158037</VOUCHERTYPENAME>
    <VOUCHERNUMBER>639</VOUCHERNUMBER>
    <CLASSNAME>BP CA</CLASSNAME>

    $sendXML .='
    <IFLTCombine>$$SysName:EndOfList</IFLTCombine>

    <IFLTType>Vouchers</IFLTType>
    <METHODTYPE>Vouchers</METHODTYPE>

    <IFLTMethod>having </IFLTMethod>

    <IFLTMethodName>Ledger Amount</IFLTMethodName>

    <IFLTAttr>iseqto</IFLTAttr>

    <IFLTAttrValue>1000</IFLTAttrValue>';



    */
    $sendXML .= <<<XXX
    </STATICVARIABLES>
    </REQUESTDESC>
    </EXPORTDATA>
    </BODY>
    </ENVELOPE>
    XXX;





    /*

    <SVDateStyle>dd/mm/yyyy</SVDateStyle>
    <SVDateSeparator>-</SVDateSeparator>
    <SVExportLanguage>Multilingual</SVExportLanguage>


    <usermethodname>amount=1000</usermethodname>
    <Filter>usermethodname</Filter>
    <MethodAttribute>Amount</MethodAttribute>
    <AttributeValue>1000</AttributeValue>
    <MethodName>IsEqTo</MethodName>
    <IFLTAttrValue>1000</IFLTAttrValue>
    <IFLTAttr>Amount</IFLTAttr>
    <IFLTMethodName>IsEqTo</IFLTMethodName>


    $sendXML = '
    <ENVELOPE>
    <HEADER>
    <TALLYREQUEST>Export Data</TALLYREQUEST>
    </HEADER>
    <BODY>
    <EXPORTDATA>
    <REQUESTDESC>
    <REPORTNAME >List of Accounts</REPORTNAME>
    <STATICVARIABLES><SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>

    </STATICVARIABLES>
    </REQUESTDESC>

    </EXPORTDATA>
    </BODY>
    </ENVELOPE>







    ';
    */







    $curl = curl_init("http://localhost:10000/");

    //curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.2a) Gecko/20021021");
    //curl_setopt($curl, CURLOPT_URL,$url); // set url to post to
    //curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7'));

    //$curl = curl_init("http://localhost/cheque/CurlReceipt.php");

    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept-Charset:UTF-8'));
    $contentarray = array("content-type:text/xml;charset:UTF-8");
    curl_setopt($curl, CURLOPT_HTTPHEADER, $contentarray);
    curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $sendXML); // post the xml
    curl_setopt($curl, CURLOPT_TIMEOUT, 300000); // set timeout in seconds
    curl_setopt($curl,CURLOPT_ENCODING,"UTF-8");
    $xmlstr = curl_exec ($curl);
    if (!$xmlstr) die("No Response from tally: Curl");
    // var_dump(curl_getinfo($curl, CURLINFO_CONTENT_TYPE));
    curl_close ($curl);

    //
    //echo '<?xml-stylesheet type="text/xsl" href="TallyVoucher.xsl"? >';
    //$xmlstr = '<?xml version="1.0" encoding="UTF-8" ? >' . $xmlresponse;


    $xmlstr= str_ireplace( ".LIST", "LIST", $xmlstr);
    $xmlstr= str_ireplace( "UDF:", "UDF", $xmlstr);
    $xml = simplexml_load_string($xmlstr);
    //echo $xml;
    if (!$xml) die("No Response from tally: simplexml");
    //$debugstr = "";
    //$debugmode = 1;
    if (isset($debugmode) )
    {
    $debugstr = <<<XXX
    <textarea cols=50 rows=20 style="background-Color:#C3FFE4;">$sendXML</textarea>
    <textarea cols=50 rows=20 style="background-Color:#FFFBB9;" >$xmlstr</textarea>
    XXX;
    }

    echo <<<XXX
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Tally Voucher View</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="generator" content="HAPedit 3.1">

    <style>
    input{
    font-size:9pt;
    }

    table{
    font-size: 9pt;

    }

    td{
    border:1px Solid Red;
    }
    .rgtbox{
    text-align: right;
    }

    </style>


    </head>
    <body >

    $debugstr

    XXX;

    echo <<<XXX
    <h3>$repname: for the Period From : $fromdate to $todate </h3> <br>
    <table align=center border=1
    cellpadding = 3
    cellspacing = 3
    style="border-collapse:collapse;border:1px solid black;">

    XXX;

    switch($oldrepname)
    {
    case "Group summary":
    gpsum();

    break;
    //case "Group Vouchers":
    //case "ledger Vouchers":
    case "Voucher Register":
    case "Day Book":
    voucherview();
    break;

    case "Voucher Party Register":
    voucherpartyview();
    break;

    case "Trial Balance":
    tbal();
    break;
    case "List of Accounts":
    case "List of Groups":
    acgplist();
    break;
    default:
    ledgerview();
    }

    echo "</table>";

    //echo "<pre>";
    //print_r($xml);
    //echo "</pre>";


    echo <<<XXX
    </body>
    </html>
    XXX;
    @ob_end_flush();
    function voucherview(){
    global $xml,$ledgername,$filterac,$totals;

    echo <<<XXX
    <thead>
    <tr bgcolor="#FFDC8C">
    <th>AcName</th>
    <th>Vhr Date</th>
    <th>Vhr Type</th>
    <th>Vhr No</th>
    <th>Narration</th>
    <th>Debit</th>
    <th>Credit</th>
    </tr>
    </thead>
    XXX;


    $cnt = count($xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE);

    for( $i=0; $i< $cnt; $i++){
    $totdr=$totcr=0;
    $vhrdate = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->DATE;
    $vhrtype = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->VOUCHERTYPENAME;




    if (strstr($vhrtype,"Bank Receipt")!==false){
    $vhrtype = "BR";
    }

    if (strstr($vhrtype,"CR")!==false){
    $vhrtype = "CR";
    }

    if (strstr($vhrtype,"DD Adj")!==false){
    $vhrtype = "DD";
    }

    if (strstr($vhrtype,"Cash Payment")!==false){
    $vhrtype = "CP";
    }

    if (strstr($vhrtype,"Imprest Payment")!==false){
    $vhrtype = "CP";
    }

    if (strstr($vhrtype,"WDL")!==false){
    $vhrtype = "WDL";
    }

    if (strstr($vhrtype,"Imprest Payment")!==false){
    $vhrtype = "IP";
    }

    if (strstr($vhrtype,"BP")!==false){
    $vhrtype = "BP";
    }
    if (strstr($vhrtype,"Journal")!==false){
    $vhrtype = "JV";
    }
    if (strstr($vhrtype,"Contra")!==false){
    $vhrtype = "CV";
    }

    if (strstr($vhrtype,"Deposit")!==false){
    $vhrtype = "DP";
    }

    $vhrno = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->VOUCHERNUMBER;
    $vhrcommnarr = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->NARRATION;
    $vhrdate = substr($vhrdate,6,2) ."-" . substr($vhrdate,4,2) ."-" .substr($vhrdate,0,4);
    $linecnt = count($xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST);
    $cheqinfavourof = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->BASICVOUCHERCHEQUENAME;

    for($r=0;$r<$linecnt; $r++){
    $vhrnarration =$ddstr="";
    $vhrlinenarr = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->NARRATION;
    $account = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->LEDGERNAME;
    $ispositive = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->ISDEEMEDPOSITIVE;
    $amount = floatval($xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->AMOUNT);
    $stupartyname = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFSTUDENTNAMELIST->UDFSTUDENTNAME;
    $dddt = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDDT->UDFMYDDDT;
    $issby = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDISSUEDBY->UDFMYDDISSUEDBY;
    $drawnon = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDDRAWNON->UDFMYDDDRAWNON;
    $ddno = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDDNO->UDFMYDDNO;
    $dddt = substr($dddt,6,2) ."-" . substr($dddt,4,2) ."-" .substr($dddt,0,4);

    $ddstr = "$ddno $dddt $drawnon $issby";


    $debit=$credit=0;

    if (trim(strtoupper($ispositive))=="YES"){
    if ($amount > 0){
    $debit = 0;$credit = $amount+0;
    }
    else{
    $debit = $amount+0;$credit = 0;
    }
    }
    else
    {
    if ($amount > 0){
    $debit = 0;$credit = $amount+0;
    }
    else{
    $debit = $amount+0;$credit = 0;
    }
    }

    $debit = -1*$debit;
    $totdr+=$debit+0;
    $totcr+=$credit+0;

    $vhrnarration = $stupartyname . "-". $vhrlinenarr . "/" . $vhrcommnarr ."-" . $cheqinfavourof . "-" . $ddstr;
    //$vhrnarration = $vhrcommnarr;;//$vhrlinenarr;
    $vhrnarration = $vhrlinenarr;

    $rowstr = <<<XXX
    <tr>
    <td>$account</td>
    <td>$vhrdate</td>
    <td>$vhrtype</td>
    <td>$vhrno</td>
    <td>$vhrnarration - $vhrlinenarr </td>
    <td class=rgtbox>$debit</td>
    <td class=rgtbox>$credit</td>
    </tr>
    XXX;

    if (isset($filterac) && (trim(strtoupper($ledgername)) !== trim(strtoupper($account)))){
    $rowstr = "";
    }
    echo $rowstr;



    $ispositive = "";
    }
    if (isset($totals)){
    echo <<<XXX
    <tr bgcolor="#FBDFFF">
    <td ></td>
    <td >Total</td>
    <td ></td>
    <td ></td>
    <td ></td>
    <td class=rgtbox>$totdr</td>
    <td class=rgtbox>$totcr</td>
    </tr>
    XXX;
    }
    }
    }//function end


    function voucherpartyview(){
    global $xml,$ledgername,$filterac,$totals;

    echo <<<XXX
    <thead>
    <tr bgcolor="#FFDC8C">
    <th>AcName</th>
    <th>Vhr Date</th>
    <th>Vhr Type</th>
    <th>Vhr No</th>
    <th>Line No</th>
    <th>Party</th>
    <th>Narration</th>
    <th>Debit</th>
    <th>Credit</th>
    </tr>
    </thead>
    XXX;


    $cnt = count($xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE);
    $oldvhrtype=""; $oldvhrno = 0; $vhrlineno = 1;
    for( $i=0; $i< $cnt; $i++){
    $totdr=$totcr=0;
    $vhrdate = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->DATE;
    $vhrtype = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->VOUCHERTYPENAME;
    /*
    Bank Receipt
    BP AICTE SDP SB 31053633522
    BP CA 10401158037
    Cash Payment
    Contra
    CR (Cash in Hand)
    Credit Note
    DD Adj
    Debit Note
    Delivery Note
    Deposit Into CA 10401158037
    Imprest Payment
    IS Diploma 30234012950
    ISTGO 30036877828
    Journal
    Memorandum
    Minority Grant Payment
    M.Tech AICTE GIA Payment 30046196075
    Payment
    Physical Stock
    Purchase
    Purchase Order
    Receipt
    Receipt Note
    Rejections In
    Rejections Out
    Reversing Journal
    Sales
    Sales Order
    Stock Journal
    WDL for Imprest
    WDL From CA to Cash in Hand
    Wdl From CA to TR Imprest
    */



    $vhrno = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->VOUCHERNUMBER;
    $vhrcommnarr = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->NARRATION;
    $vhrdate = substr($vhrdate,6,2) ."-" . substr($vhrdate,4,2) ."-" .substr($vhrdate,0,4);
    $linecnt = count($xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST);
    $cheqinfavourof = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->BASICVOUCHERCHEQUENAME;
    $stname = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->UDFSTUDENTNAMELIST->UDFSTUDENTNAME;
    for($r=0;$r<$linecnt; $r++){
    $vhrnarration =$ddstr="";
    $vhrlinenarr = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->NARRATION;
    $account = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->LEDGERNAME;
    $ispositive = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->ISDEEMEDPOSITIVE;
    $amount = floatval($xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->AMOUNT);
    $stupartyname = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFSTUDENTNAMELIST->UDFSTUDENTNAME;
    $dddt = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDDT->UDFMYDDDT;
    $issby = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDISSUEDBY->UDFMYDDISSUEDBY;
    $drawnon = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDDRAWNON->UDFMYDDDRAWNON;
    $ddno = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->VOUCHER->ALLLEDGERENTRIESLIST[$r]->UDFMYDDDNO->UDFMYDDNO;
    $dddt = substr($dddt,6,2) ."-" . substr($dddt,4,2) ."-" .substr($dddt,0,4);

    $ddstr = "$ddno $dddt $drawnon $issby";


    $debit=$credit=0;

    if (trim(strtoupper($ispositive))=="YES"){
    if ($amount > 0){
    $debit = 0;$credit = $amount+0;
    }
    else{
    $debit = $amount+0;$credit = 0;
    }
    }
    else
    {
    if ($amount > 0){
    $debit = 0;$credit = $amount+0;
    }
    else{
    $debit = $amount+0;$credit = 0;
    }
    }

    $debit = -1*$debit;
    $totdr+=$debit+0;
    $totcr+=$credit+0;

    $vhrnarration = $vhrlinenarr . "/" . $vhrcommnarr ."-" . $cheqinfavourof . "-" . $ddstr;
    if ($stupartyname == "" || is_null($stupartyname)) $stupartyname = $stname;
    $vhrnarration = $vhrcommnarr;;
    $rowstr = <<<XXX
    <tr>
    <td>$account</td>
    <td>$vhrdate</td>
    <td>$vhrtype</td>
    <td>$vhrno</td>
    <td>$vhrlineno</td>
    <td>$stupartyname</td>
    <td>$vhrnarration $vhrlinenarr</td>

    <td class=rgtbox>$debit</td>
    <td class=rgtbox>$credit</td>
    </tr>
    XXX;




    //


    //if (($vhrtype != $oldvhrtype) && ($vhrno != $oldvhrno)) {
    //$oldvhrtype=$vhrtype; $oldvhrno = $vhrno;$vhrlineno = 1;
    //}
    //else{
    //same voucher but line is different
    //$vhrlineno++;
    //}




    $stname = mysql_real_escape_string($stname);
    $vhrnarration = mysql_real_escape_string($vhrnarration);
    $debit = (!is_numeric($debit))?0:$debit;
    $credit = (!is_numeric($credit))?0:$credit;

    /*$insertsql = <<<XXX
    insert into monthlyreport.tallyledger1011
    (
    acgpname,
    vhrdate,
    vhrtype,
    vhrno,
    vhrline,
    party,
    narration,
    debit,
    credit
    )
    values
    (
    "$account", str_to_date("$vhrdate", "%d-%m-%Y"),"$vhrtype", "$vhrno",$r, "$stupartyname", "$vhrnarration", $debit, $credit)
    on duplicate key update acgpname = "$account", party="$stupartyname" , narration = "$vhrnarration", debit=$debit,credit=$credit
    XXX;
    //mysql_query($insertsql) or die("Error in updating - : $insertsql - " . mysql_error());
    ///
    */

    if (isset($filterac) && (trim(strtoupper($ledgername)) !== trim(strtoupper($account)))){
    $rowstr = "";
    }
    echo $rowstr;



    $ispositive = "";
    }
    if (isset($totals)){
    echo <<<XXX
    <tr bgcolor="#FBDFFF">
    <td ></td>
    <td >Total</td>
    <td ></td>
    <td ></td>
    <td ></td>
    <td ></td>
    <td class=rgtbox>$totdr</td>
    <td class=rgtbox>$totcr</td>
    </tr>
    XXX;
    }
    }
    }//function end






    function ledgerview(){
    global $xml;
    echo <<<XXX
    <tr bgcolor="#FFDC8C">
    <th>Vhr Date</th>
    <th>Vhr Type</th>
    <th>Vhr No</th>
    <th>Narration</th>
    <th>Debit</th>
    <th>Credit</th>
    </tr>
    XXX;
    $cnt = count($xml->DSPVCHTYPE);

    for( $i=0; $i< $cnt; $i++){

    $vhrdate = $xml->DSPVCHDATE[$i];
    $vhrtype = $xml->DSPVCHTYPE[$i];
    $vhrno = $xml->DSPEXPLVCHNUMBER[$i];
    $vhrnarration = $xml->VCHLEDNARREXPLOSION[$i] . $xml->VCHLEDNARR[$i]. $xml->DSPVCHLEDNARR[$i] . $xml->DSPVCHNARR[$i];
    $debit = $xml->DSPVCHDRAMT[$i];
    $credit = $xml->DSPVCHCRAMT[$i];

    echo <<<XXX
    <tr>
    <td>$vhrdate</td>
    <td>$vhrtype</td>
    <td>$vhrno</td>
    <td>$vhrnarration</td>
    <td class=rgtbox>$debit</td>
    <td class=rgtbox>$credit</td>
    </tr>
    XXX;
    }
    }

    function tbal(){
    global $xml;
    echo <<<XXX

    <tr bgcolor="#FFDC8C">
    <th>AcGpName</th>
    <th>OpDr</th>
    <th>OpCr</th>
    <th>Debit</th>
    <th>Credit</th>
    <th>ClDr</th>
    <th>ClCr</th>


    </tr>
    XXX;
    $cnt = count($xml->DSPACCNAME);
    for( $i=0; $i< $cnt; $i++){
    $accname = $xml->DSPACCNAME[$i]->DSPDISPNAME;
    $opdr = $xml->DSPACCINFO[$i]->DSPOPAMT->DSPOPAMTA;
    $opcr = 0;
    $debit = $xml->DSPACCINFO[$i]->DSPDRAMT->DSPDRAMTA;
    $credit = $xml->DSPACCINFO[$i]->DSPCRAMT->DSPCRAMTA;
    $cldr = $xml->DSPACCINFO[$i]->DSPCLDRAMT->DSPCLDRAMTA;
    $clcr = $xml->DSPACCINFO[$i]->DSPCLCRAMT->DSPCLCRAMTA;
    /*<DSPACCNAME><DSPDISPNAME>6h Pay Arrears Receivable</DSPDISPNAME></DSPACCNAME>

    <DSPACCINFO><DSPCLDRAMT><DSPCLDRAMTA/>
    </DSPCLDRAMT><DSPCLCRAMT><DSPCLCRAMTA>3973050.00</DSPCLCRAMTA>
    </DSPCLCRAMT></DSPACCINFO>

    <DSPACCINFO>

    <DSPOPAMT>
    <DSPOPAMTA>56718571.00</DSPOPAMTA>
    </DSPOPAMT>

    <DSPDRAMT>
    <DSPDRAMTA>-319290.00</DSPDRAMTA>
    </DSPDRAMT>

    <DSPCRAMT>
    <DSPCRAMTA/>
    </DSPCRAMT>

    <DSPCLAMT>
    <DSPCLAMTA>56399281.00</DSPCLAMTA>
    </DSPCLAMT>

    </DSPACCINFO>


    */



    echo <<<XXX
    <tr>
    <td>$accname</td>
    <td class=rgtbox>$opdr</td>
    <td class=rgtbox>$opcr</td>
    <td class=rgtbox>$debit</td>
    <td class=rgtbox>$credit</td>
    <td class=rgtbox>$cldr</td>
    <td class=rgtbox>$clcr</td>
    </tr>
    XXX;
    }
    }

    function gpsum(){
    global $xml,$groupname;
    echo <<<XXX
    <thead>
    <tr bgcolor="#FFDC8C">
    <th>Sl</th>
    <th>Group : $groupname</th>
    <th>Op Dr</th>
    <th>Op Cr</th>
    <th>Dr</th>
    <th>Cr</th>
    <th>CB Dr</th>
    <th>CB Cr</th>
    <th>CB Net</th>
    </tr>
    </thead>
    XXX;

    $cnt = count($xml->DSPACCNAME);

    $totobdr = $totobcr = $totdr = $totcr = $totcbdr = $totcbcr = $totcb = 0;
    for( $i=0; $i< $cnt; $i++){
    $gpname = $xml->DSPACCNAME[$i]->DSPDISPNAME;
    $ob = $xml->DSPACCINFO[$i]->DSPOPAMT->DSPOPAMTA;
    if ($ob < 0){$obdr = $ob; $obcr=0;}
    else {$obcr = $ob; $obdr=0;}
    $dr = $xml->DSPACCINFO[$i]->DSPDRAMT->DSPDRAMTA;
    $cr = $xml->DSPACCINFO[$i]->DSPCRAMT->DSPCRAMTA;
    $cb = $xml->DSPACCINFO[$i]->DSPCLAMT->DSPCLAMTA;
    if ($cb < 0){$cbcr = $cb; $cbdr=0;}
    else{$cbdr = $cb; $cbcr=0;}
    $totobdr += $obdr;
    $totobcr += $obcr;
    $totdr += $dr;
    $totcr += $cr;
    $totcbdr += $cbdr;
    $totcbcr += $cbcr;
    $totcb += $cb;
    $sl = $i+1;
    echo <<<XXX
    <tr bgcolor="#FFDC8C">
    <td class=rgtbox>$sl</td>
    <td>$gpname</td>
    <td class=rgtbox >$obdr</td>
    <td class=rgtbox >$obcr</td>
    <td class=rgtbox >$dr</td>
    <td class=rgtbox >$cr</td>
    <td class=rgtbox >$cbdr</td>
    <td class=rgtbox >$cbcr</td>
    <td class=rgtbox >$cb</td>
    </tr>
    XXX;
    }

    $totobdr += 0;
    $totobcr += 0;
    $totdr += 0;
    $totcr += 0;
    $totcbdr += 0;
    $totcbcr += 0;
    $totcb += 0;



    echo <<<XXX
    <tr bgcolor="#FFDC8C">
    <td></td>
    <td>Total</td>
    <td class=rgtbox >$totobdr</td>
    <td class=rgtbox >$totobcr</td>
    <td class=rgtbox >$totdr</td>
    <td class=rgtbox >$totcr</td>
    <td class=rgtbox >$totcbdr</td>
    <td class=rgtbox >$totcbcr</td>
    <td class=rgtbox >$totcb</td>
    </tr>
    XXX;
    }

    function acgplist(){
    global $xml;

    $cnt = count($xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE);
    echo $cnt;
    echo <<<XXX
    <thead>
    <tr bgcolor="#FFDC8C">
    <th>Sl</th>
    <th>AcGpName</th>
    </tr>
    </thead>
    XXX;
    for( $i=0; $i< $cnt; $i++){
    $acgpname = $xml->BODY->IMPORTDATA->REQUESTDATA->TALLYMESSAGE[$i]->GROUP->LANGUAGENAMELIST->NAMELIST->NAME;
    $sl=$i+1;
    echo <<<XXX
    <tr>
    <td>$sl</td>
    <td>$acgpname</td>
    </tr>
    XXX;
    }
    }


    ?>
     


  3. A.Baradharajan

    A.Baradharajan New Member


    Actually I get the report names (in your case it may be voucher register) - First simply by exporting the report from tally in xml format and studying the exported xml - since lack of detailed documentation about the xml interaction - we should become like a sherlock holmes and also to search several sites forums etc
     


  4. A.Baradharajan

    A.Baradharajan New Member


    Basically php xml tally integration is required in my org for publishing the contents in intranet and import mysql voucher/cheque (receipt/payment) data - it works - normally - but when tally version changed - some new tags becomes mandatory - our php file may not work - again we have to do a lot of research to make our php file to work. If tallysolutions - themselves addresses these problems and built in facility to publish data/report dynamically in their software - once for all - this problem will end.
     


  5. gopi

    gopi New Member


    Hi Baradharajan, if you don't mind request you to share your contact details, in my organization we are working tally integration, I would like to understand your exp on this.
     


  6. Maulik Patel

    Maulik Patel Active Member


    Dear Gopi,

    This is not a marketing site, its a knowledge forum. Kindly do not post such kind of messages over here.
     


  7. gopi

    gopi New Member


    Dear Maulik -- I am sorry, if my message is giving a different meaning. I am not asking for business or trying to get business from this site. We have tally in our organization and we are working on integration with other 3rd party java application. I just thought to check with people who has already integrated tally with other application.
     
    Pritam Krishna likes this.


  8. A.Baradharajan

    A.Baradharajan New Member


    Dear friends, Basically I am not a software professional (perhaps you may classify me as a hobbyist ?!) - I am a Finance Professional - I feel, This forum is for sharing our experience/problems for mutual benefit. We will interact thru' this forum - We will enrich this forum - this will help all of us. Please understand my point.

    The php file above and so many other such php and other files to interact/publish/import/export data to& from tally has been created over a long period by me from various websites forums etc. The file "as such" may not be of much help to any body - you have to study the logic and customize it to your needs.Whenever, Tally undergoes a major version change - some mandatory tags are introduced - our files may not work - we have to do a lot of research - exporting the xml from tally comparing it with the php generated xml - to find a solution.

    More over, as a finance professional -(our staff are not software experts) - I feel "Tally" has already undergone a lot of positive changes in integration capabilities - but still miles to go. Optimal solution from "MY PROFESSIONAL SIDE" - "Tally Company" should take the right steps to understand - by feed back from users having both finance and software knowledge and address the problems at least in the next/future versions.

    Thanks
     


  9. B Patil

    B Patil New Member


    Rightly Said A. Baradharajan. Tally version Change is always a nightmare for Tally Integrators and TDL Developers. I have been doing TDL since long and know a lot more who would agree to my worries when there is a version change. We always advice out customer to test newer version in another PC in educational mode, if they are using Customized modules.
     


  10. saranfca

    saranfca New Member


    After reading above conversation I think you may solve my problem. I have exported a report from tally in xml and imported the xml in excel andwhen I am trying to export the xml it is giving error of List in list, and denormalised. ow to solve it please suggest. I am also a finance professional. Thanks
     


  11. A.Baradharajan

    A.Baradharajan New Member



    what is the exact issue ? I am unable to understand ? Please Expalin in Detail saranfca
     


  12. narayana

    narayana New Member


    Dear Saranfca , i completed my tally integration with PHP that project is over ,i created xml file and i uloaded to php application , please explain your issue basically i am not a TDL developer if i under stand your issue sure i will help you
     


  13. s.srini

    s.srini New Member



  14. NAGARAJKMAR SUBRAMANIAN

    NAGARAJKMAR SUBRAMANIAN Active Member



  15. dhiraj

    dhiraj New Member


    Thanks for the program... How and where to use that program file....
     


  16. Vaidy

    Vaidy New Member


    I am trying to extract GST Sales Voucher from an application using PHP and import to Tally. Can you please let me know if your solution can be customized to meet this requirement? If so if you can share the program (vaidyag@yahoo.com) will try to work on the customization. Thanks and Regards
     


  17. Mehul Parmar

    Mehul Parmar New Member


    i have done all integration
    i have done sales,payment,receipt entry from web application in php
    it is working all fine in localhost
    but when i upload on live server it is not connecting with tally over internet
    kindly help me if anybody has solution
    i am ready to pay
     


  18. medhagopinath

    medhagopinath New Member


    got any solution ? if No pls contact me 8943022933 Gopinath, think I can help you
     


  19. teja varma

    teja varma Active Member


    because tally is running on localhost with so your web application must be in localhost in order to communicate with tally
    so it doesn't work on live or remote server because tally is not in your ip range
    if you want to integrate tally with your live server try Xml http request in tally
     
    yugal agarwal likes this.


  20. Sudhir83411

    Sudhir83411 New Member


    Hi
    I have a doubt about XML tags

    For Detailed Group voucher export by using PHP ... I am using < EXPLODEFLAG>YES< /EXPLODEFLAG> ...XML TAG.
    upload_2019-10-8_11-52-26.png

    Which XML tag should I use for F12->"Show all ledger Details" in Group voucher report

    upload_2019-10-8_11-51-18.png
     
    saravanan1999 likes this.


  21. teja varma

    teja varma Active Member


    you need to set variable DSPShowAllLedgers to Yes by modifying the report in you request
     


  22. Ramprasad

    Ramprasad New Member


    Hi,

    Wish to export purchase register in Pivot format ( upload_2019-10-12_18-45-5.png ), through PHP. Kindly suggest changes to the below TDL

    The below code generates report in Voucher format. But I require in Pivot format
    <?php
    $requestXML = '<ENVELOPE>'.
    '<HEADER>'.
    '<TALLYREQUEST>Export Data</TALLYREQUEST>'.
    '</HEADER>'.
    '<BODY>'.
    '<EXPORTDATA>'.
    '<REQUESTDESC>'.
    '<STATICVARIABLES>'.
    '<SVCURRENTCOMPANY>****</SVCURRENTCOMPANY>'.
    '<SVFROMDATE TYPE="Date">01-SEP-2019</SVFROMDATE>'.
    '<SVTODATE TYPE="Date">30-SEP-2019</SVTODATE>'.
    '<VOUCHERTYPENAME>Purchases</VOUCHERTYPENAME>'.
    '<EXPLODEFLAG>Yes</EXPLODEFLAG>'.
    '<DBINVEXPLODEFLAG>Yes</DBINVEXPLODEFLAG>'.
    '<SVEXPORTFORMAT>$$SysName:HTML</SVEXPORTFORMAT>'.
    '</STATICVARIABLES>'.
    '<REPORTNAME>Voucher Register</REPORTNAME>'.
    '</REQUESTDESC>'.
    '</EXPORTDATA>'.
    '</BODY>'.
    '</ENVELOPE>';
     


Share This Page