[fix] [minor] all variance related reports fixed

This commit is contained in:
Akhilesh Darjee 2013-11-20 13:25:04 +05:30
parent d665ab2dd7
commit 20f93546eb
4 changed files with 13 additions and 12 deletions

View File

@ -73,10 +73,10 @@ def get_costcenter_target_details(filters):
def get_target_distribution_details(filters):
target_details = {}
for d in webnotes.conn.sql("""select bd.name, bdd.month, bdd.percentage_allocation \
for d in webnotes.conn.sql("""select bd.name, bdd.month, bdd.percentage_allocation
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
where bdd.parent=bd.name and bd.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
target_details.setdefault(d.name, {}).setdefault(d.month, d.percentage_allocation)
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
return target_details
@ -113,10 +113,11 @@ def get_costcenter_account_month_map(filters):
}))
tav_dict = cam_map[ccd.name][ccd.account][month]
month_percentage = ccd.distribution_id and \
tdd.get(ccd.distribution_id, {}).get(month, 0) or 100.0/12
month_percentage = tdd.get(ccd.distribution_id, {}).get(month, 0) \
if ccd.distribution_id else 100.0/12
tav_dict.target = flt(ccd.budget_allocated) * month_percentage /100
tav_dict.target = flt(ccd.budget_allocated) * month_percentage / 100
for ad in actual_details.get(ccd.name, {}).get(ccd.account, []):
if ad.month_name == month:

View File

@ -76,7 +76,7 @@ def get_target_distribution_details(filters):
for d in webnotes.conn.sql("""select bd.name, bdd.month, bdd.percentage_allocation
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
where bdd.parent=bd.name and bd.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
target_details.setdefault(d.name, {}).setdefault(d.month, d.percentage_allocation)
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
return target_details
@ -115,8 +115,8 @@ def get_salesperson_item_month_map(filters):
}))
tav_dict = sim_map[sd.name][sd.item_group][month]
month_percentage = sd.distribution_id and \
tdd.get(sd.distribution_id, {}).get(month, 0) or 100.0/12
month_percentage = tdd.get(sd.distribution_id, {}).get(month, 0) \
if sd.distribution_id else 100.0/12
for ad in achieved_details.get(sd.name, {}).get(sd.item_group, []):
if (filters["target_on"] == "Quantity"):

View File

@ -73,7 +73,7 @@ def get_target_distribution_details(filters):
for d in webnotes.conn.sql("""select bd.name, bdd.month, bdd.percentage_allocation
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
where bdd.parent=bd.name and bd.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
target_details.setdefault(d.name, {}).setdefault(d.month, d.percentage_allocation)
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
return target_details
@ -113,8 +113,8 @@ def get_territory_item_month_map(filters):
}))
tav_dict = tim_map[td.name][td.item_group][month]
month_percentage = td.distribution_id and \
tdd.get(td.distribution_id, {}).get(month, 0) or 100.0/12
month_percentage = tdd.get(td.distribution_id, {}).get(month, 0) \
if td.distribution_id else 100.0/12
for ad in achieved_details.get(td.name, {}).get(td.item_group, []):
if (filters["target_on"] == "Quantity"):

View File

@ -22,7 +22,7 @@
return false;
});
$("#product-search").keypress(function(e) {
if(e.which==13) $("#btn-product-search").click();
if(e.which==13) $("#btn-product-search").click();
})
})
</script>