Author: apatel
Date: Fri Jul 24 16:30:03 2009
New Revision: 797552
URL:
http://svn.apache.org/viewvc?rev=797552&view=revLog:
Initialize variable so avoid NPE.
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy
Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy?rev=797552&r1=797551&r2=797552&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy Fri Jul 24 16:30:03 2009
@@ -55,9 +55,11 @@
if (UtilValidate.isNotEmpty(previousTimePeriod)) {
glAccountHistory = delegator.findOne("GlAccountHistory",
[customTimePeriodId : previousTimePeriod.customTimePeriodId, glAccountId : parameters.glAccountId, organizationPartyId : organizationPartyId], false);
- if (glAccountHistory) {
+ if (glAccountHistory && glAccountHistory.endingBalance != null) {
context.openingBalance = glAccountHistory.endingBalance;
balanceOfTheAcctgForYear = glAccountHistory.endingBalance;
+ } else {
+ context.openingBalance = BigDecimal.ZERO;
}
}
}