|
From: <dai...@us...> - 2011-12-13 07:50:25
|
Revision: 4771
http://web-erp.svn.sourceforge.net/web-erp/?rev=4771&view=rev
Author: daintree
Date: 2011-12-13 07:50:19 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
Vitaly fix to Z_ChangeStockCode.php
Modified Paths:
--------------
trunk/Z_ChangeStockCode.php
trunk/doc/Change.log
Modified: trunk/Z_ChangeStockCode.php
===================================================================
--- trunk/Z_ChangeStockCode.php 2011-12-13 07:31:31 UTC (rev 4770)
+++ trunk/Z_ChangeStockCode.php 2011-12-13 07:50:19 UTC (rev 4771)
@@ -134,7 +134,7 @@
//check if MRP tables exist before assuming
$result = DB_query("SELECT COUNT(*) FROM mrpplannedorders",$db,'','',false,false);
- if ($DB_error_no==0) {
+ if ($DB_error_no($db)==0) {
echo '<br />' . _('Changing MRP planned orders information');
$sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'";
$ErrMsg = _('The SQL to update the mrpplannedorders records failed');
@@ -238,8 +238,9 @@
$ErrMsg = _('The SQL to update the BOM records failed');
$result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true);
echo ' ... ' . _('completed');
+
+ DB_IgnoreForeignKeys($db);
-
echo '<br />' . _('Changing the BOM table records') . ' - ' . _('parents');
$sql = "UPDATE bom SET parent='" . $_POST['NewStockID'] . "' WHERE parent='" . $_POST['OldStockID'] . "'";
$ErrMsg = _('The SQL to update the BOM parent records failed');
@@ -264,8 +265,6 @@
$result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true);
echo ' ... ' . _('completed');
- $sql = 'SET FOREIGN_KEY_CHECKS=0';
- $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true);
echo '<br />' . _('Changing work order requirements information');
@@ -297,10 +296,9 @@
$ErrMsg = _('The SQL to update the stockserialitem 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);
-
+
+ DB_ReinstateForeignKeys($db);
+
$result = DB_Txn_Commit($db);
echo '<br />' . _('Deleting the old stock master record');
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2011-12-13 07:31:31 UTC (rev 4770)
+++ trunk/doc/Change.log 2011-12-13 07:50:19 UTC (rev 4771)
@@ -1,5 +1,6 @@
webERP Change Log
+13/12/11 Vitaly Shevkunov: Z_ChangeStockCode.php fixed call to DB_error_no had missing ($db) - also turned off FOREIGN KEY CHECKS before updating the BOM.
13/12/11 Exson: Fix SelectOrderItems.php and DeliveryDetails.php for where an order is modified while another order is being created in a different tab of the browser - $_SESSION['ExistingOrder'] now modified to $_SESSION['ExistingOrder' .$identifier] as suggested by Tim
11/12/11 Phil: SupplierInvoice.php attempts to post back any cost variances where there is no stock left to apportion the variances to - posting back to stockmoves (so the DailySales.php and other sales inquiry scripts reflect the appropriate GP) and the salesanalysis tables
11/12/11 Phil: DailySalesInquiry.php removed incorrect call to establish new cart object??
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|