From: <dai...@us...> - 2011-08-31 10:15:11
|
Revision: 4672 http://web-erp.svn.sourceforge.net/web-erp/?rev=4672&view=rev Author: daintree Date: 2011-08-31 10:15:04 +0000 (Wed, 31 Aug 2011) Log Message: ----------- Ricard: StockAdjustments.php now sends an email to the inventory manager on the creation of manual stock adjustments. The inventory manager email is defined in SystemParameters.php - leaving the email address blank will stop any emails from being created. Modified Paths: -------------- trunk/StockAdjustments.php trunk/SystemParameters.php trunk/doc/Change.log trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/StockAdjustments.php 2011-08-31 10:15:04 UTC (rev 4672) @@ -64,9 +64,15 @@ '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (mb_strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description FROM stockmaster WHERE description " . LIKE . " '%" . $_POST['StockText'] ."%'"; + $sql="SELECT stockid, + description + FROM stockmaster + WHERE description " . LIKE . " '%" . $_POST['StockText'] ."%'"; } else { - $sql="SELECT stockid, description FROM stockmaster WHERE stockid " . LIKE . " '%" . $_POST['StockCode'] ."%'"; + $sql="SELECT stockid, + description + FROM stockmaster + WHERE stockid " . LIKE . " '%" . $_POST['StockCode'] ."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); @@ -302,8 +308,15 @@ $Result = DB_Txn_Commit($db); - prnMsg( _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity,'success'); + $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity ; + prnMsg( $ConfirmationText,'success'); + if ($_SESSION['InventoryManagerEmail']!=''){ + $ConfirmationText = $ConfirmationText . ' ' . _('by user') . ' ' . $_SESSION['UserID'] . ' ' . _('at') . ' ' . Date('Y-m-d H:i:s'); + $EmailSubject = _('Stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID; + mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText); + } + unset ($_SESSION['Adjustment']); } /* end if there was no input error */ @@ -352,9 +365,10 @@ number_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; } -echo '<tr><td>'. _('Adjustment to Stock At Location').':</td><td><select name="StockLocation"> '; +echo '<tr><td>'. _('Adjustment to Stock At Location').':</td> + <td><select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Adjustment']->StockLocation)){ Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/SystemParameters.php 2011-08-31 10:15:04 UTC (rev 4672) @@ -84,6 +84,9 @@ }elseif (!IsEmailAddress($_POST['X_PurchasingManagerEmail'])){ $InputError = 1; prnMsg(_('The Purchasing Manager Email address does not appear to be valid'),'error'); + }elseif (!IsEmailAddress($_POST['X_InventoryManagerEmail']) AND $_POST['X_InventoryManagerEmail']!=''){ + $InputError = 1; + prnMsg(_('The Inventory Manager Email address does not appear to be valid'),'error'); }elseif (mb_strlen($_POST['X_FrequentlyOrderedItems']) > 2 || !is_numeric($_POST['X_FrequentlyOrderedItems'])) { $InputError = 1; prnMsg(_('The number of frequently ordered items to display must be numeric'),'error'); @@ -275,6 +278,9 @@ if ($_SESSION['PurchasingManagerEmail'] != $_POST['X_PurchasingManagerEmail']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_PurchasingManagerEmail'] . "' WHERE confname='PurchasingManagerEmail'"; } + if ($_SESSION['InventoryManagerEmail'] != $_POST['X_InventoryManagerEmail']){ + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_InventoryManagerEmail'] . "' WHERE confname='InventoryManagerEmail'"; + } if ($_SESSION['AutoCreateWOs'] != $_POST['X_AutoCreateWOs']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_AutoCreateWOs'] . "' WHERE confname='AutoCreateWOs'"; } @@ -1017,7 +1023,11 @@ <td><input type="text" name="X_PurchasingManagerEmail" size=50 maxlength=50 value="' . $_SESSION['PurchasingManagerEmail'] . '"></td> <td>' . _('The email address for the purchasing manager, used to receive notifications by the tendering system') .'</td></tr>'; +echo '<tr style="outline: 1px solid"><td>' . _('Inventory Manager Email Address') . ':</td> + <td><input type="text" name="X_InventoryManagerEmail" size=50 maxlength=50 value="' . $_SESSION['InventoryManagerEmail'] . '"></td> + <td>' . _('The email address for the inventory manager, where notifications of all manual stock adjustments created are sent by the system. Leave blank if no emails should be sent to the factory manager for manual stock adjustments') .'</td></tr>'; + echo '</table> <br /><div class="centre"><input type="Submit" name="submit" value="' . _('Update') . '"></div> </form>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/doc/Change.log 2011-08-31 10:15:04 UTC (rev 4672) @@ -1,5 +1,6 @@ webERP Change Log +31/8/11 Ricard: StockAdjustments.php now sends an email to the inventory manager on the creation of manual stock adjustments. The inventory manager email is defined in SystemParameters.php - leaving the email address blank will stop any emails from being created. 29/8/11 Ricard: Updated lastcostupdate in StockCostUpdate.php 29/8/11 Phil: Reinstated stockmaster.lastcostupdate field - added update to lastcostupdate in WorkOrderReceive.php 27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-31 10:15:04 UTC (rev 4672) @@ -1,3 +1,5 @@ ALTER TABLE stockmaster DROP lastcurcostdate; ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; +INSERT INTO `config` (`confname` ,`confvalue`) +VALUES ('InventoryManagerEmail', 'in...@yo...'); UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |