[Weberp-svn] SF.net SVN: weberp:[8062] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-09-03 16:08:01
|
Revision: 8062 http://weberp.svn.sourceforge.net/weberp/?rev=8062&view=rev Author: tim_schofield Date: 2011-09-03 16:07:55 +0000 (Sat, 03 Sep 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/includes/session.inc Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-09-03 16:07:41 UTC (rev 8061) +++ trunk/StockAdjustments.php 2011-09-03 16:07:55 UTC (rev 8062) @@ -290,8 +290,14 @@ $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 */ Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-09-03 16:07:41 UTC (rev 8061) +++ trunk/SystemParameters.php 2011-09-03 16:07:55 UTC (rev 8062) @@ -83,6 +83,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 or !is_numeric($_POST['X_FrequentlyOrderedItems'])) { $InputError = 1; prnMsg(_('The number of frequently ordered items to display must be numeric'),'error'); @@ -274,6 +277,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'"; } @@ -456,8 +462,8 @@ //Blind packing note echo '<tr style="outline: 1px solid"><td>' . _('Show company details on packing slips') . ':</td> <td><select name="X_DefaultBlindPackNote"> - <option '.($_SESSION['DefaultBlindPackNote']=="1"?'selected ':'').'value="1">'._('Show Company Details') . '</option> - <option '.($_SESSION['DefaultBlindPackNote']=="2"?'selected ':'').'value="2">'._('Hide Company Details') . '</option> + <option '.($_SESSION['DefaultBlindPackNote']=='1'?'selected ':'').'value="1">'._('Show Company Details') . '</option> + <option '.($_SESSION['DefaultBlindPackNote']=='2'?'selected ':'').'value="2">'._('Hide Company Details') . '</option> </select></td> <td>' . _('Customer branches can be set by default not to print packing slips with the company logo and address. This is useful for companies that ship to customers customers and to show the source of the shipment would be inappropriate. There is an option on the setup of customer branches to ship blind, this setting is the default applied to all new customer branches') . '</td> </tr>'; @@ -1016,6 +1022,9 @@ <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> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-09-03 16:07:41 UTC (rev 8061) +++ trunk/includes/session.inc 2011-09-03 16:07:55 UTC (rev 8062) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=91; +$DBVersion=93; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |