From: <ex...@us...> - 2017-06-01 01:21:11
|
Revision: 7764 http://sourceforge.net/p/web-erp/reponame/7764 Author: exsonqu Date: 2017-06-01 01:21:09 +0000 (Thu, 01 Jun 2017) Log Message: ----------- 1/6/17 VortecCPI fixed empty list error in GLAccounts.php, GLCashFlowsIndirect.php, GLCashFlowsSetup.php Modified Paths: -------------- trunk/GLAccounts.php trunk/GLCashFlowsIndirect.php trunk/GLCashFlowsSetup.php Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2017-05-18 09:24:16 UTC (rev 7763) +++ trunk/GLAccounts.php 2017-06-01 01:21:09 UTC (rev 7764) @@ -319,7 +319,7 @@ $Result = DB_query($Sql, $ErrMsg); $k = 1;// Row colour counter. - foreach($Result as $MyRow) { + while ($MyRow = DB_fech_array($Result)) { if($k == 1) { echo '<tr class="OddTableRows">'; $k = 0; Modified: trunk/GLCashFlowsIndirect.php =================================================================== --- trunk/GLCashFlowsIndirect.php 2017-05-18 09:24:16 UTC (rev 7763) +++ trunk/GLCashFlowsIndirect.php 2017-06-01 01:21:09 UTC (rev 7764) @@ -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. @@ -205,7 +207,7 @@ $IdSection = -1; // Looks for an account without setting up: $NeedSetup = FALSE; - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['cashflowsactivity'] == -1) { $NeedSetup = TRUE; echo '<tr><td colspan="8"> </td></tr>'; @@ -212,7 +214,8 @@ break; } } - foreach($Result as $MyRow) { + DB_data_seek($Result,0); + while($MyRow = DB_fetch_array($Result)) { if($IdSection <> $MyRow['cashflowsactivity']) { // Prints section total: echo '<tr> @@ -290,7 +293,7 @@ GROUP BY chartdetails.accountcode ORDER BY chartdetails.accountcode"; $Result = DB_query($Sql); - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['ActualAmount']<>0 OR $MyRow['BudgetAmount']<>0 OR $MyRow['LastAmount']<>0 OR isset($_POST['ShowZeroBalance'])) { @@ -351,7 +354,7 @@ GROUP BY chartdetails.accountcode ORDER BY chartdetails.accountcode"; $Result = DB_query($Sql); - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['ActualAmount']<>0 OR $MyRow['BudgetAmount']<>0 OR $MyRow['LastAmount']<>0 OR isset($_POST['ShowZeroBalance'])) { @@ -403,7 +406,7 @@ ORDER BY chartdetails.accountcode"; $Result = DB_query($Sql); - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['ActualAmount']<>0 OR $MyRow['BudgetAmount']<>0 OR $MyRow['LastAmount']<>0 OR isset($_POST['ShowZeroBalance'])) { @@ -467,7 +470,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)); + $Result = DB_query($Sql); + $MyRow1 = DB_fetch_array($Result); echo colDebitCredit($MyRow1['ActualProfit']), colDebitCredit($MyRow1['LastProfit']), '</tr> @@ -484,7 +488,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)); + $Result = DB_query($Sql); + $MyRow2 = DB_fetch_array($Result); echo colDebitCredit($MyRow2['ActualRetained'] - $MyRow1['ActualProfit']), colDebitCredit($MyRow2['LastRetained'] - $MyRow1['LastProfit']), '</tr><tr>', @@ -515,7 +520,7 @@ $IdSection = -1; // Looks for an account without setting up: $NeedSetup = FALSE; - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['cashflowsactivity'] == -1) { $NeedSetup = TRUE; echo '<tr><td colspan="8"> </td></tr>'; @@ -522,7 +527,8 @@ break; } } - foreach($Result as $MyRow) { + DB_data_seek($Result,0); + while($MyRow = DB_fetch_array($Result)) { if($IdSection <> $MyRow['cashflowsactivity']) { // Prints section total: echo '<tr> @@ -590,7 +596,7 @@ GROUP BY chartdetails.accountcode ORDER BY chartdetails.accountcode"; $Result = DB_query($Sql); - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['ActualAmount']<>0 OR $MyRow['LastAmount']<>0 OR isset($_POST['ShowZeroBalance'])) { if($k == 1) { @@ -644,7 +650,7 @@ GROUP BY chartdetails.accountcode ORDER BY chartdetails.accountcode"; $Result = DB_query($Sql); - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['ActualAmount']<>0 OR $MyRow['LastAmount']<>0 OR isset($_POST['ShowZeroBalance'])) { if($k == 1) { @@ -691,7 +697,7 @@ ORDER BY chartdetails.accountcode"; $Result = DB_query($Sql); - foreach($Result as $MyRow) { + while($MyRow = DB_fetch_array($Result)) { if($MyRow['ActualAmount']<>0 OR $MyRow['LastAmount']<>0 OR isset($_POST['ShowZeroBalance'])) { if($k == 1) { @@ -793,7 +799,7 @@ } $_POST['PeriodFrom'] = GetPeriod(date($_SESSION['DefaultDateFormat'], $BeginDate), $db); } - foreach($Periods as $MyRow) { + while($MyRow = DB_fetch_array($Periods)) { echo '<option',($MyRow['periodno'] == $_POST['PeriodFrom'] ? ' selected="selected"' : '' ), ' value="', $MyRow['periodno'], '">', MonthAndYearFromSQLDate($MyRow['lastdate_in_period']), '</option>'; } echo '</select>', @@ -807,7 +813,8 @@ if(!isset($_POST['PeriodTo'])) { $_POST['PeriodTo'] = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); } - foreach($Periods as $MyRow) { + DB_data_seek($Periods,0); + while($MyRow = DB_fetch_array($Periods)) { echo '<option',($MyRow['periodno'] == $_POST['PeriodTo'] ? ' selected="selected"' : '' ), ' value="', $MyRow['periodno'], '">', MonthAndYearFromSQLDate($MyRow['lastdate_in_period']), '</option>'; } echo '</select>', Modified: trunk/GLCashFlowsSetup.php =================================================================== --- trunk/GLCashFlowsSetup.php 2017-05-18 09:24:16 UTC (rev 7763) +++ trunk/GLCashFlowsSetup.php 2017-06-01 01:21:09 UTC (rev 7764) @@ -205,7 +205,7 @@ $_SESSION['PeriodProfitAccount'] = $Result['confvalue']; } } -foreach($GLAccounts as $MyRow) { +while($MyRow = DB_fetch_array($GLAccounts)) { echo '<option', ($MyRow['accountcode'] == $_SESSION['PeriodProfitAccount'] ? ' selected="selected"' : '' ), ' value="', $MyRow['accountcode'], '">', $MyRow['accountcode'], ' - ', $MyRow['accountname'], '</option>'; } echo '</select>', @@ -225,7 +225,8 @@ $_SESSION['RetainedEarningsAccount'] = $Result['retainedearnings']; } } -foreach($GLAccounts as $MyRow) { +DB_data_seek($GLAccounts,0); +while($MyRow = DB_fetch_array($GLAccounts)) { echo '<option', ($MyRow['accountcode'] == $_SESSION['RetainedEarningsAccount'] ? ' selected="selected"' : '' ), ' value="', $MyRow['accountcode'], '">', $MyRow['accountcode'], ' - ', $MyRow['accountname'], '</option>'; } echo '</select>', @@ -238,4 +239,4 @@ include('includes/footer.php'); // END: Procedure division ----------------------------------------------------- -?> \ No newline at end of file +?> |