| 
      
      
      From: <ex...@us...> - 2016-07-22 05:00:50
      
     | 
| Revision: 7571
          http://sourceforge.net/p/web-erp/reponame/7571
Author:   exsonqu
Date:     2016-07-22 05:00:47 +0000 (Fri, 22 Jul 2016)
Log Message:
-----------
22/07/16 Exson: Make items search limited to the sales orders and if search result is 1 show the result immediately in SelectSalesOrder.php
Modified Paths:
--------------
    trunk/SelectSalesOrder.php
    trunk/doc/Change.log
Modified: trunk/SelectSalesOrder.php
===================================================================
--- trunk/SelectSalesOrder.php	2016-07-22 00:46:50 UTC (rev 7570)
+++ trunk/SelectSalesOrder.php	2016-07-22 05:00:47 UTC (rev 7571)
@@ -530,6 +530,7 @@
 		<tr>
       		<td>' . _('Select a stock category') . ':
       			<select name="StockCat">';
+		echo '<option value="All">' . _('All') . '</option>';
 
 	while ($myrow1 = DB_fetch_array($result1)) {
 		echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>';
@@ -552,7 +553,7 @@
 		<br />';
 
 if (isset($StockItemsResult)
-	AND DB_num_rows($StockItemsResult)>0) {
+	AND DB_num_rows($StockItemsResult)>1) {
 
 	echo '<table cellpadding="2" class="selection">';
 	echo '<tr>
@@ -592,6 +593,10 @@
 }
 //end if stock search results to show
   else {
+	 if (isset($StockItemsResult) AND DB_num_rows($StockItemsResult) == 1) {
+		 $mystkrow = DB_fetch_array($StockItemsResult);
+		 $SelectedStockItem = $mystkrow['stockid'];
+	 }
 
 	//figure out the SQL required from the inputs available
 	if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){
@@ -880,9 +885,12 @@
 				   stockmaster.decimalplaces,
 				   SUM(locstock.quantity) AS qoh,
 				   stockmaster.units
-			  FROM stockmaster INNER JOIN locstock
+			FROM salesorderdetails INNER JOIN stockmaster
+				ON salesorderdetails.stkcode = stockmaster.stockid AND completed=0
+			INNER JOIN locstock
 			  ON stockmaster.stockid=locstock.stockid";
-	if (isset($_POST['StockCat']) AND trim($_POST['StockCat'])==''){
+	if (isset($_POST['StockCat']) 
+		AND ((trim($_POST['StockCat']) == '') OR $_POST['StockCat'] == 'All')){
 		 $WhereStockCat = '';
 	} else {
 		 $WhereStockCat = " AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ";
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log	2016-07-22 00:46:50 UTC (rev 7570)
+++ trunk/doc/Change.log	2016-07-22 05:00:47 UTC (rev 7571)
@@ -1,4 +1,6 @@
 webERP Change Log
+
+22/07/16 Exson: Make items search limited to the sales orders and if search result is 1 show the result immediately in SelectSalesOrder.php
 22/07/16 Exson: Add empty check for internal request to avoid empty request creating in InternalStockRequest.php.
 09/07/16 Exson: Fixed the utf8 character print incorrect of pdf file in class.pdf.php.
 08/07/16 Exson: Fixed the transaction atomicity bug by change table lock to row lock in SQL_CommonFunctions.inc.
 |