From: <rc...@us...> - 2014-06-27 17:32:18
|
Revision: 6784 http://sourceforge.net/p/web-erp/reponame/6784 Author: rchacon Date: 2014-06-27 17:32:13 +0000 (Fri, 27 Jun 2014) Log Message: ----------- Add code-comments, $ViewTopic, $BookMark, page_title_text and code to update NewStockID if OldStockID and SelectedStockItem are the same in Z_ChangeStockCode.php. Add id to the "Change An Inventory Item Code" topic anchor in ManualSpecialUtilities.html. Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log trunk/doc/Manual/ManualSpecialUtilities.html Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2014-06-27 15:40:41 UTC (rev 6783) +++ trunk/Z_ChangeStockCode.php 2014-06-27 17:32:13 UTC (rev 6784) @@ -1,10 +1,19 @@ <?php +/* $Id$*/ +/* This script is an utility to change an inventory item code. */ +/* It uses function ChangeFieldInTable($TableName, $FieldName, $OldValue, + $NewValue, $db) from .../includes/MiscFunctions.php.*/ -/* $Id$*/ - include ('includes/session.inc'); -$Title = _('UTILITY PAGE Change A Stock Code'); +$Title = _('UTILITY PAGE Change A Stock Code');// _('Change An Inventory Item Code') +$ViewTopic = 'SpecialUtilities'; +$BookMark = 'Z_ChangeStockCode';// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Change An Inventory Item Code') . '" />' . ' ' . + _('Change An Inventory Item Code') . '</p>'; + include('includes/SQL_CommonFunctions.inc'); if (isset($_POST['ProcessStockChange'])){ @@ -143,7 +152,8 @@ ChangeFieldInTable("bom", "component", $_POST['OldStockID'], $_POST['NewStockID'], $db); ChangeFieldInTable("bom", "parent", $_POST['OldStockID'], $_POST['NewStockID'], $db); ChangeFieldInTable("stockrequestitems", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db); - ChangeFieldInTable("stockdescriptiontranslations", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db); + ChangeFieldInTable("stockdescriptiontranslations", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db);// Updates the translated item titles (StockTitles) +/* ChangeFieldInTable("Stockdescriptions", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db);// Updates the translated item descriptions (StockDescriptions)*/ echo '<br />' . _('Changing any image files'); if (file_exists($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg')){ @@ -176,8 +186,13 @@ $ErrMsg = _('The SQL to delete the old stock master record failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); + echo '<p>' . _('Stock Code') . ': ' . $_POST['OldStockID'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewStockID']; - echo '<p>' . _('Stock Code') . ': ' . $_POST['OldStockID'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewStockID']; + // If the current SelectedStockItem is the same as the OldStockID, it updates to the NewStockID: + if ($_SESSION['SelectedStockItem'] == $_POST['OldStockID']) { + $_SESSION['SelectedStockItem'] = $_POST['NewStockID']; + } + } //only do the stuff above if $InputError==0 } @@ -203,4 +218,4 @@ include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-06-27 15:40:41 UTC (rev 6783) +++ trunk/doc/Change.log 2014-06-27 17:32:13 UTC (rev 6784) @@ -1,5 +1,6 @@ webERP Change Log +27/06/14 RChacon: Add code-comments, $ViewTopic, $BookMark, page_title_text and code to update NewStockID if OldStockID and SelectedStockItem are the same in Z_ChangeStockCode.php. Add id to the "Change An Inventory Item Code" topic anchor in ManualSpecialUtilities.html. 27/06/14 Exson: Make tel length in PO_Header.php is as same as field definition in sql. 26/06/14 Exson: Fixed the bug that Select Customers search result inconsistence with Customer receipt search result in SelectCustomer.php. 24/06/14 RChacon: Add $ViewTopic, $BookMark to Prices.php and minor improvements. Modified: trunk/doc/Manual/ManualSpecialUtilities.html =================================================================== --- trunk/doc/Manual/ManualSpecialUtilities.html 2014-06-27 15:40:41 UTC (rev 6783) +++ trunk/doc/Manual/ManualSpecialUtilities.html 2014-06-27 17:32:13 UTC (rev 6784) @@ -16,7 +16,7 @@ <p>This page requires the entry of an existing customer code and the new customer code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing customer does exist. If all is well then the customer code data is changed in all tables through-out the system that refer to the customer code. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours.</p> -<h2>Change An Inventory Code</h2> +<h2><a id="Z_ChangeStockCode">Change An Inventory Item Code</a></h2> <p>This page requires the entry of an existing stock code and the new stock code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing item does exist. If all is well then the stock code data is changed in all tables through-out the system. Sales analysis, stock movements, stock locations, Bills of Material, parent and component items, sales order details and purchase order details as well as the Stock Master, pricing and shipment charges. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours.</p> |