<odoo>
  <record id="mme_history_card_report" model="ir.actions.report">
        <field name="name">MME Calibration Report</field>
        <field name="model">sos_mme_history_card_line</field>
        <field name="report_type">qweb-pdf</field>
        <field name="report_name">sos_inventory.report_mme_history_card_line</field>
        <field name="report_file">sos_inventory.report_mme_history_card_line</field>
        <field name="binding_model_id" eval="False"/>
        <field name="binding_type">report</field>
    </record>

  <template id="report_mme_history_card_line">
    <t t-call="web.basic_layout">
    <link rel="stylesheet" href="/sos_inventory/static/src/css/style.css" />
        <div class="page">
            <h2>MONITORING AND MEASURING EQUIPMENT CALIBRATION PLANNER</h2>
                        <br></br>

            <h5>FREQUENCY: W – Weekly, F- Fifteen days, M- Monthly, Q - Quarterly, H – Half Yearly and Y – Yearly</h5>
            <br></br>
            <div style="    border: solid 1px #ccc;
    width: 14%;
    float: right;
    padding: 5px;
    text-align: center;">Planned<hr></hr>Carried</div>
          <br></br> 
 <table class="table table-bordered" style="text-align: center; vertical-align: middle;">
        <tbody>  <tr>
            <td class="column">S.No</td>
            <td class="column">Name</td>
            <td class="column">MME ID</td>
            <td class="column">MME Location</td>
            <td class="column">MME Calibration Frequency</td>
            <td class="column">Next Calibration On</td>
            <td class="column">Jan</td>
            <td class="column">Feb</td>
            <td class="column">Mar</td>
            <td class="column">Apr</td>
            <td class="column">May</td>
            <td class="column">Jun</td>
            <td class="column">Jul</td>
            <td class="column">Aug</td>
            <td class="column">Sep</td>
            <td class="column">Oct</td>
            <td class="column">Nov</td>
            <td class="column">Dec</td>
        </tr>
  
        <t t-foreach="docs" t-as="doc" t-foreach-options="{'index': 'doc_index'}">
            <tr>
                <td><t t-esc="doc_index + 1"/></td>
                <td><t t-esc="doc.name.name"/></td>
                <td><t t-esc="doc.mme_id"/></td>
                <td><t t-esc="doc.mme_used_in"/></td>
                <td>Y</td>
                <td><t t-esc="doc.next_calibration_on"/></td>
<td>
<t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 1">
<t t-esc="doc.calibration_due_date.day"/>
<hr/>
</t>
<t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 1">
<t t-esc="doc.actual_calibrated_date.day"/>
</t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 2">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 2">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 3">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 3">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 4">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 4">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 5">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 5">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 6">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 6">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 7">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 7">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 8">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 8">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 9">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 9">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 10">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 10">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 11">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 11">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
<td>
    <t t-if="doc.calibration_due_date and doc.calibration_due_date.month == 12">
        <t t-esc="doc.calibration_due_date.day"/>
        <hr/>
    </t>
    <t t-if="doc.actual_calibrated_date and doc.actual_calibrated_date.month == 12">
        <t t-esc="doc.actual_calibrated_date.day"/>
    </t>
</td>
            </tr>
        </t>
    </tbody>
</table>


        </div>
    </t>
</template>

</odoo>
