|
Author: jacopoc
Date: Sun Dec 6 19:45:59 2009 New Revision: 887752 URL: http://svn.apache.org/viewvc?rev=887752&view=rev Log: New and enhanced financial reports: * new cash flow statement report from Sumit Pandit; this is a draft and a work in progress and it is only partially working at this stage * reimplemented the comparative income statement * misc enhancements to the other financial statements Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy (with props) Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/ComparativeIncomeStatement.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/IncomeStatement.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=887752&r1=887751&r2=887752&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Sun Dec 6 19:45:59 2009 @@ -1811,6 +1811,14 @@ <value xml:lang="th">à¸à¸£à¸°à¹à¸ à¸à¸à¸±à¸à¸£</value> <value xml:lang="zh">å¡ç±»å</value> </property> + <property key="AccountingCashBalance"> + <value xml:lang="en">Cash Balance</value> + <value xml:lang="hi_IN">à ¤°à ¥â¹Ã ¤â¢Ã ¤¡à ¤¼ à ¤¶à ¥â¡Ã ¤·</value> + </property> + <property key="AccountingCashFlowStatement"> + <value xml:lang="en">Cash Flow Statement</value> + <value xml:lang="hi_IN">à ¤µà ¤â¢Ã Â¥Âà ¤¤à ¤µà ¥Âà ¤¯ à ¤¨à ¤â¢Ã ¤¦ à ¤ªà ¥Âà ¤°à ¤µà ¤¾à ¤¹</value> + </property> <property key="AccountingChartOfAcctsFor"> <value xml:lang="en">Chart of accounts for</value> <value xml:lang="hi_IN">लà¥à¤à¤¾-à¤à¤¿à¤¤à¥à¤° à¤à¥ लिà¤</value> @@ -2477,6 +2485,10 @@ <value xml:lang="th">สà¸à¸¸à¸¥à¹à¸à¸´à¸</value> <value xml:lang="zh">å¸ç§</value> </property> + <property key="AccountingCurrentAsset"> + <value xml:lang="en">Currennt Asset</value> + <value xml:lang="hi_IN">à ¤šà ¤¾à ¤²à ¥â à ¤¸à ¤®à ¥Âà ¤ªà ¤¤à ¥Âà ¤¤à ¤¿</value> + </property> <property key="AccountingCurrentBalance"> <value xml:lang="de">Ihr aktueller Kontostand ist:</value> <value xml:lang="en">Your current balance is:</value> @@ -6494,6 +6506,10 @@ <value xml:lang="th">à¹à¸à¸´à¸à¸à¹à¸§à¸à¹à¸§à¸¥à¸²</value> <value xml:lang="zh">æå¼æ¶é´æ®µ</value> </property> + <property key="AccountingOperationalCash"> + <value xml:lang="en">Operational Cash</value> + <value xml:lang="hi_IN">à ¤â¢Ã Â¥Âà ¤°à ¤¿à ¤¯à ¤¾à ¤¶à ¥â¬Ã ¤² à ¤¨à ¤â¢Ã ¤¦à ¥â¬</value> + </property> <property key="AccountingOrderItemWithIdNotFound"> <value xml:lang="de">Auftragsposition mit Nummer ${orderItemSeqId} nicht gefunden.</value> <value xml:lang="en">Order Item with id ${orderItemSeqId} not found.</value> @@ -8770,6 +8786,10 @@ <value xml:lang="en">Total amountPercentage is not equal 100.</value> <value xml:lang="hi_IN">à¤à¥à¤² amountPercentage बराबर 100 नहà¥à¤ हà¥</value> </property> + <property key="AccountingTotalCashBalance"> + <value xml:lang="en">Total Cash Balance</value> + <value xml:lang="hi_IN">à ¤â¢Ã Â¥Âà ¤² à ¤°à ¥â¹Ã ¤â¢Ã ¤¡à ¤¼ à ¤¶à ¥â¡Ã ¤·</value> + </property> <property key="AccountingTotalCostCenterAmount"> <value xml:lang="en">Cost center amount percentage saved successfully</value> </property> @@ -8777,6 +8797,10 @@ <value xml:lang="en">Total Commission Amount</value> <value xml:lang="hi_IN">à¤à¥à¤² दलालॠराशà¥</value> </property> + <property key="AccountingTotalCurrentAssetBalance"> + <value xml:lang="en">Total Current Asset Balance</value> + <value xml:lang="hi_IN">à ¤â¢Ã Â¥Âà ¤² à ¤šà ¤¾à ¤²à ¥â à ¤¸à ¤®à ¥Âà ¤ªà ¤¤à ¥Âà ¤¤à ¤¿ à ¤°à ¤¾à ¤¶à ¥â¬</value> + </property> <property key="AccountingTotalOfTheCurrentMonth"> <value xml:lang="en">Total of the current month</value> <value xml:lang="hi_IN">à¤à¤¾à¤²à¥ माह à¤à¥ à¤à¥à¤²</value> @@ -8785,6 +8809,10 @@ <value xml:lang="en">Total of Year To Date</value> <value xml:lang="hi_IN">वरà¥à¤· सॠदिनाà¤à¤ à¤à¤¾ à¤à¥à¤²</value> </property> + <property key="AccountingTotalOperationalCashBalance"> + <value xml:lang="en">Total Operational Cash Balance</value> + <value xml:lang="hi_IN">à ¤â¢Ã Â¥Âà ¤² à ¤â¢Ã Â¥Âà ¤°à ¤¿à ¤¯à ¤¾à ¤¶à ¥â¬Ã ¤² à ¤¨à ¤â¢Ã ¤¦à ¥â¬</value> + </property> <property key="AccountingTextData"> <value xml:lang="de">Textangaben</value> <value xml:lang="en">Text Data</value> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy?rev=887752&r1=887751&r2=887752&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy Sun Dec 6 19:45:59 2009 @@ -33,8 +33,8 @@ if (!thruDate) { thruDate = UtilDateTime.nowTimestamp(); } -if (!parameters.glFiscalTypeId) { - parameters.glFiscalTypeId = "ACTUAL"; +if (!glFiscalTypeId) { + return; } // Setup the divisions for which the report is executed @@ -141,7 +141,7 @@ List mainAndExprs = FastList.newInstance(); mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); -mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId)); +mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId)); mainAndExprs.add(EntityCondition.makeCondition("acctgTransTypeId", EntityOperator.NOT_EQUAL, "PERIOD_CLOSING")); mainAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); mainAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN, thruDate)); @@ -353,7 +353,7 @@ transactionTotalsMap.put(transactionTotal.glAccountId, accountMap); } // Add the "retained earnings" account -Map netIncomeResult = dispatcher.runSync("prepareIncomeStatement", UtilMisc.toMap("organizationPartyId", organizationPartyId, "glFiscalTypeId", parameters.glFiscalTypeId, "fromDate", fromDate, "thruDate", thruDate,"userLogin", userLogin)); +Map netIncomeResult = dispatcher.runSync("prepareIncomeStatement", UtilMisc.toMap("organizationPartyId", organizationPartyId, "glFiscalTypeId", glFiscalTypeId, "fromDate", fromDate, "thruDate", thruDate,"userLogin", userLogin)); BigDecimal netIncome = (BigDecimal)netIncomeResult.totalNetIncome; GenericValue retainedEarningsAccount = delegator.findOne("GlAccountTypeDefault", UtilMisc.toMap("glAccountTypeId", "RETAINED_EARNINGS", "organizationPartyId", organizationPartyId), true); if (retainedEarningsAccount) { Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy?rev=887752&view=auto ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy (added) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy Sun Dec 6 19:45:59 2009 @@ -0,0 +1,379 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.accounting.util.UtilAccounting; +import org.ofbiz.party.party.PartyWorker; + +import javolution.util.FastList; +import javolution.util.FastMap; + +if (!fromDate) { + return; +} +if (!thruDate) { + thruDate = UtilDateTime.nowTimestamp(); +} +if (!parameters.glFiscalTypeId) { + parameters.glFiscalTypeId = "ACTUAL"; +} + +uiLabelMap = UtilProperties.getResourceBundleMap("AccountingUiLabels", locale); + +// Setup the divisions for which the report is executed +List partyIds = PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP'); +partyIds.add(organizationPartyId); + +// Get the group of account classes that will be used to position accounts in the proper section of the financial statement +GenericValue cashEquivalentGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "CASH_EQUIVALENT"), true); +List cashEquivalentAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(cashEquivalentGlAccountClass); +GenericValue nonCashExpanseGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "NON_CASH_EXPENSE"), true); +List nonCashExpanseAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(nonCashExpanseGlAccountClass); +GenericValue inventoryAdjustGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "INVENTORY_ADJUST"), true); +List inventoryAdjustAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(inventoryAdjustGlAccountClass); +GenericValue currentAssetGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "CURRENT_ASSET"), true); +List currentAssetAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(currentAssetGlAccountClass); +GenericValue currentLiabilityGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "CURRENT_LIABILITY"), true); +List currentLiabilityAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(currentLiabilityGlAccountClass); +GenericValue longTermAssetGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "LONGTERM_ASSET"), true); +List longTermAssetAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(longTermAssetGlAccountClass); +GenericValue accumDepreciationGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "ACCUM_DEPRECIATION"), true); +List accumDepreciationAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(accumDepreciationGlAccountClass); +GenericValue accumAmoritizationGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "ACCUM_AMORTIZATION"), true); +List accumAmoritizationAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(accumAmoritizationGlAccountClass); +GenericValue longTermLiabilityGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "LONGTERM_LIABILITY"), true); +List longTermLiabilityAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(longTermLiabilityGlAccountClass); +GenericValue ownersEquityGlAccountClass = delegator.findOne("GlAccountClass", UtilMisc.toMap("glAccountClassId", "OWNERS_EQUITY"), true); +List ownersEquityAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(ownersEquityGlAccountClass); + +List mainAndExprs = FastList.newInstance(); +mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); +mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); +mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId)); +mainAndExprs.add(EntityCondition.makeCondition("acctgTransTypeId", EntityOperator.NOT_EQUAL, "PERIOD_CLOSING")); +mainAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); +mainAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN, thruDate)); + +List cashFlowBalanceTotalList = []; + +// CASH BALANCE +accountBalanceList = []; +transactionTotals = []; +balanceTotal = BigDecimal.ZERO; +List cashEquivalentAndExprs = FastList.newInstance(mainAndExprs); +cashEquivalentAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, cashEquivalentAccountClassIds)); +transactionTotals = delegator.findList("AcctgTransEntrySums", EntityCondition.makeCondition(cashEquivalentAndExprs, EntityOperator.AND), UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (transactionTotals) { + Map transactionTotalsMap = [:]; + balanceTotalCredit = BigDecimal.ZERO; + balanceTotalDebit = BigDecimal.ZERO; + transactionTotals.each { transactionTotal -> + Map accountMap = (Map)transactionTotalsMap.get(transactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(transactionTotal); + accountMap.remove("debitCreditFlag"); + accountMap.remove("amount"); + accountMap.D = BigDecimal.ZERO; + accountMap.C = BigDecimal.ZERO; + accountMap.balance = BigDecimal.ZERO; + } + UtilMisc.addToBigDecimalInMap(accountMap, transactionTotal.debitCreditFlag, transactionTotal.amount); + if ("D".equals(transactionTotal.debitCreditFlag)) { + balanceTotalDebit = balanceTotalDebit.add(transactionTotal.amount); + } else { + balanceTotalCredit = balanceTotalCredit.add(transactionTotal.amount); + } + BigDecimal debitAmount = (BigDecimal)accountMap.D; + BigDecimal creditAmount = (BigDecimal)accountMap.C; + BigDecimal balance = debitAmount.subtract(creditAmount); + accountMap.balance = balance; + transactionTotalsMap.(transactionTotal.glAccountId) = accountMap; + } + accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); + balanceTotal = balanceTotalDebit.subtract(balanceTotalCredit); +} +cashEquivalentBalanceTotal = balanceTotal; +context.cashEquivalentBalanceList = accountBalanceList; +context.cashEquivalentBalanceList.add("accountName":uiLabelMap.AccountingTotalCashBalance, "balance":balanceTotal); +cashFlowBalanceTotalList.add("totalName":"AccountingCashBalance", "balance":balanceTotal); + +// OPERATING CASH FLOW BALANCE +// NON_CASH_EXPENSE excluding INVENTORY_ADJUST +accountBalanceList = []; +transactionTotals = []; +balanceTotal = BigDecimal.ZERO; +List nonCashExpenseAndExprs = FastList.newInstance(mainAndExprs); +nonCashExpenseAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, nonCashExpanseAccountClassIds)); +nonCashExpenseAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.NOT_IN, inventoryAdjustAccountClassIds)); +transactionTotals = delegator.findList("AcctgTransEntrySums", EntityCondition.makeCondition(nonCashExpenseAndExprs, EntityOperator.AND), UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (transactionTotals) { + Map transactionTotalsMap = [:]; + balanceTotalCredit = BigDecimal.ZERO; + balanceTotalDebit = BigDecimal.ZERO; + transactionTotals.each { transactionTotal -> + Map accountMap = (Map)transactionTotalsMap.get(transactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(transactionTotal); + accountMap.remove("debitCreditFlag"); + accountMap.remove("amount"); + accountMap.D = BigDecimal.ZERO; + accountMap.C = BigDecimal.ZERO; + accountMap.balance = BigDecimal.ZERO; + } + UtilMisc.addToBigDecimalInMap(accountMap, transactionTotal.debitCreditFlag, transactionTotal.amount); + if ("D".equals(transactionTotal.debitCreditFlag)) { + balanceTotalDebit = balanceTotalDebit.add(transactionTotal.amount); + } else { + balanceTotalCredit = balanceTotalCredit.add(transactionTotal.amount); + } + BigDecimal debitAmount = (BigDecimal)accountMap.D; + BigDecimal creditAmount = (BigDecimal)accountMap.C; + BigDecimal balance = debitAmount.subtract(creditAmount); + accountMap.balance = balance; + transactionTotalsMap.(transactionTotal.glAccountId) = accountMap; + } + accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); + balanceTotal = balanceTotalDebit.subtract(balanceTotalCredit); +} +context.nonCashExpenseBalanceList = accountBalanceList; +context.nonCashExpenseBalanceList.add("accountName":uiLabelMap.AccountingTotalOperationalCashBalance, "balance":balanceTotal); +nonCashExpenseBalanceTotal = balanceTotal; + +// CURRENT_ASSET excluding CASH_EQUIVALENT +accountBalanceList = []; +transactionTotals = []; +balanceTotal = BigDecimal.ZERO; +List currentAssetAndExprs = FastList.newInstance(mainAndExprs); +currentAssetAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, currentAssetAccountClassIds)); +currentAssetAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.NOT_IN, cashEquivalentAccountClassIds)); +transactionTotals = delegator.findList("AcctgTransEntrySums", EntityCondition.makeCondition(currentAssetAndExprs, EntityOperator.AND), UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (transactionTotals) { + Map transactionTotalsMap = [:]; + balanceTotalCredit = BigDecimal.ZERO; + balanceTotalDebit = BigDecimal.ZERO; + transactionTotals.each { transactionTotal -> + Map accountMap = (Map)transactionTotalsMap.get(transactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(transactionTotal); + accountMap.remove("debitCreditFlag"); + accountMap.remove("amount"); + accountMap.D = BigDecimal.ZERO; + accountMap.C = BigDecimal.ZERO; + accountMap.balance = BigDecimal.ZERO; + } + UtilMisc.addToBigDecimalInMap(accountMap, transactionTotal.debitCreditFlag, transactionTotal.amount); + if ("D".equals(transactionTotal.debitCreditFlag)) { + balanceTotalDebit = balanceTotalDebit.add(transactionTotal.amount); + } else { + balanceTotalCredit = balanceTotalCredit.add(transactionTotal.amount); + } + BigDecimal debitAmount = (BigDecimal)accountMap.D; + BigDecimal creditAmount = (BigDecimal)accountMap.C; + BigDecimal balance = debitAmount.subtract(creditAmount); + accountMap.balance = balance; + transactionTotalsMap.(transactionTotal.glAccountId) = accountMap; + } + accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); + balanceTotal = balanceTotalDebit.subtract(balanceTotalCredit); +} +context.currentAssetBalanceList = accountBalanceList; +context.currentAssetBalanceList.add("accountName":uiLabelMap.AccountingTotalCurrentAssetBalance, "balance":balanceTotal); +currentAssetBalanceTotal = balanceTotal; + +// CURRENT_LIABILITY +accountBalanceList = []; +transactionTotals = []; +balanceTotal = BigDecimal.ZERO; +List currentLiabilityAndExprs = FastList.newInstance(mainAndExprs); +currentLiabilityAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, currentLiabilityAccountClassIds)); +transactionTotals = delegator.findList("AcctgTransEntrySums", EntityCondition.makeCondition(currentLiabilityAndExprs, EntityOperator.AND), UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (transactionTotals) { + Map transactionTotalsMap = [:]; + balanceTotalCredit = BigDecimal.ZERO; + balanceTotalDebit = BigDecimal.ZERO; + transactionTotals.each { transactionTotal -> + Map accountMap = (Map)transactionTotalsMap.get(transactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(transactionTotal); + accountMap.remove("debitCreditFlag"); + accountMap.remove("amount"); + accountMap.D = BigDecimal.ZERO; + accountMap.C = BigDecimal.ZERO; + accountMap.balance = BigDecimal.ZERO; + } + UtilMisc.addToBigDecimalInMap(accountMap, transactionTotal.debitCreditFlag, transactionTotal.amount); + if ("D".equals(transactionTotal.debitCreditFlag)) { + balanceTotalDebit = balanceTotalDebit.add(transactionTotal.amount); + } else { + balanceTotalCredit = balanceTotalCredit.add(transactionTotal.amount); + } + BigDecimal debitAmount = (BigDecimal)accountMap.D; + BigDecimal creditAmount = (BigDecimal)accountMap.C; + BigDecimal balance = debitAmount.subtract(creditAmount); + accountMap.balance = balance; + transactionTotalsMap.(transactionTotal.glAccountId) = accountMap; + } + accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); + balanceTotal = balanceTotalDebit.subtract(balanceTotalCredit); +} +context.currentLiabilityBalanceList = accountBalanceList; +context.currentLiabilityBalanceList.add("accountName":uiLabelMap.AccountingTotalCurrentLiabilityBalance, "balance": balanceTotal); +currentLiabilityBalanceTotal = balanceTotal; + +// TOTAL OPERATION CASH FLOW = NET INCOME + CURRENT_LIABILITY - NON_CASH_EXPENSE escluding INVENTORY_ADJUST - CURRENT_ASSET excluding CASH_EQUIVALENT +context.totalOperationsCashBalance = ((context.netIncome.add(currentLiabilityBalanceTotal)).subtract(nonCashExpenseBalanceTotal)).subtract(currentAssetBalanceTotal); +cashFlowBalanceTotalList.add("totalName":"AccountingOperationsCashBalance", "balance":context.totalOperationsCashBalance); + +// INVESTING CASH FLOW AMOUNT +// LONGTERM_ASSET && ! ACCUM_DEPRECIATION && ! ACCUM_AMORTIZATION +accountBalanceList = []; +transactionTotals = []; +balanceTotal = BigDecimal.ZERO; +List investingCashAndExprs = FastList.newInstance(mainAndExprs); +investingCashAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, longTermAssetAccountClassIds)); +investingCashAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.NOT_IN, accumDepreciationAccountClassIds)); +investingCashAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.NOT_IN, accumAmoritizationAccountClassIds)); +transactionTotals = delegator.findList("AcctgTransEntrySums", EntityCondition.makeCondition(investingCashAndExprs, EntityOperator.AND), UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (transactionTotals) { + Map transactionTotalsMap = [:]; + balanceTotalCredit = BigDecimal.ZERO; + balanceTotalDebit = BigDecimal.ZERO; + transactionTotals.each { transactionTotal -> + Map accountMap = (Map)transactionTotalsMap.get(transactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(transactionTotal); + accountMap.remove("debitCreditFlag"); + accountMap.remove("amount"); + accountMap.D = BigDecimal.ZERO; + accountMap.C = BigDecimal.ZERO; + accountMap.balance = BigDecimal.ZERO; + } + UtilMisc.addToBigDecimalInMap(accountMap, transactionTotal.debitCreditFlag, transactionTotal.amount); + if ("D".equals(transactionTotal.debitCreditFlag)) { + balanceTotalDebit = balanceTotalDebit.add(transactionTotal.amount); + } else { + balanceTotalCredit = balanceTotalCredit.add(transactionTotal.amount); + } + BigDecimal debitAmount = (BigDecimal)accountMap.D; + BigDecimal creditAmount = (BigDecimal)accountMap.C; + BigDecimal balance = debitAmount.subtract(creditAmount); + accountMap.balance = balance; + transactionTotalsMap.(transactionTotal.glAccountId) = accountMap; + } + accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); + balanceTotal = balanceTotalDebit.subtract(balanceTotalCredit); +} +investingBalanceTotal = balanceTotal; +context.investingCashBalanceList = accountBalanceList; +context.investingCashBalanceList.add("accountName":uiLabelMap.AccountingTotalInvestingCashBalance, "balance":balanceTotal); +cashFlowBalanceTotalList.add("totalName":"AccountingInvestmentsBalance", "balance":((BigDecimal.ZERO).subtract(balanceTotal))); + +// FINANCING CASH FLOW AMOUNT +// LONGTERM_LIABILITY +accountBalanceList = []; +transactionTotals = []; +balanceTotal = BigDecimal.ZERO; +List longTermLiabilityAndExprs = FastList.newInstance(mainAndExprs); +longTermLiabilityAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, longTermLiabilityAccountClassIds)); +transactionTotals = delegator.findList("AcctgTransEntrySums", EntityCondition.makeCondition(longTermLiabilityAndExprs, EntityOperator.AND), UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (transactionTotals) { + Map transactionTotalsMap = [:]; + balanceTotalCredit = BigDecimal.ZERO; + balanceTotalDebit = BigDecimal.ZERO; + transactionTotals.each { transactionTotal -> + Map accountMap = (Map)transactionTotalsMap.get(transactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(transactionTotal); + accountMap.remove("debitCreditFlag"); + accountMap.remove("amount"); + accountMap.D = BigDecimal.ZERO; + accountMap.C = BigDecimal.ZERO; + accountMap.balance = BigDecimal.ZERO; + } + UtilMisc.addToBigDecimalInMap(accountMap, transactionTotal.debitCreditFlag, transactionTotal.amount); + if ("D".equals(transactionTotal.debitCreditFlag)) { + balanceTotalDebit = balanceTotalDebit.add(transactionTotal.amount); + } else { + balanceTotalCredit = balanceTotalCredit.add(transactionTotal.amount); + } + BigDecimal debitAmount = (BigDecimal)accountMap.D; + BigDecimal creditAmount = (BigDecimal)accountMap.C; + BigDecimal balance = debitAmount.subtract(creditAmount); + accountMap.balance = balance; + transactionTotalsMap.(transactionTotal.glAccountId) = accountMap; + } + accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); + balanceTotal = balanceTotalDebit.subtract(balanceTotalCredit); +} +longTermLiabillityBalanceTotal = balanceTotal; +context.longTermLiabilityBalanceList = accountBalanceList; +context.longTermLiabilityBalanceList.add("accountName":uiLabelMap.AccountingTotalLongTermLiabilityBalance, "balance":balanceTotal); +cashFlowBalanceTotalList.add("totalName":"AccountingLongTermLiabilityBalance", "balance":balanceTotal); + +// OWNERS_EQUITY +accountBalanceList = []; +transactionTotals = []; +balanceTotal = BigDecimal.ZERO; +List ownersEquityAndExprs = FastList.newInstance(mainAndExprs); +ownersEquityAndExprs.add(EntityCondition.makeCondition("glAccountClassId", EntityOperator.IN, ownersEquityAccountClassIds)); +transactionTotals = delegator.findList("AcctgTransEntrySums", EntityCondition.makeCondition(ownersEquityAndExprs, EntityOperator.AND), UtilMisc.toSet("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount"), UtilMisc.toList("glAccountId"), null, false); +if (transactionTotals) { + Map transactionTotalsMap = [:]; + balanceTotalCredit = BigDecimal.ZERO; + balanceTotalDebit = BigDecimal.ZERO; + transactionTotals.each { transactionTotal -> + Map accountMap = (Map)transactionTotalsMap.get(transactionTotal.glAccountId); + if (!accountMap) { + accountMap = UtilMisc.makeMapWritable(transactionTotal); + accountMap.remove("debitCreditFlag"); + accountMap.remove("amount"); + accountMap.D = BigDecimal.ZERO; + accountMap.C = BigDecimal.ZERO; + accountMap.balance = BigDecimal.ZERO; + } + UtilMisc.addToBigDecimalInMap(accountMap, transactionTotal.debitCreditFlag, transactionTotal.amount); + if ("D".equals(transactionTotal.debitCreditFlag)) { + balanceTotalDebit = balanceTotalDebit.add(transactionTotal.amount); + } else { + balanceTotalCredit = balanceTotalCredit.add(transactionTotal.amount); + } + BigDecimal debitAmount = (BigDecimal)accountMap.D; + BigDecimal creditAmount = (BigDecimal)accountMap.C; + BigDecimal balance = debitAmount.subtract(creditAmount); + accountMap.balance = balance; + transactionTotalsMap.(transactionTotal.glAccountId) = accountMap; + } + accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); + balanceTotal = balanceTotalCredit.subtract(balanceTotalDebit); +} +ownersEquityBalanceTotal = balanceTotal; +context.ownersEquityBalanceList = accountBalanceList; +context.ownersEquityBalanceList.add("accountName":uiLabelMap.AccountingOwnersEquityBalance, "balance":balanceTotal); +cashFlowBalanceTotalList.add("totalName":"AccountingOwnersEquityBalance", "balance":balanceTotal); + +// CASH FLOW STATEMENT ENDING BALANCE +// ENDING BALANCE = CASH BALANCE + OPERATING CASH BALANCE + LONG TERM LIABILITY BALANCE + OWNERS EQUITY BALANCE - INVESTMENT BALANCE +cashFlowEndingBalance = cashEquivalentBalanceTotal.add(context.totalOperationsCashBalance).add(longTermLiabillityBalanceTotal).add(ownersEquityBalanceTotal).subtract(investingBalanceTotal) +cashFlowBalanceTotalList.add("totalName":"AccountingCashFlowEndingBalance", "balance":cashFlowEndingBalance); +context.cashFlowBalanceTotalList = cashFlowBalanceTotalList; Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/ComparativeIncomeStatement.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/ComparativeIncomeStatement.groovy?rev=887752&r1=887751&r2=887752&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/ComparativeIncomeStatement.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/ComparativeIncomeStatement.groovy Sun Dec 6 19:45:59 2009 @@ -17,109 +17,69 @@ * under the License. */ +import org.ofbiz.base.util.UtilMisc; import java.math.BigDecimal; -import java.sql.Timestamp; -import org.ofbiz.entity.util.EntityUtil; -period1FromDate = parameters.period1FromDate; -period1ThruDate = parameters.period1ThruDate; -period2FromDate = parameters.period2FromDate; -period2ThruDate = parameters.period2ThruDate; - -if (period1FromDate && period1ThruDate && organizationPartyId && period2FromDate && period2ThruDate) { - onlyIncludePeriodTypeIdList = []; - onlyIncludePeriodTypeIdList.add("FISCAL_YEAR"); - glAccountIncomeList = []; - glAccountExpenseList = []; - periodExpenses = []; - periodIncomes = []; - period1IncomeStatement = getGlAccountTotals(onlyIncludePeriodTypeIdList, Timestamp.valueOf(period1FromDate), Timestamp.valueOf(period1ThruDate), organizationPartyId, parameters.glFiscalTypeId); - period1Expenses = []; - period1Incomes = []; - if (period1IncomeStatement) { - context.period1TotalNetIncome = period1IncomeStatement.totalNetIncome; - glAccountTotalsMapForPeriod1 = period1IncomeStatement.glAccountTotalsMap; - if (glAccountTotalsMapForPeriod1) { - period1Expenses = glAccountTotalsMapForPeriod1.expenses; - period1Incomes = glAccountTotalsMapForPeriod1.income; - if (period1Incomes) - periodIncomes.addAll(period1Incomes); - if (period1Expenses) - periodExpenses.addAll(period1Expenses); - } - } - period2IncomeStatement = getGlAccountTotals(onlyIncludePeriodTypeIdList ,Timestamp.valueOf(period2FromDate) ,Timestamp.valueOf(period2ThruDate) ,organizationPartyId , parameters.glFiscalTypeId); - period2Expenses = []; - period2Incomes = []; - if (period2IncomeStatement) { - context.period2TotalNetIncome = period2IncomeStatement.totalNetIncome; - glAccountTotalsMapForPeriod2 = period2IncomeStatement.glAccountTotalsMap; - if (glAccountTotalsMapForPeriod2) { - period2Expenses = glAccountTotalsMapForPeriod2.expenses; - period2Incomes = glAccountTotalsMapForPeriod2.income; - period2Expenses.each { period2Expense -> - if (!((periodExpenses.glAccountId).contains(period2Expense.glAccountId))) - periodExpenses.add(period2Expense); - } - period2Incomes.each { period2Income -> - if (!((periodIncomes.glAccountId).contains(period2Income.glAccountId))) - periodIncomes.add(period2Income); - } - } +revenueAccountBalanceMap = [:]; +revenueAccountBalanceList = []; +revenueAccountBalanceList1.each { accountBalance -> + revenueAccountBalanceMap.put(accountBalance.glAccountId, UtilMisc.toMap("glAccountId", accountBalance.glAccountId, "accountCode", accountBalance.accountCode, "accountName", accountBalance.accountName, "balance1", accountBalance.balance, "balance2", BigDecimal.ZERO)); +} +revenueAccountBalanceList2.each { accountBalance -> + Map assetAccount = (Map)revenueAccountBalanceMap.get(accountBalance.glAccountId); + if (!assetAccount) { + revenueAccountBalanceMap.put(accountBalance.glAccountId, UtilMisc.toMap("glAccountId", accountBalance.glAccountId, "accountCode", accountBalance.accountCode, "accountName", accountBalance.accountName, "balance2", accountBalance.balance, "balance1", BigDecimal.ZERO)); + } else { + assetAccount.put("balance2", accountBalance.balance); } - periodExpenses.each { periodExpense -> - period1TotalAmount = BigDecimal.ZERO; - period2TotalAmount = BigDecimal.ZERO; - if ((period1Expenses.glAccountId).contains(periodExpense.glAccountId)) { - period1Expenses.each { period1Expense -> - if(periodExpense.glAccountId.equals(period1Expense.glAccountId)) - period1TotalAmount = period1Expense.totalAmount; - } - } - if ((period2Expenses.glAccountId).contains(periodExpense.glAccountId)) { - period2Expenses.each { period2Expense -> - if(periodExpense.glAccountId.equals(period2Expense.glAccountId)) - period2TotalAmount = period2Expense.totalAmount; - } - } - glAccountExpenseList.add([glAccountId : periodExpense.glAccountId , period1TotalAmount : period1TotalAmount , period2TotalAmount : period2TotalAmount]); - context.glAccountExpenseList = glAccountExpenseList; +} +revenueAccountBalanceList = UtilMisc.sortMaps(revenueAccountBalanceMap.values().asList(), UtilMisc.toList("accountCode")); +context.revenueAccountBalanceList = revenueAccountBalanceList; + +expenseAccountBalanceMap = [:]; +expenseAccountBalanceList = []; +expenseAccountBalanceList1.each { accountBalance -> + expenseAccountBalanceMap.put(accountBalance.glAccountId, UtilMisc.toMap("glAccountId", accountBalance.glAccountId, "accountCode", accountBalance.accountCode, "accountName", accountBalance.accountName, "balance1", accountBalance.balance, "balance2", BigDecimal.ZERO)); +} +expenseAccountBalanceList2.each { accountBalance -> + Map assetAccount = (Map)expenseAccountBalanceMap.get(accountBalance.glAccountId); + if (!assetAccount) { + expenseAccountBalanceMap.put(accountBalance.glAccountId, UtilMisc.toMap("glAccountId", accountBalance.glAccountId, "accountCode", accountBalance.accountCode, "accountName", accountBalance.accountName, "balance2", accountBalance.balance, "balance1", BigDecimal.ZERO)); + } else { + assetAccount.put("balance2", accountBalance.balance); } - periodIncomes.each { periodIncome -> - period1TotalAmount = BigDecimal.ZERO; - period2TotalAmount = BigDecimal.ZERO; - if ((period1Incomes.glAccountId).contains(periodIncome.glAccountId)) { - period1Incomes.each { period1Income -> - if(periodIncome.glAccountId.equals(period1Income.glAccountId)) - period1TotalAmount = period1Income.totalAmount; - } - } - if ((period2Incomes.glAccountId).contains(periodIncome.glAccountId)) { - period2Incomes.each { period2Income -> - if(periodIncome.glAccountId.equals(period2Income.glAccountId)) - period2TotalAmount = period2Income.totalAmount; - } - } - glAccountIncomeList.add([glAccountId : periodIncome.glAccountId , period1TotalAmount : period1TotalAmount , period2TotalAmount : period2TotalAmount]); - context.glAccountIncomeList = glAccountIncomeList; +} +expenseAccountBalanceList = UtilMisc.sortMaps(expenseAccountBalanceMap.values().asList(), UtilMisc.toList("accountCode")); +context.expenseAccountBalanceList = expenseAccountBalanceList; + +incomeAccountBalanceMap = [:]; +incomeAccountBalanceList = []; +incomeAccountBalanceList1.each { accountBalance -> + incomeAccountBalanceMap.put(accountBalance.glAccountId, UtilMisc.toMap("glAccountId", accountBalance.glAccountId, "accountCode", accountBalance.accountCode, "accountName", accountBalance.accountName, "balance1", accountBalance.balance, "balance2", BigDecimal.ZERO)); +} +incomeAccountBalanceList2.each { accountBalance -> + Map assetAccount = (Map)incomeAccountBalanceMap.get(accountBalance.glAccountId); + if (!assetAccount) { + incomeAccountBalanceMap.put(accountBalance.glAccountId, UtilMisc.toMap("glAccountId", accountBalance.glAccountId, "accountCode", accountBalance.accountCode, "accountName", accountBalance.accountName, "balance2", accountBalance.balance, "balance1", BigDecimal.ZERO)); + } else { + assetAccount.put("balance2", accountBalance.balance); } } +incomeAccountBalanceList = UtilMisc.sortMaps(incomeAccountBalanceMap.values().asList(), UtilMisc.toList("accountCode")); +context.incomeAccountBalanceList = incomeAccountBalanceList; -private Map getGlAccountTotals(List onlyIncludePeriodTypeIdList, Timestamp fromDate, Timestamp thruDate, String organizationPartyId, String glFiscalTypeId) { - customTimePeriodResult = dispatcher.runSync("findCustomTimePeriods", [findDate : thruDate, organizationPartyId : organizationPartyId, onlyIncludePeriodTypeIdList : onlyIncludePeriodTypeIdList, userLogin : userLogin]); - if (customTimePeriodResult) { - customTimePeriod = EntityUtil.getFirst(customTimePeriodResult.customTimePeriodList); - if (customTimePeriod) { - customTimePeriodFromDate = new Timestamp((customTimePeriod.fromDate).getTime()); - customTimePeriodThruDate = new Timestamp((customTimePeriod.thruDate).getTime()); - if (customTimePeriodFromDate.compareTo(fromDate) > 0) - fromDate = customTimePeriodFromDate; - if (customTimePeriodThruDate.compareTo(thruDate) < 0) - thruDate = customTimePeriodThruDate; - context.financialYearFromDate = customTimePeriodFromDate; - } - prepareIncomeStatement = dispatcher.runSync("prepareIncomeStatement", - [fromDate : fromDate, thruDate : thruDate, organizationPartyId : organizationPartyId, glFiscalTypeId : glFiscalTypeId, userLogin : userLogin]); - return prepareIncomeStatement; +balanceTotalMap = [:]; +balanceTotalList = []; +balanceTotalList1.each { accountBalance -> + balanceTotalMap.put(accountBalance.totalName, UtilMisc.toMap("totalName", accountBalance.totalName, "balance1", accountBalance.balance, "balance2", BigDecimal.ZERO)); +} +balanceTotalList2.each { accountBalance -> + Map assetAccount = (Map)balanceTotalMap.get(accountBalance.totalName); + if (!assetAccount) { + balanceTotalMap.put(accountBalance.totalName, UtilMisc.toMap("totalName", accountBalance.totalName, "balance2", accountBalance.balance, "balance1", BigDecimal.ZERO)); + } else { + assetAccount.put("balance2", accountBalance.balance); } -} \ No newline at end of file +} +balanceTotalList = balanceTotalMap.values().asList(); +context.balanceTotalList = balanceTotalList; Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/IncomeStatement.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/IncomeStatement.groovy?rev=887752&r1=887751&r2=887752&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/IncomeStatement.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/IncomeStatement.groovy Sun Dec 6 19:45:59 2009 @@ -33,8 +33,8 @@ if (!thruDate) { thruDate = UtilDateTime.nowTimestamp(); } -if (!parameters.glFiscalTypeId) { - parameters.glFiscalTypeId = "ACTUAL"; +if (!glFiscalTypeId) { + return; } // Setup the divisions for which the report is executed @@ -56,7 +56,7 @@ List mainAndExprs = FastList.newInstance(); mainAndExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)); mainAndExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y")); -mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId)); +mainAndExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, glFiscalTypeId)); mainAndExprs.add(EntityCondition.makeCondition("acctgTransTypeId", EntityOperator.NOT_EQUAL, "PERIOD_CLOSING")); mainAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); mainAndExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN, thruDate)); Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=887752&r1=887751&r2=887752&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sun Dec 6 19:45:59 2009 @@ -2266,7 +2266,8 @@ <response name="success" type="view" value="InventoryValuationCsv"/> <response name="error" type="view" value="InventoryValuation"/> </request-map> - + <request-map uri="CashFlowStatement"><security https="true" auth="true"/><response name="success" type="view" value="CashFlowStatement"/></request-map> + <!-- ================ Depreciation Calculation Report requests ================ --> <request-map uri="showFixedAssetDepreciation"> <security https="true" auth="true"/> @@ -2730,6 +2731,7 @@ <view-map name="InventoryValuation" type="screen" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#InventoryValuation"/> <view-map name="InventoryValuationPdf" type="screenfop" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#InventoryValuationPdf" content-type="application/pdf" encoding="none"/> <view-map name="InventoryValuationCsv" type="screencsv" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#InventoryValuationCsv" content-type="text/csv" encoding="none"/> + <view-map name="CashFlowStatement" type="screen" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#CashFlowStatement"/> <!-- Assignment Mappings --> <view-map name="EditPartyFixedAssetAssignments" type="screen" page="component://accounting/widget/FixedAssetScreens.xml#EditPartyFixedAssetAssignments"/> Modified: ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml?rev=887752&r1=887751&r2=887752&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml Sun Dec 6 19:45:59 2009 @@ -832,6 +832,11 @@ <parameter param-name="organizationPartyId"/> </link> </menu-item> + <menu-item name="CashFlowStatement" title="${uiLabelMap.AccountingCashFlowStatement}"> + <link target="CashFlowStatement"> + <parameter param-name="organizationPartyId"/> + </link> + </menu-item> </menu> <menu name="PartyAdminTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" default-menu-item-name="PartyAcctgPreference"> Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?rev=887752&r1=887751&r2=887752&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml Sun Dec 6 19:45:59 2009 @@ -130,24 +130,33 @@ <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> </form> - - <form name="BalanceSheetParameters" type="single" target="BalanceSheet" - header-row-style="header-row" default-table-style="basic-table"> + <form name="ComparativeIncomeStatementParameters" type="single" target="ComparativeIncomeStatement" header-row-style="header-row" default-table-style="basic-table"> <field name="organizationPartyId"><hidden/></field> - <field name="thruDate"><date-time default-value="${nowTimestamp}"/></field> - <field name="glFiscalTypeId" title="${uiLabelMap.FormFieldTitle_glFiscalType}"> + <field name="period1FromDate" title="${uiLabelMap.FormFieldTitle_period1FromDate}" required-field="true" position="1"><date-time type="timestamp"/></field> + <field name="period2FromDate" title="${uiLabelMap.FormFieldTitle_period2FromDate}" required-field="true" position="2"><date-time type="timestamp"/></field> + <field name="period1ThruDate" title="${uiLabelMap.FormFieldTitle_period1ThruDate}" required-field="true" position="1"><date-time type="timestamp"/></field> + <field name="period2ThruDate" title="${uiLabelMap.FormFieldTitle_period2ThruDate}" required-field="true" position="2"><date-time type="timestamp"/></field> + <field name="period1GlFiscalTypeId" position="1"> <drop-down> - <entity-options entity-name="GlFiscalType" description="${description}"> + <entity-options entity-name="GlFiscalType" key-field-name="glFiscalTypeId" description="${description}"> <entity-order-by field-name="glFiscalTypeId"/> </entity-options> </drop-down> </field> - <field name="submitButton" widget-style="smallSubmit"><submit button-type="button"/></field> + <field name="period2GlFiscalTypeId" position="2"> + <drop-down> + <entity-options entity-name="GlFiscalType" key-field-name="glFiscalTypeId" description="${description}"> + <entity-order-by field-name="glFiscalTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> - <form name="ComparativeBalanceSheetParameters" type="single" target="ComparativeBalanceSheet" - header-row-style="header-row" default-table-style="basic-table"> + <!-- This is required to render the date range in the PDF: the two columns layout is not supported --> + <form name="ComparativeIncomeStatementParametersOneColumn" type="single" target="ComparativeIncomeStatement" header-row-style="header-row" default-table-style="basic-table"> <field name="organizationPartyId"><hidden/></field> - <field name="period1ThruDate"><date-time/></field> + <field name="period1FromDate" title="${uiLabelMap.FormFieldTitle_period1FromDate}" required-field="true"><date-time type="timestamp"/></field> + <field name="period1ThruDate" title="${uiLabelMap.FormFieldTitle_period1ThruDate}" required-field="true"><date-time type="timestamp"/></field> <field name="period1GlFiscalTypeId"> <drop-down> <entity-options entity-name="GlFiscalType" key-field-name="glFiscalTypeId" description="${description}"> @@ -155,7 +164,8 @@ </entity-options> </drop-down> </field> - <field name="period2ThruDate"><date-time/></field> + <field name="period2FromDate" title="${uiLabelMap.FormFieldTitle_period2FromDate}" required-field="true"><date-time type="timestamp"/></field> + <field name="period2ThruDate" title="${uiLabelMap.FormFieldTitle_period2ThruDate}" required-field="true"><date-time type="timestamp"/></field> <field name="period2GlFiscalTypeId"> <drop-down> <entity-options entity-name="GlFiscalType" key-field-name="glFiscalTypeId" description="${description}"> @@ -163,9 +173,58 @@ </entity-options> </drop-down> </field> - <field name="submitButton" widget-style="smallSubmit"><submit button-type="button"/></field> + <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> + <form name="ComparativeIncomeStatementRevenues" type="list" list-name="revenueAccountBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance1" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + <field name="balance2" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="ComparativeIncomeStatementExpenses" type="list" list-name="expenseAccountBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance1" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + <field name="balance2" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="ComparativeIncomeStatementIncome" type="list" list-name="incomeAccountBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance1" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + <field name="balance2" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> </form> + <form name="BalanceSheetParameters" type="single" target="BalanceSheet" + header-row-style="header-row" default-table-style="basic-table"> + <field name="organizationPartyId"><hidden/></field> + <field name="thruDate"><date-time default-value="${nowTimestamp}"/></field> + <field name="glFiscalTypeId" title="${uiLabelMap.FormFieldTitle_glFiscalType}"> + <drop-down> + <entity-options entity-name="GlFiscalType" description="${description}"> + <entity-order-by field-name="glFiscalTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="submitButton" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> <form name="BalanceSheetAssets" type="list" list-name="assetAccountBalanceList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="accountCode"> @@ -199,6 +258,35 @@ <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> </form> + <form name="BalanceTotals" type="list" list-name="balanceTotalList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <row-actions> + <set field="totalName" value="${groovy: uiLabelMap.get(totalName)}"/> + </row-actions> + <field name="totalName" title="${uiLabelMap.CommonTotal}" title-area-style="tableheadhuge"><display description="${totalName}"/></field> + <field name="balance" title="_" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="ComparativeBalanceSheetParameters" type="single" target="ComparativeBalanceSheet" + header-row-style="header-row" default-table-style="basic-table"> + <field name="organizationPartyId"><hidden/></field> + <field name="period1ThruDate" position="1"><date-time/></field> + <field name="period2ThruDate" position="2"><date-time/></field> + <field name="period1GlFiscalTypeId" position="1"> + <drop-down> + <entity-options entity-name="GlFiscalType" key-field-name="glFiscalTypeId" description="${description}"> + <entity-order-by field-name="glFiscalTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="period2GlFiscalTypeId" position="2"> + <drop-down> + <entity-options entity-name="GlFiscalType" key-field-name="glFiscalTypeId" description="${description}"> + <entity-order-by field-name="glFiscalTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="submitButton" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> <form name="ComparativeBalanceSheetAssets" type="list" list-name="assetAccountBalanceList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="accountCode"> @@ -235,14 +323,6 @@ <field name="balance1" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> <field name="balance2" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> </form> - <form name="BalanceTotals" type="list" list-name="balanceTotalList" - odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> - <row-actions> - <set field="totalName" value="${groovy: uiLabelMap.get(totalName)}"/> - </row-actions> - <field name="totalName" title="${uiLabelMap.CommonTotal}" title-area-style="tableheadhuge"><display description="${totalName}"/></field> - <field name="balance" title="_" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> - </form> <form name="ComparativeBalanceTotals" type="list" list-name="balanceTotalList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <row-actions> @@ -500,21 +580,7 @@ <field name="totalInventoryCost" use-when="currencyUomId==null" title="${uiLabelMap.CommonTotalValue}"><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field> </form> - <form name="ComparativeIncomeStatementParameters" type="single" header-row-style="header-row" default-table-style="basic-table"> - <field name="period1FromDate" title="${uiLabelMap.FormFieldTitle_period1FromDate}" required-field="true" position="1"><date-time type="timestamp"/></field> - <field name="period1ThruDate" title="${uiLabelMap.FormFieldTitle_period1ThruDate}" required-field="true" position="2"><date-time type="timestamp"/></field> - <field name="period2FromDate" title="${uiLabelMap.FormFieldTitle_period2FromDate}" required-field="true" position="1"><date-time type="timestamp"/></field> - <field name="period2ThruDate" title="${uiLabelMap.FormFieldTitle_period2ThruDate}" required-field="true" position="2"><date-time type="timestamp"/></field> - <field name="glFiscalTypeId" title="${uiLabelMap.FormFieldTitle_glFiscalType}"> - <drop-down> - <entity-options entity-name="GlFiscalType" description="${description}"> - <entity-order-by field-name="glFiscalTypeId"/> - </entity-options> - </drop-down> - </field> - <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit" tooltip="Please enter From and Thru date in fields above"><submit button-type="button"/></field> - </form> - + <form name="ComparativeIncomeStatementList" type="list" list-name="glAccountIncomeList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <row-actions> @@ -588,4 +654,108 @@ <field name="totalEndingBalance" title="${uiLabelMap.AccountingEndingBalance}" widget-style="tabletextright"><display description="${totalEndingBalance}" type="currency" currency="${currencyUomId}"/></field> </form> + <form name="CashFlowStatementParameters" type="single" header-row-style="header-row" default-table-style="basic-table"> + <field name="selectedMonth" title="${uiLabelMap.CommonMonth}"> + <drop-down> + <list-options list-name="monthList" key-name="value" description="${description}"/> + </drop-down> + </field> + <field name="fromDate" required-field="false"><date-time type="timestamp"/></field> + <field name="thruDate" required-field="false"><date-time type="timestamp"/></field> + <field name="glFiscalTypeId" title="${uiLabelMap.FormFieldTitle_glFiscalType}"> + <drop-down> + <entity-options entity-name="GlFiscalType" description="${description}"> + <entity-order-by field-name="glFiscalTypeId"/> + </entity-options> + </drop-down> + </field> + <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit" tooltip="Please enter From and Thru date in fields above"><submit button-type="button"/></field> + </form> + + <!-- Cash Flow Statement --> + <form name="CashFlowStatementOperationalCash" type="list" list-name="nonCashExpenseBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="CashFlowStatementCurrentAsset" type="list" list-name="currentAssetBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="CashFlowStatementCurrentLiability" type="list" list-name="currentLiabilityBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="CashFlowStatementInvestment" type="list" list-name="investingCashBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="CashFlowStatementLongTermLiability" type="list" list-name="longTermLiabilityBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="CashFlowStatementOwnersEquity" type="list" list-name="ownersEquityBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="CashFlowStatementCashBalance" type="list" list-name="cashEquivalentBalanceList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="accountCode"> + <hyperlink target="FindAcctgTransEntries" description="${accountCode}"> + <parameter param-name="glAccountId"/> + <parameter param-name="organizationPartyId"/> + </hyperlink> + </field> + <field name="accountName" title-area-style="tableheadwide"><display description="${accountName}"/></field> + <field name="balance" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> + <form name="CashFlowBalanceTotals" type="list" list-name="cashFlowBalanceTotalList" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <row-actions> + <set field="totalName" value="${groovy: uiLabelMap.get(totalName)}"/> + </row-actions> + <field name="totalName" title="${uiLabelMap.CommonTotal}" title-area-style="tableheadhuge"><display description="${totalName}"/></field> + <field name="balance" title="_" widget-style="tabletextright"><display type="currency" currency="${currencyUomId}"/></field> + </form> </forms> |
| Free forum by Nabble | Edit this page |
