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 8de5fe9..ec261b2 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 717d008..4a83eb8 100644
--- a/hr_payroll_community/models/hr_payslip.py
+++ b/hr_payroll_community/models/hr_payslip.py
@@ -162,14 +162,20 @@ class HrPayslip(models.Model):
contract_ids = payslip.contract_id.ids or \
self.get_contract(payslip.employee_id, payslip.date_from, payslip.date_to)
for contract in self.contract_id:
- print('contract++++++++++++++++=',contract)
+ print('contract++++++++++++++++=',contract.wage,contract.hra,contract.other_allowance,contract.travel_allowance)
+ total_salary = contract.wage + contract.other_allowance + contract.hra + contract.travel_allowance
list_value =[(0, 0, {
- 'emloyee_payslip_id':self.id,
+ 'date_from':payslip.date_from,
+ 'date_to':payslip.date_to,
+ 'state':payslip.state,
+ 'number':payslip.number,
+ 'emloyee_payslip_id':payslip.id,
'employee_id':payslip.employee_id.id,
'basic_salary':contract.wage,
- 'other_allowances':contract.other_allowance,
+ 'other_allowance':contract.other_allowance,
'housing_allowance':contract.hra,
- 'travel_allowance':contract.travel_allowance
+ 'travel_allowance':contract.travel_allowance,
+ 'total_salary':total_salary
})]
print('list_value============',list_value)
payslip.emp_salary_line_ids = list_value
@@ -674,14 +680,23 @@ class EmployeeSalary(models.Model):
#basic_salary = fields.Float()
basic_salary = fields.Integer('Basic Salary',help="Employee's monthly gross wage.")
other_allowance = fields.Float()
- #housing_allowance = fields.Float('Housing Allowance')
- #travel_allowance = fields.Float('Transportation Allowance')
other_allowances = fields.Monetary(string="Other Allowance", help="Other allowances")
housing_allowance = fields.Monetary(string='HRA', tracking=True, help="House rent allowance.")
travel_allowance = fields.Monetary(string="Travel Allowance", help="Travel allowance")
- total_salary = fields.Float('Total Salary')
- monthly_deduct = fields.Float('Monthly Deduction in AED')
+ total_salary = fields.Float('Gross Salary')
+ loan_deduct = fields.Float('Loan Deduduction')
+ monthly_deduct = fields.Float('Other Deduction')
deduction_start_date = fields.Date('Deduction Start Date')
deduction_end_date = fields.Date('Deduction End Date')
currency_id = fields.Many2one(string="Currency", related='company_id.currency_id', readonly=True)
company_id = fields.Many2one('res.company', default=lambda self: self.env.company,)
+ date_from = fields.Date(string='Date From')
+ date_to = fields.Date(string='Date To')
+ number = fields.Char(string='Reference')
+ net_salary = fields.Float('Net Salary')
+ state = fields.Selection([
+ ('draft', 'Draft'),
+ ('verify', 'Waiting'),
+ ('done', 'Done'),
+ ('cancel', 'Rejected'),
+ ], string='Status', index=True, readonly=True, copy=False, default='draft',)
diff --git a/hr_payroll_community/views/hr_payslip_views.xml b/hr_payroll_community/views/hr_payslip_views.xml
index cde93e1..3aaf5ba 100644
--- a/hr_payroll_community/views/hr_payslip_views.xml
+++ b/hr_payroll_community/views/hr_payslip_views.xml
@@ -5,17 +5,21 @@
employee.salary.rule.tree
employee.salary.rule
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
@@ -34,10 +38,9 @@
-
+
+
-
-
@@ -47,15 +50,17 @@
- Employee SalaryRule
+ Employee Payslip Details
employee.salary.rule
- tree,form
-
+ tree,form
+
@@ -309,7 +314,7 @@
-
+