-
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: Clear Depreciation Schedule before modification #28507
Merged
nextchamp-saqib
merged 11 commits into
frappe:develop
from
GangaManoj:fix-clear-depr-schedule
Dec 13, 2021
Merged
fix: Clear Depreciation Schedule before modification #28507
nextchamp-saqib
merged 11 commits into
frappe:develop
from
GangaManoj:fix-clear-depr-schedule
Dec 13, 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
November 22, 2021 16:19
GangaManoj
requested review from
nextchamp-saqib
and removed request for
nextchamp-saqib and
deepeshgarg007
November 22, 2021 16:20
…nal Entries before modifying the schedule
GangaManoj
force-pushed
the
fix-clear-depr-schedule
branch
from
November 22, 2021 16:21
e048be2
to
475d839
Compare
… clearing the schedule
GangaManoj
force-pushed
the
fix-clear-depr-schedule
branch
from
November 23, 2021 21:53
bb578d2
to
6ec5a19
Compare
Codecov Report
@@ Coverage Diff @@
## develop #28507 +/- ##
========================================
Coverage 55.22% 55.22%
========================================
Files 1122 1122
Lines 66782 66794 +12
========================================
+ Hits 36879 36889 +10
- Misses 29903 29905 +2
|
nextchamp-saqib
added a commit
that referenced
this pull request
Jan 21, 2022
…-28507 fix: Clear Depreciation Schedule before modification (backport #28507)
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.
Problem
Before performing actions that modify the Depreciation Schedule of an Asset (eg: repairs, sales, etc), the Schedule needs to be cleared of all rows that don't have Journal Entries linked with them. This is performed by
clear_depreciation_schedule()
. However, the function is flawed while dealing with multiple Finance Books, posing two problems:Fix
Only clear the Depreciation Schedule rows which are not linked with Journal Entries.
Note: In each of these cases, there's an additional flaw- there's only one Depreciation Schedule entry made for the sale, even when there are multiple Finance Books. I'll fix that in a later PR.
Case 1
There are multiple Finance Books, but at the time of sale, none of the Depreciation Schedule rows are linked with Journal Entries.
Before:
After:
Case 2
There are multiple Finance Books and at the time of sale, only one of the Depreciation Schedule rows associated with each Finance Book is linked with a Journal Entry.
Before:
After:
Case 3
There are two Finance Books, and at the time of sale, all of the Depreciation Schedule rows associated with the second Finance Book are linked with Journal Entries, and all but the last Depreciation Schedule row associated with the first Finance Book are linked with Journal Entries.
Before:
After:
Testing Info
(Refer Cases 1, 2 and 3 for images)