<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="report_student_bonafide">
        <t t-call="web.html_container">
            <t t-foreach="docs" t-as="o">
                <t t-call="web.external_layout">
                    <div class="page" style="font-family: 'Odoo Unicode Support Noto'">
                        <div class="mt-6 text-center">
                            <h4 style="position:relative;font-size:25px;padding-bottom:5px; width: 34%; display:inline-block; border-bottom:2px solid black;">
                                 <strong>BONAFIDE CERTIFICATE</strong>
                             </h4>
                         </div>
                        <br/>
                        <div style="width: 100%; margin-bottom: 5px; font-size: 20px;">
                            <span style="float: left;">
                                <b>Certificate No. : </b>
                                <span t-out="o.certificate_number or '____________'"/>
                            </span>
                            <span style="float: right;">
                                <b>Date : </b>
                                <span t-esc="time.strftime('%Y-%m-%d')" t-options="{'widget':'date'}"/>
                            </span>
                            <div style="clear: both;"></div>
                        </div>
                        <br/>
                        <div style="font-size: 20px;">
                            <p>
                                This is to certify that
                                <strong><span t-out="o.title.shortcut or ''"/></strong>
                                <strong><span t-out="o.name or ''"/></strong>
                                <t t-if="o.course_detail_ids[0].state == 'running'"> is </t>
                                <t t-if="o.course_detail_ids[0].state == 'finished'"> was </t>
                                a bonafide student of
                                <strong><span t-out="o.course_detail_ids[0].course_id.name if o.course_detail_ids else  ''"/></strong>,
                                <span t-out="o.course_detail_ids[0].course_id.department_id.name if o.course_detail_ids else''"/>
                                at <strong><span t-out="o.company_id.name or ''"/></strong>
                                from <b><span t-esc="o.course_detail_ids[0].create_date if o.course_detail_ids else ''" t-options="{'widget':'date'}"/></b> to
                                <b><span t-esc="time.strftime('%Y-%m-%d')"  t-options="{'widget':'date'}"/></b>.
                            </p>
                            <p>
                                The student is currently studying
                                <t t-if="o.course_detail_ids[0].academic_years_id.name or o.course_detail_ids[0].academic_term_id.name">
                                    in the
                                    <strong><span t-out="o.course_detail_ids[0].academic_years_id.name if o.course_detail_ids else''"/></strong>
                                    <span> &amp;nbsp; </span>
                                    <strong><span t-out="o.course_detail_ids[0].academic_term_id.name if o.course_detail_ids else''"/></strong>
                                </t>
                                of the <strong><span t-out="o.course_detail_ids[0].course_id.name if o.course_detail_ids else''"/></strong> program
                                under <strong><span t-out="o.company_id.name or ''"/></strong>
                                bearing the Enrollment Student ID :
                                <strong><span t-out="o.course_detail_ids[0].roll_number if o.course_detail_ids else''"/></strong>.
                            </p>
                            <p>
                                This certificate is issued upon the request of the student for the purpose of
                                <strong><span t-out="data.get('purpose_display', '') if data else ''"/></strong>.
                            </p>
                            <div style="width: 100%; margin-top: 30px; display: flex; justify-content: space-between;">
                               <div>
                                   <b>Principal / Head of Institution</b><br/>
                                   (Signature with seal)<br/>
                                   Name : <span t-out=" '_____________'"/><br/>
                                   Designation : <span t-out="'_____________'"/>
                               </div>
                           </div>
                        </div>
                    </div>
                </t>
            </t>
        </t>
    </template>
</odoo>
