-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
feat: Ledger for advance payment #43709
Merged
ruthra-kumar
merged 22 commits into
frappe:develop
from
ruthra-kumar:ledger_for_advance_payment
Nov 1, 2024
Merged
feat: Ledger for advance payment #43709
ruthra-kumar
merged 22 commits into
frappe:develop
from
ruthra-kumar:ledger_for_advance_payment
Nov 1, 2024
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
ruthra-kumar
force-pushed
the
ledger_for_advance_payment
branch
2 times, most recently
from
October 18, 2024 11:01
ed05638
to
20b25c6
Compare
ruthra-kumar
force-pushed
the
ledger_for_advance_payment
branch
from
October 30, 2024 10:36
14814b3
to
b197f4b
Compare
ruthra-kumar
force-pushed
the
ledger_for_advance_payment
branch
from
October 31, 2024 05:06
b197f4b
to
cf7b8f1
Compare
ruthra-kumar
requested review from
deepeshgarg007 and
rohitwaghchaure
as code owners
October 31, 2024 05:07
3 tasks
ruthra-kumar
added a commit
that referenced
this pull request
Nov 4, 2024
…-43709 feat: Ledger for advance payment (backport #43709)
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.
Issue
System allows advance payment to exceed Sales / Purchase Order grand total.
Consider below scenario,
Current Limitation
This happens because technically there is no distinction between a Normal Payment and an Advance Payment. So there is no persistent data structure to track the Advance Amount received for a Sales / Purchase Order. This distinction is inferred solely based on the allocation. If the Payment is allocated to a Sales / Purchase Order, then it is considered as an Advance Payment.
The problem with this approach is once reconciliation happens, the allocation to Sales / Purchase Order are replaced with an Invoice. So, we loose the critical information: A certain amount was received as an Advance, but it is now allocated to an Invoice.
Solution
A separate ledger to track Advance Payments against Sales Order or Purchase Order that only captures Submit and Cancel events. This way Reconciliation / Un-Reconciliation doesn't affect the advance amount calculation.
todo:
[ ] Refactor HR code as wellFor
Employee Advance
andGratuity
, reference is maintained even after the advance has been allocated. So, HRMS will continue to use GL Entry for calculatingadvance_paid
,no-docs