From 64774e612b37e2372916e55e01ca2e867360651e Mon Sep 17 00:00:00 2001 From: Mazen Abdo Date: Thu, 6 Nov 2025 08:49:17 +0200 Subject: [PATCH] Adding modifications to the xlsx report --- .../report/payroll_bank_albilad_report.py | 59 ++++++++----------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/odex25_hr/exp_payroll_albilad/report/payroll_bank_albilad_report.py b/odex25_hr/exp_payroll_albilad/report/payroll_bank_albilad_report.py index 0958928d1..d0acc7ae3 100644 --- a/odex25_hr/exp_payroll_albilad/report/payroll_bank_albilad_report.py +++ b/odex25_hr/exp_payroll_albilad/report/payroll_bank_albilad_report.py @@ -37,8 +37,7 @@ class PayrollBankAlbiladReportXlsx(models.AbstractModel): }) format2 = workbook.add_format({ 'font_size': 11, 'bottom': True, 'right': True, 'left': True, 'top': True, - 'align': 'center', 'bold': True, 'valign': 'vcenter', - 'bg_color': 'blue', 'font_color': 'white' + 'align': 'center', 'bold': True, 'valign': 'vcenter' }) format3 = workbook.add_format({ 'font_size': 14, 'bottom': True, 'right': True, 'left': True, 'top': True, @@ -55,19 +54,7 @@ class PayrollBankAlbiladReportXlsx(models.AbstractModel): sheet.set_column('B:B', 5) sheet.set_column('C:L', 20) - # Add payroll header with date range and blue background - if report_type == 'salary': - sheet.merge_range('E3:H3', 'مسير البنك للرواتب' + ' ' + str(date_from) + ' - ' + str(date_to), format2) - elif report_type == 'allowance': - sheet.merge_range('E3:H3', 'مسير البنك للحوافز' + ' ' + str(date_from) + ' - ' + str(date_to), format2) - elif report_type == 'overtime': - sheet.merge_range('E3:H3', 'مسير البنك للعمل الإضافي' + ' ' + str(date_from) + ' - ' + str(date_to), format2) - elif report_type == 'training': - sheet.merge_range('E3:H3', 'مسير البنك للتدريب' + ' ' + str(date_from) + ' - ' + str(date_to), format2) - elif report_type == 'mission': - sheet.merge_range('E3:H3', 'مسير البنك لمهام العمل' + ' ' + str(date_from) + ' - ' + str(date_to), format2) - - row = 4 + row = 2 if no_details: # With details section @@ -163,30 +150,30 @@ class PayrollBankAlbiladReportXlsx(models.AbstractModel): row = self._write_training_data(sheet, row, date_from, date_to, entry_type, employees, salary, salary_ids, bank, branch, company_id, format1) else: # No details section - row = 4 + row = 3 # English headers row - sheet.write(3, 2, 'Total Amount', format2) - sheet.write(3, 3, 'Beneficiary Account IBAN', format2) - sheet.write(3, 4, 'Beneficiary Name', format2) - sheet.write(3, 5, 'Beneficiary Bank CODE', format2) - sheet.write(3, 6, 'Payment Description', format2) - sheet.write(3, 7, 'Basic Salary', format2) - sheet.write(3, 8, 'Housing Allowance', format2) - sheet.write(3, 9, 'Other Earnings', format2) - sheet.write(3, 10, 'Deductions', format2) - sheet.write(3, 11, 'Beneficiary National/IqamaID', format2) + sheet.write(2, 2, 'Total Amount', format2) + sheet.write(2, 3, 'Beneficiary Account IBAN', format2) + sheet.write(2, 4, 'Beneficiary Name', format2) + sheet.write(2, 5, 'Beneficiary Bank CODE', format2) + sheet.write(2, 6, 'Payment Description', format2) + sheet.write(2, 7, 'Basic Salary', format2) + sheet.write(2, 8, 'Housing Allowance', format2) + sheet.write(2, 9, 'Other Earnings', format2) + sheet.write(2, 10, 'Deductions', format2) + sheet.write(2, 11, 'Beneficiary National/IqamaID', format2) # Arabic headers row - sheet.write(4, 2, 'المبلغ الاجمالي', format2) - sheet.write(4, 3, 'رقم الايبان', format2) - sheet.write(4, 4, 'اسم المستفيد', format2) - sheet.write(4, 5, 'بنك المستفيد', format2) - sheet.write(4, 6, 'تفاصيل التحويل', format2) - sheet.write(4, 7, 'الراتب الاساسي', format2) - sheet.write(4, 8, 'بدل السكن', format2) - sheet.write(4, 9, 'البدلات الاخرى', format2) - sheet.write(4, 10, 'الخصم', format2) - sheet.write(4, 11, 'رقم الهوية', format2) + sheet.write(3, 2, 'المبلغ الاجمالي', format2) + sheet.write(3, 3, 'رقم الايبان', format2) + sheet.write(3, 4, 'اسم المستفيد', format2) + sheet.write(3, 5, 'بنك المستفيد', format2) + sheet.write(3, 6, 'تفاصيل التحويل', format2) + sheet.write(3, 7, 'الراتب الاساسي', format2) + sheet.write(3, 8, 'بدل السكن', format2) + sheet.write(3, 9, 'البدلات الاخرى', format2) + sheet.write(3, 10, 'الخصم', format2) + sheet.write(3, 11, 'رقم الهوية', format2) if report_type == 'salary': for bank in banks: