mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
Merge pull request #4338 from anandpdoshi/fix/salary-slip-earning-deduction
[fix] pull earning and deduction on change of employee
This commit is contained in:
@@ -23,6 +23,8 @@ class SalarySlip(TransactionBase):
|
|||||||
self.get_leave_details()
|
self.get_leave_details()
|
||||||
struct = self.check_sal_struct()
|
struct = self.check_sal_struct()
|
||||||
if struct:
|
if struct:
|
||||||
|
self.set("earnings", [])
|
||||||
|
self.set("deduction", [])
|
||||||
self.pull_sal_struct(struct)
|
self.pull_sal_struct(struct)
|
||||||
|
|
||||||
def check_sal_struct(self):
|
def check_sal_struct(self):
|
||||||
@@ -41,7 +43,7 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
def pull_sal_struct(self, struct):
|
def pull_sal_struct(self, struct):
|
||||||
from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
|
from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
|
||||||
self.update(make_salary_slip(struct, self).as_dict())
|
make_salary_slip(struct, self)
|
||||||
|
|
||||||
def pull_emp_details(self):
|
def pull_emp_details(self):
|
||||||
emp = frappe.db.get_value("Employee", self.employee,
|
emp = frappe.db.get_value("Employee", self.employee,
|
||||||
|
|||||||
Reference in New Issue
Block a user