<odoo>
  <record id="action_report_proposal_boq" model="ir.actions.report">
        <field name="name">Proposal</field>
        <field name="model">sos_proposal_boq</field>
        <field name="report_type">qweb-pdf</field>
        <field name="report_name">sos_sales.report_proposal_boq</field>
        <field name="report_file">sos_sales.report_proposal_boq</field>
        <field name="print_report_name">"BOQ _ %s" % object.customer_name</field>
        <field name="binding_model_id" eval="False"/>
        <field name="binding_type">report</field>
    </record>

<template id="report_proposal_boq">
    <t t-call="web.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-call="web.external_layout">
             <link rel="stylesheet" href="/sos_inventory/static/src/css/style.css" />
                <div class="page">

                    <table class="table">
                     <t t-if="o.proposal_id.proposal_id">
                    <tr><td class="column">Proposal Id</td><td colspan="3"><t t-esc="o.proposal_id.proposal_id"/></td></tr>
                    </t>
                    <tr><td class="column">Customer Name</td><td><t t-esc="o.customer_name"/></td><td class="column">Location</td><td><t t-esc="o.location"/></td></tr>
                    </table>
                     <br></br>
        <table class="table">
        <tbody>  
        <tr><td colspan="6" style="background-color:#ddd;font-weight:bold">Accessories List</td></tr>
        <tr class="column">
        <td class="column">S.No</td>
        <td class="column">Accessory</td>
        <td class="column">UOM</td>
        <td class="column">Qty</td>
        </tr>  
        <t t-set="counter" t-value="0"/>

        <t t-foreach="o.line_ids_fg" t-as="line_items">
<tr>
 <t t-set="counter" t-value="counter + 1"/>
<td><t t-esc="counter"/></td>
<td><t t-esc="line_items.component_id.display_name"/></td>
<td><t t-esc="line_items.uom"/></td>
<td><t t-esc="line_items.quantity"/></td>
</tr>
</t>


    <t t-foreach="o.line_ids_sfg" t-as="line_items">
    <tr>
    <t t-set="counter" t-value="counter + 1"/>
    <td><t t-esc="counter"/></td>
    <td><t t-esc="line_items.component_id.display_name"/></td>
    <td><t t-esc="line_items.uom"/></td>
    <td><t t-esc="line_items.quantity"/></td>
    </tr>
    </t>

    <t t-foreach="o.line_ids_material" t-as="line_items">
    <tr>
    <t t-set="counter" t-value="counter + 1"/>
    <td><t t-esc="counter"/></td>
    <td><t t-esc="line_items.component_id.display_name"/></td>
    <td><t t-esc="line_items.uom"/></td>
    <td><t t-esc="line_items.quantity"/></td>
    </tr>
    </t>
        <tr><td colspan="6" style="background-color:#ddd;font-weight:bold">Installation Kit</td></tr>
        <tr class="column">
        <td class="column">S.No</td>
        <td class="column">Accessory</td>
        <td class="column">UOM</td>
        <td class="column">Qty</td>
        </tr> 
<t t-foreach="o.line_ids_installation_kit" t-as="line_items">
    <tr>
    <t t-set="counter" t-value="counter + 1"/>
    <td><t t-esc="counter"/></td>
    <td><t t-esc="line_items.component_id.display_name"/></td>
    <td><t t-esc="line_items.uom"/></td>
    <td><t t-esc="line_items.quantity"/></td>
    </tr>
    </t>
<tr><td colspan="6" style="background-color:#ddd;font-weight:bold">Miscellaneous</td></tr>
 <tr class="column">
        <td class="column">S.No</td>
        <td class="column">Name</td>
        <td class="column">Cost</td>
        <td class="column">Qty</td>
        </tr>  
<t t-foreach="o.line_ids_miscellaneous" t-as="line_items">
    <tr>
    <t t-set="counter" t-value="counter + 1"/>
    <td><t t-esc="counter"/></td>
    <td><t t-esc="line_items.name"/></td>
    <td><t t-esc="line_items.cost"/></td>
    <td><t t-esc="line_items.quantity"/></td>
    </tr>
    </t>
        </tbody>
        </table>
  <div style="width: 100%; display: flex; justify-content: space-between; margin-top: 50px;">

<table class="table table-bordered">

        <tr style="background-color:#ccc">
        <td style="padding: 8px;" class="column"><b>Department </b></td>
            <td style="padding: 8px;" class="column"><b>Authorized Signatory </b></td>
            <td style="padding: 8px;" class="column"><b>Authorized On</b></td>
            <td style="padding: 8px;" class="column"><b>Authorized By</b></td>
        </tr>
        <tr>
        <td>CE</td>
            <td><img style="height:80px;width:100px" t-if="o.boq_submitted_by_image" t-att-src="'data:image/png;base64,%s' % (o.boq_submitted_by_image.decode())" alt="BOQ Submitted By"/></td>

            <td><t t-esc="o.boq_submitted_by_approved_on"/></td>
             <td><t t-esc="o.boq_submitted_by_name.name"/></td>
        </tr>
        <tr>
        <td>Accounts</td>
            <td><img style="height:80px;width:100px" t-if="o.acc_approved_by_image" t-att-src="'data:image/png;base64,%s' % (o.acc_approved_by_image.decode())" alt="Tested By"/></td>

            <td><t t-esc="o.acc_approved_on"/></td>
             <td><t t-esc="o.acc_approved_by_name.name"/></td>
        </tr>
      
    </table>

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

</odoo>
