def get_valuation_rate():
 item_val_rate_map = {}
 for d in frappe.db.sql(u'select item_code,\n DCTB  DCTB sum(actual_qty*valuation_rate)/sum(actual_qty) as val_rate\n DCTB  DCTB from tabBin where actual_qty > 0 group by item_code', as_dict=1):
  item_val_rate_map.setdefault(d.item_code, d.val_rate)
 return item_val_rate_map

def get_valuation_rate ( ) : item_val_rate_map = { } for d in frappe . db . sql ( u'select item_code,\n DCTB  DCTB sum(actual_qty*valuation_rate)/sum(actual_qty) as val_rate\n DCTB  DCTB from tabBin where actual_qty > 0 group by item_code' , as_dict = 1 ) : item_val_rate_map . setdefault ( d . item_code , d . val_rate ) return item_val_rate_map
get an average valuation rate of an item from all warehouses .