[Weberp-svn] SF.net SVN: weberp:[9416] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-07-13 09:42:40
|
Revision: 9416 http://weberp.svn.sourceforge.net/weberp/?rev=9416&view=rev Author: tim_schofield Date: 2012-07-13 09:42:28 +0000 (Fri, 13 Jul 2012) Log Message: ----------- Ricard: Flag on locations to allow (or deny) internal stock requests from that location. Modified Paths: -------------- trunk/InternalStockRequest.php trunk/Locations.php Added Paths: ----------- trunk/sql/mysql/updates/142.php Modified: trunk/InternalStockRequest.php =================================================================== --- trunk/InternalStockRequest.php 2012-07-13 08:27:23 UTC (rev 9415) +++ trunk/InternalStockRequest.php 2012-07-13 09:42:28 UTC (rev 9416) @@ -186,6 +186,7 @@ $sql="SELECT loccode, locationname FROM locations + WHERE internalrequest = 1 ORDER BY locationname"; $result=DB_query($sql, $db); Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2012-07-13 08:27:23 UTC (rev 9415) +++ trunk/Locations.php 2012-07-13 09:42:28 UTC (rev 9416) @@ -52,7 +52,8 @@ email='" . $_POST['Email'] . "', contact='" . $_POST['Contact'] . "', taxprovinceid = '" . $_POST['TaxProvince'] . "', - managed = '" . $_POST['Managed'] . "' + managed = '" . $_POST['Managed'] . "', + internalrequest = '" . $_POST['InternalRequest'] . "' WHERE loccode = '" . $SelectedLocation . "'"; $ErrMsg = _('An error occurred updating the') . ' ' . $SelectedLocation . ' ' . _('location record because'); @@ -76,6 +77,7 @@ unset($_POST['Managed']); unset($SelectedLocation); unset($_POST['Contact']); + unset($_POST['InternalRequest']); } elseif ($InputError !=1) { @@ -87,6 +89,13 @@ $_POST['Managed'] = 0; } + /* Set the InternalRequest field to 1 if it is checked, otherwise 0 */ + if($_POST['InternalRequest'] == 'Yes') { + $_POST['InternalRequest'] = 1; + } else { + $_POST['InternalRequest'] = 0; + } + /*SelectedLocation is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Location form */ $sql = "INSERT INTO locations ( @@ -103,8 +112,8 @@ email, contact, taxprovinceid, - managed - ) + managed, + internalrequest) VALUES ( '" . $_POST['LocCode'] . "', '" . $_POST['LocationName'] . "', @@ -119,8 +128,8 @@ '" . $_POST['Email'] . "', '" . $_POST['Contact'] . "', '" . $_POST['TaxProvince'] . "', - '" . $_POST['Managed'] . "' - )"; + '" . $_POST['Managed'] . "', + '" . $_POST['InternalRequest'] . "')"; $ErrMsg = _('An error occurred inserting the new location record because'); $DbgMsg = _('The SQL used to insert the location record was'); @@ -162,6 +171,7 @@ unset($_POST['Managed']); unset($SelectedLocation); unset($_POST['Contact']); + unset($_POST['InternalRequest']); } @@ -399,7 +409,8 @@ email, taxprovinceid, cashsalecustomer, - managed + managed, + internalrequest FROM locations WHERE loccode='" . $SelectedLocation . "'"; @@ -421,6 +432,7 @@ $_POST['TaxProvince'] = $myrow['taxprovinceid']; $_POST['CashSaleCustomer'] = $myrow['cashsalecustomer']; $_POST['Managed'] = $myrow['managed']; + $_POST['InternalRequest'] = $myrow['internalrequest']; echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; @@ -511,6 +523,20 @@ } echo '</select></td></tr>'; + echo '<tr> + <td>' . _('Allow internal requests?') . ':</td> + <td><select name="InternalRequest">'; + if ($_POST['InternalRequest']==1){ + echo '<option selected="selected" value="1">' . _('Yes') . '</option>'; + } else { + echo '<option value="1">' . _('Yes') . '</option>'; + } + if ($_POST['InternalRequest']==0){ + echo '<option selected="selected" value="0">' . _('No') . '</option>'; + } else { + echo '<option value="0">' . _('No') . '</option>'; + } + /* This functionality is not written yet ... <tr><td><?php echo _('Enable Warehouse Management') . ':'; ?></td> Added: trunk/sql/mysql/updates/142.php =================================================================== --- trunk/sql/mysql/updates/142.php (rev 0) +++ trunk/sql/mysql/updates/142.php 2012-07-13 09:42:28 UTC (rev 9416) @@ -0,0 +1,9 @@ +<?php + +// Add a field in stockmaster to record the last time the category was changed. + +AddColumn('internalrequest', 'locations', 'TINYINT( 4 )', 'NOT NULL', '1', 'managed', $db); + +UpdateDBNo(basename(__FILE__, '.php'), $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |