From b01b108dfa7baf53562f361a69657fe2ec1fc981 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 5 Jan 2021 17:34:16 +0530 Subject: [PATCH] fix: do not consider current salary slip in sum --- erpnext/payroll/doctype/salary_slip/salary_slip.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.py b/erpnext/payroll/doctype/salary_slip/salary_slip.py index 99d8a8317c..3bb1f62b08 100644 --- a/erpnext/payroll/doctype/salary_slip/salary_slip.py +++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py @@ -1145,7 +1145,9 @@ class SalarySlip(TransactionBase): fields = ['sum(net_pay) as sum'], filters = {'employee_name' : self.employee_name, 'start_date' : ['>=', period_start_date], - 'end_date' : ['<', period_end_date]}) + 'end_date' : ['<', period_end_date], + 'name': ['!=', self.name] + }) year_to_date = flt(salary_slip_sum[0].sum) if salary_slip_sum else 0.0 @@ -1160,7 +1162,8 @@ class SalarySlip(TransactionBase): fields = ['sum(net_pay) as sum'], filters = {'employee_name' : self.employee_name, 'start_date' : ['>=', first_day_of_the_month], - 'end_date' : ['<', self.start_date] + 'end_date' : ['<', self.start_date], + 'name': ['!=', self.name] }) month_to_date = flt(salary_slip_sum[0].sum) if salary_slip_sum else 0.0