From: <rc...@us...> - 2016-03-24 17:10:04
|
Revision: 7480 http://sourceforge.net/p/web-erp/reponame/7480 Author: rchacon Date: 2016-03-24 17:10:01 +0000 (Thu, 24 Mar 2016) Log Message: ----------- Minor changes: standardise names and variables in horizontal analysis. Modified Paths: -------------- trunk/AnalysisHorizontalIncome.php trunk/AnalysisHorizontalPosition.php trunk/doc/Manual/ManualGeneralLedger.html Modified: trunk/AnalysisHorizontalIncome.php =================================================================== --- trunk/AnalysisHorizontalIncome.php 2016-03-24 02:22:23 UTC (rev 7479) +++ trunk/AnalysisHorizontalIncome.php 2016-03-24 17:10:01 UTC (rev 7480) @@ -2,10 +2,10 @@ /* $Id: AnalysisHorizontalIncome.php 7349 2015-09-14 14:43:19Z rchacon $*/ /* Shows the horizontal analysis of the statement of comprehensive income. */ -function RelativeChange($SelectedPeriod, $PreviousPeriod) { +function RelativeChange($selected_period, $previous_period) { // Calculates the relative change between selected and previous periods. Uses percent with locale number format. - if($PreviousPeriod<>0) { - return locale_number_format(($SelectedPeriod-$PreviousPeriod)*100/$PreviousPeriod,$_SESSION['CompanyRecord']['decimalplaces']) . '%'; + if($previous_period<>0) { + return locale_number_format(($selected_period-$previous_period)*100/$previous_period, $_SESSION['CompanyRecord']['decimalplaces']) . '%'; } else { return _('N/A'); } @@ -157,8 +157,8 @@ } else {// Summary report: echo '<th class="text" colspan="2">', _('Summary'), '</th>'; } - echo '<th class="number">', ' - ', $myrow[0], '</th> - <th class="number">', _('Last Year'), '</th> + echo '<th class="number">', _('Current period'), '</th> + <th class="number">', _('Last period'), '</th> <th class="number">', _('Actual change'), '</th> <th class="number">', _('Relative change'), '</th> </tr> @@ -183,8 +183,8 @@ SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, SUM(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwdly, SUM(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwdly - FROM chartmaster - INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname + FROM chartmaster + INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails ON chartmaster.accountcode= chartdetails.accountcode INNER JOIN glaccountusers ON glaccountusers.accountcode=chartmaster.accountcode AND glaccountusers.userid='" . $_SESSION['UserID'] . "' AND glaccountusers.canview=1 WHERE accountgroups.pandl=1 Modified: trunk/AnalysisHorizontalPosition.php =================================================================== --- trunk/AnalysisHorizontalPosition.php 2016-03-24 02:22:23 UTC (rev 7479) +++ trunk/AnalysisHorizontalPosition.php 2016-03-24 17:10:01 UTC (rev 7480) @@ -2,10 +2,10 @@ /* $Id: AnalysisHorizontalPosition.php 7349 2015-09-14 14:43:19Z rchacon $*/ /* Shows the horizontal analysis of the statement of financial position. */ -function RelativeChange($SelectedPeriod, $PreviousPeriod) { +function RelativeChange($selected_period, $previous_period) { // Calculates the relative change between selected and previous periods. Uses percent with locale number format. - if($PreviousPeriod<>0) { - return locale_number_format(($SelectedPeriod-$PreviousPeriod)*100/$PreviousPeriod,$_SESSION['CompanyRecord']['decimalplaces']) . '%'; + if($previous_period<>0) { + return locale_number_format(($selected_period-$previous_period)*100/$previous_period, $_SESSION['CompanyRecord']['decimalplaces']) . '%'; } else { return _('N/A'); } @@ -57,15 +57,6 @@ } echo ' value="', $myrow['periodno'], '">', MonthAndYearFromSQLDate($myrow['lastdate_in_period']), '</option>'; } -/* - while($myrow=DB_fetch_array($Periods)) { - echo '<option'; - if($myrow['periodno']==$DefaultToPeriod) { - echo ' selected="selected"'; - } - echo ' value="', $myrow['periodno'], '">', MonthAndYearFromSQLDate($myrow['lastdate_in_period']), '</option>'; - } -*/ echo '</select></td> </tr> <tr> @@ -120,8 +111,8 @@ } else {// Summary report: echo '<th class="text" colspan="2">', _('Summary'), '</th>'; } - echo '<th class="number">', $BalanceDate, '</th> - <th class="number">', _('Last Year'), '</th> + echo '<th class="number">', _('Current period'), '</th> + <th class="number">', _('Last period'), '</th> <th class="number">', _('Actual change'), '</th> <th class="number">', _('Relative change'), '</th> </tr> @@ -156,8 +147,8 @@ chartmaster.accountname, Sum(CASE WHEN chartdetails.period='" . $_POST['BalancePeriodEnd'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS balancecfwd, Sum(CASE WHEN chartdetails.period='" . ($_POST['BalancePeriodEnd'] - 12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS balancecfwdly - FROM chartmaster - INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname + FROM chartmaster + INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails ON chartmaster.accountcode= chartdetails.accountcode INNER JOIN glaccountusers ON glaccountusers.accountcode=chartmaster.accountcode AND glaccountusers.userid='" . $_SESSION['UserID'] . "' AND glaccountusers.canview=1 WHERE accountgroups.pandl=0 Modified: trunk/doc/Manual/ManualGeneralLedger.html =================================================================== --- trunk/doc/Manual/ManualGeneralLedger.html 2016-03-24 02:22:23 UTC (rev 7479) +++ trunk/doc/Manual/ManualGeneralLedger.html 2016-03-24 17:10:01 UTC (rev 7480) @@ -364,9 +364,9 @@ <li> <h3><a id="AnalysisHorizontal">Horizontal analysis</a></h3> <p>The horizontal analysis, also known as trend analysis, is a financial statement analysis technique that shows changes in the amounts of corresponding financial statement items over a period of time. It is a useful tool to evaluate trend situations.</p> - <p>The statements for two periods are used in horizontal analysis. The earliest period is used as the base period. The items on the later statement are compared with items on the statement of the base period. The changes are shown both in currency (absolute variation) and percentage (relative variation).</p> - <p>The absolute variation is calculated as <i>selected_period</i> - <i>previous_period</i>. - <p>The relative variation is calculated as (<i>selected_period</i> - <i>previous_period</i>) / <i>previous_period</i> * 100. + <p>The statements for two periods are used in horizontal analysis. The earliest period is used as the base period. The items on the later statement are compared with items on the statement of the base period. The changes are shown both in currency (actual change) and percentage (relative change).</p> + <p>The actual change is calculated as <i>selected_period</i> - <i>previous_period</i>. + <p>The relative change is calculated as (<i>selected_period</i> - <i>previous_period</i>) / <i>previous_period</i> * 100. <h4><a id="AnalysisHorizontalPosition">Horizontal Analysis of Statement of Financial Position</a></h4> <p>The debit amounts (assets) of the selected and previous statement of financial position are shown as positive numbers; the credit amounts (liabilities and equity) are shown as negative numbers.</p> <p>The sources of funds are shown as positive numbers in the absolute variation column; the applications of funds are shown as negative numbers in the absolute variation column.</p> |