mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-09 16:12:53 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-05-21 16:16:39",
|
"creation": "2013-05-21 16:16:39",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-07-23 15:27:03",
|
"modified": "2013-07-24 21:44:41",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "The account to which you will pay (have paid) the money to.",
|
"description": "Supplier (Payable) Account",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "credit_to",
|
"fieldname": "credit_to",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@@ -771,22 +771,22 @@
|
|||||||
"reqd": 0
|
"reqd": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 1,
|
"amend": 0,
|
||||||
"cancel": 1,
|
"cancel": 0,
|
||||||
"create": 1,
|
"create": 0,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"role": "Accounts User",
|
"role": "Accounts User",
|
||||||
"submit": 1,
|
"submit": 0,
|
||||||
"write": 1
|
"write": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
"amend": 0,
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 1,
|
"create": 0,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"role": "Purchase User",
|
"role": "Purchase User",
|
||||||
"submit": 0,
|
"submit": 0,
|
||||||
"write": 1
|
"write": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
"amend": 0,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-05-24 19:29:05",
|
"creation": "2013-05-24 19:29:05",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-07-23 15:28:32",
|
"modified": "2013-07-24 21:44:15",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "The account to which you will pay (have paid) the money to.",
|
"description": "Customer (Receivable) Account",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "debit_to",
|
"fieldname": "debit_to",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
|
|||||||
@@ -145,24 +145,6 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
'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
|
||||||
from tabAccount
|
from tabAccount
|
||||||
|
|||||||
Reference in New Issue
Block a user