diff --git a/odex30_base/hr_contract_custom/__init__.py b/odex30_base/hr_contract_custom/__init__.py
new file mode 100644
index 0000000..0650744
--- /dev/null
+++ b/odex30_base/hr_contract_custom/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/odex30_base/hr_contract_custom/__manifest__.py b/odex30_base/hr_contract_custom/__manifest__.py
new file mode 100644
index 0000000..f7d0015
--- /dev/null
+++ b/odex30_base/hr_contract_custom/__manifest__.py
@@ -0,0 +1,24 @@
+{
+ "name": "HR Contract Custom",
+ "version": "18.0.1.0.0",
+ "category": "Odex25-HR/Odex25-HR",
+ "depends": [
+ "hr_contract",
+ "hr_base"
+ ],
+ "data": [
+ "security/ir.model.access.csv",
+ "security/ir_rules.xml",
+ "data/ir_sequence.xml",
+ "data/ir_cron.xml",
+ "views/contract_view.xml",
+ "views/hr_re_contract_view.xml",
+ "views/hr_contract_extension_view.xml",
+ "views/hr_employee_view.xml",
+ "report/employee_contract_report_template.xml",
+ "report/employee_dependents_report_template.xml",
+ "report/payroll_template.xml",
+ "report/probationary_evaluation.xml",
+ "data/mail_template.xml",
+ ],
+}
diff --git a/odex30_base/hr_contract_custom/data/ir_cron.xml b/odex30_base/hr_contract_custom/data/ir_cron.xml
new file mode 100644
index 0000000..ab406a9
--- /dev/null
+++ b/odex30_base/hr_contract_custom/data/ir_cron.xml
@@ -0,0 +1,12 @@
+
+
The Contract of ${object.employee_id.name} is going to expire on ${object.date_end}.
+ Please renew the contract or end it before expiry date According the notice period.
+
+
+
Best regards,
+ ]]> + + + + The Contract trial period of ${object.employee_id.name} is going to expire on${object.trial_date_end}.
+ Please renew the trial contract period or contracting is Done it before expiry date According the notice period..
+
+
+
Best regards,
+ ]]> +Dear,
\n" +" The Contract of ${object.employee_id.name} is going to expire on ${object.date_end}.\n"
+" Please renew the contract or end it before expiry date According the notice period.\n"
+"
\n"
+"
Best regards,
\n" +" \n" +" " +msgstr "" +" \n" +"عزيزي,
\n" +" عقد الموظف ${object.employee_id.name} سوف ينتهي بتاريخ ${object.date_end}.\n"
+" يجب تجديد العقد للموظف او إنهاء العقد قبل تاريخ النهاية حسب فترة الاشعار المتفق عليها.\n"
+"
\n"
+"
\n"
+"
تحياتي,
\n" +" \n" +" " + + +#. module: hr_contract_custom +#: model:mail.template,body_html:hr_contract_custom.email_template_contract_trial_period_expiration_reminder +msgid "" +"\n" +" \n" +"Dear ,
\n" +" The Contract trial period of ${object.employee_id.name} is going to expire on${object.trial_date_end}.\n"
+" Please renew the trial contract period or contracting is Done it before expiry date According the notice period.\n"
+"
\n"
+"
Best regards,
\n" +" \n" +" " +msgstr "" +" \n" +"عزيزي,
\n" +" فترة تجربة عقد الموظف ${object.employee_id.name} سوف تنتهي بتاريخ ${object.trial_date_end}.\n"
+" يجب تجديد فترة التجربة او إنهاء العقد قبل تاريخ نهاية فترة التجربة حسب فترة الاشعار المتفق عليها.\n"
+"
\n"
+"
\n"
+"
تحياتي,
\n" +" \n" +" " + +#. module: hr_contract_custom +#: model:ir.model.fields,field_description:hr_contract_custom.field_hr_contract__last_salary_gosi +#, python-format +msgid "Last Salary Gosi" +msgstr "آخر راتب للتأمينات" + +#. module: hr_contract_custom +#: model:ir.model.fields,help:hr_contract_custom.field_hr_contract__last_salary_gosi +#, python-format +msgid "The Last Salary Gosi After The Age 50 Years." +msgstr "آخر راتب في التأمينات الاجتماعية بعد سن الخمسين" + + +#. module: hr_contract_custom +#: code:addons/hr_contract_custom/models/hr_contract.py:0 +#: model_terms:ir.ui.view,arch_db:hr_contract_custom.hr_contract_form_view +#, python-format +msgid "Effective Form" +msgstr "مباشرة العمل" diff --git a/odex30_base/hr_contract_custom/models/__init__.py b/odex30_base/hr_contract_custom/models/__init__.py new file mode 100644 index 0000000..1c80478 --- /dev/null +++ b/odex30_base/hr_contract_custom/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- + +from . import hr_contract +from . import hr_employee +from . import hr_re_contract +from . import hr_contract_extension diff --git a/odex30_base/hr_contract_custom/models/hr_contract.py b/odex30_base/hr_contract_custom/models/hr_contract.py new file mode 100644 index 0000000..c290e08 --- /dev/null +++ b/odex30_base/hr_contract_custom/models/hr_contract.py @@ -0,0 +1,746 @@ +# -*- coding: utf-8 -*- + +import datetime +from datetime import datetime as dt +from datetime import timedelta +from dateutil import relativedelta +from hijri_converter import convert +# from googletrans import Translator + +from odoo import models, fields, api, _, exceptions + +# translator = Translator() + + +# Contract +class Contract(models.Model): + _inherit = 'hr.contract' + + name = fields.Char(related="employee_id.emp_no", readonly=True, string='Employee Number') + state = fields.Selection(selection=[('draft', _('Draft')), + ('employeed_aproval', _('Employeed Approval')), + ('hr_head_approval', _('HR Head Approval')), + ('program_directory', _('Executive Approval')), + ('end_contract', _('End Contract'))], default="draft", tracking=True) + + + active = fields.Boolean(default=True) + employee_name = fields.Char(related="employee_id.name", readonly=True) + employee_type = fields.Selection(selection=[('saudi', _('Saudi')), ('foreign', _('Foreign')), + ('displaced', _('Displaced Tribes')), + ('external', _('Outsource1')), ('external2', _('Outsource2'))], + default='saudi', + tracking=True) + contract_status = fields.Selection(selection=[('single', _('single contract')), + ('marriage', _('marriage contract'))], default='single', + tracking=True) + contract_duration = fields.Selection(selection=[('3_months', _('3 Months')), + ('6_months', _('6 Months')), + ('9_months', _('9 Months')), + ('12_months', _('12 Months')), + ('24_months', _('24 Months')), ('36_months', _('36 Months')), + ('none', _('None'))], default='12_months') + experience_year = fields.Integer() + has_end_service_benefit = fields.Boolean(string='Has end service benefits') + + # fields on salary information page + suspended = fields.Boolean(string='Suspended') + social_insurance = fields.Boolean(string='Social Insurance') + salary = fields.Float(string='Base Salary', tracking=True) + + # fields of information page + wage = fields.Float() + advatages = fields.Text() + trial_date_start = fields.Date(tracking=True) + trial_date_end = fields.Date(tracking=True) + date_start = fields.Date(tracking=True) + date_end = fields.Date(tracking=True) + note = fields.Text() + # fields of dependent page + employee_code = fields.Char() + allow_mbl = fields.Boolean(string='Allow Mobile Allowance') + sign_bonous = fields.Boolean(string='Sign on Bounus') + loan_allow = fields.Boolean(string='Allow Loan Allowance') + air_allow = fields.Boolean(string='Air Allowance') + adults = fields.Integer(string='Adult(s)') + # children = fields.Integer() + infants = fields.Integer() + package = fields.Float() + gosi = fields.Boolean(string='GOSI') + # vehicle_attendance = fields.Integer(string='Vehicle Attendance') + # system_attendance = fields.Integer(string='System Attendance') + # line_manager_attendance = fields.Integer(string='Line Manager Attendance') + # expense_claim = fields.Float(string='Expense Claim') + # hr_visa_ticket = fields.Float(string='HR Visa/Ticket') + # other_allowances = fields.Float(string='Other Allowances') + # advance_salary = fields.Float(string='Advance AGT Salary') + hr_expense = fields.Float(string='Hr Expense') + cash_sales = fields.Float(string='Cash Sales') + traffic_fine = fields.Float(string='Traffic Fine') + bk_balance = fields.Float(string='Bank Balance') + other_deductions = fields.Float(string='Other Deductions') + + fn = fields.Char(string="First Name") + mn = fields.Char("Middle Name") + ln = fields.Char(string="Last Name") + dn = fields.Char(string="Display Name") + e_date = fields.Date(string="Effective Date") + + status = fields.Selection(selection=[('bachelor', 'Bachelor'), ('family', 'family')], string='Status') + hra = fields.Char("HRA") + t_allow = fields.Float(string="Transport Allowance") + f_allow = fields.Float(string="Food Allowance") + f_ot = fields.Float(string="Fixed OT") + departure = fields.Char(string="Departure Air Port") + destination = fields.Char(string="Destination Air Port") + medical = fields.Selection(selection=[('yes', 'Yes'), ('no', 'No')], string='Medical') + + c_accommodation = fields.Selection(selection=[( + 'yes', 'Yes'), + ('no', 'No')], string='Company Accommodation') + + c_vehicle = fields.Selection(selection=[( + 'yes', 'Yes'), + ('no', 'No')], string='Company Vehicle') + + c_vacation = fields.Selection(selection=[( + '12', '12 Months'), + ('18', '18 Months'), + ('24', '24 Months')], string='Contractual Vacation') + + nod = fields.Selection(selection=[( + '12', '12 Months'), + ('18', '18 Months'), + ('24', '24 Months')], string='Number of days') + + probation = fields.Selection(selection=[( + '3', '3 Months'), + ('6', '6 Months')], string='Probation') + + dependent = fields.Selection(selection=[( + '1', '1+1 '), + ('2', '1+2 '), + ('3', '1+3 '), + ('all', 'All ')], string='Dependent') + + incentive = fields.Selection(selection=[( + 'yes', 'Yes'), + ('no', 'No')], string='Incentive') + + monthly_salary = fields.Float(string='Monthly Salary', compute='_compute_monthly_salary') + saudi_emp_type = fields.Selection([('saudi-contract', _('Saudi Contracting')), + ('saudi-non', _('Saudi Non-Contracting'))], _('Saudi Employee Type'), + default='saudi-contract') + + contract_type = fields.Selection([('local', _('Local')), ('international', _('International'))], _('Contract Type')) + + contract_description = fields.Selection([('locum', _('Temporary')), ('permanent', _('Permanent'))], + _('Contract Description'), default='permanent') + + house_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('House Allowance Type'), default='none') + house_allowance = fields.Float(_('House Allowance')) + salary_insurnce = fields.Float(string='Salary Insurnce') + overtime_eligible = fields.Selection([('yes', _('Yes')), ('no', _('No'))], _('Overtime Eligibility'), default='no') + overtime_eligible_float = fields.Float(_('Overtime Eligibility Amount')) + exit_and_return = fields.Selection([('yes', _('Yes')), ('no', _('No'))], _('Exit and Return'), default='no') + exit_and_return_amount = fields.Float(_('Exit and Return Amount'), default=200) + + air_ticket_eligible = fields.Selection([('yes', _('Yes')), ('no', _('No'))], + _('Air Ticket Eligible'), default='no') + annual_leave = fields.Selection([('yes', 'Yes'), ('no', 'No')], string='Annual Leave', default="no") + annual_leave_days = fields.Float(string='Annual Leave In Days') + transport_allowance_type = fields.Selection( + [('none', _('None')), ('perc', _('Percentage')), ('num', _('Number')), ('company', 'By Company')], + _('Transportation Allowance Type'), default='none') + transport_allowance = fields.Float(_('Transportation Allowance')) + + transport_allowance_temp = fields.Float(string='Transportation Allowance', compute='_get_amount') + + field_allowance_type = fields.Selection( + [('none', _('None')), ('perc', _('Percentage')), ('num', _('Number')), ('company', 'By Company')], + _('Field Allowance Type'), default='none') + field_allowance = fields.Float(_('Field Allowance')) + + field_allowance_temp = fields.Float(string='Field Allowance', compute='_get_amount') + + special_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Special Allowance Type'), default='none') + special_allowance = fields.Float(_('Special Allowance')) + special_allowance_temp = fields.Float(_('Special Allowance'), compute='_get_amount') + + other_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Other Allowances Type'), default='none') + other_allowance = fields.Float(_('Other Allowances')) + other_allowance_temp = fields.Float(_('Other Allowances'), compute='_get_amount') + + travel_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Travel Allowance Type'), default='none') + travel_allowance = fields.Float(_('Travel Allowance')) + travel_allowance_temp = fields.Float(_('Travel Allowance'), compute='_get_amount') + education_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Education Allowance Type'), default='none') + education_allowance = fields.Float(_('Education Allowance')) + education_allowance_temp = fields.Float(_('Education Allowance'), compute='_get_amount') + + food_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Food Allowance Type'), default='none') + food_allowance2 = fields.Float(_('Food Allowance')) + food_allowance2_temp = fields.Float(_('Food Allowance'), compute='_get_amount') + + security_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Security Allowance Type'), default='none') + security_allowance = fields.Float(_('Security Allowance')) + security_allowance_temp = fields.Float(_('Security Allowance'), compute='_get_amount') + communication_allowance_type = fields.Selection( + [('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Communication Allowance Type'), default='none') + communication_allowance = fields.Float(_('Communication Allowance')) + communication_allowance_temp = fields.Float(_('Communication Allowance'), compute='_get_amount') + + retire_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Retire Allowance Type'), default='none') + retire_allowance = fields.Float(_('Retirement Allowance')) + + infect_allowance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Infection Allowance Type'), default='none') + infect_allowance = fields.Float(_('Infection Allowance')) + supervision_allowance_type = fields.Selection( + [('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Supervision Allowance Type'), default='none') + supervision_allowance = fields.Float(_('Supervision Allowance')) + insurance_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Insurance Type'), default='none') + insurance = fields.Float(_('Insurance')) + other_deduction_type = fields.Selection([('none', _('None')), ('perc', _('Percentage')), ('num', _('Number'))], + _('Other Deductions Type'), default='none') + other_deduction = fields.Float(_('Other Deductions')) + gosi_deduction = fields.Float(compute="_calculate_gosi", string='Gosi (Employee Percentage)') + gosi_employer_deduction = fields.Float(compute="_calculate_gosi", string='Gosi (Employer Percentage)') + total_gosi = fields.Float(compute="_calculate_gosi", string='Total') + is_gosi_deducted = fields.Selection([('yes', _('Yes')), ('no', _('No'))], default='yes') + blood_type = fields.Selection( + [('O-', 'O−'), ('O+', 'O+'), ('A-', 'A−'), ('A+', 'A+'), ('B-', 'B−'), ('B+', 'B+'), ('AB-', 'AB−'), + ('AB+', 'AB+')], 'Blood Type') + + religion = fields.Selection([('muslim', _('Muslim')), ('christian', _('Christian')), ('other', _('Other'))], + _('Religion')) + gender = fields.Selection([('male', _('Male')), ('female', _('Female'))], + _('Gender')) + + birth_place = fields.Char(_('Birth Place')) + + point_of_hire = fields.Char(_('Point of hire')) + city = fields.Char(_('City Hired From')) + country = fields.Char(_('Country Hired From')) + contact_address = fields.Char(_('Contact address'), size=512) + + date_of_birth = fields.Date(_('Date Of Birth')) + marital = fields.Selection( + [('single', _('Single')), ('married', _('Married')), ('widower', _('Widower')), ('divorced', _('Divorced'))], + _('Marital Status'), default='single') + mobile_no = fields.Char(_('Mobile No')) + p_o_box_no = fields.Char(_('P. O. Box')) + zip_code = fields.Char(_('Zip Code')) + saudi_id_iqama = fields.Char(_('Saudi ID / Identity No.')) + saudi_id_iqama_date = fields.Date(_('Saudi ID / Identity Issue Date')) + saudi_id_iqama_expiry = fields.Date(_('Saudi ID / Identity Expiry Date')) + passport_number = fields.Char(_('Passport number')) + passport_issue_date = fields.Date(_('Passport Issue Date')) + passport_expiry_date = fields.Date(_('Passport Expiry Date')) + passport_issue_place = fields.Char(_('Passport Issue Place')) + saudi_com_number = fields.Char(_('Saudi Commission Number')) + saudi_com_date = fields.Date(_('Saudi Commission Issue Date')) + saudi_com_expiry_date = fields.Date(_('Saudi Commission Expiry Date')) + bls_date = fields.Date(_('BLS Date')) + acls_date = fields.Date(_('ACLS Date')) + insurance_date = fields.Date(_('Insurance Date')) + specialty = fields.Char(_('Specialty')) + category = fields.Char(_('Category')) + effective_from = fields.Date(_('Effective From')) + to_contact = fields.Text(_('To contact in case of Emergency')) + + emp_type = fields.Selection([('saudi', _('Holiday1')), + ('other', _('Holiday2')), + ('displaced', _('Holiday3')), + ('external', _('Holiday4')), + ('external2', _('Other'))], _('Annual Leave Entitlement'), tracking=True) + appraisal = fields.Boolean(_('Appraisal')) + re_contract = fields.Boolean(_('re contract')) + contract_draft = fields.Boolean(_('Contract Draft')) + breakdown_allowance = fields.Float(compute="_cal_allowance", string='Breakdown Allowance') + car_allowance = fields.Float(_('Car Allowance')) + ticket_allowance = fields.Float(_('Ticket Allowance')) + medical_ins_allowance = fields.Float(_('Medical Insurance Allowance')) + medical_ins_issue_date = fields.Date(_('Medical Insurance Issue Date')) + medical_ins_exp_date = fields.Date(_('Medical Insurance Expiry Date')) + join_date = fields.Date(_('Join Date')) + driving_lic_issue_date = fields.Date(_('Driving License Issue Date')) + driving_lic_exp_date = fields.Date(_('Driving License Expiry Date')) + driving_lic_issue_place = fields.Char(_('Driving License Issue Place')) + dependants_ticket_amount = fields.Float(string='Dependants Ticket Amount', compute='_get_dependants_ticket_amount') + air_ticket_amount = fields.Float(string='Air Ticket Amount') + air_ticket_number = fields.Integer(string='Air Ticket No.') + total_air_ticket_amount = fields.Float(string='Total Air Ticket Amount', compute='_get_total_ticket_amount') + trial_duration = fields.Float(string='Trail Duration', compute='_compute_contract_duration') + contract_duration_cal = fields.Float(string='Contract Duration', compute='_compute_contract_duration') + + # Relational fields + job_id = fields.Many2one(related="employee_id.job_id", readonly=True, tracking=True) + working_hours = fields.Many2one(related='employee_id.resource_calendar_id') + analytic_account_id = fields.Many2one(comodel_name='account.analytic.account') + journal_id = fields.Many2one(comodel_name='account.journal') + vac_des = fields.Many2one(comodel_name='hr.vacation.dest', string='Vacation Destination') + employee_dependent_ids = fields.One2many(comodel_name='hr.employee.dependent', inverse_name='contract_id') + employee_dependant = fields.One2many('hr.employee.dependent', 'contract_id', _('Employee Dependants')) + children_allowance = fields.One2many('hr.children.allowance', 'contract_id', _('Children Allowance')) + nationality = fields.Many2one('res.country', related='employee_id.country_id', readonly=True) + type_id = fields.Many2one(related='employee_id.employee_type_id', string="Contractor Type", tracking=True) + contractor_type = fields.Many2one(related='employee_id.employee_type_id', string="Contractor Type", required=False, tracking=True, store=True) + employee_id = fields.Many2one('hr.employee') + department_id = fields.Many2one('hr.department', _('Department Name'), related='employee_id.department_id', + readonly=True) + hiring_date = fields.Date(related='employee_id.first_hiring_date', string="Hiring Date", readonly=True) + all_exper_year = fields.Integer(compute='_compute_all_experience', store=True) + all_exper_month = fields.Integer(compute='_compute_all_experience', store=True) + all_exper_day = fields.Integer(compute='_compute_all_experience', store=True) + + previous_contract_id = fields.Many2one('hr.contract', store=True, string='Previous Contract', + help='The Previous Contract Of The Employee') + + ######################### consultant #####################new /:19/10 + consultants = fields.Boolean(default=False) + consultant_salary = fields.Float(string='Consultant Salary') + consultant_hour = fields.Float(string='Consultant Hour') + max_consultant_hour = fields.Float(string='Max Consultant Hour') + + salary_status = fields.Selection([('in', _('IN')), ('out', _('OUT'))], + _('Salary Status')) + recruited_talent = fields.Selection([('billable', _('Billable')), ('un_billable', _('Un Billable'))], + _('Recruited Talent')) + class_contract = fields.Selection([('employees', _('Employees')), ('collect_money', _('Collect Money')), + ('endowments', _('Endowments')),('researchers', _('Researchers'))], + _('Classification Contracts'), tracking=True) + period_ticket = fields.Integer() + dependant_count = fields.Integer(compute='_get_employee_dependant_count', store=True) + + has_transportation = fields.Boolean(string='Has Transportation?', default=True) + has_housing = fields.Boolean(string='Has Housing?', default=True) + + check_nationality = fields.Boolean(related='employee_id.check_nationality', store=True, string="Saudi?") + + last_salary_gosi = fields.Float(string='Last Salary Gosi', help='The Last Salary Gosi After The Age 50 Years.') + + + def _get_employee_dependant_count(self): + for rec in self: + rec.dependant_count = len( + self.env['hr.employee.dependent'].search([('contract_id', '=', rec.id)])) + + @api.depends('employee_id') + def _compute_all_experience(self): + for item in self: + if item.employee_id: + item.all_exper_year = item.employee_id.experience_year + item.employee_id.service_year + item.all_exper_month = item.employee_id.experience_month + item.employee_id.service_month + item.all_exper_day = item.employee_id.experience_day + item.employee_id.service_day + + if item.all_exper_month > 11: + item.all_exper_year = item.all_exper_year + 1 + item.all_exper_month = item.all_exper_month - 12 + if item.all_exper_day > 30: + item.all_exper_month = item.all_exper_month + 1 + item.all_exper_day = item.all_exper_day - 30 + + @api.onchange('contractor_type') + def onchange_contractor_type(self): + if self.contractor_type: + self.type_id = self.contractor_type + self.consultants = self.contractor_type.consultants + self.employee_id.employee_type_id = self.contractor_type + + @api.onchange('date_start', 'hiring_date') + def get_trial_date_field(self): + for rec in self: + # rec.trial_date_start = False + # rec.trial_date_end = False + if rec.hiring_date and rec.date_start: + date_start = datetime.datetime.strptime(str(rec.hiring_date), '%Y-%m-%d') + rec.trial_date_start = rec.hiring_date + rec.trial_date_end = date_start + relativedelta.relativedelta(months=3) + elif rec.date_start and not rec.hiring_date: + date_start = datetime.datetime.strptime(str(rec.date_start), '%Y-%m-%d') + rec.trial_date_start = rec.date_start + rec.trial_date_end = date_start + relativedelta.relativedelta(months=3) + + @api.onchange('employee_id') + def _emp_type_employee(self): + for item in self: + previous_contract = self.search([('employee_id', '=', item.employee_id.id), + ('active', '=', True), ], limit=1) + if previous_contract: + raise exceptions.UserError(_('Sorry, Can Not Create More than One contract for an Employeet %s') % + item.employee_id.name) + + if item.employee_id: + #if item.employee_id.check_nationality: + # item.emp_type = 'saudi' + #else: + # item.emp_type = 'other' + if item.employee_id.marital == 'single': + item.contract_status = 'single' + else: + item.contract_status = 'marriage' + item.job_id = item.employee_id.job_id + item.department_id = item.employee_id.department_id + item.employee_code = item.employee_id.employee_code + item.fn = item.employee_id.fn + item.mn = item.employee_id.mn + item.ln = item.employee_id.ln + item.dn = item.employee_id.name + + '''@api.onchange('emp_type') + def chick_saudi_percentage(self): + for item in self: + Saudization_percen = item.env.user.company_id.saudi_percentage + if Saudization_percen > 0: + saudi = len(item.search([('active', '=', True), ('emp_type', 'in', ('saudi', 'displaced')), + ('state', '=', 'program_directory')]).ids) + all_emp = len(item.search([('active', '=', True), ('state', '!=', 'end_contract')]).ids) + 1 + saudi_percen = (saudi / all_emp) * 100 + if saudi_percen > Saudization_percen and item.emp_type in ('saudi', 'displaced'): + raise exceptions.Warning( + _('The Saudization percentage should not exceed Percentage %s') % Saudization_percen) + + none_saudi = len(item.search( + [('active', '=', True), ('emp_type', '=', 'other'), ('state', '=', 'program_directory')]).ids) + none_Saudization_percen = (100 - Saudization_percen) + none_percen = (none_saudi / all_emp) * 100 + if none_percen > none_Saudization_percen and item.emp_type == 'other': + raise exceptions.Warning( + _('The None Saudization percentage should not exceed Percentage %s') % none_Saudization_percen)''' + + def change_current_date_hijri(self, date): + date = datetime.datetime.strptime(str(date), '%Y-%m-%d') + year = date.year + day = date.day + month = date.month + hijri_date = convert.Gregorian(year, month, day).to_hijri() + return hijri_date + + def translate_to_eng(self, text): + if text: + eng_text = text + ln = translator.detect(text) + if ln.lang != 'en': + eng_text = translator.translate(text, dest='en') + return eng_text + else: + return ' ' + + ###############>>send email end contract and trial peroid<<<########## + @api.model + def contract_mail_reminder(self): + now = dt.now() + timedelta(days=1) + date_now = now.date() + match = self.search([('state', '!=', 'end_contract'), + ('contract_duration', 'not in',( '3_months','6_months'))]) + # trial_days_send_email=5 + cont_end_reminder = self.env.user.company_id.contract_end_reminder + cont_trial_reminder = self.env.user.company_id.contract_trial_reminder + for i in match: + if i.date_end: + exp_date = fields.Date.from_string(i.date_end) - timedelta(days=cont_end_reminder) + if date_now >= exp_date: + self.env.ref('hr_contract_custom.email_template_contract_period_expiration_reminder', False).send_mail(i.id) + + if i.trial_date_end: + exp_date = fields.Date.from_string(i.trial_date_end) + exp_date1 = fields.Date.from_string(i.trial_date_end) - timedelta(days=cont_trial_reminder) + # if date_now >= exp_date : + if exp_date >= date_now and date_now >= exp_date1: + self.env.ref('hr_contract_custom.email_template_contract_trial_period_expiration_reminder', False).send_mail(i.id) + + ########################################################################## + @api.onchange('contract_duration', 'date_start') + def get_contract_end_date(self): + if self.date_start and self.contract_description == 'locum': + + date_start = datetime.datetime.strptime(str(self.date_start), '%Y-%m-%d') + + if self.contract_duration == '3_months': + self.date_end = date_start + relativedelta.relativedelta(months=3) - timedelta(days=1) + elif self.contract_duration == '6_months': + self.date_end = date_start + relativedelta.relativedelta(months=6) - timedelta(days=1) + elif self.contract_duration == '9_months': + self.date_end = date_start + relativedelta.relativedelta(months=9) - timedelta(days=1) + elif self.contract_duration == '12_months': + self.date_end = date_start + relativedelta.relativedelta(months=12) - timedelta(days=1) + elif self.contract_duration == '24_months': + self.date_end = date_start + relativedelta.relativedelta(months=24) - timedelta(days=1) + elif self.contract_duration == '36_months': + self.date_end = date_start + relativedelta.relativedelta(months=36) - timedelta(days=1) + else: + self.date_end = False + + # get salary amount form salary degree + @api.onchange('salary_degree') + def onchange_salary_degree(self): + if self.salary_degree: + self.salary = self.salary_degree.base_salary + + # Get Salary Insurnce from Salary amount + @api.onchange('salary') + def onchange_base_salary_insurance(self): + if self.salary: + self.salary_insurnce = self.salary + + # update to control on date constrains + @api.onchange('trial_date_start', 'trial_date_end', 'date_start', 'date_end') + def onchange_dates(self): + if self.trial_date_start: + if self.trial_date_end: + if self.date_start: + if self.date_end: + start_date_1 = dt.strptime(str(self.date_start), "%Y-%m-%d") + end_date_1 = dt.strptime(str(self.date_end), "%Y-%m-%d") + trial_start_date_1 = dt.strptime(str(self.trial_date_start), "%Y-%m-%d") + trial_end_date_1 = dt.strptime(str(self.trial_date_end), "%Y-%m-%d") + + if trial_end_date_1 < trial_start_date_1: + raise exceptions.Warning(_('trial End Date must be greater than Trial Start date')) + if end_date_1 < start_date_1: + raise exceptions.Warning(_('End date must be greater than Start date')) + + @api.onchange('contract_description') + def _contract_duration_change_state(self): + if self.contract_description == 'permanent': + self.contract_duration = 'none' + self.date_end = '' + + @api.depends('wage', 'house_allowance', 'transport_allowance', 'communication_allowance') + def _compute_monthly_salary(self): + for rec in self: + rec.monthly_salary = rec.wage + rec.house_allowance_temp + rec.transport_allowance_temp + \ + rec.communication_allowance_temp + rec.field_allowance_temp + \ + rec.special_allowance_temp + rec.other_allowance_temp + + @api.depends() + def _cal_allowance(self): + allowance = 0.0 + if self.employee_id.country_id.code == 'SA': + allowance = self.salary * 1 / 100 + self.breakdown_allowance = allowance + + @api.depends() + def _calculate_gosi(self): + saudi_gosi = self.env.user.company_id.saudi_gosi + company_gosi = self.env.user.company_id.company_gosi + none_saudi_gosi = self.env.user.company_id.none_saudi_gosi + + max_saudi_gosi = self.env.user.company_id.max_amount_saudi_gosi + max_company_gosi = self.env.user.company_id.max_amount_company_gosi + + Sanad_saudi_gosi = self.env.user.company_id.Sanad_saudi_gosi + Sanad_company_gosi = self.env.user.company_id.Sanad_company_gosi + + for record in self: + #if (record.emp_type == 'saudi' or record.emp_type == 'displaced') and record.is_gosi_deducted == "yes": + record.employee_id._compute_employee_age() + sanad_age = record.salary_scale.retirement_age + emp_age = record.employee_id.employee_age + + if record.check_nationality==True and record.is_gosi_deducted == "yes": + if emp_age >= sanad_age and sanad_age > 0 : + employee_gosi = (record.salary_insurnce + record.house_allowance_temp) * (saudi_gosi - Sanad_saudi_gosi) / 100 + employer_gosi = (record.salary_insurnce + record.house_allowance_temp) * (company_gosi - Sanad_company_gosi)/ 100 + else: + employee_gosi = (record.salary_insurnce + record.house_allowance_temp) * saudi_gosi / 100 + employer_gosi = (record.salary_insurnce + record.house_allowance_temp) * company_gosi / 100 + + if employee_gosi <= max_saudi_gosi: + record.gosi_deduction = employee_gosi + else: + record.gosi_deduction = max_saudi_gosi + if employer_gosi <= max_company_gosi: + record.gosi_employer_deduction = employer_gosi + else: + record.gosi_employer_deduction = max_company_gosi + record.total_gosi = record.gosi_deduction + record.gosi_employer_deduction + + #elif (record.emp_type == 'saudi' or record.emp_type == 'displaced') and record.is_gosi_deducted == "no": + elif record.check_nationality==True and record.is_gosi_deducted == "no": + if emp_age >= sanad_age and sanad_age > 0 : + employee_gosi = (record.salary_insurnce + record.house_allowance_temp) * (saudi_gosi - Sanad_saudi_gosi) / 100 + employer_gosi = (record.salary_insurnce + record.house_allowance_temp) * (company_gosi - Sanad_company_gosi) / 100 + else: + employee_gosi = (record.salary_insurnce + record.house_allowance_temp) * saudi_gosi / 100 + employer_gosi = (record.salary_insurnce + record.house_allowance_temp) * company_gosi / 100 + + if employee_gosi <= max_saudi_gosi: + employee_gosi = employee_gosi + else: + employee_gosi = max_saudi_gosi + if employer_gosi <= max_company_gosi: + employer_gosi = employer_gosi + else: + employer_gosi = max_company_gosi + + record.gosi_deduction = 0.0 + record.gosi_employer_deduction = employee_gosi + employer_gosi + record.total_gosi = employee_gosi + employer_gosi + + else: + # pass + employer_gosi = (record.salary_insurnce + record.house_allowance_temp) * none_saudi_gosi / 100 + + record.gosi_deduction = 0.0 + record.gosi_employer_deduction = employer_gosi + record.total_gosi = employer_gosi + + #if (record.emp_type == 'saudi' or record.emp_type == 'displaced') and record.saudi_emp_type == 'saudi-non': + if record.check_nationality==True and record.saudi_emp_type == 'saudi-non': + record.gosi_deduction = 0.0 + record.gosi_employer_deduction = 0.0 + record.total_gosi = 0.0 + + @api.depends('date_start', 'date_end', 'trial_date_start', 'trial_date_end') + def _compute_contract_duration(self): + for item in self: + item.contract_duration_cal = 0 + item.trial_duration = 0 + if item.date_start and item.date_end: + date_start = datetime.datetime.strptime(str(item.date_start), '%Y-%m-%d').date() + date_end = datetime.datetime.strptime(str(item.date_end), '%Y-%m-%d').date() + item.contract_duration_cal = relativedelta.relativedelta(date_end, date_start).years + + if item.trial_date_start and item.trial_date_end: + date_start = datetime.datetime.strptime(str(item.trial_date_start), '%Y-%m-%d').date() + date_end = datetime.datetime.strptime(str(item.trial_date_end), '%Y-%m-%d').date() + item.trial_duration = relativedelta.relativedelta(date_end, date_start).months + if item.trial_duration > 6: + raise exceptions.Warning(_('The period of trail duration must be not more than 6 months')) + + '''@api.onchange('date_start') + def _compute_trial_period(self): + if self.date_start and self.date_end: + date_start = datetime.datetime.strptime(str(self.date_start), '%Y-%m-%d').date() + self.trial_date_start = self.date_start + self.trial_date_end = date_start + relativedelta.relativedelta(months=3) - timedelta(days=1)''' + + @api.depends('air_ticket_amount') + def _get_total_ticket_amount(self): + self.total_air_ticket_amount = self.air_ticket_amount * self.air_ticket_number + + @api.onchange('employee_id') + def _onchange_employee_id(self): + if self.employee_id: + self.job_id = self.employee_id.job_id + self.department_id = self.employee_id.department_id + self.employee_code = self.employee_id.employee_code + self.fn = self.employee_id.fn + self.mn = self.employee_id.mn + self.ln = self.employee_id.ln + self.dn = self.employee_id.name + + @api.model + def create(self, vals): + contracts = super(Contract, self).create(vals) + contracts.employee_id.contract_id = contracts.id + return contracts + + def draft_state(self): + self.state = "draft" + + def employeed_aproval(self): + #self.chick_saudi_percentage() + self.state = "employeed_aproval" + + def hr_head_approval(self): + #self.chick_saudi_percentage() + self.state = "hr_head_approval" + + def end_contract_state(self): + if self.date_end == False: + raise exceptions.Warning(_('The contract End Date Must Be Entered')) + else: + self.state = "end_contract" + + def program_directory(self): + #self.chick_saudi_percentage() + self.employee_id.contract_id = self.id + hiring_date = self.employee_id.first_hiring_date + effective = self.env['employee.effective.form'].search([('contract_id', '=', self.id)]) + if not effective and not hiring_date: + self.env['employee.effective.form'].create({ + 'employee_id': self.employee_id.id, + 'contract_id': self.id, + 'department_id': self.department_id.id, + 'contract_start': self.date_start, + 'effective_form_date': self.date_start, + 'state': 'draft'}) + self.state = "program_directory" + + def unlink(self): + for i in self: + if i.state != 'draft': + raise exceptions.Warning(_('You can not delete record in state not in draft')) + # if i.hiring_date: + # raise exceptions.Warning(_('You can not delete record has Hiring date')) + return super(Contract, self).unlink() + + @api.onchange('working_hours') + def _onchange_working_hours(self): + if self.employee_id.contract_id.id == self._origin.id: + self.env['resource.resource'].browse([self.employee_id.resource_id.id]).write( + {'calendar_id': self.working_hours.id}) + + + # Smart Button to access effective form + + def action_view_effective_frm(self): + effective_id = self.env['employee.effective.form'].search([('employee_id', '=', self.employee_id.id)]) + return { + 'name': _('Employee Effective Form'), + 'domain': [('id', '=', effective_id.id)], + 'view_mode': 'tree,form', + 'res_model': 'employee.effective.form', + 'view_id': False, + 'type': 'ir.actions.act_window', + } + + +class VacationDest(models.Model): + _name = 'hr.vacation.dest' + + _rec_name = 'name' + name = fields.Char(required=True) + + +class EmployeeChildAllowance(models.Model): + _name = 'hr.children.allowance' + + name = fields.Char(_('Children Name')) + age = fields.Integer(_('Age')) + fees = fields.Float(_('Educational Fees')) + remarks = fields.Text(_('Remarks')) + + # Relational fields + contract_id = fields.Many2one('hr.contract', _('Contract')) + + +class ContractType(models.Model): + _name = "hr.contract.type" + _description = "Contract Type" + _order = "sequence, id" + + name = fields.Char(string="Contract Type", required=True) + sequence = fields.Integer(help="Gives the sequence when displaying a list of Contract.", default=10) + salary_type = fields.Selection([("amount", _("Amount")), ("scale", _("Scale"))], string="Salary Type") + code = fields.Char(string='Code') + consultants = fields.Boolean(default=False, string='Consultants') + country_id = fields.Many2one("res.country", string="Country") + company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company) + + + diff --git a/odex30_base/hr_contract_custom/models/hr_contract_extension.py b/odex30_base/hr_contract_custom/models/hr_contract_extension.py new file mode 100644 index 0000000..ff8ceea --- /dev/null +++ b/odex30_base/hr_contract_custom/models/hr_contract_extension.py @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- + +import datetime +from dateutil import relativedelta +from odoo import api, fields, models, _, exceptions + + +class ContractExtension(models.Model): + _name = 'hr.contract.extension' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _rec_name = 'employee_id' + + employee_id = fields.Many2one('hr.employee', string="Employee", required=True) + employee_no = fields.Char(related='employee_id.emp_no', readonly=True,string='Employee Number', store=True) + contract_id = fields.Many2one(related='employee_id.contract_id', store=True, string="Contract") + department_id = fields.Many2one(related='employee_id.department_id', store=True, string="Department") + type = fields.Selection(selection=[('extension', 'Extension'), ('end', 'Contract End'), ('confirm', 'Confirm')], + required=True, string="Type", tracking=True) + state = fields.Selection(selection=[('draft', 'Draft'), ('confirm', 'wait Direct Manager'), + ('emp_confirm', 'wait Employee'), + ('direct_manager', 'Wait HR Approve'), ('hr_approve', 'Approved'), + ('refused', 'Refused')], required=True, string="State", default='draft', + tracking=True) + date_from = fields.Date() + date_to = fields.Date() + old_date_from = fields.Date(compute='get_relation_field', store=True, string="Trial start") + old_date_to = fields.Date(compute='get_relation_field', store=True, string="Trial end") + contract_date_end = fields.Date(compute='get_relation_field', store=True, string="Contract Date end") + end_date = fields.Date() + comments = fields.Text(string="Comments") + company_id = fields.Many2one(related='employee_id.company_id', string="Company") + + @api.onchange('employee_id') + def get_relation_field(self): + for rec in self: + rec.old_date_from = rec.contract_id.trial_date_start + rec.old_date_to = rec.contract_id.trial_date_end + rec.contract_date_end = rec.contract_id.date_end + rec.end_date = rec.contract_id.trial_date_end + rec.date_from = False + rec.date_to = False + if rec.old_date_to: + date_start = datetime.datetime.strptime(str(rec.old_date_to), '%Y-%m-%d') + rec.date_from = rec.old_date_to + rec.date_to = date_start + relativedelta.relativedelta(months=3) + + @api.constrains('employee_id') + def once_request(self): + for i in self: + employee_id = self.env['hr.contract.extension'].search( + [('id', '!=', i.id), ('employee_id', '=', i.employee_id.id), + ('state', 'not in', ('draft', 'refused'))]) + for rec in employee_id: + if rec.type == 'extension' and i.type == 'extension': + raise exceptions.Warning(_('Sorry, Not possible to request Extension Form more than once')) + + if rec.type == 'confirm' and i.type == 'confirm': + raise exceptions.Warning(_('Sorry, Not possible to request Confirm Form more than once')) + + if rec.type == 'end' and i.type == 'end': + raise exceptions.Warning(_('Sorry, Not possible to request Termination Form more than once')) + + if rec.type == 'confirm' and (i.type == 'end' or i.type == 'extension'): + raise exceptions.Warning(_('Sorry, Not possible End Or Extension request After Confirm')) + + if rec.type == 'end' and (i.type == 'confirm' or i.type == 'extension'): + raise exceptions.Warning(_('Sorry, Not possible Confirm Or Extension request After End')) + + if not i.contract_id: + raise exceptions.Warning(_('Sorry, Not possible to request Extension with Not Contract')) + + @api.constrains('date_from', 'date_to') + def date_constrin(self): + for item in self: + if item.old_date_to and item.date_from: + if item.old_date_to > item.date_from: + raise exceptions.Warning(_('Extension Date Form Must be Greater than Old Date To')) + + if item.date_to and item.date_from: + if item.date_from >= item.date_to: + raise exceptions.Warning(_('Date Form Must be Less Than Date To')) + + date_start = datetime.datetime.strptime(str(item.date_from), '%Y-%m-%d').date() + date_end = datetime.datetime.strptime(str(item.date_to), '%Y-%m-%d').date() + trial_duration = relativedelta.relativedelta(date_end, date_start).months + if trial_duration > 3: + raise exceptions.Warning(_('The period of Extension trail duration must be not more than 3 months')) + + def confirm(self): + for rec in self: + rec.once_request() + rec.state = 'confirm' + + def direct_manager(self): + for rec in self: + rec.once_request() + if rec.type != 'extension': + rec.state = 'direct_manager' + else: + rec.state = 'emp_confirm' + + def emp_confirm(self): + for rec in self: + rec.once_request() + if rec.employee_id.user_id.id == rec.env.uid: + rec.state = 'direct_manager' + else: + raise exceptions.Warning(_('Sorry, For Employee %s Confirm Only !') % (rec.employee_id.name)) + + def hr_approve(self): + for rec in self: + rec.once_request() + if rec.type == 'extension': + rec.contract_id.sudo().write({ + #'trial_date_start': rec.date_from, + 'trial_date_end': rec.date_to + }) + elif rec.type == 'end': + rec.contract_id.sudo().write({ + # 'state':'end_contract', + 'date_end': rec.end_date + }) + else: + rec.contract_id.sudo().write({ + 'state': 'program_directory', }) + rec.state = 'hr_approve' + + def refused(self): + for rec in self: + if rec.type != 'extension' or rec.state != 'emp_confirm': + rec.state = "refused" + else: + rec.state = 'confirm' + + def draft_state(self): + for item in self: + if item.type == 'extension': + item.contract_id.sudo().write({ + #'trial_date_start': item.old_date_from, + 'trial_date_end': item.old_date_to + }) + if item.type == 'end': + item.contract_id.sudo().write({'date_end': item.contract_date_end}) + item.state = "draft" + + def unlink(self): + for i in self: + if i.state != 'draft': + raise exceptions.Warning(_('You can not delete record in state not in draft')) + return super(ContractExtension, self).unlink() diff --git a/odex30_base/hr_contract_custom/models/hr_employee.py b/odex30_base/hr_contract_custom/models/hr_employee.py new file mode 100644 index 0000000..b31bbea --- /dev/null +++ b/odex30_base/hr_contract_custom/models/hr_employee.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +from num2words import num2words +from datetime import datetime, timedelta +from odoo import api, fields, models,_ + + +class HrEmployee(models.Model): + _inherit = "hr.employee" + + base_salary = fields.Float(compute="compute_base_salary") + salary_in_words = fields.Char(compute="get_salary_amount") + payslip_lines = fields.One2many(comodel_name="hr.payslip.line", compute="compute_base_salary") + employee_dependant = fields.One2many(related='contract_id.employee_dependant',readonly=False, tracking=True) + employee_type_id = fields.Many2one('hr.contract.type', string="Employee Type", ondelete='cascade', tracking=True) + + + @api.depends("base_salary") + def get_salary_amount(self): + for item in self: + item.salary_in_words = num2words(item.base_salary, lang=self.env.user.lang) + + def compute_base_salary(self): + for item in self: + last_day_of_prev_month = datetime.now().date().replace(day=1) - timedelta(days=1) + start_day_of_prev_month = datetime.now().date().replace(day=1) - timedelta(days=last_day_of_prev_month.day) + payroll = item.env["hr.payslip"].search( + [ + ("employee_id", "=", item.name), + ("date_from", "<=", datetime.now().date()), + ("date_to", ">=", datetime.now().date()), + ("contract_id", "=", item.contract_id.id), + ], + limit=1, + ) + if not payroll: + payroll = item.env["hr.payslip"].search( + [ + ("employee_id", "=", item.name), + ("date_from", "<=", start_day_of_prev_month), + ("date_to", ">=", last_day_of_prev_month), + ("contract_id", "=", item.contract_id.id), + ],limit=1, + ) + + item.base_salary = payroll.total_allowances + item.payslip_lines = payroll.allowance_ids.filtered( + lambda r: r.salary_rule_id.rules_type in ("salary", "house") + ).sorted(lambda b: b.name) + diff --git a/odex30_base/hr_contract_custom/models/hr_re_contract.py b/odex30_base/hr_contract_custom/models/hr_re_contract.py new file mode 100644 index 0000000..2f3eead --- /dev/null +++ b/odex30_base/hr_contract_custom/models/hr_re_contract.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields, _, exceptions, api +import datetime +from datetime import datetime +from dateutil.relativedelta import relativedelta +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT + + +class hr_extend(models.Model): + _name = 'hr.re.contract' + _rec_name = 'employee_id' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + state = fields.Selection(string='State', selection=[ + ('draft', 'Draft'), + ('submitted', 'Submitted'), + ('direct_manager', 'Direct Manager'), + ('hr_manager', 'HR Manager'), + ('done', 'Re-Contract'), + ('refuse', 'Refuse'), + ], default='draft', tracking=True) + + company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.user.company_id) + employee_id = fields.Many2one('hr.employee', string='Employee', required=True) + date = fields.Date(default=fields.Date.context_today, string="Date Request") + effective_date = fields.Date() + job_id = fields.Many2one('hr.job', string='Job Position', compute='_get_employee_data', store=True) + department_id = fields.Many2one('hr.department', string='Department', compute='_get_employee_data', store=True) + + hire_date = fields.Date(string='Hire Date', compute='_get_employee_data', store=True) + contract_id = fields.Many2one('hr.contract', compute='_get_employee_data', store=True, string='Current Contract', + help='Latest contract of the employee') + + new_salary = fields.Float() + start_date = fields.Date(string='Current Contract Start Date', compute='_get_employee_data', store=True) + new_contract_start_date = fields.Date() + new_contract_end_date = fields.Date() + eoc_date = fields.Date(string='Current Contract End Date', compute='_get_employee_data', store=True) + increase_salary = fields.Selection([('no', 'NO'), ('yes', 'YES')], string='Increase Salary?', default='no') + last_renewal = fields.Boolean(readonly=True, string='Last Renewal?', default=True) + + contract_type = fields.Selection([('temporary', _('Temporary')), ('permanent', _('Permanent'))], + _('Contract Type'), default='temporary', tracking=True) + + iqama_end_date = fields.Date(related="employee_id.iqama_number.expiry_date",string='Identity End Date', readonly=True) + + # employee_type = fields.Selection(related='employee_id.contract_id.contract_description', store=True) + + def action_refuse(self): + for item in self: + if item.state == 'done': + contracts = self.env['hr.contract'].search([('employee_id', '=', self.employee_id.id)], + order='id DESC')[:2] + item.contract_id.write({ + 'salary': item.contract_id.salary_degree.base_salary, + 'salary_scale': item.contract_id.salary_scale.id, + 'salary_level': item.contract_id.salary_level.id, + 'salary_group': item.contract_id.salary_group.id, + 'salary_degree': item.contract_id.salary_degree.id, }) + self.state = "refuse" + + def action_submit(self): + self._get_employee_data() + self.state = 'submitted' + + def action_direct_manager(self): + # if self.employee_id.parent_id and self._uid != self.employee_id.parent_id.user_id.id: + # raise exceptions.Warning(_('This is Not Your Role beacuse Your Direct Manager')) + self._get_employee_data() + self._check_contract() + self.state = "direct_manager" + + def action_hr_manager(self): + self._get_employee_data() + self.state = "hr_manager" + + def action_done(self): + self._check_contract() + today = datetime.now().date() + str_today = today.strftime('%Y-%m-%d') + # if str_today != self.effective_date: + # raise exceptions.Warning(_('You can not re-contract employee because effective date is not today')) + last_record = self.env['hr.re.contract'].search( + [('id', '!=', self.id), ('employee_id', '=', self.employee_id.id), + ('state', '=', 'done'), ('last_renewal', '=', True)], order='id desc', limit=1) + default = { + 'job_id': self.job_id.id, + 'employee_id': self.employee_id.id, + 'department_id': self.department_id.id, + # 'date_start': self.new_contract_start_date, + 'date_end': self.new_contract_end_date, + 'name': 'Re-Contract' + self.employee_id.name, + 'state': 'program_directory', + } + if self.increase_salary == 'yes': + + default.update({'wage': self.new_salary_degree.base_salary, + 'salary_scale': self.new_salary_scale.id, + 'salary_level': self.new_salary_level.id, + # 'experience_year': self.experience_year, + 'salary_group': self.new_salary_group.id, + 'salary_degree': self.new_salary_degree.id, + }) + + else: + default.update({'wage': self.contract_id.salary_degree.base_salary, + 'salary_scale': self.contract_id.salary_scale.id, + 'salary_level': self.contract_id.salary_level.id, + 'experience_year': self.contract_id.experience_year, + 'salary_group': self.contract_id.salary_group.id, + 'salary_degree': self.contract_id.salary_degree.id, + }) + + c_id = self.contract_id.copy(default=default) + + for line in self.contract_id.employee_dependant: + line.contract_id = c_id.id + + for line in self.contract_id.advantages: + line.contract_advantage_id = c_id.id + + self.contract_id.write({'active': False}) + if last_record: + last_record.last_renewal = False + if self.contract_type == 'permanent': + c_id.contract_description = 'permanent' + # Employee back to service + self.employee_id.state = 'open' + self.contract_id.state = 'program_directory' + + self.state = "done" + + def unlink(self): + for i in self: + if i.state != 'draft': + raise exceptions.Warning(_('You can not delete record in state not in draft')) + return super(hr_extend, self).unlink() + + @api.onchange('employee_id', 'new_contract_start_date', 'contract_type') + def onchange_new_contract_start_date(self): + for rec in self: + if rec.eoc_date: + rec.new_contract_start_date = False + rec.new_contract_end_date = False + date_start = datetime.strptime(str(rec.eoc_date), '%Y-%m-%d') + date_start += relativedelta(days=1) + rec.new_contract_start_date = date_start + # rec.new_contract_end_date = date_start + relativedelta(years=3) + if not rec.eoc_date and rec.employee_id: + raise exceptions.Warning(_('You can not renewal contract is open Date')) + if rec.new_contract_start_date: + start_date = datetime.strptime(str(rec.new_contract_start_date), DEFAULT_SERVER_DATE_FORMAT).date() + end_date = start_date + relativedelta(years=1) + end_date -= relativedelta(days=1) + rec.new_contract_end_date = end_date + if rec.contract_type == 'permanent': + rec.new_contract_end_date = False + + def _check_contract(self): + old_start_date = datetime.strptime(str(self.contract_id.date_start), DEFAULT_SERVER_DATE_FORMAT).date() + # old_end_date = datetime.strptime(self.contract_id.date_end, DEFAULT_SERVER_DATE_FORMAT).date() + new_start_date = datetime.strptime(str(self.new_contract_start_date), DEFAULT_SERVER_DATE_FORMAT).date() + + if self.contract_id.date_end: + old_end_date = datetime.strptime(str(self.contract_id.date_end), DEFAULT_SERVER_DATE_FORMAT).date() + if new_start_date <= old_end_date: + raise exceptions.Warning(_('New Contract must have start date after the end date of old contract')) + elif old_start_date <= new_start_date <= old_end_date: + raise exceptions.Warning(_('New Contract must have start date after the end date of old contract')) + + if self.new_contract_end_date: + new_end_date = datetime.strptime(str(self.new_contract_end_date), DEFAULT_SERVER_DATE_FORMAT).date() + + if new_start_date >= new_end_date: + raise exceptions.Warning(_('New Contract start date must be before the end date')) + + return True + + def action_set_to_draft(self): + if self.state == 'done': + last_record = self.env['hr.re.contract'].search( + [('id', '!=', self.id), ('employee_id', '=', self.employee_id.id), + ('state', '=', 'done'), ('last_renewal', '=', False)], order='id desc', limit=1) + + if self.last_renewal == False: + raise exceptions.Warning(_('The record Cannot be Set To Draft Because It Is Not Last Renewal Record')) + for line in self.employee_id.contract_id.advantages: + line.contract_advantage_id = self.contract_id.id + for line in self.employee_id.contract_id.employee_dependant: + line.contract_id = self.contract_id.id + contracts = self.env['hr.contract'].search([('employee_id', '=', self.employee_id.id)], order='id DESC')[:2] + if self.contract_id: + self.contract_id.write({'active': True}) + contracts.draft_state() + contracts.unlink() + if last_record: + last_record.last_renewal = True + self.state = "draft" diff --git a/odex30_base/hr_contract_custom/report/employee_contract_report_template.xml b/odex30_base/hr_contract_custom/report/employee_contract_report_template.xml new file mode 100644 index 0000000..1d9c890 --- /dev/null +++ b/odex30_base/hr_contract_custom/report/employee_contract_report_template.xml @@ -0,0 +1,851 @@ + +|
+ |
+
+
+
+ |
+
| + عقـــــــد عمل + | ++ EMPLOYMENT Contract + | +
| + تم بعون الله إبرام هذا العقد، في هذا التاريخ + + هـ، الموافق + + بيــــــن كل من: + | ++ This contract is made and entered into this + + H, corresponding to + + G by and between: + | +
| + 1. شركة + + وهي شركة سعودية قائمة مؤسسة بموجب أنظمة المملكة العربية السعودية ومركزها + الرئيسي – الرياض، المملكة العربية السعودية وعنوانها البريدي ص. ب ( + ) الرياض (12334). (ويشار إليها في هذا العقد بـ "صاحب العمل")، + | ++ 1., + a Saudi company existing under the laws of the Kingdom of Saudi Arabia and + having its principal place of business in Riyadh, its postal address is P.O. + Box, Riyadh 12334, (hereinafter referred to as the “Employer”). + | +
| + 2. السيد / + + ، + + الجنسية بموجب هوية رقم : + + (ويشار إليه في هذا العقد بـ"الموظف"). + | ++ 2. Mr., + + nationality, holding ID No + + (Hereinafter referred to as the “Employee”). + | +
| + تمهيد: + | ++ Preamble: + | +
| + بناءً على الرغبة المشتركة لطرفي هذا العقد، وهما بكامل الأهلية المعتبرة شرعاً + ونظاماً للتعاقد مع بعضهما كصاحب عمل وموظف ، فقد اتفق الطرفان على الشروط + والأحكام التالية: + | ++ Upon their mutual interest being in their full legal capacities to contract + with each other as employer and employee, The parties hereto agree to the + terms and conditions stipulated herein as follows: + | +
|
+ |
+ + (1)The above-mentioned preamble is considered as integral part of this + contract. + | +
|
+ (2) التعيين
+ + يعمل الموظف على وظيفة + + أو أي عمل آخر يسند اليه يتناسب مع مؤهلاته العلمية وخبراته العملية وبحسب ما + تفتضيه مصلحة العمل بشرط ألا يتعارض مع الوصف الوظيفي للوظيفة يكون مقر عمل + الموظف في مدينة الرياض أو في أي مكان آخر تحدده الشركة داخل المملكة العربية + السعودية أو خارجها إذا ما دعت الحاجة إلى ذلك طبقاً لنظام العمل والسياسات + التي تضعها الشركة مع مراعاة الاحكام التالية: + لا يكون نقل الموظف من مكان عمله الأصلي إلى مكان آخر يقتضي تغيير محل إقامته + إلا بموافقة الموظف كتابة. + يجوز للشركة في حالات الضرورة التي قد تفتضيها ظروف عارضة ولمدة لا تزيد عن + ثلاثين يوماً في السنة، تكليف الموظف ان يعمل في مكان مختلف عن المكان الأصلي + دون موافقته وتتحمل الشركة تكاليف انتقال الموظف وإقامته خلال تلك المدة. + ان يعمل في مكان مختلف عن المكان الأصلي دون موافقته وتتحمل الشركة تكاليف + انتقال الموظف وإقامته خلال تلك المدة. + |
+
+ 2) Appointment
+ + The Employer hereby appoint the Employee to work as + + Position, or any work assigned to him/ her so long the Employee has all + credentials and experiences to carry out this work. The location of the job + shall be Riyadh or any other locations decided by the company in accordance + with labour law and internal procedures, provided these conditions are met + Written acceptance by the employee must be obtained if the company decide to + transfer the employee to a different location, under urgent circumstances + only, the employer may order the employee to relocate to a different + location provided these conditions are satisfied:The relocation duration + shall not exceed 30 days, the employer shall compensate the employee or the + employer incur all the cost with respect to housing and transportation as a + result of the relocation. + |
+
|
+ (3) الراتب الشهري
+ + (ا) الراتب الشهري الأساسي للموظف هو () ريال سعودي شاملاً كافة أيام الشهر بما فيها عطلات نهاية الأسبوع والعطل + الرسمية. + + (ب) يُدفع راتب الموظف الأساسي الشهري، إضافة إلى أي بدلات أو مدفوعات أخرى، + ناقصاً أية اقتطاعات مستحقة عليه، على أساس شهري في آخر كل شهر (حسب التقويم + الميلادي). + |
+
+ 3.Monthly Salary
+ + (a) The Employee's basic monthly salary, which includes each and every day + of the month, including the Weekend, and holidays, is SR (). + + (b) The Employee's monthly salary plus any other allowances or payments + minus any deductions shall be paid monthly at the end of each month (in + accordance with the Gregorian calendar). + |
+
|
+ (4) البدلات
+ + يستحق الموظف البدلات الإضافية التالية: + + (أ) السكن + + يحق للموظف الحصول على بدل سكن مقداره (3) ثلاث رواتب أساسية سنوياً، تقسم على + 12 شهراَ وتدفع في آخر كل شهر. + + (ب) المواصلات + + يحق للموظف الحصول على بدل مواصلات بمقدار (10%) عشرة بالمائة من الراتب + الأساسي تدفع في آخر كل شهر. + |
+
+ (4) Allowances
+ + The Employee is eligible for the additional allowances specified below: + + (a) Housing Allowance + + The Employee shall be entitled to receive a housing allowance of (3) Three + basic Salary per annum, divided to 12 months and payable at the end of each + months. + + (b) Transportation + + The Employee shall be entitled to receive a car allowance of (10%) ten + percent from the basic Salary, payable at the end of each month. + |
+
|
+ (5) موقع العمل
+ + سيكون موقع عمل الموظف في مدينة الرياض، بالمملكة العربية السعودية. + |
+
+ (5) Work Location
+ + The Employee will be employed in the city of Riyadh21, Saudi Arabia. + |
+
|
+ (6) مدة العقد
+ + مدة هذا العقد سنة واحدة ميلادية، ويبدأ اعتبارا من تاريخ، مع مراعاة النصوص الواردة في هذا العقد بخصوص الإنهاء، ويعتبر الموظف تحت + التجربة لمدة ثلاث أشهر من تاريخ مباشرته للعمل بموجب هذا العقد. ويجوز باتفاق + مكتوب بين الطرفين تمديد فترة التجربة بشرط إلا يزيد أجمالي فترة التجربة عن + مائة وثمانين يوماً، ولا تدخل في حساب فترة التجربة إجازة عيدي الفطر والاضحى + والإجازة المرضية. ويحق للطرفين خلالها إنهاء هذا العقد دون الحاجة إلى توجيه + اشعار مسبق ودون أن يترتب للطرف الثاني تعويض أو مكافأة نهاية الخدمة وذلك + وفقاً لنظام العمل ويتوجب على أحد الطرفين إشعار الطرف الآخر كتابيا في حالة + عدم رغبته في تجديد العقد وإلا يعدّ العقد قد تجدد تلقائياً لمدة مماثلة، وفي + حال تجدد العقد ثلاث مرات متتالية او بلغت مده العقد الأصلي مع التجديد أربع + سنوات ايهما اقل تحول العقد الى عقد غير محدد المدة. + |
+
+ (6) Period of Employment
+ + The duration of this contract is a one year, The start date is from + + G, subject to provisions regarding the termination of employment contained + in this contract, The Employee shall, however, be on probation for the first + three (3) Gregorian months of employment. + The probation period might be extended for no longer than 180 days excluding + all official holydays and sick leave provided the extension of the probation + period is written and agreed upon by both parties. + A party shall notify the other in writing indicating the desire to terminate + this contract, if terminated during the probation period the employee is not + entitled to end of service reward nor any kind of rewards in accordance with + Saudi labor law. If there is no termination during the probation period and + the contract continues in effect the contract will be automatically renewed + for the same term unless, either party notify the other if the intention not + to renew the contract. Renewing the contract for three consecutive times or + if the duration of the original contact including the renewal is 4years + which duration is lesser, the contract will be deemed a nonspecific + contract. + |
+
|
+ (7) ساعات العمل
+ + يبلغ عدد ساعات العمل الفعلي في أسبوع العمل الواحد أربعين (40) ساعة موزعة على + خمسة أيام عمل بواقع ثماني (8) ساعات لكل يوم عمل ولا يدخل فيها وقت التنقل من + وإلى موقع العمل. وفي شهر رمضان المبارك تكون ساعات العمل الأسبوعية للموظف + المسلم ثلاثين (30) ساعة بواقع ست (6) ساعات في اليوم. + |
+
+ (7) Work Hours
+ + The number of hours actually worked in a work week shall normally be forty + (40) and the number of hours worked in each work day shall normally be eight + (8), exclusive of traveling time to and from work. If the Employee is a + Muslim, the working hour during the month of Ramadan shall normally be + thirty (30) hours and the work day shall normally be six (6) hours. + |
+
|
+ (8) العمل الإضافي
+ + يمكن أن يُطلب من الموظف العمل لساعات إضافية. ويعوض الموظف عن ساعات العمل + الإضافية وفقا لنظام العمل السعودي وسياسات صاحب العمل الداخلية، ولا يتم تعويض + الموظف عن العمل الإضافي إلا إذا كان ذلك العمل الإضافي قد تم بموافقة كتابية + ومسبقة من رئيس الموظف ووفقاً للوائح صاحب العمل. + |
+
+ (8) Overtime
+ + The Employee may be required to work overtime. The Employee will be + compensated for overtime in accordance with the Saudi Labor Law and the + Employer’s internal policy. The Employee shall not be able to claim overtime + unless such overtime work were authorized beforehand by his supervisor and + shall be in accordance with the Employers guidelines in this regards. + |
+
|
+ (9) العطل الرسمية
+ + يحق للموظف التمتع خلال السنة بالعطل الرسمية المعتمدة وفقاً لنظام العمل + السعودي. وإذا طلب منه أن يعمل خلال أيام العطل الرسمية، فإنه يستحق تعويضا عن + كل ساعة عمل فعلية وفقا لنظام العمل السعودي. + |
+
+ (9) Holidays
+ + The Employee will be entitled to days off for public holidays in accordance + with the Saudi Labor Law. If the Employee is required to work on a holiday, + he shall be entitled to payment for every hour actually worked on such + holiday in accordance with the Saudi Labor Law. + |
+
|
+ (10) الإجازة السنوية
+ + بالإضافة إلى العطل الرسمية العامة والإجازات الأخرى المدفوعة الأجر بموجب نظام + العمل السعودي، يستحق الموظف إجازة مدتها (30) ثلاثون يوماً عن كل سنة من + الخدمة في المملكة العربية السعودية على أن يحدد صاحب العمل موعدها بما يتناسب + مع ظروف العمل. + |
+
+ (10) Annual Vacation
+ + In addition to public holidays and other paid leave requires by the Saudi + Labor law, the Employee will be eligible for a vacation consisting of 30 + days per year of employment in Saudi Arabia. The Employer shall have the + right to specify the starting date of the Employee’s annual vacation as + dictated by work requirements. + |
+
|
+ (11) الإجازة المرضية
+ + يدفع الأجرعن الإجازة المرضية وفقاً لنظام العمل السعودي شرط أن تكون الحاجة + للعلاج الطبي و/أو الاستشفاء مثبتة كتابة من مستشفى معتمد. + |
+
+ (11) Sick Leave
+ + Sick leave will be paid in accordance with the provisions of the Saudi + Arabian Labor Law, provided that the need for medical treatment and/or + hospitalization is confirmed in writing by an approved hospital. + |
+
|
+ (12) التأمينات الاجتماعية
+ + يقتطع صاحب العمل من الراتب الشهري للموظف مبلغ النسبة المطلوبة من الموظف + لاشتراكه في نظام التأمينات الاجتماعية طبقا للوائح والأنظمة المعتمدة لدى + المؤسسة العامة للتأمينات الاجتماعية، بينما يدفع صاحب العمل نسبة الاشتراك + المطلوبة منه وفقا للوائح والأنظمة المعتمدة لدى المؤسسة العامة للتأمينات + الاجتماعية. + |
+
+ (12) Social Insurance
+ + The Employer shall pay directly to the General Organization for Social + Insurance ("GOSI") an amount equal to the contribution which is required to + be made by an employer in accordance with the rules and regulations of GOSI. + The Employer will withhold contributions due by the Employee from the + Employee's salary only to the extent that the Employer is required or + permitted to do so pursuant to the rules and regulations of GOSI. + |
+
|
+ (13) التأمين الطبي
+ + يوفر صاحب العمل للموظف تأمينا طبياً طبقاً للنظام المعمول به في المملكة + العربية السعودية ووفقا للسياسات التي يقررها صاحب العمل بين الحين والآخر. + |
+
+ (13) Medical Insurance
+ + The Employee will be eligible to participate in medical insurance and + benefit plans in accordance with the practice in Saudi Arabia and in + accordance with the policies the Employer has in place from time to time. + |
+
|
+ (14) الأنظمة والتعليمات
+ + يتعهد الموظف بأن يتقيد بما يصدره صاحب العمل من سياسات وتوجيهات وتعليمات + وبكافة الأنظمة والأعراف المعمول بها في المملكة العربية السعودية. ولن يكون + صاحب العمل مسؤولاً عن أية عقوبات أو غرامات أو مطالبات نظامية يتعرض لها + الموظف نتيجةً لمخالفته أياً من هذه الأنظمة. + |
+
+ (14) Laws and Instructions
+ + The Employee undertakes to comply with all policies, directives and + instructions issued by the Employer and with the laws, regulations and + customs of the Kingdom of Saudi Arabia. The Employer shall have no + responsibility for any penalties or liabilities incurred by the Employee due + the Employee's violation of such laws, regulations and customs. + |
+
|
+ (15) صحة المعلومات
+ + يحق لصاحب العمل أن يتأكد من صحة المعلومات وسلامتها الواردة في طلب التوظيف + والشهادات المقدمة من الموظف وفي حالة ثبوت أيّ احتيال أو تزوير أو غش فيها + فانه يحق للصاحب العمل إنهاء هذا العقد دون إشعار أو تعويض أو مكافأة وتحميله + مسئولية وتكاليف أيّ خسائر يتعرض لها صاحب العمل جراء ذلك إضافة إلى أيّ جزاءات + أو ملاحقات / مخالفات نظاميه قد تنتج عن ذلك. + |
+
+ (15) Truth of Information
+ + The Employer shall have the right to verify about the correctness and truth + of information stated in the employment application and certificates + furnished by the Employee. The Employer shall have the right at any time to + terminate the contract without notice or compensation and the Employee will + bear any responsibility, losses or expenses if it has been proved that the + employment was based on cheating, misrepresentation or fraud. + |
+
|
+ (16) العمل لدى الغير والإضرابات
+ + بقبوله العمل بموجب هذا العقد، فإن الموظف يتعهد بأنه لن يمارس أيّ عمل أو + وظيفة أخرى لدى أيّ شخص أو جهة أخرى غير صاحب العمل، ولن يشارك، لأيّ سبب كان، + في أيّ إضراب عن العمل أو أية نزاعات عمالية أو صناعية أو سياسية أو اجتماعية، + أو في أيّ إجراء أو عمل قد يؤدي إلى توقف عمله أو انقطاعه. + |
+
+ (16) Other Employment and Strikes
+ + In accepting employment hereunder, the Employee, undertakes that he will not + engage in any other business or employment and that he will not for any + reason whatsoever engage in any strikes or other labor disputes or take part + in any industrial, political or social dispute or action involving the + cessation or withdrawal of the Employee’s labor. + |
+
|
+ (17) المسائل الأخرى
+ + كل أمر لم يرد بشأنه نص صريح على سبيل التحديد في هذا العقد يطبق عليه سياسات + ولوائح صاحب العمل الداخلية ونظام العمل السعودي ويشمل ذلك جميع التعديلات + واللوائح والقرارات والتعاميم التي أصدرت أو يتم إصدارها في المستقبل. + |
+
+ (17) Other Matters
+ + Any stipulations, which are not specifically mentioned in this contract, + will be subject to the internal policies and procedures of the Employer and + the Saudi Labor Law. This includes all the amendments, rules, decisions and + circulars, being entered in the future. + |
+
|
+ (18) المراسلات والإخطارات
+ + يحق لصاحب العمل أن يسلم جميع الإشعارات والاخطارات إلى + الموظف مباشرة باليد أثناء فترة عمله لديه أو على عنوانه (داخل المملكة) أو إلى + بريده الاليكتروني أو بوضعها على لوحة الإعلانات بمقر عمل صاحب العمل حيث يعمل + الموظف، ويعتبر هذا التسليم بمثابة إقرار باستلام تلك الإشعارات والاخطارات في + التاريخ المذكور في الإشعار وتعتبر هذه الإشعارات كأنما سلمت باليد. + |
+
+ (18) Correspondences and Notifications
+ + The Employer will have the right to hand over all the notifications, or + information to the Employee directly by hand during his work or by sending + it to the Employee’s address in Saudi Arabia, or to advertise it on the + notice board in the Employer’s headquarters where the Employee works. This + delivery shall be deemed to be duly given on the date of notification and as + if it has been handed over by hand. + |
+
|
+ (19) السريـة والملكية الفكرية
+ + مع عدم الاخلال بما ورد في المادة (83)، يوافق الموظف على أن أيّة دراسات أو + معلومات أو بيانات أو أي مستندات يحصل عليها جراء عمله تعتبر ملكاً لصاحب العمل + وكذلك أي براءات اختراع أو أبحاث أو حقوق طبع ونشر تتعلق بنشاط صاحب العمل + يعتبر حقا خالصا له. + |
+
+ (19) Confidentiality and Intellectual Property
+ + Without prejudice to Article (83) the Employee agrees and undertakes that + all the studies, information, statements and any other documents the + employee obtains during his work are considered the sole properties of the + Employee. Also all the research, inventions or copy rights related to the + company’s activities are considered sole properties of the company. + |
+
|
+ (20) إنهاء العقد
+ + بما لا يتعارض مع ورد في المواد (74) (77) او (80) من نظام العمل السعودي عن + حالات الإنهاء وفسخ العقد. + + (1) يحق لأيّ من الطرفين إنهاء هذا العقد إذا كان غير محدد المدة بناء على سبب + مشروع يجب بيانه بموجب إشعار يوجه الى الطرف الاخر كتابه قبل الانهاء بمدة ستون + (60) يوما. إذا قرر صاحب العمل أن الموظف لم يعد يصلح للقيام بعمله أو أنه زائد + عن حاجة العمل. + + (2) يجوز لصاحب العمل أن ينهي خدمة الموظف فوراً وبدون فترة إنذار أو بدل فترة + إنذار، وبدون أي حق للموظف بأية تعويضات، وذلك في أي وقت أثناء فترة التجربة أو + في أي من الحالات و/أو المخالفات التي نص عليها نظام العمل السعودي. + + + (ج) تحسب مكافأة نهاية الخدمة على أساس الراتب الأساسي مضافا إليه بدلا السكن + والنقل فقط، ولا تدخل أي بدلات أو عمولات أو أي منافع أخرى في احتساب المكافأة. + |
+
+ (20) Termination
+ + Without prejudice to Article(74) (77) (80) of Saudi labor law in relation to + termination + + (a) Either party has the right to terminate a nonspecific contract provided + an appropriate reason is given and sixty (60) days’ notice written is + rendered to the other party. If the Employer decided that the Employee is no + longer suitable for the job or the position is being eliminated. + + (b) The Employer has the right to dismiss the Employee forthwith, without + notice or pay in lieu of such notice and without any right on the part of + the Employee to any other benefit, at any time while the Employee is on + probation or in the event the Employee commits any of the acts and + violations articulated into the Saudi Labor Law. + + (c ) End of service benefit shall be calculated on the basis of basic salary + and housing, transportation allowances. Commissions and other benefits such + as allowances in cash or in kind or any kind of incentives are not included + in the end of service benefit calculation. + |
+
|
+ (21) وحده العقد
+ + يشكل هذا العقد الاتفاق الكامل بين الطرفين فيما يخص توظيف الموظف من قبل صاحب + العمل في المملكة العربية السعودية. ويلغي هذا العقد ويحل محل جميع الاتفاقيات + والتفاهمات السابقة والحالية، كتابية كانت أم شفهية. + |
+
+ (21) Entire Contract
+ + This contract constitutes the entire contract between the parties with + respect to the Employee's employment by the Employer in the Kingdom of Saudi + Arabia and supersedes and render null and void all prior or contemporaneous + contract or understandings, whether oral or written. + |
+
|
+ (22) التنازل واستقلالية النصوص
+ + إن عدم قيام أيّ من الطرفين في أيّ وقت بفرض تنفيذ أيّ من فقرات هذا العقد أو + لم يطالب الطرف الآخر بتنفيذ أيّ من فقراته، فإن ذلك لا يجب أن يفسر بأيّ حال + من الأحوال على أنه تنازل عن تلك الفقرة أو على أنه يؤثر على صلاحية هذا العقد + أو على حق أيّ من الطرفين في فرض تنفيذ كل فقرة من فقرات العقد وفقا لشروطه + وأحكامه. وإذا أصبح أيّ شرط من شروط هذا العقد أو جزء منه باطلاً، فإن ذلك لن + يبطل الشروط الأخرى أو الجزء المتبقي من الشرط المعني. ويظل هذا العقد في جميع + هذه الحالات سارياً ومرتب لكل اثاره النظامية. + |
+
+ 22)
+ Waiver and Severability
+ + The failure of either party to enforce at any time any of the provisions of + this contract or to require at any time performance by the other party of + any of the provisions hereof, shall in no way be construed to be a waiver of + the provisions or to affect the validity of this contract or the right of + either party thereafter to enforce each and every provision in accordance + with the terms of this contract. Invalidation of any provision of this + contract, or portion thereof, shall not invalidate any other provision or + the remainder of the relevant provision and the rest of this contract shall + in all such cases remain in full force and effect. + |
+
|
+ (23) النظام المطبق وتسوية المنازعات
+ + يخضع هذا العقد للأنظمة السعودية ويفسر وفقا لها، بما في ذلك ودون حصر نظام + العمل السعودي الصادر بموجب المرسوم الملكي رقم م/51 بتاريخ 23/08/1426هـ. وعلى + الطرفين أن يبذلا كل جهد ممكن لتسوية أيـّـة نزاعات تنشأ بينهما على خلفية هذا + العقد بالطرق الودية. وإذا تعذر ذلك، يحال النزاع إلى الجهة القضائية المختصة + للفصل في النزاع بشكل نهائي + |
+
+ (23) Governing Law and Disputes
+ + This contract shall be governed by and construed in accordance with the laws + and regulations of the Kingdom of Saudi Arabia, including without limitation + the Labor Law issued under Royal Decree No. M/51 dated 23/08/1426H. The + parties will make every effort to settle disputes amicably, but if the + parties are unable to reach an amicable settlement, the dispute will be + referred to and decided by the relevant and appropriate judicial body. + |
+
|
+ (24) اللغة
+ + اللغة المعتمدة في تفسير هذا العقد هي اللغة العربية. + |
+
+ (24) Language
+ + The Arabic text shall supersede the English text in interpreting this + contract. + |
+
|
+ (25) نسخ العقد
+ + حرر هذا العقد من نسختين أصليتين يحتفظ كل طرف بنسخة أصلية واحدة بعد التوقيع + عليها من قبل الطرفين. + |
+
+ (25) Copies of the contract
+ + This contract has been written into two copies in which each party will have + one copy after being signed by both parties. + |
+
| + صاحب العمل: + + | ++ The Employer: + + | +
| + يمثله: + | ++ Authorized Representative: + | +
| + الصفة: الرئيس التنفيذي + | ++ Title: + | +
| + التــــوقيع: + | ++ Signature: + | +
| + الموظف: + | ++ The Employee: + | +
| + التــــوقيع: + | ++ Signature: + | +
| + نأمل منكم تعبئة النموذج الخاص بكم موضحا فيه تواريخ الميلاد باليوم و الشهر و السنة بالميلادي (إذا أمكن) وإعادته لنا بعد التوقيع عليه، ولكم جزيل الشكر. + | + ++ Please complete this form indicate the Date, Month, Year in Gregorian (If possible) and return it back to our department after your signature. | +||
| . | +. | +. | +. | +
|
+ أسم الموظف الثلاثي بالإنجليزي
+ + name + |
+
+ رقم بطاقة الأحوال / الهوية
+ + Saudi ID/ Identity No. + |
+
+ الجنسية
+ + Nationality + |
+
+ تاريخ الميلاد (بالميلادي)
+ + D.O.B (Gregorian) + |
+
|
+ |
+
+ |
+
+ |
+
+ |
+
+ المعالين: +
++ Dependents: +
+| + # + | +
+ الاسم الثلاثي بالإنجليزي
+ + name + |
+
+ الجنس
+ + Sex + |
+
+ صلة القرابة
+ + Relation + |
+
+ تاريخ الميلاد (بالميلادي)
+ + D.O.B (Gregorian) + |
+
+ رقم بطاقة الأحوال / الهوية
+ + Saudi ID/ Identity No + |
+
|---|---|---|---|---|---|
| + + | +
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
| + أقر بأن هذه المعلومات المذكورة في هذه الاستمارة صحيحة. + | ++ I do hereby declare that the information provided is to the best of my knowledge true and accurate. + | +||
| . | +. | +. | +. | +
| + الاسم + | ++ .............................................................................................................................................. | ++ name + | +|
| + التوقيع + | ++ .......................................................................................................................................... | ++ Signature + | +|
| + التاريخ + | ++ .............................................................................................................................................. | ++ Date + | +|
| . | +. | +. | +. | +
| + لاستخدام إدارة الموارد البشرية + | +. | +. | ++ For Human Resources Department + | +
| + تمت مطابقة الأسماء حسب الجواز / الهوية / بطاقة الأحوال + | +
+ الاسم :
+ + التاريخ : + |
+
+ ملاحظات:
+
+ + التوقيع: + |
+ . | +
+ تفيد شركة
+
+
+ بأن الســيــد/ة
+
+
+ -
+
+ الجـنـسـيـة
+ ,
+ بـموجـب الهـويـة رقـم
+
+
+ اعـتـبـارا من
+
+ (
+
+ ) ريــال فقط
+
+ ريال لاغير. و قد أعطي هذا الخطاب بناء على طلبـه دون ادني مسئولية على الشـركة.
+
+
|
+
+ |
+ ||||||||
| + التاريخ + | ++ + | ++ Date + | ++ الرقم الوظيفي + | ++ + | +: Employee No | +|||
| + اسم الموظف + | ++ + | ++ Employee Name + | ++ المسمى الوظيفي + | ++ + | +Position + | +|||
| + الإدارة + | ++ + | ++ Dept + | ++ تاريخ التعيين + | ++ + | +Joining + Date + | +|||
|
+
+ |
+ |||||||
|
+
+ |
+ |||||||
|
+
+ |
+ |||||||
|
+ Pass
+ يبقى
+
+ |
+
+ Extended
+ تمديد فترة التجربة
+ |
+
+ Fail
+ غير مناسب و تنتهي فترة خدمته
+ |
+
+ |||||
|
+
+ |
+ |||||||
| + + | +|||||||
|
+
+ |
+ |||||||
|
+
+ Direct Manager
+
+
+
+ المدير المباشر
+
+ |
+ |||||||
|
+
+ Agreed
+
+
+ الموافقة
+
+ |
+ |||||||
|
+
+ Approval
+
+
+ الإعتماد
+
+ |
+
+ الإجراءات:+1- يكون الموظف المستجد تحت التجربة لفترة تسعين يوماً + ميلادياً . + +2- خلال فترة التجربة يجب تقديم خطة عمل لتحديد أداء + الموظف خلال فترة التجربة، وذلك من قبل إدارته . + +3- في حالة عدم تعبئة النموذج أعلاه يعتبر الموظف قد اجتاز + فترة التجربة بنجاح. + + |
+
+ +
+