Merge pull request #6648 from saurabh6790/hotfix

[fix] calculate variance only for submitted budgets
This commit is contained in:
Nabin Hait 2016-10-19 15:05:11 +05:30 committed by GitHub
commit 44b4e5eef3

View File

@ -64,7 +64,7 @@ def get_cost_center_target_details(filters):
return frappe.db.sql("""
select b.cost_center, b.monthly_distribution, ba.account, ba.budget_amount
from `tabBudget` b, `tabBudget Account` ba
where b.name=ba.parent and b.fiscal_year=%s and b.company=%s
where b.name=ba.parent and b.docstatus = 1 and b.fiscal_year=%s and b.company=%s
""", (filters.fiscal_year, filters.company), as_dict=True)
#Get target distribution details of accounts of cost center
@ -86,6 +86,7 @@ def get_actual_details(cost_center, fiscal_year):
from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b
where
b.name = ba.parent
and b.docstatus = 1
and ba.account=gl.account
and gl.fiscal_year=%s
and b.cost_center=%s