You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ap...@apache.org on 2009/08/26 17:11:38 UTC
svn commit: r808047 - in /ofbiz/trunk/applications/accounting:
script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy
widget/ReportFinancialSummaryScreens.xml
Author: apatel
Date: Wed Aug 26 15:11:37 2009
New Revision: 808047
URL: http://svn.apache.org/viewvc?rev=808047&view=rev
Log:
Remaining reports are now including sub-division gl entries when preparing financial reports. Patch from OFBIZ-2818. Thanks Awdesh, Eva for help.
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=808047&r1=808046&r2=808047&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Wed Aug 26 15:11:37 2009
@@ -895,9 +895,12 @@
<call-class-method class-name="org.ofbiz.accounting.util.UtilAccounting" method-name="getDescendantGlAccountClassIds" ret-field="incomeAccountClassIds">
<field field="incomeGlAccountClass" type="GenericValue"/>
</call-class-method>
+ <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/>
+ <set field="partyIds[]" from-field="organizationPartyId"/>
<entity-condition entity-name="AcctgTransAndEntries" list="acctgTransAndEntries">
<condition-list combine="and">
- <condition-expr field-name="organizationPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+ <condition-expr field-name="organizationPartyId" operator="in" from-field="partyIds"/>
<condition-expr field-name="isPosted" operator="equals" value="Y"/>
<condition-expr field-name="glFiscalTypeId" operator="equals" from-field="parameters.glFiscalTypeId"/>
<condition-expr field-name="transactionDate" operator="greater-equals" from-field="parameters.fromDate"/>
@@ -914,14 +917,14 @@
</entity-condition>
<set field="findCustomTimePeriodsMap.findDate" from-field="parameters.fromDate" type="Timestamp"/>
- <set field="findCustomTimePeriodsMap.organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="findCustomTimePeriodsMap.organizationPartyId" from-field="organizationPartyId"/>
<call-service service-name="findCustomTimePeriods" in-map-name="findCustomTimePeriodsMap">
<result-to-field result-name="customTimePeriodList"/>
</call-service>
<first-from-list list="customTimePeriodList" entry="customTimePeriod"/>
<set field="acctgTransEntriesAndTransTotalMap.isPosted" value="Y"/>
- <set field="acctgTransEntriesAndTransTotalMap.organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="acctgTransEntriesAndTransTotalMap.organizationPartyId" from-field="organizationPartyId"/>
<set field="acctgTransEntriesAndTransTotalMap.customTimePeriodStartDate" from-field="customTimePeriod.fromDate" type="Timestamp"/>
<set field="acctgTransEntriesAndTransTotalMap.customTimePeriodEndDate" from-field="parameters.thruDate" type="Timestamp"/>
@@ -1041,7 +1044,10 @@
</call-class-method>
<!-- retrieve the last closed date for the same type of time period -->
- <set field="findLastClosedDateInMap.organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/>
+ <set field="partyIds[]" from-field="organizationPartyId"/>
+ <set field="findLastClosedDateInMap.organizationPartyId" from-field="organizationPartyId"/>
<set field="findLastClosedDateInMap.findDate" from-field="parameters.thruDate"/>
<call-service service-name="findLastClosedDate" in-map-name="findLastClosedDateInMap">
<result-to-field result-name="lastClosedDate"/>
@@ -1055,7 +1061,7 @@
<if-not-empty field="lastClosedTimePeriod">
<entity-condition entity-name="GlAccountAndHistory" list="glAccountAndHistories">
<condition-list combine="and">
- <condition-expr field-name="organizationPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+ <condition-expr field-name="organizationPartyId" operator="in" from-field="partyIds"/>
<condition-expr field-name="customTimePeriodId" operator="equals" from-field="lastClosedTimePeriod.customTimePeriodId"/>
<condition-expr field-name="glAccountClassId" operator="in" from-field="assetAccountClassIds"/>
</condition-list>
@@ -1066,7 +1072,7 @@
</iterate>
<entity-condition entity-name="GlAccountAndHistory" list="glAccountAndHistories">
<condition-list combine="and">
- <condition-expr field-name="organizationPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+ <condition-expr field-name="organizationPartyId" operator="in" from-field="partyIds"/>
<condition-expr field-name="customTimePeriodId" operator="equals" from-field="lastClosedTimePeriod.customTimePeriodId"/>
<condition-expr field-name="glAccountClassId" operator="in" from-field="liabilityAccountClassIds"/>
</condition-list>
@@ -1077,7 +1083,7 @@
</iterate>
<entity-condition entity-name="GlAccountAndHistory" list="glAccountAndHistories">
<condition-list combine="and">
- <condition-expr field-name="organizationPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+ <condition-expr field-name="organizationPartyId" operator="in" from-field="partyIds"/>
<condition-expr field-name="customTimePeriodId" operator="equals" from-field="lastClosedTimePeriod.customTimePeriodId"/>
<condition-expr field-name="glAccountClassId" operator="in" from-field="equityAccountClassIds"/>
</condition-list>
@@ -1090,7 +1096,7 @@
<entity-condition entity-name="AcctgTransAndEntries" list="acctgTransAndEntries">
<condition-list combine="and">
- <condition-expr field-name="organizationPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+ <condition-expr field-name="organizationPartyId" operator="in" from-field="partyIds"/>
<condition-expr field-name="isPosted" operator="equals" value="Y"/>
<condition-expr field-name="glFiscalTypeId" operator="equals" from-field="parameters.glFiscalTypeId"/>
<condition-expr field-name="transactionDate" operator="greater-equals" from-field="lastClosedDate"/>
@@ -1117,7 +1123,7 @@
</iterate>
<entity-condition entity-name="AcctgTransAndEntries" list="acctgTransAndEntries">
<condition-list combine="and">
- <condition-expr field-name="organizationPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+ <condition-expr field-name="organizationPartyId" operator="in" from-field="partyIds"/>
<condition-expr field-name="isPosted" operator="equals" value="Y"/>
<condition-expr field-name="glFiscalTypeId" operator="equals" from-field="parameters.glFiscalTypeId"/>
<condition-expr field-name="transactionDate" operator="greater-equals" from-field="lastClosedDate"/>
@@ -1144,7 +1150,7 @@
</iterate>
<entity-condition entity-name="AcctgTransAndEntries" list="acctgTransAndEntries">
<condition-list combine="and">
- <condition-expr field-name="organizationPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+ <condition-expr field-name="organizationPartyId" operator="in" from-field="partyIds"/>
<condition-expr field-name="isPosted" operator="equals" value="Y"/>
<condition-expr field-name="glFiscalTypeId" operator="equals" from-field="parameters.glFiscalTypeId"/>
<condition-expr field-name="transactionDate" operator="greater-equals" from-field="lastClosedDate"/>
@@ -1171,7 +1177,7 @@
</iterate>
<!-- retrieve the last closed date for the same type of time period -->
- <set field="prepareIncomeStatementInMap.organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="prepareIncomeStatementInMap.organizationPartyId" from-field="organizationPartyId"/>
<set field="prepareIncomeStatementInMap.glFiscalTypeId" from-field="parameters.glFiscalTypeId"/>
<set field="prepareIncomeStatementInMap.fromDate" from-field="lastClosedDate"/>
<set field="prepareIncomeStatementInMap.thruDate" from-field="parameters.thruDate"/>
@@ -1180,7 +1186,7 @@
</call-service>
<!-- get the retained earnings account -->
<entity-one entity-name="GlAccountTypeDefault" value-field="retainedEarningsAccount" use-cache="true">
- <field-map field-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <field-map field-name="organizationPartyId"/>
<field-map field-name="glAccountTypeId" value="RETAINED_EARNINGS"/>
</entity-one>
<if-not-empty field="retainedEarningsAccount">
Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy?rev=808047&r1=808046&r2=808047&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy Wed Aug 26 15:11:37 2009
@@ -35,7 +35,7 @@
decimals = UtilNumber.getBigDecimalScale("ledger.decimals");
rounding = UtilNumber.getBigDecimalRoundingMode("ledger.rounding");
-exprs = [EntityCondition.makeCondition("organizationPartyId", EntityOperator.EQUALS, organizationPartyId)];
+exprs = [EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds)];
if (fromDate) {
exprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
} else return;
Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=808047&r1=808046&r2=808047&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Wed Aug 26 15:11:37 2009
@@ -561,6 +561,8 @@
<set field="tabButtonItem" value="OrganizationAccountingReports"/>
<set field="tabButtonItem2" value="TransactionTotals"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/>
+ <set field="partyIds[]" from-field="organizationPartyId"/>
<service service-name="getPartyAccountingPreferences" result-map="result" auto-field-map="true"/>
<set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/>
<set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
@@ -643,6 +645,8 @@
<actions>
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/>
+ <set field="partyIds[]" from-field="organizationPartyId"/>
<set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/>
<set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/>
<script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/>
@@ -669,6 +673,8 @@
<actions>
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/>
+ <set field="partyIds[]" from-field="organizationPartyId"/>
<set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/>
<set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/>
<script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/>
@@ -913,6 +919,8 @@
<set field="tabButtonItem" value="OrganizationAccountingReports"/>
<set field="tabButtonItem2" value="MonthlyTrialBalance"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId" type="String"/>
+ <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/>
+ <set field="partyIds[]" from-field="organizationPartyId"/>
<script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy"/>
<set field="financialYearFromDate" from-field="financialYearFromDate" type="Timestamp"/>
<script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/>
@@ -986,6 +994,8 @@
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<set field="organizationPartyId" from-field="parameters.organizationPartyId" type="String"/>
+ <set field="partyIds" value="${groovy:org.ofbiz.party.party.PartyWorker.getAssociatedPartyIdsByRelationshipType(delegator, organizationPartyId, 'GROUP_ROLLUP')}" type="List"/>
+ <set field="partyIds[]" from-field="organizationPartyId"/>
<script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/MonthlyTrialBalance.groovy"/>
<set field="financialYearFromDate" from-field="financialYearFromDate" type="Timestamp"/>
<script location="component://accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy"/>