fix: skip payments against orders in AP / AR #37284
Closed
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
Currently, when a Payment Entry is created against a Purchase / Sales Order, the corresponding Payment Ledger Entry gets fetched in the Accounts Payable / Receivable Report. However, since there are no PLEs made against the order, the outstanding total of the order never gets added to the AP / AR total. But the payment amount against that order gets deducted from the AP / AR total. This leads to an incorrect total amount.
Example
Suppose a Purchase Order is created with a total amount of
₹1000
. And a Payment Entry is created against the PO for₹300
. The Accounts Payable Report shows the following entries -₹300
was reduced from the total Payable amount although the Purchase Order total was never added since no Payment Ledger Entries exist against it.Solution
Skip PLEs made against Orders in the query for AP / AR Report.
no-docs