Skip to content

Commit

Permalink
fix: payment recon not showing payment entry when party_type is Student
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Sep 2, 2023
1 parent 0d26f67 commit c675f9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion erpnext/accounts/party.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def get_party_account(party_type, party=None, company=None, include_advance=Fals
if (account and account_currency != existing_gle_currency) or not account:
account = get_party_gle_account(party_type, party, company)

if include_advance and party_type in ["Customer", "Supplier"]:
if include_advance and party_type in ["Customer", "Supplier", "Student"]:
advance_account = get_party_advance_account(party_type, party, company)
if advance_account:
return [account, advance_account]
Expand Down
1 change: 1 addition & 0 deletions erpnext/accounts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ def get_outstanding_invoices(
precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2

if account:
# breakpoint()
root_type, account_type = frappe.get_cached_value(
"Account", account, ["root_type", "account_type"]
)
Expand Down
5 changes: 3 additions & 2 deletions erpnext/controllers/accounts_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,8 @@ def get_common_query(
limit,
condition,
):
payment_type = "Receive" if party_type == "Customer" else "Pay"
account_type = frappe.db.get_value("Account", party_account, "account_type")
payment_type = "Receive" if account_type == "Receivable" else "Pay"
payment_entry = frappe.qb.DocType("Payment Entry")

q = (
Expand All @@ -2403,7 +2404,7 @@ def get_common_query(
.where(payment_entry.docstatus == 1)
)

if party_type == "Customer":
if payment_type == "Receive":
q = q.select((payment_entry.paid_from_account_currency).as_("currency"))
q = q.select(payment_entry.paid_from)
q = q.where(payment_entry.paid_from.isin(party_account))
Expand Down

0 comments on commit c675f9a

Please sign in to comment.