Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP]asset management: compensate deviation via last entry #1785

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

luc-demeyer
Copy link
Contributor

account_asset_management, change logic to compensate deviation of posted entries.

Before this PR, deviations are corrected in the first period after posted/init entries.

This leads to rather strange situations illustrated by the following example:

Create an asset with

  • purchase value 120 EUR
  • start date 2022-12-01
  • duration 1 year
  • linear, prorata temporis
  • monthly depreciation

Set lock date to 2022-12-31.
Intuitevely one would expect a depreciation table with 10 EUR/month depreciation. But the pro-rata temporis will calculate for period december 2022 : 31 / 365 * 120 = 10.19 EUR.

The user changes the INIT entry value to 10 EUR since his legacy system has calculated 10 EUR / month. This will probably be the case when the 'legacy' system is a spreadsheet. After recompute the compensation is calculated for 2023-01 and becomes 99.81 EUR.

After this PR, we continue with the monthly depreciation amount of 10 EUR and compensate in the last month (with also 10 EUR in the last month).
Result: clean depreciation table matching end user expectation.

account_asset_management, change logic to compensate deviation of posted entries.

Before this PR, deviations are corrected in the first period after posted/init entries.

This leads to rather strange situations illustrated by the following example:

Create an asset with
- purchase value 120 EUR
- start date 2022-12-01
- duration 1 year
- linear, prorata temporis
- monthly depreciation

Set lock date to 2022-12-31.
Intuitevely one would expect a depreciation table with 10 EUR/month depreciation.
But the pro-rata temporis will calculate for period december 2022 : 31 / 365 * 120 = 10.19 EUR.

The user changes the INIT entry value to 10 EUR since his legacy system has calculated 10 EUR / month.
This will probably be the case when the 'legacy' system is a spreadsheet.
After recompute the compensation is calculated for 2023-01 and becomes 99.81 EUR.

After this PR, we continue with the monthly depreciation amount of 10 EUR and compensate in the
last month (with also 10 EUR in the last month).
Result: clean depreciation table matching end user expectation.
@luc-demeyer
Copy link
Contributor Author

Depreciation table before this PR:
image

Depreciation table after this PR:
image

@luc-demeyer luc-demeyer changed the title [IMP]asset management: compensate deviation via last entry darft: [IMP]asset management: compensate deviation via last entry Nov 30, 2023
@luc-demeyer luc-demeyer changed the title darft: [IMP]asset management: compensate deviation via last entry draft: [IMP]asset management: compensate deviation via last entry Nov 30, 2023
module : account_asset_management, unit tests
Via this commit we align unit test_04 to the new logic where deviations
are compensated via the last depreciation board entry.
At the same time the scenario becomes more realistic:
the INIT entry now gets a value of 269.44 EUR (versus calculated prorata value of 269.53),
before this commit the INIT value was set to 279.44, hence a deviation that
is much larger than whatever you can get via another calculation logic.
Since we now compensate via the last entry, we only need to check that the table
maintains the monthly depreciation amount of 55.55 and the last entry.
Since we have in this test the same INIT value in both leap and noleap year use cases,
the last period deprecation will in both case be equal (8.31 EUR).
@luc-demeyer luc-demeyer changed the title draft: [IMP]asset management: compensate deviation via last entry [IMP]asset management: compensate deviation via last entry Nov 30, 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.

None yet

1 participant