From: <te...@us...> - 2017-01-05 00:11:19
|
Revision: 7716 http://sourceforge.net/p/web-erp/reponame/7716 Author: tehonu Date: 2017-01-05 00:11:17 +0000 (Thu, 05 Jan 2017) Log Message: ----------- Fix warnings in http://www.weberp.org/forum/showthread.php?tid=2962. following Tim's solution. Modified Paths: -------------- trunk/GLCashFlowsIndirect.php Modified: trunk/GLCashFlowsIndirect.php =================================================================== --- trunk/GLCashFlowsIndirect.php 2017-01-02 00:40:32 UTC (rev 7715) +++ trunk/GLCashFlowsIndirect.php 2017-01-05 00:11:17 UTC (rev 7716) @@ -76,8 +76,10 @@ $Title, '" /> ', // Icon title. $Title, '<br />', // Page title, reporting statement. stripslashes($_SESSION['CompanyRecord']['coyname']), '<br />'; // Page title, reporting entity. - $PeriodFromName = DB_fetch_array(DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodFrom'])); - $PeriodToName = DB_fetch_array(DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodTo'])); + $Result = DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodFrom']); + $PeriodFromName = DB_fetch_array($Result); + $Result = DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodTo']); + $PeriodToName = DB_fetch_array($Result); echo _('From'), ' ', MonthAndYearFromSQLDate($PeriodFromName['lastdate_in_period']), ' ', _('to'), ' ', MonthAndYearFromSQLDate($PeriodToName['lastdate_in_period']), '<br />'; // Page title, reporting period. include_once('includes/CurrenciesArray.php');// Array to retrieve currency name. echo _('All amounts stated in'), ': ', _($CurrencyName[$_SESSION['CompanyRecord']['currencydefault']]), '</p>';// Page title, reporting presentation currency and level of rounding used. @@ -97,7 +99,8 @@ // Gets the net profit for the period GL account: if(!isset($_SESSION['PeriodProfitAccount'])) { $_SESSION['PeriodProfitAccount'] = ''; - $MyRow = DB_fetch_array(DB_query("SELECT confvalue FROM `config` WHERE confname ='PeriodProfitAccount'")); + $Result = DB_query("SELECT confvalue FROM `config` WHERE confname ='PeriodProfitAccount'"); + $MyRow = DB_fetch_array($Result); if($MyRow) { $_SESSION['PeriodProfitAccount'] = $MyRow['confvalue']; } @@ -106,7 +109,8 @@ if(!isset($_SESSION['RetainedEarningsAccount'])) { $_SESSION['RetainedEarningsAccount'] = ''; /* $MyRow = DB_fetch_array(DB_query("SELECT confvalue FROM `config` WHERE confname ='RetainedEarningsAccount'"));// RChacon: Standardise to config table? */ - $MyRow = DB_fetch_array(DB_query("SELECT retainedearnings FROM companies WHERE coycode = 1")); + $Result = DB_query("SELECT retainedearnings FROM companies WHERE coycode = 1"); + $MyRow = DB_fetch_array($Result); if($MyRow) { $_SESSION['RetainedEarningsAccount'] = $MyRow['confvalue']; } @@ -465,7 +469,8 @@ INNER JOIN chartdetails ON chartmaster.accountcode=chartdetails.accountcode INNER JOIN accountgroups ON chartmaster.group_=accountgroups.groupname WHERE accountgroups.pandl=1"; - $MyRow1 = DB_fetch_array(DB_query($Sql)); + $Result1 = DB_query($Sql); + $MyRow1 = DB_fetch_array($Result1); echo colDebitCredit($MyRow1['ActualProfit']), colDebitCredit($MyRow1['LastProfit']), '</tr> @@ -482,7 +487,8 @@ WHERE accountgroups.pandl=0 AND chartdetails.accountcode!='" . $_SESSION['PeriodProfitAccount'] . "' AND chartdetails.accountcode!='" . $_SESSION['RetainedEarningsAccount'] . "'";// Gets retained earnings by the complement method to include differences. The complement method: Changes(retained earnings) = -Changes(other accounts). - $MyRow2 = DB_fetch_array(DB_query($Sql)); + $Result2 = DB_query($Sql); + $MyRow2 = DB_fetch_array($Result2); echo colDebitCredit($MyRow2['ActualRetained'] - $MyRow1['ActualProfit']), colDebitCredit($MyRow2['LastRetained'] - $MyRow1['LastProfit']), '</tr><tr>', |