From: <tim...@us...> - 2010-01-12 11:02:33
|
Revision: 3293 http://web-erp.svn.sourceforge.net/web-erp/?rev=3293&view=rev Author: tim_schofield Date: 2010-01-12 11:02:25 +0000 (Tue, 12 Jan 2010) Log Message: ----------- Check thast mrpplannedorders table exists before trying to alter it Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log.html Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2010-01-10 13:15:53 UTC (rev 3292) +++ trunk/Z_ChangeStockCode.php 2010-01-12 11:02:25 UTC (rev 3293) @@ -123,29 +123,34 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - echo '<BR>' . _('Changing MRP planned orders information'); + $sql="select count(table_name) from information_schema.tables where table_schema='".$_SESSION['DatabaseName']."' and table_name='mrpplannedorders'"; + $result = DB_query($sql,$db); + $row=DB_fetch_row($result); + if ($row[0]>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'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - echo ' ... ' . _('completed'); - + $sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; + $ErrMsg = _('The SQL to update the mrpplannedorders records failed'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + echo ' ... ' . _('completed'); + } + echo '<BR>' . _('Changing MRP requirements information'); $sql = "UPDATE mrprequirements SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrprequirements records failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - + echo '<BR>' . _('Changing MRP supplies information'); $sql = "UPDATE mrpsupplies SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrpsupplies records failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - + echo '<br>' . _('Changing sales analysis records'); $sql = "UPDATE salesanalysis SET stockid='" . $_POST['NewStockID'] . "' WHERE stockid='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update Sales Analysis records failed'); @@ -235,14 +240,14 @@ echo '<br>' . _('Changing any image files'); if (file_exists($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg')) { - if (rename($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg', + if (rename($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg', $_SESSION['part_pics_dir'] . '/' .$_POST['NewStockID'].'.jpg')) { echo ' ... ' . _('completed'); } else { echo ' ... ' . _('failed'); } } else { - echo ' ... ' . _('completed'); + echo ' ... ' . _('completed'); } echo '<br>' . _('Changing the item properties table records') . ' - ' . _('parents'); @@ -265,7 +270,7 @@ $ErrMsg = _('The SQL to update the parent stockid worequirements records failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - + echo '<BR>' . _('Changing work order information'); $sql = "UPDATE woitems SET stockid='" . $_POST['NewStockID'] . "' WHERE stockid='" . $_POST['OldStockID'] . "'"; @@ -310,7 +315,7 @@ echo '<tr><td>' . _('New Inventory Code') . ":</td><td><input type=Text name='NewStockID' size=20 maxlength=20></td></tr>"; echo '</table>'; -echo "<input type=submit name='ProcessStockChange' VALUE='" . _('Process') . "'>"; +echo "<div class=centre><input type=submit name='ProcessStockChange' VALUE='" . _('Process') . "'></div>"; echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-10 13:15:53 UTC (rev 3292) +++ trunk/doc/Change.log.html 2010-01-12 11:02:25 UTC (rev 3293) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>12/01/10 Tim: Z_ChangeStockCode.php - Check thast mrpplannedorders table exists before trying to alter it</p> <p>10/01/10 Tim: StockTransfers.php - Correctly show stockid in links to ther functions.</p> <p>10/01/10 Bryan Nielsen: BOMs.php - syntax error includes() was used not include()</p> <p>09/01/10 Phil: Fix price for same item on an order priced at different prices - unfortunately, this means that there may be rounding errors on very large currencies as I reverted to the old logic using the stockmoves which use local currency and then converting back to the currency of the invoice - fixed both portrait and landscape This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |