From: <te...@us...> - 2014-09-05 01:17:20
|
Revision: 6863 http://sourceforge.net/p/web-erp/reponame/6863 Author: tehonu Date: 2014-09-05 01:17:11 +0000 (Fri, 05 Sep 2014) Log Message: ----------- Added condition "not create demand for discontinued items". Seems not reasonable to create a demand for obsolete items. Modified Paths: -------------- trunk/MRPCreateDemands.php Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2014-09-05 00:55:09 UTC (rev 6862) +++ trunk/MRPCreateDemands.php 2014-09-05 01:17:11 UTC (rev 6863) @@ -68,6 +68,7 @@ AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' " . $WhereLocation . " " . $WhereCategory . " + AND stockmaster.discontinued = 0 AND salesorders.quotation=0 GROUP BY salesorderdetails.stkcode"; //echo "<br />$sql<br />"; |
From: <te...@us...> - 2015-09-30 08:31:14
|
Revision: 7361 http://sourceforge.net/p/web-erp/reponame/7361 Author: tehonu Date: 2015-09-30 08:31:12 +0000 (Wed, 30 Sep 2015) Log Message: ----------- Allow selection of several stock categories Modified Paths: -------------- trunk/MRPCreateDemands.php Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2015-09-28 00:57:25 UTC (rev 7360) +++ trunk/MRPCreateDemands.php 2015-09-30 08:31:12 UTC (rev 7361) @@ -46,10 +46,6 @@ prnMsg($msg,'error'); } - $WhereCategory = " "; - if ($_POST['CategoryID']!='All') { - $WhereCategory = " AND stockmaster.categoryid ='" . $_POST['CategoryID'] . "' "; - } $WhereLocation = " "; if ($_POST['Location']!='All') { $WhereLocation = " AND salesorders.fromstkloc ='" . $_POST['Location'] . "' "; @@ -67,7 +63,7 @@ WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) ."' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' " . $WhereLocation . " - " . $WhereCategory . " + AND stockmaster.categoryid IN ('". implode("','",$_POST['Categories'])."') AND stockmaster.discontinued = 0 AND salesorders.quotation=0 GROUP BY salesorderdetails.stkcode"; @@ -210,6 +206,26 @@ echo '<option value="' . $myrow['mrpdemandtype'] . '">' . $myrow['mrpdemandtype'] . ' - ' .$myrow['description'] . '</option>'; } //end while loop echo '</select></td></tr>'; + +echo '<tr> + <td>' . _('Inventory Categories') . ':</td> + <td><select autofocus="autofocus" required="required" minlength="1" size="12" name="Categories[]"multiple="multiple">'; + $SQL = 'SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription'; + $CatResult = DB_query($SQL); + while ($MyRow = DB_fetch_array($CatResult)) { + if (isset($_POST['Categories']) AND in_array($MyRow['categoryid'], $_POST['Categories'])) { + echo '<option selected="selected" value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] .'</option>'; + } else { + echo '<option value="' . $MyRow['categoryid'] . '">' . $MyRow['categorydescription'] . '</option>'; + } + } + echo '</select> + </td> + </tr>'; + +/* echo '<tr><td>' . _('Inventory Category') . ':</td> <td><select name="CategoryID">'; echo '<option selected="selected" value="All">' . _('All Stock Categories') . '</option>'; @@ -222,6 +238,7 @@ } //end while loop echo '</select></td> </tr>'; +*/ echo '<tr><td>' . _('Inventory Location') . ':</td> <td><select name="Location">'; echo '<option selected="selected" value="All">' . _('All Locations') . '</option>'; |
From: <te...@us...> - 2015-09-30 12:36:54
|
Revision: 7362 http://sourceforge.net/p/web-erp/reponame/7362 Author: tehonu Date: 2015-09-30 12:36:52 +0000 (Wed, 30 Sep 2015) Log Message: ----------- Clean up commented lines Modified Paths: -------------- trunk/MRPCreateDemands.php Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2015-09-30 08:31:12 UTC (rev 7361) +++ trunk/MRPCreateDemands.php 2015-09-30 12:36:52 UTC (rev 7362) @@ -225,20 +225,6 @@ </td> </tr>'; -/* -echo '<tr><td>' . _('Inventory Category') . ':</td> - <td><select name="CategoryID">'; -echo '<option selected="selected" value="All">' . _('All Stock Categories') . '</option>'; -$sql = "SELECT categoryid, - categorydescription - FROM stockcategory"; -$result = DB_query($sql); -while ($myrow = DB_fetch_array($result)) { - echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' .$myrow['categorydescription'] . '</option>'; -} //end while loop -echo '</select></td> - </tr>'; -*/ echo '<tr><td>' . _('Inventory Location') . ':</td> <td><select name="Location">'; echo '<option selected="selected" value="All">' . _('All Locations') . '</option>'; |