fix termination report

This commit is contained in:
Bakry 2025-06-16 17:18:47 +03:00
parent 5eb594b508
commit a06ee93538
3 changed files with 31 additions and 24 deletions

View File

@ -339,7 +339,7 @@ msgstr "قيمة التذكرة"
#. module: hr_termination #. module: hr_termination
#: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__all #: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__all
msgid "All" msgid "All"
msgstr "الكل" msgstr "الكــل"
#. module: hr_termination #. module: hr_termination
#: model:ir.model.fields,help:hr_termination.field_account_move__state #: model:ir.model.fields,help:hr_termination.field_account_move__state
@ -988,7 +988,7 @@ msgstr "اخر يوم عمل"
#. module: hr_termination #. module: hr_termination
#: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__leave #: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__leave
msgid "Leave" msgid "Leave"
msgstr "" msgstr "الإجازات"
#. module: hr_termination #. module: hr_termination
#: model:ir.model.fields,field_description:hr_termination.field_hr_termination__leave_balance #: model:ir.model.fields,field_description:hr_termination.field_hr_termination__leave_balance
@ -1270,7 +1270,7 @@ msgstr ""
#. module: hr_termination #. module: hr_termination
#: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__salary #: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__salary
msgid "Salary" msgid "Salary"
msgstr "مرتب" msgstr "الرواتب"
#. module: hr_termination #. module: hr_termination
#: model:ir.model.fields,field_description:hr_termination.field_hr_termination__salary_amount #: model:ir.model.fields,field_description:hr_termination.field_hr_termination__salary_amount
@ -1589,7 +1589,7 @@ msgstr " %s لا توجد قيمة لقاعدة الراتب"
#. module: hr_termination #. module: hr_termination
#: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__ticket #: model:ir.model.fields.selection,name:hr_termination.selection__employee_termination_report__type__ticket
msgid "Ticket" msgid "Ticket"
msgstr "التذاكر" msgstr "تذاكر السفر"
#. module: hr_termination #. module: hr_termination
#: model_terms:ir.ui.view,arch_db:hr_termination.hr_termination_report #: model_terms:ir.ui.view,arch_db:hr_termination.hr_termination_report

View File

@ -24,9 +24,11 @@
<th style=" border: 1px solid gray;border-bottom:0px;text-align:center;color:#FFFFFF"> <th style=" border: 1px solid gray;border-bottom:0px;text-align:center;color:#FFFFFF">
سنوات الخدمة(سنة/شهر/يوم) سنوات الخدمة(سنة/شهر/يوم)
</th> </th>
<t t-if="type == 'all' or type == 'termination'">
<th style="border: 1px solid gray;border-bottom:0px;text-align:center;color:#FFFFFF"> <th style="border: 1px solid gray;border-bottom:0px;text-align:center;color:#FFFFFF">
سبب إنهاء الخدمة سبب إنهاء الخدمة
</th> </th>
</t>
<t t-if="type == 'all' or type == 'leave'"> <t t-if="type == 'all' or type == 'leave'">
<th style="border: 1px solid gray;border-bottom:0px;text-align:center;color:#FFFFFF"> <th style="border: 1px solid gray;border-bottom:0px;text-align:center;color:#FFFFFF">
رصيد الإجازة رصيد الإجازة
@ -55,10 +57,11 @@
قيمة نهاية الخدمة قيمة نهاية الخدمة
</th> </th>
</t> </t>
<t t-if="type == 'all'">
<th style="border: 1px solid gray;border-bottom:0px;text-align:center;background-color:#263f79;color:#FFFFFF"> <th style="border: 1px solid gray;border-bottom:0px;text-align:center;background-color:#263f79;color:#FFFFFF">
إجمالي المستحق إجمالي المستحق
</th> </th>
</t>
</tr> </tr>
<t t-if="type == 'all'"> <t t-if="type == 'all'">
<tr> <tr>
@ -124,7 +127,7 @@
نهاية الخدمة لأكبر من 5 سنة نهاية الخدمة لأكبر من 5 سنة
</th> </th>
<th style="border: 1px solid gray;border-top:0px;background-color:#263f79;color:#FFFFFF"/> <th style="border: 1px solid gray;border-top:0px;background-color:#263f79;color:#FFFFFF"/>
<th style="border: 1px solid gray;border-top:0px;background-color:#263f79;color:#FFFFFF"/> <!--th style="border: 1px solid gray;border-top:0px;background-color:#263f79;color:#FFFFFF"/-->
</tr> </tr>
</t> </t>
</thead> </thead>
@ -151,9 +154,11 @@
<td style=" border: 1px solid gray;page-break-inside: avoid"> <td style=" border: 1px solid gray;page-break-inside: avoid">
<t t-esc="data[key]['experiences_year']"/> <t t-esc="data[key]['experiences_year']"/>
</td> </td>
<t t-if="type == 'all' or type == 'termination'">
<td style="border: 1px solid gray;page-break-inside: avoid"> <td style="border: 1px solid gray;page-break-inside: avoid">
<t t-esc="data[key]['termination_reson']"/> <t t-esc="data[key]['termination_reson']"/>
</td> </td>
</t>
<t t-if="type == 'all' or type == 'leave'"> <t t-if="type == 'all' or type == 'leave'">
<td style=" border: 1px solid gray;page-break-inside: avoid"> <td style=" border: 1px solid gray;page-break-inside: avoid">
<t t-esc="round(data[key]['remind_leave_day'],2)"/> <t t-esc="round(data[key]['remind_leave_day'],2)"/>
@ -186,10 +191,11 @@
<t t-esc="round(data[key]['termination_price'],2)"/> <t t-esc="round(data[key]['termination_price'],2)"/>
</td> </td>
</t> </t>
<t t-if="type == 'all' ">
<td style=" border: 1px solid gray;page-break-inside: avoid"> <td style=" border: 1px solid gray;page-break-inside: avoid">
<t t-esc="round(data[key]['total'],2)"/> <t t-esc="round(data[key]['total'],2)"/>
</td> </td>
</t>
</tr> </tr>
</tbody> </tbody>
@ -204,8 +210,8 @@
<t t-esc="round(data['total_rule'][rule],2)"/> <t t-esc="round(data['total_rule'][rule],2)"/>
</td> </td>
</t> </t>
<td style="background-color:#263f79;"></td> <td t-if="type == 'all' or type == 'termination'" style="background-color:#263f79;"></td>
<td style="background-color:#263f79;"></td> <td t-if="type == 'all' or type == 'termination'" style="background-color:#263f79;"></td>
<td t-if="type == 'all' or type == 'leave'" style=" border: 1px solid gray;background-color:#263f79;color:#FFFFFF"> <td t-if="type == 'all' or type == 'leave'" style=" border: 1px solid gray;background-color:#263f79;color:#FFFFFF">
<t t-esc="round(data['total_sum']['remaining_leaves'],2)"/> </td> <t t-esc="round(data['total_sum']['remaining_leaves'],2)"/> </td>
@ -221,7 +227,7 @@
<t t-esc="round(data['total_sum']['amount'],2)"/> </td> <t t-esc="round(data['total_sum']['amount'],2)"/> </td>
<td t-if="type == 'all' or type == 'termination'" style=" border: 1px solid gray;background-color:#263f79;color:#FFFFFF"> <td t-if="type == 'all' or type == 'termination'" style=" border: 1px solid gray;background-color:#263f79;color:#FFFFFF">
<t t-esc="round(data['total_sum']['termination_price'],2)"/></td> <t t-esc="round(data['total_sum']['termination_price'],2)"/></td>
<td style=" border: 1px solid gray;background-color:#263f79;color:#FFFFFF"> <t t-esc="round(data['total_sum']['total'],2)"/></td> <td t-if="type == 'all' " style=" border: 1px solid gray;background-color:#263f79;color:#FFFFFF"> <t t-esc="round(data['total_sum']['total'],2)"/></td>
</tr> </tr>
<!-- </t>--> <!-- </t>-->

View File

@ -596,8 +596,8 @@ class ReportTerminationPublic(models.AbstractModel):
if type == 'all' or type == 'termination': if type == 'all' or type == 'termination':
cause_amount, five_cause_amount, amount = self.get_cause_amount(emp.first_hiring_date, cause_type_name, cause_amount, five_cause_amount, amount = self.get_cause_amount(emp.first_hiring_date, cause_type_name,
end_date, emp) end_date, emp)
if type == 'all' or type == 'ticket': if emp.check_nationality ==False and (type == 'all' or type == 'ticket'):
ticket = self.env['hr.ticket.request'].search([('employee_id', '=', emp.id), ('state', '=', 'done')]) ticket = self.env['hr.ticket.request'].search([('employee_id', '=', emp.id), ('state', '=', 'done'),('mission_check','=',False)])
if ticket: if ticket:
if len(ticket) != year: if len(ticket) != year:
if len(ticket) < year: if len(ticket) < year:
@ -606,12 +606,12 @@ class ReportTerminationPublic(models.AbstractModel):
else: else:
ticket_num = 0 ticket_num = 0
else: else:
if year < 2: #if year < 2:
ticket_num = year ticket_num = year
ticket_price = ticket_num * emp.contract_id.ticket_allowance ticket_price = ticket_num * emp.contract_id.ticket_allowance
else: #else:
ticket_num = 2 #ticket_num = 2
ticket_price = ticket_num * emp.contract_id.ticket_allowance #ticket_price = ticket_num * emp.contract_id.ticket_allowance
number_year = ' سنه %s : شهر%s : يوم%s' % (year, month, day) number_year = ' سنه %s : شهر%s : يوم%s' % (year, month, day)
salary = 0.0 salary = 0.0
result = self.get_salary_rules_and_loans(emp, end_date, emp.first_hiring_date, cause_type_name) result = self.get_salary_rules_and_loans(emp, end_date, emp.first_hiring_date, cause_type_name)
@ -759,12 +759,12 @@ class TerminationReportXls(models.AbstractModel):
sheet.write(4, not_salary + 2, ('نهاية الخدمة لأقل من5 سنة'), format2) sheet.write(4, not_salary + 2, ('نهاية الخدمة لأقل من5 سنة'), format2)
sheet.write(4, not_salary + 3, ('قيمة نهاية الخدمة لأكبر من 5 سنة'), format2) sheet.write(4, not_salary + 3, ('قيمة نهاية الخدمة لأكبر من 5 سنة'), format2)
sheet.write(3, not_salary + 5, ('قيمة نهاية الخدمة'), format2) sheet.write(3, not_salary + 5, ('قيمة نهاية الخدمة'), format2)
sheet.write(3, not_salary + 4, ('إجمالي المستحق'), format2) #sheet.write(3, not_salary + 4, ('إجمالي المستحق'), format2)
if type == 'salary': if type == 'salary':
sheet.write(3, len_of_salary + 6, ('إجمالي المستحق'), format2) sheet.write(3, len_of_salary + 6, ('إجمالي المستحق'), format2)
if type != 'salary' and type != 'all' and type != 'termination': #if type != 'salary' and type != 'all' and type != 'termination':
sheet.write(3, not_salary + 4, ('إجمالي المستحق'), format2) #sheet.write(3, not_salary + 4, ('إجمالي المستحق'), format2)
row = 4 row = 4
for key in mykey: for key in mykey:
row += 1 row += 1
@ -798,14 +798,15 @@ class TerminationReportXls(models.AbstractModel):
sheet.write(row, data_row + 2, final_dic[key]['ticket'], format2) sheet.write(row, data_row + 2, final_dic[key]['ticket'], format2)
sheet.write(row, data_row + 3, final_dic[key]['ticket_price'], format2) sheet.write(row, data_row + 3, final_dic[key]['ticket_price'], format2)
if type == 'termination': if type == 'termination':
sheet.write(row, data_row + 1, final_dic[key]['termination_reson'], format2)
sheet.write(row, data_row + 2, final_dic[key]['five_year_price'], format2) sheet.write(row, data_row + 2, final_dic[key]['five_year_price'], format2)
sheet.write(row, data_row + 3, final_dic[key]['amount'], format2) sheet.write(row, data_row + 3, final_dic[key]['amount'], format2)
sheet.write(row, data_row + 4, final_dic[key]['termination_price'], format2) sheet.write(row, data_row + 4, final_dic[key]['termination_price'], format2)
sheet.write(row, data_row + 5, final_dic[key]['total'], format2) #sheet.write(row, data_row + 5, final_dic[key]['total'], format2)
if type == 'salary': if type == 'salary':
sheet.write(row, len_of_salary + 6, final_dic[key]['total'], format2) sheet.write(row, len_of_salary + 6, final_dic[key]['total'], format2)
if type != 'salary' and type != 'all' and type != 'termination': #if type != 'salary' and type != 'all' and type != 'termination':
sheet.write(row, data_row + 4, final_dic[key]['total'], format2) #sheet.write(row, data_row + 4, final_dic[key]['total'], format2)
y = len(final_dic) + 1 + len_of_salary + 1 y = len(final_dic) + 1 + len_of_salary + 1
sheet.merge_range(y, 1, y, 2, _('الاجمالى'), format2) sheet.merge_range(y, 1, y, 2, _('الاجمالى'), format2)
m = 3 m = 3