diff --git a/hr_payroll_community/models/__pycache__/hr_payslip.cpython-36.pyc b/hr_payroll_community/models/__pycache__/hr_payslip.cpython-36.pyc index ec261b2..c8f392d 100644 Binary files a/hr_payroll_community/models/__pycache__/hr_payslip.cpython-36.pyc and b/hr_payroll_community/models/__pycache__/hr_payslip.cpython-36.pyc differ diff --git a/hr_payroll_community/models/hr_payslip.py b/hr_payroll_community/models/hr_payslip.py index 3a1f938..7652589 100644 --- a/hr_payroll_community/models/hr_payslip.py +++ b/hr_payroll_community/models/hr_payslip.py @@ -162,11 +162,14 @@ class HrPayslip(models.Model): contract_ids = payslip.contract_id.ids or \ self.get_contract(payslip.employee_id, payslip.date_from, payslip.date_to) for input_line in payslip.input_line_ids: + print('input====================',input_line.code) + loan_deduct = 0.0 + other_deduct = 0.0 if input_line.code == 'LO': loan_deduct = input_line.amount - else: + if not input_line.code == 'LO': other_deduct += input_line.amount - print('tets+++++++++++++++++',loan_deduct,other_deduct) + print('tets+++++++++++++++++',input_line.code,loan_deduct,other_deduct) for contract in self.contract_id: total_salary = contract.wage + contract.other_allowance + contract.hra + contract.travel_allowance net_salary = (total_salary -(loan_deduct + other_deduct) ) @@ -182,8 +185,8 @@ class HrPayslip(models.Model): 'housing_allowance':contract.hra, 'travel_allowance':contract.travel_allowance, 'total_salary':total_salary, - 'loan_deduct': loan_deduct, - 'monthly_deduct':other_deduct + 'loan_deduct': sum(input_line.amount for input_line in payslip.input_line_ids if input_line.code == 'LO'), + 'monthly_deduct':sum(input_line.amount for input_line in payslip.input_line_ids if not input_line.code == 'LO'), 'net_salary':net_salary })] print('list_value============',list_value)