refactor: use CURRENT_DATE instead of CURDATE() (#31356)

* refactor: use CURRENT_DATE instead of CURDATE()

* style: reformat to black spec

* refactor: use QB for auto_close queries

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
Conor
2022-06-15 01:37:33 -05:00
committed by GitHub
parent 37e9622426
commit b8f728a40a
12 changed files with 35 additions and 28 deletions

View File

@@ -691,7 +691,7 @@ def get_doctype_wise_filters(filters):
def get_batch_numbers(doctype, txt, searchfield, start, page_len, filters):
query = """select batch_id from `tabBatch`
where disabled = 0
and (expiry_date >= CURDATE() or expiry_date IS NULL)
and (expiry_date >= CURRENT_DATE or expiry_date IS NULL)
and name like {txt}""".format(
txt=frappe.db.escape("%{0}%".format(txt))
)