|
From: <te...@us...> - 2012-04-14 07:55:13
|
Revision: 5244
http://web-erp.svn.sourceforge.net/web-erp/?rev=5244&view=rev
Author: tehonu
Date: 2012-04-14 07:55:06 +0000 (Sat, 14 Apr 2012)
Log Message:
-----------
Ricard: Adding stock category as filter for selection in TopItems.php
Modified Paths:
--------------
trunk/TopItems.php
trunk/doc/Change.log
Modified: trunk/TopItems.php
===================================================================
--- trunk/TopItems.php 2012-04-14 02:23:19 UTC (rev 5243)
+++ trunk/TopItems.php 2012-04-14 07:55:06 UTC (rev 5244)
@@ -47,6 +47,34 @@
}
echo '</select></td>
</tr>';
+
+ // stock category selection
+ $SQL="SELECT categoryid,
+ categorydescription
+ FROM stockcategory
+ ORDER BY categorydescription";
+ $result1 = DB_query($SQL,$db);
+
+ echo '<tr>
+ <td width="150">' . _('In Stock Category') . ' </td>
+ <td>:</td>
+ <td><select name="StockCat">';
+ if (!isset($_POST['StockCat'])){
+ $_POST['StockCat']='All';
+ }
+ if ($_POST['StockCat']=='All'){
+ echo '<option selected="selected" value="All">' . _('All') . '</option>';
+ } else {
+ echo '<option value="All">' . _('All') . '</option>';
+ }
+ while ($myrow1 = DB_fetch_array($result1)) {
+ if ($myrow1['categoryid']==$_POST['StockCat']){
+ echo '<option selected="selected" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>';
+ } else {
+ echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>';
+ }
+ }
+
//view order by list to display
echo '<tr>
<td width="150">' . _('Select Order By ') . ' </td>
@@ -60,12 +88,12 @@
echo '<tr>
<td>' . _('Number Of Days') . ' </td>
<td>:</td>
- <td><input class="number" tabindex="3" type="text" name="NumberOfDays" size="8" maxlength="8" value="0" /></td>
+ <td><input class="number" tabindex="3" type="text" name="NumberOfDays" size="8" maxlength="8" value="30" /></td>
</tr>';
//view number of NumberOfTopItems items
echo '<tr>
<td>' . _('Number Of Top Items') . ' </td><td>:</td>
- <td><input class="number" tabindex="4" type="text" name="NumberOfTopItems" size="8" maxlength="8" value="1" /></td>
+ <td><input class="number" tabindex="4" type="text" name="NumberOfTopItems" size="8" maxlength="8" value="100" /></td>
</tr>
<tr>
<td></td>
@@ -104,6 +132,10 @@
$SQL = $SQL . " AND debtorsmaster.typeid = '" . $_POST['Customers'] . "'";
}
+ if ($_POST['StockCat'] != 'All') {
+ $SQL = $SQL . " AND stockmaster.categoryid = '" . $_POST['StockCat'] . "'";
+ }
+
$SQL = $SQL . " GROUP BY salesorderdetails.stkcode
ORDER BY " . $_POST['Sequence'] . " DESC
LIMIT " . filter_number_format($_POST['NumberOfTopItems']);
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2012-04-14 02:23:19 UTC (rev 5243)
+++ trunk/doc/Change.log 2012-04-14 07:55:06 UTC (rev 5244)
@@ -1,4 +1,5 @@
webERP Change Log
+14/04/2012 Ricard: Adding stock category as filter for selection in TopItems.php
12/4/2012 TurboPT: Replaced table row bgcolor [or style=background-color] with the appropriate css class.
11/4/2012 Ricard: Code simplified on TopItems.php
7/4/2012 TurboPT: Remove invalid attribute colspan found within table tag elements.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|