Skip to content

Commit

Permalink
fix: incorrect dr/cr on Adv Payment against Journals
Browse files Browse the repository at this point in the history
(cherry picked from commit f6c1dff)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Jun 30, 2024
1 parent 760b2e2 commit 4e74257
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,12 +1218,17 @@ def get_dr_and_account_for_advances(self, reference):
return "credit", reference.account

if reference.reference_doctype == "Payment Entry":
# reference.account_type and reference.payment_type is only available for Reverse payments
if reference.account_type == "Receivable" and reference.payment_type == "Pay":
return "credit", self.party_account
else:
return "debit", self.party_account

return "debit", reference.account
if reference.reference_doctype == "Journal Entry":
if self.party_type == "Customer" and self.payment_type == "Receive":
return "credit", reference.account
else:
return "debit", reference.account

def add_advance_gl_for_reference(self, gl_entries, invoice):
args_dict = {
Expand Down

0 comments on commit 4e74257

Please sign in to comment.