emp reporttt

This commit is contained in:
blackbelts 2025-05-29 12:48:35 +03:00
parent e8c8e7d038
commit ea83e7b540
2 changed files with 77 additions and 90 deletions

View File

@ -16,22 +16,21 @@
<field name="dpi">90</field> <field name="dpi">90</field>
</record> </record>
<record id="paperformat_euro_lowmarginn" model="report.paperformat"> <record id="paperformat_euro_lowmarginn" model="report.paperformat">
<field name="name">A4 low margin</field> <field name="name">A4 low margin</field>
<field name="default" eval="True"/> <field name="default" eval="True"/>
<field name="format">A4</field> <field name="format">A4</field>
<field name="page_height">0</field> <field name="page_height">0</field>
<field name="page_width">0</field> <field name="page_width">0</field>
<field name="orientation">Portrait</field> <field name="orientation">Portrait</field>
<field name="margin_top">5</field> <field name="margin_top">5</field>
<field name="margin_bottom">5</field> <field name="margin_bottom">5</field>
<field name="margin_left">5</field> <field name="margin_left">5</field>
<field name="margin_right">5</field> <field name="margin_right">5</field>
<field name="header_line" eval="False"/> <field name="header_line" eval="False"/>
<field name="header_spacing">0</field> <field name="header_spacing">0</field>
<field name="dpi">80</field> <field name="dpi">80</field>
</record> </record>
<template id="employee_attendance_report_template"> <template id="employee_attendance_report_template">
@ -359,31 +358,19 @@
</template> </template>
<template id="totals_only_attendance_report_template"> <template id="totals_only_attendance_report_template">
<div class="page" style="font-size:12pt" dir="rtl"> <div class="page" style="font-size:12pt" dir="rtl">
<style>
@page {
size: A4 landscape;
margin: 0.5cm;
}
body, .page {
width: 100%;
}
</style>
<center> <center>
<h2 style="font-weight:bold">تقرير الحضور والانصراف للموظفين</h2> <h2 style="font-weight:bold">تقرير الحضور والانصراف للموظفين</h2>
</center> </center>
<br/> <br/>
<!-- <div class="row">-->
<!-- <div class="col-md-6">-->
<!-- <h4 style="font-weight:bold">من تاريخ</h4>-->
<!-- <t t-esc="date_start"/>-->
<!-- </div>-->
<!-- <div class="col-md-6">-->
<!-- <h4 style="font-weight:bold">إلى</h4>-->
<!-- <t t-esc="date_end"/>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="d-flex justify-content-center" style="gap: 50px; text-align: center;">-->
<!-- <div>-->
<!-- <h4 style="font-weight: bold;">من تاريخ</h4>-->
<!-- <t t-esc="date_start"/>-->
<!-- </div>-->
<!-- <div>-->
<!-- <h4 style="font-weight: bold;">إلى</h4>-->
<!-- <t t-esc="date_end"/>-->
<!-- </div>-->
<!-- </div>-->
<div style="text-align: center; font-weight: bold; font-size: 16px;"> <div style="text-align: center; font-weight: bold; font-size: 16px;">
من تاريخ : <span style="font-weight: normal;"><t t-esc="date_start"/></span> من تاريخ : <span style="font-weight: normal;"><t t-esc="date_start"/></span>
@ -393,22 +380,22 @@
<table class="table table-condensed" style="width:100%"> <table class="table table-condensed" style="width:100%">
<thead style="width:100%;"> <thead style="width:100%;">
<tr style="width:100%;text-align:center; background-color: #b9d7d4 "> <tr style="width:100%;text-align:center; background-color: #b9d7d4 ">
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الرقم الوظيفي</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الرقم الوظيفي</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">اسم الموظف</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">اسم الموظف</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">الدوام</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">الدوام</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">رقم الهوية</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">رقم الهوية</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">اﻹدارة</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">اﻹدارة</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">المسمي الوظيفي</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:10%;text-align:center;">المسمي الوظيفي</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">ايام الحضور</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">ايام الحضور</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الاجازات</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الاجازات</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الاجازات الرسمية</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الاجازات الرسمية</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الغياب</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الغياب</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">ساعات العمل الفعلية</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">ساعات العمل الفعلية</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">ساعات العمل الاضافية</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">ساعات العمل الاضافية</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الاستئذان</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الاستئذان</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">مهام عمل/انتداب/تدريب</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">مهام عمل/انتداب/تدريب</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">التأخيرات</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">التأخيرات</th>
<th tyle="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الخروج المبكر</th> <th style="border: 1px solid gray; padding: 1px; font-size:0.8em;background-color: #b9d7d4;color: black;width:6%;text-align:center;">الخروج المبكر</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -472,10 +459,10 @@
font-family: ae_AlMohanad; font-family: ae_AlMohanad;
} }
</style> </style>
<!-- <t t-if="totals_only">--> <t t-if="totals_only">
<!-- <t t-call="attendances.totals_only_attendance_report_template"/>--> <t t-call="attendances.totals_only_attendance_report_template"/>
<!-- </t>--> </t>
<!-- <t t-else="">--> <t t-else="">
<t t-if="type == 'late'"> <t t-if="type == 'late'">
<t t-call="attendances.late_attendance_report_template"/> <t t-call="attendances.late_attendance_report_template"/>
</t> </t>
@ -485,42 +472,42 @@
<t t-if="type == 'employee'"> <t t-if="type == 'employee'">
<t t-call="attendances.employee_attendance_report_template"/> <t t-call="attendances.employee_attendance_report_template"/>
</t> </t>
<!-- </t>-->
</t>
</t>
</template>
<template id="general_attendances_report_temp_land">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<style type="text/css">
@font-face {
font-family: 'ae_AlMohanad';
src: local('ae_AlMohanad'), local('ae_AlMohanad'),
url('/attendances/static/fonts/ae_AlMohanad.ttf') format('truetype');
}
*{
font-family: ae_AlMohanad;
}
</style>
<t t-if="totals_only">
<t t-call="attendances.totals_only_attendance_report_template"/>
</t> </t>
</t> </t>
</t> </t>
</template> </template>
<record id="action_totals_only_attendance_reportt" model="ir.actions.report"> <!-- <template id="general_attendances_report_temp_land">-->
<field name="model">employee.attendance.report</field> <!-- <t t-call="web.html_container">-->
<field name="name">Attendance Report</field> <!-- <t t-call="web.external_layout">-->
<field name="report_type">qweb-pdf</field> <!-- <style type="text/css">-->
<field name="report_name">attendances.general_attendances_report_temp_land</field> <!-- @font-face {-->
<field name="paperformat_id" ref="attendances.paperformat_attendance_landscapee"/> <!-- font-family: 'ae_AlMohanad';-->
<!-- src: local('ae_AlMohanad'), local('ae_AlMohanad'),-->
<!-- url('/attendances/static/fonts/ae_AlMohanad.ttf') format('truetype');-->
<!-- }-->
<!-- *{-->
<!-- font-family: ae_AlMohanad;-->
<!-- }-->
<!-- </style>-->
<!-- &lt;!&ndash; <t t-if="totals_only">&ndash;&gt;-->
<!-- <t t-call="attendances.totals_only_attendance_report_template"/>-->
<!-- &lt;!&ndash; </t>&ndash;&gt;-->
</record> <!-- </t>-->
<!-- </t>-->
<!-- </template>-->
<!-- <record id="action_totals_only_attendance_reportt" model="ir.actions.report">-->
<!-- <field name="model">employee.attendance.report</field>-->
<!-- <field name="name">Attendance Report</field>-->
<!-- <field name="report_type">qweb-pdf</field>-->
<!-- <field name="report_name">attendances.general_attendances_report_temp_land</field>-->
<!-- <field name="paperformat_id" ref="attendances.paperformat_attendance_landscapee"/>-->
<!-- </record>-->
<record id="action_general_attendance_reportt" model="ir.actions.report"> <record id="action_general_attendance_reportt" model="ir.actions.report">
@ -528,7 +515,7 @@
<field name="name">Attendance Report</field> <field name="name">Attendance Report</field>
<field name="report_type">qweb-pdf</field> <field name="report_type">qweb-pdf</field>
<field name="report_name">attendances.general_attendances_report_temp</field> <field name="report_name">attendances.general_attendances_report_temp</field>
<!-- <field name="paperformat_id" ref="attendances.paperformat_euro_lowmarginn"/>--> <!-- <field name="paperformat_id" ref="attendances.paperformat_euro_lowmarginn"/>-->
</record> </record>

View File

@ -62,10 +62,10 @@ class AttendancesReport(models.TransientModel):
def print_report(self): def print_report(self):
if not self.employee_ids: if not self.employee_ids:
raise ValidationError(_("Please select Employees Name")) raise ValidationError(_("Please select Employees Name"))
if self.print_totals_only == True: # if self.print_totals_only == True:
return self.env.ref("attendances.action_totals_only_attendance_reportt").report_action(self, data=self._payload()) # return self.env.ref("attendances.action_totals_only_attendance_reportt").report_action(self, data=self._payload())
else: # else:
return self.env.ref("attendances.action_general_attendance_reportt").report_action(self, data=self._payload()) return self.env.ref("attendances.action_general_attendance_reportt").report_action(self, data=self._payload())