mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 12:49:10 +00:00
refactor: DB independent quoting and truthy/falsy values (#31358)
* refactor: DB independent quoting and truthy/falsy values * style: reformat to black spec * fix: ifnull -> coalesce * fix: coalesce -> Coalesce * fix: revert pypika comparison * refactor: convert queries to QB * fix: incorrect value types for query `=` query makes no sense with list of values * fix: remove warehouse docstatus condition * fix: keep using base rate as rate Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -83,7 +83,7 @@ def get_conditions(filters):
|
||||
("gst_hsn_code", " and gst_hsn_code=%(gst_hsn_code)s"),
|
||||
("company_gstin", " and company_gstin=%(company_gstin)s"),
|
||||
("from_date", " and posting_date >= %(from_date)s"),
|
||||
("to_date", "and posting_date <= %(to_date)s"),
|
||||
("to_date", " and posting_date <= %(to_date)s"),
|
||||
):
|
||||
if filters.get(opts[0]):
|
||||
conditions += opts[1]
|
||||
|
||||
@@ -47,7 +47,7 @@ def execute(filters=None):
|
||||
s.name = gl.party
|
||||
AND s.irs_1099 = 1
|
||||
AND gl.fiscal_year = %(fiscal_year)s
|
||||
AND gl.party_type = "Supplier"
|
||||
AND gl.party_type = 'Supplier'
|
||||
AND gl.company = %(company)s
|
||||
{conditions}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class VATAuditReport(object):
|
||||
`tab{doctype}`
|
||||
WHERE
|
||||
docstatus = 1 {where_conditions}
|
||||
and is_opening = "No"
|
||||
and is_opening = 'No'
|
||||
ORDER BY
|
||||
posting_date DESC
|
||||
""".format(
|
||||
|
||||
Reference in New Issue
Block a user