From: <ex...@us...> - 2014-06-20 17:55:51
|
Revision: 6762 http://sourceforge.net/p/web-erp/reponame/6762 Author: exsonqu Date: 2014-06-20 17:55:43 +0000 (Fri, 20 Jun 2014) Log Message: ----------- 21/06/14 Exson: Add location check in StockAdjustments.php to prevent from users selecting controlled items based on one location but changed the location before submit it to server which make serial not exist check absolutely failed. Modified Paths: -------------- trunk/StockAdjustments.php Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2014-06-19 14:56:16 UTC (rev 6761) +++ trunk/StockAdjustments.php 2014-06-20 17:55:43 UTC (rev 6762) @@ -86,6 +86,9 @@ } if (isset($_POST['StockLocation'])){ + if($_SESSION['Adjustment' . $identifier]->StockLocation != $_POST['StockLocation']){/* User has changed the stock location, so the serial no must be validated again */ + $_SESSION['Adjustment' . $identifier]->SerialItems = array(); + } $_SESSION['Adjustment' . $identifier]->StockLocation = $_POST['StockLocation']; }else{ if(empty($_SESSION['Adjustment' . $identifier]->StockLocation)){ @@ -105,6 +108,9 @@ } if($_POST['Quantity'] != 0){//To prevent from serilised quantity changing to zero $_SESSION['Adjustment' . $identifier]->Quantity = filter_number_format($_POST['Quantity']); + if(count($_SESSION['Adjustment' . $identifier]->SerialItems) == 0 AND $_SESSION['Adjustment' . $identifier]->Controlled == 1 ){/* There is no quantity available for controlled items */ + $_SESSION['Adjustment' . $identifier]->Quantity = 0; + } } if(isset($_GET['OldIdentifier'])){ $_SESSION['Adjustment'.$identifier]->StockLocation=$_SESSION['Adjustment'.$_GET['OldIdentifier']]->StockLocation; |