fix: update sql function usage syntax
This commit is contained in:
@@ -766,7 +766,7 @@ def validate_against_pcv(is_opening, posting_date, company):
|
||||
)
|
||||
|
||||
last_pcv_date = frappe.db.get_value(
|
||||
"Period Closing Voucher", {"docstatus": 1, "company": company}, "max(period_end_date)"
|
||||
"Period Closing Voucher", {"docstatus": 1, "company": company}, {"MAX": "period_end_date"}
|
||||
)
|
||||
|
||||
if last_pcv_date and getdate(posting_date) <= getdate(last_pcv_date):
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import cint, flt
|
||||
|
||||
from frappe.query_builder.functions import Sum
|
||||
from erpnext.controllers.status_updater import StatusUpdater
|
||||
|
||||
|
||||
@@ -128,11 +128,11 @@ class PackingSlip(StatusUpdater):
|
||||
item.idx
|
||||
)
|
||||
)
|
||||
|
||||
DocType = frappe.qb.DocType("Delivery Note Item" if item.dn_detail else "Packed Item")
|
||||
remaining_qty = frappe.db.get_value(
|
||||
"Delivery Note Item" if item.dn_detail else "Packed Item",
|
||||
{"name": item.dn_detail or item.pi_detail, "docstatus": 0},
|
||||
["sum(qty - packed_qty)"],
|
||||
Sum(DocType.qty - DocType.packed_qty),
|
||||
)
|
||||
|
||||
if remaining_qty is None:
|
||||
@@ -174,7 +174,7 @@ class PackingSlip(StatusUpdater):
|
||||
return (
|
||||
cint(
|
||||
frappe.db.get_value(
|
||||
"Packing Slip", {"delivery_note": self.delivery_note, "docstatus": 1}, ["max(to_case_no)"]
|
||||
"Packing Slip", {"delivery_note": self.delivery_note, "docstatus": 1}, {"MAX": "to_case_no"}
|
||||
)
|
||||
)
|
||||
+ 1
|
||||
|
||||
Reference in New Issue
Block a user