'Returns data for evaluating formula'

def get_data_for_eval(self):

    data = frappe._dict()
    data.update(frappe.get_doc(u'Salary    Structure    Employee', {u'employee': self.employee, u'parent': self.salary_structure}).as_dict())
    data.update(frappe.get_doc(u'Employee', self.employee).as_dict())
    data.update(self.as_dict())
    salary_components = frappe.get_all(u'Salary    Component', fields=[u'salary_component_abbr'])
    for sc in salary_components:
        data.setdefault(sc.salary_component_abbr, 0)
    for key in (u'earnings', u'deductions'):
        for d in self.get(key):
            data[d.abbr] = d.amount
    return data
