query fix sales-person-target-variance-item-group-wise (#14271)

This commit is contained in:
Zarrar 2018-05-30 11:56:58 +05:30 committed by Rushabh Mehta
parent 58200182b4
commit 39c0add5a2

View File

@ -98,7 +98,7 @@ def get_achieved_details(filters, sales_person, all_sales_persons, target_item_g
END as qty,
CASE
WHEN so.status = "Closed" THEN sum(soi.delivered_qty * soi.conversion_factor * soi.base_net_rate * (st.allocated_percentage/100))
ELSE soi.base_net_amount * (st.allocated_percentage/100))
ELSE sum(soi.base_net_amount * (st.allocated_percentage/100))
END as amount
from
`tabSales Order Item` soi, `tabSales Order` so, `tabSales Team` st