-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
fix: Calculate depreciation_amount accurately #27585
Merged
nextchamp-saqib
merged 48 commits into
frappe:develop
from
GangaManoj:fix-depr-after-sale
Nov 2, 2021
Merged
fix: Calculate depreciation_amount accurately #27585
nextchamp-saqib
merged 48 commits into
frappe:develop
from
GangaManoj:fix-depr-after-sale
Nov 2, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GangaManoj
requested review from
deepeshgarg007 and
nextchamp-saqib
as code owners
September 19, 2021 23:25
nextchamp-saqib
added
CI-failing
Unit tests or patch tests are failing.
needs-tests
This PR needs automated unit-tests.
labels
Sep 20, 2021
GangaManoj
changed the title
fix: Calculate depreciation_left accurately
fix: Calculate depreciation_amount accurately
Sep 21, 2021
… be sold in the future gets returned
Codecov Report
@@ Coverage Diff @@
## develop #27585 +/- ##
===========================================
+ Coverage 55.24% 55.50% +0.25%
===========================================
Files 1255 1248 -7
Lines 67935 67753 -182
===========================================
+ Hits 37534 37605 +71
+ Misses 30401 30148 -253
|
Will that also fix #27431 ? |
@Mergifyio backport version-13-hotfix |
✅ Backports have been created
|
nextchamp-saqib
added a commit
that referenced
this pull request
Dec 6, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Example
Initial Asset Value = Rs 100,000
Expected Value After Useful Life = Rs 10,000
Number of Depreciation = 3
Frequency of Depreciation = 12
Before:
On selling the Asset on 31/12/2021, the Depreciation Amount for the second row should have been 30,000, but instead it's being calculated incorrectly as 20,000.
After:
Example
Before:
On returning the Asset, the Depreciation Amount for the third row should have been 30,000, but instead it's being calculated incorrectly as -30,000.
After:
Explanation
If this Asset is set to be sold on 31-12-2021(which is in the future right now), an additional Depreciation Entry would be made for that date. On returning this Asset, the Depreciation Schedule should be reset and the Depreciation Entry posted on its sale should be reversed, but because the sale was made on the scheduled date for depreciation, the Depreciation Entry does not get reversed.
With the new condition, the Depreciation Entry made on sale will be reversed if the sale was set to happen in the future(i.e. if the Posting Date for the Sales Invoice is in the future) but gets returned, even if the date of sale = scheduled date for depreciation.