fix: payment recon not showing payment entry when party_type is Student (#36920)

* fix: payment recon not showing payment entry when party_type is Student

* chore: code cleanup

* fix: payment recon based on account_type which is fetched from Party Type master
This commit is contained in:
RitvikSardana
2023-09-05 12:00:54 +05:30
committed by GitHub
parent 13ca474a46
commit d2f03c8a65
2 changed files with 4 additions and 3 deletions

View File

@@ -2437,7 +2437,8 @@ def get_common_query(
limit,
condition,
):
payment_type = "Receive" if party_type == "Customer" else "Pay"
account_type = frappe.db.get_value("Party Type", party_type, "account_type")
payment_type = "Receive" if account_type == "Receivable" else "Pay"
payment_entry = frappe.qb.DocType("Payment Entry")
q = (
@@ -2454,7 +2455,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))