From: <dai...@us...> - 2011-03-04 19:40:53
|
Revision: 4503 http://web-erp.svn.sourceforge.net/web-erp/?rev=4503&view=rev Author: daintree Date: 2011-03-04 19:40:47 +0000 (Fri, 04 Mar 2011) Log Message: ----------- Kovacs Attila fixes GROUP BY clauses in SQL and laguage binding always UTF-8 Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log.html trunk/includes/LanguageSetup.php Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/Stocks.php 2011-03-04 19:40:47 UTC (rev 4503) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Item Maintenance'); include('includes/header.inc'); @@ -19,7 +17,7 @@ } if (isset($StockID) and !isset($_POST['UpdateCategories'])) { - $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."'"; + $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { @@ -48,7 +46,7 @@ } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check prnMsg(_('The file size is over the maximum allowed. The maximum size allowed in KB is') . ' ' . $_SESSION['MaxImageSize'],'warn'); $UploadTheFile ='No'; - } elseif ( $_FILES['ItemPicture']['type'] == "text/plain" ) { //File Type Check + } elseif ( $_FILES['ItemPicture']['type'] == 'text/plain' ) { //File Type Check prnMsg( _('Only graphics files can be uploaded'),'warn'); $UploadTheFile ='No'; } elseif (file_exists($filename)){ @@ -219,7 +217,7 @@ $OldControlled = $myrow[1]; $OldSerialised = $myrow[2]; - $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."'"; + $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $stkqtychk = DB_fetch_row($result); @@ -268,7 +266,7 @@ /*now check that if it was a Manufactured, Kitset, Phantom or Assembly and is being changed to a purchased or dummy - that no BOM exists */ if (($OldMBFlag=='M' OR $OldMBFlag =='K' OR $OldMBFlag=='A' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='B' OR $_POST['MBFlag']=='D')) { - $sql = "SELECT COUNT(*) FROM bom WHERE parent = '".$StockID."'"; + $sql = "SELECT COUNT(*) FROM bom WHERE parent = '".$StockID."' GROUP BY parent"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -279,7 +277,7 @@ /*now check that if it was Manufac, Phantom or Purchased and is being changed to assembly or kitset, it is not a component on an existing BOM */ if (($OldMBFlag=='M' OR $OldMBFlag =='B' OR $OldMBFlag=='D' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K')) { - $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."'"; + $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."' GROUP BY component"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -462,7 +460,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'StockMoves' - $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockid='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM stockmoves WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -471,7 +469,7 @@ echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('stock movements that refer to this item'); } else { - $sql= "SELECT COUNT(*) FROM bom WHERE component='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM bom WHERE component='".$StockID."' GROUP BY component"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -479,7 +477,7 @@ prnMsg( _('Cannot delete this item record because there are bills of material that require this part as a component'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bills of material that require this part as a component'); } else { - $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -487,7 +485,7 @@ prnMsg( _('Cannot delete this item record because there are existing sales orders for this part'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales order items against this part'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE stockid='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM salesanalysis WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -495,7 +493,7 @@ prnMsg(_('Cannot delete this item because sales analysis records exist for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this part'); } else { - $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."'"; + $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -503,7 +501,7 @@ prnMsg(_('Cannot delete this item because there are existing purchase order items for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('purchase order item record relating to this part'); } else { - $sql = "SELECT SUM(quantity) AS qoh FROM locstock WHERE stockid='".$StockID."'"; + $sql = "SELECT SUM(quantity) AS qoh FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]!=0) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/doc/Change.log.html 2011-03-04 19:40:47 UTC (rev 4503) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL</p> +<p>5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF- now as no dynamic changing of character set required all translations are utf-8</p> <p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> <p>3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive</p> <p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry</p> Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-03-03 09:14:45 UTC (rev 4502) +++ trunk/includes/LanguageSetup.php 2011-03-04 19:40:47 UTC (rev 4503) @@ -37,7 +37,7 @@ //putenv('LANG=$Language_Country'); bindtextdomain ('messages', $PathPrefix . 'locale'); textdomain ('messages'); - bind_textdomain_codeset('messages', _('ISO-8859-1')); + bind_textdomain_codeset('messages', 'UTF-8'); $locale_info = localeconv(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |