From: <Ex...@us...> - 2012-02-17 03:32:38
|
Revision: 4918 http://web-erp.svn.sourceforge.net/web-erp/?rev=4918&view=rev Author: ExsonQu Date: 2012-02-17 03:32:32 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Fixed bugs which leads to can credit GRNs without no invoiced quantity or quantity invoiced to become negative. Report by Crag. Fixed bug change logical operator from AND to OR on chgPrice judgment condition. Modified Paths: -------------- branches/stable/SuppCreditGRNs.php Modified: branches/stable/SuppCreditGRNs.php =================================================================== --- branches/stable/SuppCreditGRNs.php 2012-02-17 03:27:51 UTC (rev 4917) +++ branches/stable/SuppCreditGRNs.php 2012-02-17 03:32:32 UTC (rev 4918) @@ -35,9 +35,16 @@ $InputError=False; $Complete = False; + // Validate Credit Quantity to prevent from credit quantity more than quantity invoiced + if (!is_numeric(filter_number_format($_POST['This_QuantityCredited'])) + or ($_POST['Prev_QuantityInv'] - filter_number_format($_POST['This_QuantityCredited']))<0){ + $InputError = True; + prnMsg(_('The credit quantity is not numeric or the quantity to credit is more that quantity invoiced') . '. ' . _('The goods received cannot be credited by this quantity'),'error'); + } + if (!is_numeric(filter_number_format($_POST['ChgPrice'])) - AND filter_number_format($_POST['ChgPrice'])<0){ + or filter_number_format($_POST['ChgPrice'])<0){ $InputError = True; prnMsg(_('The price charged in the suppliers currency is either not numeric or negative') . '. ' . _('The goods received cannot be credited at this price'),'error'); @@ -317,4 +324,4 @@ } //end if there were GRNs to select echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |