[enhance] Add Accounts table in to mention expense account based on company #5777

This commit is contained in:
Saurabh
2016-07-18 15:20:47 +05:30
parent f589c82d68
commit 718d835f45
12 changed files with 225 additions and 39 deletions

View File

@@ -63,7 +63,9 @@ def work():
def get_expenses():
expenses = []
expese_types = frappe.db.sql("select name, default_account from `tabExpense Claim Type`",as_dict=1)
expese_types = frappe.db.sql("""select ect.name, eca.default_account from `tabExpense Claim Type` ect,
`tabExpense Claim Account` eca where eca.parent=ect.name
and eca.company=%s """, frappe.flags.company,as_dict=1)
for expense_type in expese_types[:random.randint(1,4)]:
claim_amount = random.randint(1,20)*10