Merge pull request #24313 from deepeshgarg007/ytd_error_fix_v13

fix: Consider only submitted salary slips
This commit is contained in:
Deepesh Garg 2021-01-06 09:30:00 +05:30 committed by GitHub
commit f2863f9d16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1154,10 +1154,10 @@ class SalarySlip(TransactionBase):
filters = {'employee_name' : self.employee_name,
'start_date' : ['>=', period_start_date],
'end_date' : ['<', period_end_date],
'name': ['!=', self.name]
'name': ['!=', self.name],
'docstatus': 1
})
year_to_date = flt(salary_slip_sum[0].sum) if salary_slip_sum else 0.0
year_to_date += self.net_pay
@ -1171,7 +1171,8 @@ class SalarySlip(TransactionBase):
filters = {'employee_name' : self.employee_name,
'start_date' : ['>=', first_day_of_the_month],
'end_date' : ['<', self.start_date],
'name': ['!=', self.name]
'name': ['!=', self.name],
'docstatus': 1
})
month_to_date = flt(salary_slip_sum[0].sum) if salary_slip_sum else 0.0