Merge pull request #6648 from saurabh6790/hotfix
[fix] calculate variance only for submitted budgets
This commit is contained in:
commit
44b4e5eef3
@ -64,7 +64,7 @@ def get_cost_center_target_details(filters):
|
|||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
select b.cost_center, b.monthly_distribution, ba.account, ba.budget_amount
|
select b.cost_center, b.monthly_distribution, ba.account, ba.budget_amount
|
||||||
from `tabBudget` b, `tabBudget Account` ba
|
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)
|
""", (filters.fiscal_year, filters.company), as_dict=True)
|
||||||
|
|
||||||
#Get target distribution details of accounts of cost center
|
#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
|
from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b
|
||||||
where
|
where
|
||||||
b.name = ba.parent
|
b.name = ba.parent
|
||||||
|
and b.docstatus = 1
|
||||||
and ba.account=gl.account
|
and ba.account=gl.account
|
||||||
and gl.fiscal_year=%s
|
and gl.fiscal_year=%s
|
||||||
and b.cost_center=%s
|
and b.cost_center=%s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user