gilPts commented on code in PR #586: URL: https://github.com/apache/ofbiz-framework/pull/586#discussion_r1100136979
########## applications/accounting/groovyScripts/reports/BalanceSheet.groovy: ########## @@ -101,7 +101,12 @@ if (lastClosedTimePeriod) { timePeriodAndExprs.add(EntityCondition.makeCondition("customTimePeriodId", EntityOperator.EQUALS, lastClosedTimePeriod.customTimePeriodId)) lastTimePeriodHistories = from("GlAccountAndHistory").where(timePeriodAndExprs).queryList() lastTimePeriodHistories.each { lastTimePeriodHistory -> - Map accountMap = UtilMisc.toMap("glAccountId", lastTimePeriodHistory.glAccountId, "accountCode", lastTimePeriodHistory.accountCode, "accountName", lastTimePeriodHistory.accountName, "balance", lastTimePeriodHistory.getBigDecimal("endingBalance"), "D", lastTimePeriodHistory.getBigDecimal("postedDebits"), "C", lastTimePeriodHistory.getBigDecimal("postedCredits")) + // Contra accounts are CREDIT accounts and act to offset the value of any asset DEBIT accounts they correspond + // to. These contra accounts shall be listed in the asset section of the balance sheet with the intention of + // reducing overall asset values. We therefore negate the opening credit balance of the contra account, treating + // it as if it was an asset account with a negative value. + def endingBalance = lastTimePeriodHistory.getBigDecimal("endingBalance").negate() Review Comment: It is better to declare the good type when known ```suggestion BigDecimal endingBalance = lastTimePeriodHistory.getBigDecimal("endingBalance").negate() ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ofbiz.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org