From: <dai...@us...> - 2012-06-04 04:10:12
|
Revision: 5426 http://web-erp.svn.sourceforge.net/web-erp/?rev=5426&view=rev Author: daintree Date: 2012-06-04 04:10:05 +0000 (Mon, 04 Jun 2012) Log Message: ----------- tax api fixes for POS Modified Paths: -------------- trunk/api/api_stock.php trunk/api/api_taxgroups.php trunk/api/api_xml-rpc.php Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2012-06-04 03:49:24 UTC (rev 5425) +++ trunk/api/api_stock.php 2012-06-04 04:10:05 UTC (rev 5426) @@ -530,8 +530,7 @@ $Errors[0]=NoAuthorisation; return $Errors; } - $sql="SELECT stockid, - description + $sql="SELECT stockid FROM stockmaster WHERE " . $Field ." LIKE '%".$Criteria."%'"; $result = DB_Query($sql, $db); Modified: trunk/api/api_taxgroups.php =================================================================== --- trunk/api/api_taxgroups.php 2012-06-04 03:49:24 UTC (rev 5425) +++ trunk/api/api_taxgroups.php 2012-06-04 04:10:05 UTC (rev 5426) @@ -90,12 +90,23 @@ } $sql = "SELECT * FROM taxauthorities WHERE taxid='".$TaxAuthority."'"; $result = DB_query($sql, $db); - return DB_fetch_array($result); + $i=0; + while ($myrow=DB_fetch_array($result)){ + $Answer[$i]['taxcatid'] = $myrow['taxcatid']; + $Answer[$i]['dispatchtaxprovince'] = $myrow['dispatchtaxprovince']; + $Answer[$i]['taxrate'] = $myrow['taxrate']; + } + $Errors[0]=0; + $Errors[1]=$Answer; + return $Errors; } -/* This function takes as a parameter a tax authority id - * and returns an array containing the rate of tax fpr the selected - * tax authority. + +/ + +/* This function takes as a parameter a tax authority id and a tax category id + * and returns an array containing the rate of tax for the selected + * tax authority and tax category */ function GetTaxAuthorityRates($TaxAuthority, $User, $Password) { @@ -105,9 +116,10 @@ $Errors[0]=NoAuthorisation; return $Errors; } - $sql = "SELECT * FROM taxauthrates WHERE taxauthority='".$TaxAuthority."'"; + $sql = "SELECT taxcatid, dispatchtaxprovince, taxrate FROM taxauthrates WHERE taxauthority='".$TaxAuthority."' AND taxcatid='" . $TaxCatID . "'"; $result = DB_query($sql, $db); - return DB_fetch_array($result); + $TaxRateRow = DB_fetch_row($result); + return $TaxRateRow[0]; } Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-06-04 03:49:24 UTC (rev 5425) +++ trunk/api/api_xml-rpc.php 2012-06-04 04:10:05 UTC (rev 5426) @@ -1862,6 +1862,7 @@ return $rtn; } + unset($Description); unset($Parameter); unset($ReturnValue); @@ -1953,7 +1954,7 @@ $Parameter[1]['description'] = _('A valid weberp username. This user should have security access to this data.'); $Parameter[2]['name'] = _('User password'); $Parameter[2]['description'] = _('The weberp password associated with this user name. '); - $ReturnValue[0] = _('This function returns an array of tax authority tax rates.'); + $ReturnValue[0] = _('This function returns the tax rates for the authority.'); /*E*/$GetTaxAuthorityRates_sig = array(array($xmlrpcStruct,$xmlrpcString), /*x*/ array($xmlrpcStruct,$xmlrpcString,$xmlrpcString,$xmlrpcString)); @@ -1963,8 +1964,8 @@ ob_start('ob_file_callback'); /*x*/ if ($xmlrpcmsg->getNumParams() == 3) { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetTaxAuthorityRates($xmlrpcmsg->getParam( 0 )->scalarval( ), -/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), -/*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ))) ); +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ) )) ); /*x*/ } else { /*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetTaxAuthorityRates($xmlrpcmsg->getParam( 0 )->scalarval( ), '', ''))); /*x*/ } @@ -2009,7 +2010,7 @@ $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); $Parameter[1]['name'] = _('User password'); $Parameter[1]['description'] = _('The weberp password associated with this user name. '); - $ReturnValue[0] = _('This function returns an array of customer types.'); + $ReturnValue[0] = _('This function returns an array of customer types'); /*E*/ $GetCustomerTypeList_sig = array(array($xmlrpcStruct), /*x*/ array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); @@ -3246,6 +3247,10 @@ "function" => "xmlrpc_GetTaxgroupList", "signature" => $GetTaxgroupList_sig, "docstring" => $GetTaxgroupList_doc), + "weberp.xmlrpc_GetTaxCategoryList" => array( + "function" => "xmlrpc_GetTaxCategoryList", + "signature" => $GetTaxCategoryList_sig, + "docstring" => $GetTaxCategoryList_doc), "weberp.xmlrpc_GetTaxgroupDetails" => array( "function" => "xmlrpc_GetTaxgroupDetails", "signature" => $GetTaxgroupDetails_sig, @@ -3262,10 +3267,10 @@ "function" => "xmlrpc_GetTaxAuthorityDetails", "signature" => $GetTaxAuthorityDetails_sig, "docstring" => $GetTaxAuthorityDetails_doc), - "weberp.xmlrpc_GetTaxAuthorityRates" => array( - "function" => "xmlrpc_GetTaxAuthorityRates", - "signature" => $GetTaxAuthorityRates_sig, - "docstring" => $GetTaxAuthorityRates_doc), + "weberp.xmlrpc_GetTaxAuthorityRate" => array( + "function" => "xmlrpc_GetTaxAuthorityRate", + "signature" => $GetTaxAuthorityRate_sig, + "docstring" => $GetTaxAuthorityRate_doc), "weberp.xmlrpc_GetCustomerTypeList" => array( "function" => "xmlrpc_GetCustomerTypeList", "signature" => $GetCustomerTypeList_sig, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |