<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2026 Nexa Systems Inc.
    License OPL-1 (Odoo Proprietary License v1.0)

    Email templates for Fusion Clock.
    Design: Matches the Fusion email design system (thin accent bar, system fonts,
    dark/light mode safe, no user signatures).
-->
<odoo noupdate="1">

    <!-- =============================================================== -->
    <!-- Employee Individual Report Email -->
    <!-- =============================================================== -->
    <record id="mail_template_clock_employee_report" model="mail.template">
        <field name="name">Fusion Clock: Employee Report</field>
        <field name="model_id" ref="fusion_clock.model_fusion_clock_report"/>
        <field name="subject">Your Attendance Report - {{ object.date_start }} to {{ object.date_end }}</field>
        <field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
        <field name="email_to">{{ object.employee_id.work_email or '' }}</field>
        <field name="body_html"><![CDATA[
<div style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;max-width:600px;margin:0 auto;">
    <div style="height:4px;background-color:#10B981;"></div>
    <div style="padding:32px 28px;">
        <p style="color:#10B981;font-size:13px;font-weight:600;letter-spacing:0.5px;text-transform:uppercase;margin:0 0 24px 0;">
            <t t-out="object.company_id.name"/>
        </p>
        <h2 style="font-size:22px;font-weight:700;margin:0 0 6px 0;line-height:1.3;">Attendance Report</h2>
        <p style="opacity:0.65;font-size:15px;line-height:1.5;margin:0 0 24px 0;">
            Hello <strong><t t-out="object.employee_id.name"/></strong>,
            your attendance report for
            <strong><t t-out="object.date_start" t-options="{'widget': 'date'}"/></strong> to
            <strong><t t-out="object.date_end" t-options="{'widget': 'date'}"/></strong> is ready.
        </p>

        <table style="width:100%;border-collapse:collapse;margin:0 0 24px 0;">
            <tr><td colspan="2" style="padding:10px 14px;font-size:12px;font-weight:600;opacity:0.55;text-transform:uppercase;letter-spacing:0.5px;border-bottom:2px solid rgba(128,128,128,0.25);">Report Summary</td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);width:35%;">Days Worked</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="object.days_worked"/></td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">Total Hours</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="'%.1f' % object.total_hours"/>h</td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">Net Hours</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="'%.1f' % object.net_hours"/>h</td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">Total Breaks</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="'%.0f' % object.total_breaks"/> min</td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">Penalties</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="object.total_penalties"/></td></tr>
        </table>

        <div style="padding:10px 14px;border:1px dashed rgba(128,128,128,0.35);border-radius:6px;margin:0 0 24px 0;">
            <p style="margin:0;font-size:13px;opacity:0.65;"><strong style="opacity:1;">Attached:</strong> Attendance Report (PDF)</p>
        </div>

        <div style="border-left:3px solid #10B981;padding:12px 16px;margin:0 0 24px 0;">
            <p style="margin:0;font-size:14px;line-height:1.5;">You can also download this report from your portal at any time.</p>
        </div>
    </div>
    <div style="padding:16px 28px;text-align:center;">
        <p style="opacity:0.5;font-size:11px;line-height:1.5;margin:0;">
            <t t-out="object.company_id.name"/><br/>
            This is an automated notification from Fusion Clock.
        </p>
    </div>
</div>
        ]]></field>
        <field name="report_template_ids" eval="[(4, ref('fusion_clock.action_report_clock_employee'))]"/>
        <field name="auto_delete" eval="False"/>
    </record>

    <!-- =============================================================== -->
    <!-- Batch Report Email (to managers) -->
    <!-- =============================================================== -->
    <record id="mail_template_clock_batch_report" model="mail.template">
        <field name="name">Fusion Clock: Batch Report</field>
        <field name="model_id" ref="fusion_clock.model_fusion_clock_report"/>
        <field name="subject">Employee Attendance Batch Report - {{ object.date_start }} to {{ object.date_end }}</field>
        <field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
        <field name="email_to">{{ (object.company_id.sudo().env['ir.config_parameter'].get_param('fusion_clock.report_recipient_emails') or '') }}</field>
        <field name="body_html"><![CDATA[
<div style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;max-width:600px;margin:0 auto;">
    <div style="height:4px;background-color:#10B981;"></div>
    <div style="padding:32px 28px;">
        <p style="color:#10B981;font-size:13px;font-weight:600;letter-spacing:0.5px;text-transform:uppercase;margin:0 0 24px 0;">
            <t t-out="object.company_id.name"/>
        </p>
        <h2 style="font-size:22px;font-weight:700;margin:0 0 6px 0;line-height:1.3;">Batch Attendance Report</h2>
        <p style="opacity:0.65;font-size:15px;line-height:1.5;margin:0 0 24px 0;">
            The attendance batch report for
            <strong><t t-out="object.date_start" t-options="{'widget': 'date'}"/></strong> to
            <strong><t t-out="object.date_end" t-options="{'widget': 'date'}"/></strong> is attached.
        </p>

        <div style="padding:10px 14px;border:1px dashed rgba(128,128,128,0.35);border-radius:6px;margin:0 0 24px 0;">
            <p style="margin:0;font-size:13px;opacity:0.65;"><strong style="opacity:1;">Attached:</strong> Batch Attendance Report (PDF)</p>
        </div>

        <div style="border-left:3px solid #10B981;padding:12px 16px;margin:0 0 24px 0;">
            <p style="margin:0;font-size:14px;line-height:1.5;">This report includes all employees' attendance summaries with daily breakdowns, total hours, and penalty information.</p>
        </div>
    </div>
    <div style="padding:16px 28px;text-align:center;">
        <p style="opacity:0.5;font-size:11px;line-height:1.5;margin:0;">
            <t t-out="object.company_id.name"/><br/>
            This is an automated notification from Fusion Clock.
        </p>
    </div>
</div>
        ]]></field>
        <field name="report_template_ids" eval="[(4, ref('fusion_clock.action_report_clock_batch'))]"/>
        <field name="auto_delete" eval="False"/>
    </record>

    <!-- =============================================================== -->
    <!-- Weekly Summary Email -->
    <!-- =============================================================== -->
    <record id="mail_template_weekly_summary" model="mail.template">
        <field name="name">Fusion Clock: Weekly Summary</field>
        <field name="model_id" ref="hr.model_hr_employee"/>
        <field name="subject">Your Weekly Attendance Summary</field>
        <field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
        <field name="email_to">{{ object.work_email or '' }}</field>
        <field name="body_html"><![CDATA[
<div style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;max-width:600px;margin:0 auto;">
    <div style="height:4px;background-color:#10B981;"></div>
    <div style="padding:32px 28px;">
        <p style="color:#10B981;font-size:13px;font-weight:600;letter-spacing:0.5px;text-transform:uppercase;margin:0 0 24px 0;">
            <t t-out="object.company_id.name"/>
        </p>
        <h2 style="font-size:22px;font-weight:700;margin:0 0 6px 0;line-height:1.3;">Weekly Summary</h2>
        <p style="opacity:0.65;font-size:15px;line-height:1.5;margin:0 0 24px 0;">
            Hello <strong><t t-out="object.name"/></strong>,
            here is your attendance summary for the past week.
        </p>

        <table style="width:100%;border-collapse:collapse;margin:0 0 24px 0;">
            <tr><td colspan="2" style="padding:10px 14px;font-size:12px;font-weight:600;opacity:0.55;text-transform:uppercase;letter-spacing:0.5px;border-bottom:2px solid rgba(128,128,128,0.25);">Summary</td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);width:35%;">Total Hours</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="ctx.get('total_hours', 0)"/>h</td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">Overtime</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="ctx.get('overtime_hours', 0)"/>h</td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">Penalties</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="ctx.get('penalty_count', 0)"/></td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">Absences</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="ctx.get('absence_count', 0)"/></td></tr>
            <tr><td style="padding:10px 14px;opacity:0.6;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);">On-Time Streak</td><td style="padding:10px 14px;font-size:14px;border-bottom:1px solid rgba(128,128,128,0.15);"><t t-out="ctx.get('streak', 0)"/> days</td></tr>
        </table>

        <div style="border-left:3px solid #10B981;padding:12px 16px;margin:0 0 24px 0;">
            <p style="margin:0;font-size:14px;line-height:1.5;">Log in to <a href="/my/clock" style="color:#10B981;">your portal</a> to view full details.</p>
        </div>
    </div>
    <div style="padding:16px 28px;text-align:center;">
        <p style="opacity:0.5;font-size:11px;line-height:1.5;margin:0;">
            <t t-out="object.company_id.name"/><br/>
            This is an automated notification from Fusion Clock.
        </p>
    </div>
</div>
        ]]></field>
        <field name="auto_delete" eval="False"/>
    </record>

    <!-- =============================================================== -->
    <!-- Correction Request Notification -->
    <!-- =============================================================== -->
    <record id="mail_template_correction_request" model="mail.template">
        <field name="name">Fusion Clock: Correction Request</field>
        <field name="model_id" ref="fusion_clock.model_fusion_clock_correction"/>
        <field name="subject">Timesheet Correction Request: {{ object.employee_id.name }}</field>
        <field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
        <field name="body_html"><![CDATA[
<div style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;max-width:600px;margin:0 auto;">
    <div style="height:4px;background-color:#d69e2e;"></div>
    <div style="padding:32px 28px;">
        <p style="color:#d69e2e;font-size:13px;font-weight:600;letter-spacing:0.5px;text-transform:uppercase;margin:0 0 24px 0;">
            <t t-out="object.company_id.name"/>
        </p>
        <h2 style="font-size:22px;font-weight:700;margin:0 0 6px 0;line-height:1.3;">Correction Request</h2>
        <p style="opacity:0.65;font-size:15px;line-height:1.5;margin:0 0 24px 0;">
            <strong><t t-out="object.employee_id.name"/></strong> has submitted a timesheet correction request.
        </p>

        <div style="border-left:3px solid #d69e2e;padding:12px 16px;margin:0 0 24px 0;">
            <p style="margin:0;font-size:14px;line-height:1.5;"><strong>Reason:</strong> <t t-out="object.reason"/></p>
        </div>

        <div style="border-left:3px solid #10B981;padding:12px 16px;margin:0 0 24px 0;">
            <p style="margin:0;font-size:14px;line-height:1.5;">Please review and approve or reject from the Fusion Clock backend.</p>
        </div>
    </div>
    <div style="padding:16px 28px;text-align:center;">
        <p style="opacity:0.5;font-size:11px;line-height:1.5;margin:0;">
            <t t-out="object.company_id.name"/><br/>
            This is an automated notification from Fusion Clock.
        </p>
    </div>
</div>
        ]]></field>
        <field name="auto_delete" eval="False"/>
    </record>

</odoo>
