Skip to content
This repository has been archived by the owner on Jan 5, 2018. It is now read-only.

Commit

Permalink
Updated income statement data prep service and template to better sep…
Browse files Browse the repository at this point in the history
…arate revenue/sales and cost of sales and show more complete subtotals, now much better matches traditional income statements; based on recent updates to the gl account classes to support this structure
  • Loading branch information
jonesde committed Nov 11, 2013
1 parent 1a9f133 commit b559f24
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
17 changes: 12 additions & 5 deletions mantle-usl/service/mantle/ledger/LedgerReportServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This Work includes contributions authored by David E. Jones, not as a
<parameter name="timePeriodIdMap" type="Map"/>
<parameter name="assetInfoMap" type="Map"/>
<parameter name="contraAssetInfoMap" type="Map"/>

<parameter name="liabilityInfoMap" type="Map"/>
<parameter name="equityInfoMap" type="Map"/>
</out-parameters>
Expand Down Expand Up @@ -70,9 +71,12 @@ This Work includes contributions authored by David E. Jones, not as a
<out-parameters>
<parameter name="currencyUomId"/>
<parameter name="timePeriodIdMap" type="Map"/>
<parameter name="incomeInfoMap" type="Map"/>

<parameter name="revenueInfoMap" type="Map"/>
<parameter name="contraRevenueInfoMap" type="Map"/>
<parameter name="costOfSalesInfoMap" type="Map"/>

<parameter name="incomeInfoMap" type="Map"/>
<parameter name="expenseInfoMap" type="Map"/>
</out-parameters>
<actions>
Expand All @@ -90,16 +94,19 @@ This Work includes contributions authored by David E. Jones, not as a

<set field="commonMap" from="[organizationPartyId:organizationPartyId, timePeriodIdList:timePeriodIdList]"/>

<service-call name="mantle.ledger.LedgerReportServices.get#GlAccountClassReportInfo"
in-map="commonMap + [classEnumId:'INCOME']" out-map="incomeOut"/>
<set field="incomeInfoMap" from="incomeOut.classInfoMap"/>
<service-call name="mantle.ledger.LedgerReportServices.get#GlAccountClassReportInfo"
in-map="commonMap + [classEnumId:'REVENUE']" out-map="revenueOut"/>
<set field="revenueInfoMap" from="revenueOut.classInfoMap"/>

<service-call name="mantle.ledger.LedgerReportServices.get#GlAccountClassReportInfo"
in-map="commonMap + [classEnumId:'CONTRA_REVENUE']" out-map="contraRevenueOut"/>
<set field="contraRevenueInfoMap" from="contraRevenueOut.classInfoMap"/>
<service-call name="mantle.ledger.LedgerReportServices.get#GlAccountClassReportInfo"
in-map="commonMap + [classEnumId:'COST_OF_SALES']" out-map="costOfSalesOut"/>
<set field="costOfSalesInfoMap" from="costOfSalesOut.classInfoMap"/>

<service-call name="mantle.ledger.LedgerReportServices.get#GlAccountClassReportInfo"
in-map="commonMap + [classEnumId:'INCOME']" out-map="incomeOut"/>
<set field="incomeInfoMap" from="incomeOut.classInfoMap"/>
<service-call name="mantle.ledger.LedgerReportServices.get#GlAccountClassReportInfo"
in-map="commonMap + [classEnumId:'EXPENSE']" out-map="expenseOut"/>
<set field="expenseInfoMap" from="expenseOut.classInfoMap"/>
Expand Down
47 changes: 29 additions & 18 deletions mantle-usl/template/ledger/IncomeStatement.html.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -35,47 +35,58 @@ This Work includes contributions authored by David E. Jones, not as a
</div>
</div>
<div class="form-body">
<div class="form-row">
<div class="form-cell">${incomeInfoMap.className}</div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency">${ec.l10n.formatCurrency(incomeInfoMap.balanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
<@showChildClassList incomeInfoMap.childClassInfoList 1/>

<div class="form-row">
<div class="form-cell">${revenueInfoMap.className}</div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency">${ec.l10n.formatCurrency(revenueInfoMap.balanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
<@showChildClassList revenueInfoMap.childClassInfoList 1/>
<div class="form-row">
<div class="form-cell">${contraRevenueInfoMap.className}</div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency">${ec.l10n.formatCurrency(contraRevenueInfoMap.balanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
<@showChildClassList contraRevenueInfoMap.childClassInfoList 1/>
<div class="form-row">
<div class="form-cell"><span class="form-title">Net Sales</span></div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency(revenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 - contraRevenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>

<div class="form-row">
<div class="form-cell">${costOfSalesInfoMap.className}</div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency">${ec.l10n.formatCurrency(costOfSalesInfoMap.balanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
<@showChildClassList costOfSalesInfoMap.childClassInfoList 1/>
<div class="form-row">
<div class="form-cell"><span class="form-title">Cost of Sales Total</span></div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency(costOfSalesInfoMap.totalBalanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>

<div class="form-row">
<div class="form-cell"><span class="form-title">Income Total</span></div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency(incomeInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 + revenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
<div class="form-cell"><span class="form-title">Gross Profit On Sales</span></div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency((revenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 - contraRevenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0) - costOfSalesInfoMap.totalBalanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>



<div class="form-row">
<div class="form-cell">${incomeInfoMap.className}</div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency">${ec.l10n.formatCurrency(incomeInfoMap.balanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
<@showChildClassList incomeInfoMap.childClassInfoList 1/>
<div class="form-row">
<div class="form-cell">${expenseInfoMap.className}</div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency">${ec.l10n.formatCurrency(expenseInfoMap.balanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
<@showChildClassList expenseInfoMap.childClassInfoList 1/>


<div class="form-row">
<div class="form-cell">${contraRevenueInfoMap.className}</div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency">${ec.l10n.formatCurrency(contraRevenueInfoMap.balanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
<@showChildClassList contraRevenueInfoMap.childClassInfoList 1/>

<div class="form-row">
<div class="form-cell"><span class="form-title">Expense Total</span></div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency(expenseInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 + contraRevenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
<div class="form-cell"><span class="form-title">Net Operating Income</span></div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency(incomeInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 - expenseInfoMap.totalBalanceByTimePeriod[timePeriodId]!0, currencyUomId, 2)}</span></div></#list>
</div>
</div>
<div class="form-body">
<div class="form-row">
<div class="form-cell"><span class="form-title">Net Income</span></div>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency((incomeInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 + revenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0) - (expenseInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 + contraRevenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0), currencyUomId, 2)}</span></div></#list>
<#list timePeriodIdList as timePeriodId><div class="form-cell"><span class="currency form-title">${ec.l10n.formatCurrency((incomeInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 + revenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0) - (contraRevenueInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 + costOfSalesInfoMap.totalBalanceByTimePeriod[timePeriodId]!0 + expenseInfoMap.totalBalanceByTimePeriod[timePeriodId]!0), currencyUomId, 2)}</span></div></#list>
</div>
</div>
</div>

0 comments on commit b559f24

Please sign in to comment.