Is_pl_account and debit_or_credit field removed and added report_type field in account

This commit is contained in:
Nabin Hait
2014-03-21 11:14:49 +05:30
parent b5e6d7e171
commit 0c21e2afef
45 changed files with 244 additions and 627 deletions

View File

@@ -106,17 +106,24 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
'page_len': page_len})
def tax_account_query(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select name, parent_account from tabAccount
tax_accounts = frappe.db.sql("""select name, parent_account from tabAccount
where tabAccount.docstatus!=2
and (account_type in (%s) or root_type = %s)
and account_type in (%s)
and group_or_ledger = 'Ledger'
and company = %s
and `%s` LIKE %s
limit %s, %s""" %
(", ".join(['%s']*len(filters.get("account_type"))),
"%s", "%s", searchfield, "%s", "%s", "%s"),
tuple(filters.get("account_type") + [filters.get("root_type"),
filters.get("company"), "%%%s%%" % txt, start, page_len]))
(", ".join(['%s']*len(filters.get("account_type"))), "%s", searchfield, "%s", "%s", "%s"),
tuple(filters.get("account_type") + [filters.get("company"), "%%%s%%" % txt,
start, page_len]))
if not tax_accounts:
tax_accounts = frappe.db.sql("""select name, parent_account from tabAccount
where tabAccount.docstatus!=2 and group_or_ledger = 'Ledger'
and company = %s and `%s` LIKE %s limit %s, %s"""
% ("%s", searchfield, "%s", "%s", "%s"),
(filters.get("company"), "%%%s%%" % txt, start, page_len))
return tax_accounts
def item_query(doctype, txt, searchfield, start, page_len, filters):
from frappe.utils import nowdate