From: <lin...@us...> - 2010-02-20 11:28:28
|
Revision: 3354 http://web-erp.svn.sourceforge.net/web-erp/?rev=3354&view=rev Author: lindsayh Date: 2010-02-20 11:28:20 +0000 (Sat, 20 Feb 2010) Log Message: ----------- Fix InsertSalesInvoice to return a value always, and also to return the invoice number generated. InsertSalesCredit always returns a value now. And updated the InsertSalesInvoice description now that I see how it works! Modified Paths: -------------- trunk/api/api_debtortransactions.php trunk/api/api_xml-rpc.php trunk/doc/Change.log.html Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2010-02-20 07:24:11 UTC (rev 3353) +++ trunk/api/api_debtortransactions.php 2010-02-20 11:28:20 UTC (rev 3354) @@ -369,7 +369,10 @@ $Errors[0] = DatabaseUpdateFailed; } else { $Errors[0]=0; + // Return invoice number too + $Errors[] = $InvoiceDetails['transno']; } + return $Errors; } else { return $Errors; } @@ -478,6 +481,7 @@ } else { $Errors[0]=0; } + return $Errors; } else { return $Errors; } Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2010-02-20 07:24:11 UTC (rev 3353) +++ trunk/api/api_xml-rpc.php 2010-02-20 11:28:20 UTC (rev 3354) @@ -1007,11 +1007,20 @@ $Description = _('Inserts a sales invoice into the debtortrans table and does the relevant GL entries'); $Parameter[0]['name'] = _('Invoice Details'); - $Parameter[0]['description'] = _('An array of index/value items describing the invoice.'); + $Parameter[0]['description'] = _('An array of index/value items describing the invoice.') + ._('The field names can be found ').'<a href="../../Z_DescribeTable.php?table=debtortrans">'._('here ').'</a>' + ._('and are case sensitive. ')._('The values should be of the correct type, and the api will check them before updating the database. ') + ._('The transno key is generated by this call, and if a value is supplied, it will be ignored. ') + ._('Two additional fields are required. "partcode" needs to be a genuine part number, though it appears to serve no real purpose. ') + ._('"salesarea" also is required, though again it appears to serve no useful purpose. ') + ._('It is not necessary to include all the fields in this parameter, the database default value will be used if the field is not given.'); $Parameter[1]['name'] = _('User name'); $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 integers. ') + ._('If the first element is zero then the function was successful, and the second element is the invoice number. ') + ._('Otherwise an array of error codes is returned and no insertion takes place. '); /*E*/ $InsertSalesInvoice_sig = array(array($xmlrpcStruct,$xmlrpcStruct), /*x*/ array($xmlrpcStruct,$xmlrpcStruct,$xmlrpcString,$xmlrpcString)); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-20 07:24:11 UTC (rev 3353) +++ trunk/doc/Change.log.html 2010-02-20 11:28:20 UTC (rev 3354) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>20/02/10 Lindsay: Bug fix and better description for API functions for SalesInvoiceEntry/Modify</p> <p>19/02/10 Lindsay: Bug fixing to make SalesOrder entry work for old and new API.</p> <p>18/02/10 Lindsay: API: date formatting in api_salesorders.php; added FormatDateWithTimeForSQL function to includes/DateFunctions.inc <p>16/02/10 Pak Ricard: New Petty cash module</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |