mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
[accounts] [minor] [fix] fixed set_query for Mode of Payment
This commit is contained in:
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
cur_frm.set_query("default_account", function(doc) {
|
cur_frm.set_query("default_account", function(doc) {
|
||||||
return{
|
return{
|
||||||
query: "controllers.queries.account_query",
|
|
||||||
filters: {
|
filters: {
|
||||||
'account_type': "Bank or Cash",
|
'account_type': "Bank or Cash",
|
||||||
|
"group_or_ledger": "Ledger",
|
||||||
'company': doc.company
|
'company': doc.company
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,24 +144,6 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
limit %(start)s, %(page_len)s """ % {'field': fields,'key': searchfield,
|
limit %(start)s, %(page_len)s """ % {'field': fields,'key': searchfield,
|
||||||
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), 'start': start,
|
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), 'start': start,
|
||||||
'page_len': page_len})
|
'page_len': page_len})
|
||||||
|
|
||||||
def account_query(doctype, txt, searchfield, start, page_len, filters):
|
|
||||||
conditions = []
|
|
||||||
if not filters:
|
|
||||||
filters = {}
|
|
||||||
if not filters.group_or_ledger:
|
|
||||||
filters.group_or_ledger = "Ledger"
|
|
||||||
|
|
||||||
return webnotes.conn.sql("""
|
|
||||||
select tabAccount.name, tabAccount.parent_account, tabAccount.debit_or_credit
|
|
||||||
from tabAccount
|
|
||||||
where tabAccount.docstatus!=2
|
|
||||||
and
|
|
||||||
and tabAccount.%(key)s LIKE "%(txt)s"
|
|
||||||
%(fcond)s %(mcond)s
|
|
||||||
limit %(start)s, %(page_len)s""" % {'key': searchfield,
|
|
||||||
'txt': "%%%s%%" % txt, 'fcond': get_filters_cond(doctype, filters, conditions),
|
|
||||||
'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len})
|
|
||||||
|
|
||||||
def tax_account_query(doctype, txt, searchfield, start, page_len, filters):
|
def tax_account_query(doctype, txt, searchfield, start, page_len, filters):
|
||||||
return webnotes.conn.sql("""select name, parent_account, debit_or_credit
|
return webnotes.conn.sql("""select name, parent_account, debit_or_credit
|
||||||
|
|||||||
Reference in New Issue
Block a user