From: <tim...@us...> - 2010-11-05 10:45:51
|
Revision: 4139 http://web-erp.svn.sourceforge.net/web-erp/?rev=4139&view=rev Author: tim_schofield Date: 2010-11-05 10:45:43 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Poul Bjerre-Jensen: SelectProduct.php,PurchData.php. Add in Minimum order quantity to Purchasing data Modified Paths: -------------- trunk/PurchData.php trunk/SelectProduct.php trunk/doc/Change.log.html Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2010-11-04 06:17:56 UTC (rev 4138) +++ trunk/PurchData.php 2010-11-05 10:45:43 UTC (rev 4139) @@ -1,6 +1,13 @@ <?php +/************************************************************/ +/*To deploy this revised version take the following steps: */ +/*1. Add field called MinOrderQty as Int to purchdata */ +/*2. Copy this code on top of the standard PurchData.php */ +/*3. Copy the revised SelectProduct.php over the existing */ +/* pbj 11/3/2010 */ +/************************************************************/ -/* $Id$*/ +/* $Id: PurchData.php 3952 2010-09-30 15:22:14Z tim_schofield $*/ $PageSecurity = 4; @@ -53,6 +60,11 @@ unset($_POST['LeadTime']); prnMsg(_('The lead time entered was not numeric') . ' (' . _('a number is expected') . ') - ' . _('no changes have been made to the database'), 'error'); } + if (!is_numeric($_POST['MinOrderQty'])) { + $InputError = 1; + unset($_POST['LeadTime']); + prnMsg(_('The lead time entered was not numeric') . ' (' . _('a number is expected') . ') - ' . _('no changes have been made to the database'), 'error'); + } if (!is_numeric($_POST['ConversionFactor'])) { $InputError = 1; unset($_POST['ConversionFactor']); @@ -68,6 +80,7 @@ supplierdescription, suppliers_partno, leadtime, + MinOrderQty, preferred) VALUES ('" . $SupplierID . "', '" . $StockID . "', @@ -78,6 +91,7 @@ '" . $_POST['SupplierDescription'] . "', '" . $_POST['SupplierCode'] . "', '" . $_POST['LeadTime'] . "', + '" . $_POST['MinOrderQty'] . "', '" . $_POST['Preferred'] . "')"; $ErrMsg = _('The supplier purchasing details could not be added to the database because'); $DbgMsg = _('The SQL that failed was'); @@ -93,6 +107,7 @@ supplierdescription='" . $_POST['SupplierDescription'] . "', suppliers_partno='" . $_POST['SupplierCode'] . "', leadtime='" . $_POST['LeadTime'] . "', + MinOrderQty='" . $_POST['MinOrderQty'] . "', preferred='" . $_POST['Preferred'] . "' WHERE purchdata.stockid='".$StockID."' AND purchdata.supplierno='".$SupplierID."' @@ -114,6 +129,7 @@ unset($_POST['LeadTime']); unset($_POST['Preferred']); unset($_POST['SupplierCode']); + unset($_POST['MinOrderQty']); unset($SuppName); } } @@ -140,6 +156,7 @@ purchdata.supplierdescription, purchdata.leadtime, purchdata.suppliers_partno, + purchdata.MinOrderQty, purchdata.preferred FROM purchdata INNER JOIN suppliers ON purchdata.supplierno=suppliers.supplierid @@ -159,6 +176,7 @@ <th>' . _('Currency') . '</th> <th>' . _('Effective From') . '</th> <th>' . _('Supplier Unit') . '</th> + <th>' . _('Min Order Qty') . '</th> <th>' . _('Lead Time') . '</th> <th>' . _('Preferred') . '</th> </tr>'; @@ -186,11 +204,12 @@ <td>%s</td> <td>%s</td> <td>%s</td> + <td>%s</td> <td class=number>%s " . _('days') . "</td> <td>%s</td> <td><a href='%s?%s&StockID=%s&SupplierID=%s&Edit=1&EffectiveFrom=%s'>" . _('Edit') . "</a></td> <td><a href='%s?%s&StockID=%s&SupplierID=%s&Delete=1&EffectiveFrom=%s' onclick=\"return confirm('" . _('Are you sure you wish to delete this suppliers price?') . "');\">" . _('Delete') . "</a></td> - </tr>", $myrow['suppname'], number_format($myrow['price'], 3), $myrow['currcode'], ConvertSQLDate($myrow['effectivefrom']), $myrow['unitname'], $myrow['leadtime'], $DisplayPreferred, $_SERVER['PHP_SELF'], SID, $StockID, $myrow['supplierno'], $myrow['effectivefrom'], $_SERVER['PHP_SELF'], SID, $StockID, $myrow['supplierno'], $myrow['effectivefrom']); + </tr>", $myrow['suppname'], number_format($myrow['price'], 3), $myrow['currcode'], ConvertSQLDate($myrow['effectivefrom']), $myrow['unitname'],$myrow['MinOrderQty'], $myrow['leadtime'], $DisplayPreferred, $_SERVER['PHP_SELF'], SID, $StockID, $myrow['supplierno'], $myrow['effectivefrom'], $_SERVER['PHP_SELF'], SID, $StockID, $myrow['supplierno'], $myrow['effectivefrom']); } //end of while loop echo '</table><br/>'; if ($CountPreferreds > 1) { @@ -257,7 +276,7 @@ suppliers.address1, suppliers.address2, suppliers.address3 - FROM suppliers WHERE suppliers.suppname " . LIKE ."'%" . $SearchString . "%'"; + FROM suppliers WHERE suppliers.suppname LIKE " ."'".$SearchString."'"; } elseif (strlen($_POST['SupplierCode']) > 0) { $SQL = "SELECT suppliers.supplierid, suppliers.suppname, @@ -345,6 +364,7 @@ purchdata.leadtime, purchdata.conversionfactor, purchdata.suppliers_partno, + purchdata.MinOrderQty, purchdata.preferred, stockmaster.units FROM purchdata INNER JOIN suppliers @@ -366,6 +386,7 @@ $_POST['LeadTime'] = $myrow['leadtime']; $_POST['ConversionFactor'] = $myrow['conversionfactor']; $_POST['Preferred'] = $myrow['preferred']; + $_POST['MinOrderQty'] = $myrow['MinOrderQty']; $_POST['SupplierCode'] = $myrow['suppliers_partno']; $stockuom=$myrow['units']; } @@ -409,6 +430,9 @@ if (!isset($_POST['SupplierCode'])) { $_POST['SupplierCode'] = ''; } + if (!isset($_POST['MinOrderQty'])) { + $_POST['MinOrderQty'] = ''; + } echo '<tr><td>' . _('Currency') . ':</td> <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> @@ -438,6 +462,8 @@ <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 VALUE=' . $_POST['ConversionFactor'] . '></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> <td><input type=text name="SupplierCode" maxlength=15 size=15 VALUE="' . $_POST['SupplierCode'] . '"></td></tr>'; + echo '<tr><td>' . _('MinOrderQty') . ':</td> + <td><input type=text name="MinOrderQty" maxlength=15 size=15 VALUE="' . $_POST['MinOrderQty'] . '"></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> <td><input type=text name="SupplierDescription" maxlength=50 size=51 VALUE="' . $_POST['SupplierDescription'] . '"></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2010-11-04 06:17:56 UTC (rev 4138) +++ trunk/SelectProduct.php 2010-11-05 10:45:43 UTC (rev 4139) @@ -1,5 +1,5 @@ <?php -/* $Id$*/ +/* $Id: SelectProduct.php 3971 2010-09-30 15:27:57Z tim_schofield $*/ $PageSecurity = 2; $PricesSecurity = 12; include ('includes/session.inc'); @@ -321,6 +321,7 @@ <th width="5%">' . _('Curr') . '</th> <th width="15%">' . _('Eff Date') . '</th> <th width="10%">' . _('Lead Time') . '</th> + <th width="10%">' . _('Min Order Qty') . '</th> <th width="5%">' . _('Prefer') . '</th></tr>'; $SuppResult = DB_query("SELECT suppliers.suppname, suppliers.currcode, @@ -329,6 +330,7 @@ purchdata.effectivefrom, purchdata.leadtime, purchdata.conversionfactor, + purchdata.MinOrderQty, purchdata.preferred FROM purchdata INNER JOIN suppliers ON purchdata.supplierno=suppliers.supplierid @@ -339,7 +341,9 @@ <td class=select>' . number_format($SuppRow['price'] / $SuppRow['conversionfactor'], 2) . '</td> <td class=select>' . $SuppRow['currcode'] . '</td> <td class=select>' . ConvertSQLDate($SuppRow['effectivefrom']) . '</td> - <td class=select>' . $SuppRow['leadtime'] . '</td>'; + <td class=select>' . $SuppRow['leadtime'] . '</td> + <td class=select>' . $SuppRow['MinOrderQty'] . '</td>'; + switch ($SuppRow['preferred']) { /* 2008-08-19 ToPu */ case 1: Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-11-04 06:17:56 UTC (rev 4138) +++ trunk/doc/Change.log.html 2010-11-05 10:45:43 UTC (rev 4139) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/11/10 Poul Bjerre-Jensen: SelectProduct.php,PurchData.php. Add in Minimum order quantity to Purchasing data</p> <p>02/11/10 Tim: SelectCustomer.php. Correction to work with debtors that have a - in the code</p> <p>31/10/10 Tim: SuppTransGLAnalysis.php. Minor bug fixes</p> <p>31/10/10 Tim: SuppTransGLAnalysis.php. Force the user to select a GL account code instaed of defaulting to first on the list</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |