'Update workstation rate and calculates totals'

def calculate_op_cost(self):

    self.operating_cost = 0
    self.base_operating_cost = 0
    for d in self.get(u'operations'):
        if d.workstation:
            if (not d.hour_rate):
                d.hour_rate = flt(frappe.db.get_value(u'Workstation', d.workstation, u'hour_rate'))
        if (d.hour_rate and d.time_in_mins):
            d.operating_cost = ((flt(d.hour_rate) * flt(d.time_in_mins)) / 60.0)
            d.base_hour_rate = (flt(d.hour_rate) * flt(self.conversion_rate))
            d.base_operating_cost = ((flt(d.base_hour_rate) * flt(d.time_in_mins)) / 60.0)
        self.operating_cost += flt(d.operating_cost)
        self.base_operating_cost += flt(d.base_operating_cost)
