From: <dai...@us...> - 2014-03-15 00:03:06
|
Revision: 6608 http://sourceforge.net/p/web-erp/reponame/6608 Author: daintree Date: 2014-03-15 00:03:02 +0000 (Sat, 15 Mar 2014) Log Message: ----------- fixes to Z_ChangeStockCategory.php script Modified Paths: -------------- trunk/Z_ChangeStockCategory.php trunk/doc/Change.log Modified: trunk/Z_ChangeStockCategory.php =================================================================== --- trunk/Z_ChangeStockCategory.php 2014-03-14 22:17:30 UTC (rev 6607) +++ trunk/Z_ChangeStockCategory.php 2014-03-15 00:03:02 UTC (rev 6608) @@ -20,13 +20,13 @@ } if (ContainsIllegalCharacters($_POST['NewStockCategory'])) { - prnMsg(_('The new stock code to change the old code to contains illegal characters - no changes will be made'), 'error'); + prnMsg(_('The new stock category to change the old code to contains illegal characters - no changes will be made'), 'error'); include ('includes/footer.inc'); exit; } if ($_POST['NewStockCategory'] == '') { - prnMsg(_('The new stock code to change the old code to must be entered as well'), 'error'); + prnMsg(_('The new stock category to change the old code to must be entered as well'), 'error'); include ('includes/footer.inc'); exit; } @@ -77,19 +77,26 @@ $result = DB_query($sql, $db, $ErrMsg, $DbgMsg, true); echo ' ... ' . _('completed'); echo '<br />' . _('Changing sales analysis records'); - $sql = "UPDATE salesanalysis SET stkcategory='" . $_POST['NewStockID'] . "' WHERE stkcategory='" . $_POST['OldStockCategory'] . "'"; + $sql = "UPDATE salesanalysis SET stkcategory='" . $_POST['NewStockCategory'] . "' WHERE stkcategory='" . $_POST['OldStockCategory'] . "'"; $ErrMsg = _('The SQL to update Sales Analysis records failed'); $result = DB_query($sql, $db, $ErrMsg, $DbgMsg, true); echo ' ... ' . _('completed'); + + echo '<br />' . _('Changing internal stock category roles records'); + $sql = "UPDATE internalstockcatrole SET categoryid='" . $_POST['NewStockCategory'] . "' WHERE categoryid='" . $_POST['OldStockCategory'] . "'"; + $ErrMsg = _('The SQL to update internal stock category role records failed'); + $result = DB_query($sql, $db, $ErrMsg, $DbgMsg, true); + echo ' ... ' . _('completed'); + $sql = 'SET FOREIGN_KEY_CHECKS=1'; $result = DB_query($sql, $db, $ErrMsg, $DbgMsg, true); $result = DB_Txn_Commit($db); echo '<br />' . _('Deleting the old stock category record'); $sql = "DELETE FROM stockcategory WHERE categoryid='" . $_POST['OldStockCategory'] . "'"; $ErrMsg = _('The SQL to delete the old stock category record failed'); - $result = DB_query($sql, $db, $ErrMsg, $DbgMsg, true); + $result = DB_query($sql, $db, $ErrMsg, $DbgMsg); echo ' ... ' . _('completed'); - echo '<p>' . _('Stock Code') . ': ' . $_POST['OldStockCategory'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewStockCategory']; + echo '<p>' . _('Stock Category') . ': ' . $_POST['OldStockCategory'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewStockCategory']; } echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; @@ -99,11 +106,11 @@ <table> <tr> <td>' . _('Existing Inventory Category Code') . ':</td> - <td><input type="text" name="OldStockCategory" size="20" maxlength="20" /></td> + <td><input type="text" data-type="no-illegal-chars" name="OldStockCategory" title="' . _('Enter up to six alphanumeric characters or underscore as a code for this stock category') . '" size="7" maxlength="6" /></td> </tr> <tr> <td>' . _('New Inventory Category Code') . ':</td> - <td><input type="text" name="NewStockCategory" size="20" maxlength="20" /></td> + <td><input type="text" data-type="no-illegal-chars" title="' . _('Enter up to six alphanumeric characters or underscore as a code for this stock category') . '" name="NewStockCategory" size="7" maxlength="6" /></td> </tr> </table> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-03-14 22:17:30 UTC (rev 6607) +++ trunk/doc/Change.log 2014-03-15 00:03:02 UTC (rev 6608) @@ -1,8 +1,9 @@ webERP Change Log +15/3/14 Phil: Z_ChangeStockCategory.php was not updating sales analysis records correctly - fixed 15/3/14 Andrew Galuski: Auto Supplier number functionality 14/3/14 Jiro Akits: Updated zh_TW.utf8 translation -14/3/14 phil: removed htmchars in DB_escape_string() functions as suggested by Tim +14/3/14 Phil: removed htmchars in DB_escape_string() functions as suggested by Tim 05/03/14 icedlava: Ensure there are no unescaped characters in existing data when updating purchorders after reversing GRN. This fixes a symptom of a more widespread bug and therefore temporary until more general fix is applied. 05/03/14 icedlava: Remove input fields (Country and Language) and display this data instead on customer view page 03/03/14 Exson: Remove redundant code in CustomerAllocations.php |