update
This commit is contained in:
@@ -27,25 +27,37 @@
|
||||
</div>
|
||||
|
||||
<!-- Employee Info -->
|
||||
<table style="width:100%; margin-bottom:16px;">
|
||||
<table style="width:100%; margin-bottom:16px; border-collapse:collapse;">
|
||||
<tr>
|
||||
<td style="width:50%;">
|
||||
<td style="width:50%; padding:8px 12px; border:1px solid #e0e0e0;">
|
||||
<strong>Employee:</strong> <t t-esc="doc.employee_id.name"/>
|
||||
</td>
|
||||
<td style="width:50%; text-align:right;">
|
||||
<td style="width:50%; padding:8px 12px; border:1px solid #e0e0e0; text-align:right;">
|
||||
<strong>Company:</strong> <t t-esc="doc.company_id.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td style="padding:8px 12px; border:1px solid #e0e0e0;">
|
||||
<strong>Department:</strong> <t t-esc="doc.employee_id.department_id.name or 'N/A'"/>
|
||||
</td>
|
||||
<td style="text-align:right;">
|
||||
<td style="padding:8px 12px; border:1px solid #e0e0e0; text-align:right;">
|
||||
<strong>Schedule:</strong> <t t-esc="dict(doc._fields['schedule_type'].selection).get(doc.schedule_type, '')"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- Pay Period -->
|
||||
<table style="width:100%; margin-bottom:16px; border-collapse:collapse;">
|
||||
<tr>
|
||||
<td style="padding:8px 12px; border:1px solid #e0e0e0; background:#f8f9fa;">
|
||||
<strong>Pay Period:</strong>
|
||||
<t t-esc="doc.date_start" t-options="{'widget': 'date', 'format': 'MMM d, yyyy'}"/>
|
||||
—
|
||||
<t t-esc="doc.date_end" t-options="{'widget': 'date', 'format': 'MMM d, yyyy'}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- Summary Box -->
|
||||
<table style="width:100%; border-collapse:collapse; margin-bottom:24px; background:#f8f9fa; border-radius:8px;">
|
||||
<tr>
|
||||
@@ -80,6 +92,13 @@
|
||||
</div>
|
||||
<div style="font-size:11px; color:#6b7280;">Penalties</div>
|
||||
</td>
|
||||
<td style="padding:12px; text-align:center; border:1px solid #e0e0e0;">
|
||||
<div style="font-size:20px; font-weight:bold;"
|
||||
t-attf-style="color: {{ '#3b82f6' if doc.leave_days > 0 else '#1a1d23' }};">
|
||||
<t t-esc="doc.leave_days"/>
|
||||
</div>
|
||||
<div style="font-size:11px; color:#6b7280;">Leave Days</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -129,6 +148,40 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Leave Days -->
|
||||
<t t-if="doc.leave_request_ids">
|
||||
<h4 style="color:#1a1d23; margin:24px 0 8px;">Leave Days</h4>
|
||||
<table style="width:100%; border-collapse:collapse; font-size:11px;">
|
||||
<thead>
|
||||
<tr style="background:#3b82f6; color:white;">
|
||||
<th style="padding:8px; text-align:left;">Date</th>
|
||||
<th style="padding:8px; text-align:left;">Reason</th>
|
||||
<th style="padding:8px; text-align:center;">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="doc.leave_request_ids.sorted(key=lambda l: l.leave_date)" t-as="lv">
|
||||
<tr t-attf-style="background: {{ '#f0f7ff' if lv_index % 2 == 0 else '#ffffff' }};">
|
||||
<td style="padding:6px 8px; border-bottom:1px solid #e0e0e0;">
|
||||
<t t-esc="lv.leave_date" t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
<td style="padding:6px 8px; border-bottom:1px solid #e0e0e0;">
|
||||
<t t-esc="lv.reason"/>
|
||||
</td>
|
||||
<td style="padding:6px 8px; border-bottom:1px solid #e0e0e0; text-align:center;">
|
||||
<t t-if="lv.state == 'reviewed'">
|
||||
<span style="color:#10B981; font-weight:bold;">Reviewed</span>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<span style="color:#3b82f6;">Auto-Approved</span>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</t>
|
||||
|
||||
<!-- Footer -->
|
||||
<div style="margin-top:24px; padding-top:12px; border-top:1px solid #e0e0e0; text-align:center;">
|
||||
<p style="color:#9ca3af; font-size:10px;">
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<th style="padding:8px; text-align:center;">Breaks (min)</th>
|
||||
<th style="padding:8px; text-align:center;">Late In</th>
|
||||
<th style="padding:8px; text-align:center;">Early Out</th>
|
||||
<th style="padding:8px; text-align:center;">Leave</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -45,6 +46,7 @@
|
||||
<t t-set="emp_dates" t-value="set(a.check_in.date() for a in emp_atts if a.check_in)"/>
|
||||
<t t-set="late_count" t-value="len(doc.env['fusion.clock.penalty'].search([('employee_id', '=', emp.id), ('date', '>=', doc.date_start), ('date', '<=', doc.date_end), ('penalty_type', '=', 'late_in')]))"/>
|
||||
<t t-set="early_count" t-value="len(doc.env['fusion.clock.penalty'].search([('employee_id', '=', emp.id), ('date', '>=', doc.date_start), ('date', '<=', doc.date_end), ('penalty_type', '=', 'early_out')]))"/>
|
||||
<t t-set="emp_leaves" t-value="doc.leave_request_ids.filtered(lambda l: l.employee_id == emp)"/>
|
||||
<tr t-attf-style="background: {{ '#f8f9fa' if emp_index % 2 == 0 else '#ffffff' }};">
|
||||
<td style="padding:6px 8px; border-bottom:1px solid #e0e0e0; font-weight:bold;">
|
||||
<t t-esc="emp.name"/>
|
||||
@@ -69,6 +71,10 @@
|
||||
t-attf-style="color: {{ '#ef4444' if early_count else '#1a1d23' }};">
|
||||
<t t-esc="early_count"/>
|
||||
</td>
|
||||
<td style="padding:6px 8px; border-bottom:1px solid #e0e0e0; text-align:center;"
|
||||
t-attf-style="color: {{ '#3b82f6' if emp_leaves else '#1a1d23' }};">
|
||||
<t t-esc="len(emp_leaves)"/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user