fix: change sql function string to pypika

sql function string not supported anymore
This commit is contained in:
Faris Ansari
2025-06-06 17:20:56 +05:30
parent 20e2fda183
commit 300530d35a

View File

@@ -2232,6 +2232,8 @@ class AccountsController(TransactionBase):
def set_advance_payment_status(self): def set_advance_payment_status(self):
new_status = None new_status = None
PaymentRequest = frappe.qb.DocType("Payment Request")
paid_amount = frappe.get_value( paid_amount = frappe.get_value(
doctype="Payment Request", doctype="Payment Request",
filters={ filters={
@@ -2239,7 +2241,7 @@ class AccountsController(TransactionBase):
"reference_name": self.name, "reference_name": self.name,
"docstatus": 1, "docstatus": 1,
}, },
fieldname="sum(grand_total - outstanding_amount)", fieldname=Sum(PaymentRequest.grand_total - PaymentRequest.outstanding_amount),
) )
if not paid_amount: if not paid_amount: