You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "danwatford (via GitHub)" <gi...@apache.org> on 2023/02/07 16:00:51 UTC

[GitHub] [ofbiz-framework] danwatford opened a new pull request, #586: Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)

danwatford opened a new pull request, #586:
URL: https://github.com/apache/ofbiz-framework/pull/586

   Convert the ending balances read from GlAccountHistory for contra accounts from credit to debit values by negating them. This ensure they correctly reduce the value of the asset accounts they correspond to.
   


-- 
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-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #586: Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #586:
URL: https://github.com/apache/ofbiz-framework/pull/586#issuecomment-1421021440

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=586)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=586&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=586) No Coverage information  
   [![No Duplication information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo-16px.png 'No Duplication information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=586&metric=duplicated_lines_density&view=list) No Duplication information
   
   


-- 
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-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] danwatford commented on pull request #586: Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)

Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #586:
URL: https://github.com/apache/ofbiz-framework/pull/586#issuecomment-1424561526

   Closing this PR as fixes built on top of the recent refactoring of BalanceSheet.groovy will be brought in from trunk instead.
   See https://lists.apache.org/thread/yqrr7r07ts0w9q4pkwywp2fvy7y2hhk0
   


-- 
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-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] danwatford closed pull request #586: Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)

Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford closed pull request #586: Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)
URL: https://github.com/apache/ofbiz-framework/pull/586


-- 
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-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #586: Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)

Posted by "gilPts (via GitHub)" <gi...@apache.org>.
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-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org