svn commit: r797552 - /ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r797552 - /ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy

apatel-2
Author: apatel
Date: Fri Jul 24 16:30:03 2009
New Revision: 797552

URL: http://svn.apache.org/viewvc?rev=797552&view=rev
Log:
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;
             }
         }
     }