Skip to content

Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)#586

Closed
danwatford wants to merge 1 commit into
apache:release22.01from
danwatford:ofbiz-12754-release22-01
Closed

Fixed: Display contra accounts on balance sheet as negative values (OFBIZ-12754)#586
danwatford wants to merge 1 commit into
apache:release22.01from
danwatford:ofbiz-12754-release22-01

Conversation

@danwatford
Copy link
Copy Markdown
Contributor

@danwatford danwatford commented Feb 7, 2023

NOTE: This PR is for Release 22.01

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.

…FBIZ-12754)

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.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

// 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()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to declare the good type when known

Suggested change
def endingBalance = lastTimePeriodHistory.getBigDecimal("endingBalance").negate()
BigDecimal endingBalance = lastTimePeriodHistory.getBigDecimal("endingBalance").negate()

@danwatford
Copy link
Copy Markdown
Contributor Author

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

@danwatford danwatford closed this Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants