[fix] queries
This commit is contained in:
parent
2ed025e62d
commit
5bd8cfd9fe
@ -410,7 +410,7 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
|
||||
and tabAccount.docstatus!=2
|
||||
and ifnull(tabAccount.master_type, "")=""
|
||||
and ifnull(tabAccount.master_name, "")=""
|
||||
and tabAccount.company = '%(company)s'
|
||||
and tabAccount.%(key)s LIKE '%(txt)s'
|
||||
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
|
||||
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype)})
|
||||
and tabAccount.company = %(company)s
|
||||
and tabAccount.{key} LIKE %(txt)s
|
||||
{mcond}""".format(key=searchfield, mcond=get_match_cond(doctype)),
|
||||
{'company': filters['company'], 'txt': "%%{0}%%".format(txt)})
|
||||
|
@ -611,11 +611,10 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters):
|
||||
and tabAccount.docstatus!=2
|
||||
and ifnull(tabAccount.master_type, "")=""
|
||||
and ifnull(tabAccount.master_name, "")=""
|
||||
and tabAccount.company = '%(company)s'
|
||||
and tabAccount.%(key)s LIKE '%(txt)s'
|
||||
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
|
||||
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype)})
|
||||
|
||||
and tabAccount.company = %(company)s
|
||||
and tabAccount.{key} LIKE %(txt)s
|
||||
{mcond}""".format(key=searchfield, mcond=get_match_cond(doctype)),
|
||||
{'company': filters['company'], 'txt': "%%{0}%%".format(txt)})
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_delivery_note(source_name, target_doc=None):
|
||||
|
@ -43,8 +43,8 @@ def get_so_details():
|
||||
|
||||
def get_last_so_amt(customer):
|
||||
res = frappe.db.sql("""select net_total from `tabSales Order`
|
||||
where customer ='%(customer)s' and docstatus = 1 order by transaction_date desc
|
||||
limit 1""" % {'customer':customer})
|
||||
where customer = %(customer)s and docstatus = 1 order by transaction_date desc
|
||||
limit 1""", {'customer':customer})
|
||||
|
||||
return res and res[0][0] or 0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user