mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 18:29:08 +02:00
work on payslip
This commit is contained in:
@@ -161,9 +161,15 @@ class HrPayslip(models.Model):
|
|||||||
# if we don't give the contract, then the rules to apply should be for all current contracts of the employee
|
# if we don't give the contract, then the rules to apply should be for all current contracts of the employee
|
||||||
contract_ids = payslip.contract_id.ids or \
|
contract_ids = payslip.contract_id.ids or \
|
||||||
self.get_contract(payslip.employee_id, payslip.date_from, payslip.date_to)
|
self.get_contract(payslip.employee_id, payslip.date_from, payslip.date_to)
|
||||||
|
for input_line in payslip.input_line_ids:
|
||||||
|
if input_line.code == 'LO':
|
||||||
|
loan_deduct = input_line.amount
|
||||||
|
else:
|
||||||
|
other_deduct += input_line.amount
|
||||||
|
print('tets+++++++++++++++++',loan_deduct,other_deduct)
|
||||||
for contract in self.contract_id:
|
for contract in self.contract_id:
|
||||||
print('contract++++++++++++++++=',contract.wage,contract.hra,contract.other_allowance,contract.travel_allowance)
|
|
||||||
total_salary = contract.wage + contract.other_allowance + contract.hra + contract.travel_allowance
|
total_salary = contract.wage + contract.other_allowance + contract.hra + contract.travel_allowance
|
||||||
|
net_salary = (total_salary -(loan_deduct + other_deduct) )
|
||||||
list_value =[(0, 0, {
|
list_value =[(0, 0, {
|
||||||
'date_from':payslip.date_from,
|
'date_from':payslip.date_from,
|
||||||
'date_to':payslip.date_to,
|
'date_to':payslip.date_to,
|
||||||
@@ -175,7 +181,10 @@ class HrPayslip(models.Model):
|
|||||||
'other_allowance':contract.other_allowance,
|
'other_allowance':contract.other_allowance,
|
||||||
'housing_allowance':contract.hra,
|
'housing_allowance':contract.hra,
|
||||||
'travel_allowance':contract.travel_allowance,
|
'travel_allowance':contract.travel_allowance,
|
||||||
'total_salary':total_salary
|
'total_salary':total_salary,
|
||||||
|
'loan_deduct': loan_deduct,
|
||||||
|
'monthly_deduct':other_deduct
|
||||||
|
'net_salary':net_salary
|
||||||
})]
|
})]
|
||||||
print('list_value============',list_value)
|
print('list_value============',list_value)
|
||||||
payslip.emp_salary_line_ids = list_value
|
payslip.emp_salary_line_ids = list_value
|
||||||
|
|||||||
Reference in New Issue
Block a user