From: <dai...@us...> - 2010-11-23 07:05:41
|
Revision: 4164 http://web-erp.svn.sourceforge.net/web-erp/?rev=4164&view=rev Author: daintree Date: 2010-11-23 07:05:34 +0000 (Tue, 23 Nov 2010) Log Message: ----------- Pak Ricard - fix for MRP with utf-8 temporary tables Modified Paths: -------------- trunk/MRP.php trunk/MRPShortages.php trunk/SupplierAllocations.php trunk/doc/Change.log.html Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2010-11-21 09:20:08 UTC (rev 4163) +++ trunk/MRP.php 2010-11-23 07:05:34 UTC (rev 4164) @@ -26,7 +26,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -34,7 +34,7 @@ parent char(20), component char(20), sortpart text, - level int)'; + level int) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -84,7 +84,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); $sql = "INSERT INTO passbom (part, sortpart) @@ -109,7 +109,7 @@ flush(); $sql = 'CREATE TEMPORARY TABLE bomlevels ( part char(20), - level int)'; + level int) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); // Read tempbom and split sortpart into separate parts. For each separate part, calculate level as @@ -141,7 +141,7 @@ leadtime smallint(6) NOT NULL default "0", pansize double NOT NULL default "0", shrinkfactor double NOT NULL default "0", - eoq double NOT NULL default "0")'; + eoq double NOT NULL default "0") DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); $sql = 'INSERT INTO levels (part, level, @@ -229,7 +229,7 @@ mrpdemandtype varchar(6), orderno int(11), directdemand smallint, - whererequired char(20))'; + whererequired char(20)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); @@ -343,7 +343,7 @@ orderno int(11), mrpdate date, updateflag smallint(6), - PRIMARY KEY (id))'; + PRIMARY KEY (id)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of mrpsupplies failed because')); prnMsg(_('Loading supplies from purchase orders'),'info'); @@ -495,7 +495,7 @@ shrinkageflag varchar(5), eoqflag varchar(5), usemrpdemands varchar(5), - leeway smallint)'; + leeway smallint) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); // Create entry for location field from $_POST['location'], which is an array // since multiple locations can be selected Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2010-11-21 09:20:08 UTC (rev 4163) +++ trunk/MRPShortages.php 2010-11-23 07:05:34 UTC (rev 4164) @@ -35,7 +35,7 @@ $sql = 'CREATE TEMPORARY TABLE demandtotal ( part char(20), demand double, - KEY `PART` (`part`))'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of demandtotal failed because')); $sql = 'INSERT INTO demandtotal @@ -50,7 +50,7 @@ $sql = 'CREATE TEMPORARY TABLE supplytotal ( part char(20), supply double, - KEY `PART` (`part`))'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of supplytotal failed because')); /* 21/03/2010: Ricard modification to allow items with total supply = 0 be included in the report */ Modified: trunk/SupplierAllocations.php =================================================================== --- trunk/SupplierAllocations.php 2010-11-21 09:20:08 UTC (rev 4163) +++ trunk/SupplierAllocations.php 2010-11-23 07:05:34 UTC (rev 4164) @@ -203,19 +203,19 @@ $_SESSION['Alloc']->TransDate = FormatDateForSQL($_SESSION['Alloc']->TransDate); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ('" . $_SESSION['Alloc']->TransType . "', - '" . $_SESSION['Alloc']->TransNo . "', - '" . $_SESSION['Alloc']->TransDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['purchasesexchangediffact'] . "', - '". _('Exch diff') . "', - '" . $MovtInDiffOnExch . "')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['purchasesexchangediffact'] . "', + '". _('Exch diff') . "', + '" . $MovtInDiffOnExch . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the difference on exchange arising out of this allocation could not be inserted because'); @@ -225,20 +225,20 @@ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ('" . $_SESSION['Alloc']->TransType . "', - '" . $_SESSION['Alloc']->TransNo . "', - '" . $_SESSION['Alloc']->TransDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['creditorsact'] . "', - '" . _('Exch Diff') . "', - '" . -$MovtInDiffOnExch . "')"; - + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['creditorsact'] . "', + '" . _('Exch Diff') . "', + '" . -$MovtInDiffOnExch . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ' : ' . _('The GL entry for the difference on exchange arising out of this allocation could not be inserted because'); @@ -309,22 +309,22 @@ $SQL= "SELECT systypes.typename, - supptrans.type, - supptrans.transno, - supptrans.trandate, - supptrans.supplierno, - suppliers.suppname, - rate, - (supptrans.ovamount+supptrans.ovgst) AS total, - supptrans.diffonexch, - supptrans.alloc - FROM supptrans, - systypes, - suppliers - WHERE supptrans.type = systypes.typeid - AND supptrans.supplierno = suppliers.supplierid - AND supptrans.id='" . $_SESSION['AllocTrans'] . "'"; - + supptrans.type, + supptrans.transno, + supptrans.trandate, + supptrans.supplierno, + suppliers.suppname, + rate, + (supptrans.ovamount+supptrans.ovgst) AS total, + supptrans.diffonexch, + supptrans.alloc + FROM supptrans, + systypes, + suppliers + WHERE supptrans.type = systypes.typeid + AND supptrans.supplierno = suppliers.supplierid + AND supptrans.id='" . $_SESSION['AllocTrans'] . "'"; + $Result = DB_query($SQL, $db); if (DB_num_rows($Result) != 1){ echo _('There was a problem retrieving the information relating the transaction selected') . '. ' . _('Allocations are unable to proceed'); @@ -351,20 +351,20 @@ /*First get the transactions that have outstanding balances ie Total-Alloc >0 */ $SQL= "SELECT supptrans.id, - typename, - transno, - trandate, - suppreference, - rate, - ovamount+ovgst AS total, - diffonexch, - alloc - FROM supptrans, - systypes - WHERE supptrans.type = systypes.typeid - AND supptrans.settled=0 - AND abs(ovamount+ovgst-alloc)>0.009 - AND supplierno='" . $_SESSION['Alloc']->SupplierID . "'"; + typename, + transno, + trandate, + suppreference, + rate, + ovamount+ovgst AS total, + diffonexch, + alloc + FROM supptrans, + systypes + WHERE supptrans.type = systypes.typeid + AND supptrans.settled=0 + AND abs(ovamount+ovgst-alloc)>0.009 + AND supplierno='" . $_SESSION['Alloc']->SupplierID . "'"; $ErrMsg = _('There was a problem retrieving the transactions available to allocate to'); @@ -392,23 +392,23 @@ above logic will be overwritten with the prev alloc detail below */ $SQL = "SELECT supptrans.id, - typename, - transno, - trandate, - suppreference, - rate, - ovamount+ovgst AS total, - diffonexch, - supptrans.alloc-suppallocs.amt AS prevallocs, - amt, - suppallocs.id AS allocid - FROM supptrans, - systypes, - suppallocs - WHERE supptrans.type = systypes.typeid - AND supptrans.id=suppallocs.transid_allocto - AND suppallocs.transid_allocfrom='" . $_SESSION['AllocTrans'] . - "' AND supplierno='" . $_SESSION['Alloc']->SupplierID . "'"; + typename, + transno, + trandate, + suppreference, + rate, + ovamount+ovgst AS total, + diffonexch, + supptrans.alloc-suppallocs.amt AS prevallocs, + amt, + suppallocs.id AS allocid + FROM supptrans, + systypes, + suppallocs + WHERE supptrans.type = systypes.typeid + AND supptrans.id=suppallocs.transid_allocto + AND suppallocs.transid_allocfrom='" . $_SESSION['AllocTrans'] . + "' AND supplierno='" . $_SESSION['Alloc']->SupplierID . "'"; $ErrMsg = _('There was a problem retrieving the previously allocated transactions for modification'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-11-21 09:20:08 UTC (rev 4163) +++ trunk/doc/Change.log.html 2010-11-23 07:05:34 UTC (rev 4164) @@ -1,7 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>21/11/10 Phil:Rewritten FixedAssetJournal.php - renamed FixedAssetDepreciation.php -<p>20/11/10 Phil: Rewritten FixedAssetItems.php FixedAssetCategories.php and modified FixedAssetLocations.php to use the new structure +<p>23/11/10 Pak Ricard: MRP.php and MRPShortages.php fixed temporary tables to use utf-8 - code failed without probably depends on mysql server settings</p> +<p>21/11/10 Phil:Rewritten FixedAssetJournal.php - renamed FixedAssetDepreciation.php</p> +<p>20/11/10 Phil: Rewritten FixedAssetItems.php FixedAssetCategories.php and modified FixedAssetLocations.php to use the new structure</p> <p>18/11/10 Tim: upgrade3.11.1-4.00.sql - Fix sql syntax errors brought in on recent changes.</p> <p>14/11/10 Phil: SelectAsset.php script reworked SelectAssetType.php script now deleted</p> <p>08/11/10 Exson: Z_ImportStocks.php - Bug fixes.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |