<?xml version="1.0" encoding="UTF-8" ?>
<odoo>

    <template id="proposal_status_report">
        <t t-call="web.html_container">
            <div class="page">
                <t t-foreach="docs" t-as="doc">
                    <t t-call="web.external_layout">
                        <t t-set="seq" t-value="1"/>
                        <h2  class="text-center">Proposal Status <span t-esc="data['form']['proposal_state_id'][1]" /> Report</h2><br></br>
                        <p class="text-center"> For The Period <span t-esc="data['form']['date_from']"/> -  <span t-esc="data['form']['date_to']"/> </p>

                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th style="text-align: center;"><strong>#</strong></th>
                                    <th style="text-align: center;"><strong>Submital Date</strong></th>
                                    <th style="text-align: center;"><strong>RFP No <br/> P No <br/> JOB no </strong></th>
                                    <th style="text-align: center;"><strong>Proposal Name</strong></th>
                                    <th style="text-align: center;"><strong>Note on Proposal</strong></th>
                                    <th style="text-align: center;"><strong>P Fee <br/> Revised Fee</strong></th>
                                    <th style="text-align: center;"><strong>Rank</strong></th>
                                    <th style="text-align: center;"><strong>Job Fee</strong></th>
                                    <th style="text-align: center;"><strong>Contract Status</strong></th>
                                    <th style="text-align: center;"><strong>Remark</strong></th>
                                    <th style="text-align: center;"><strong>Duration</strong></th>
                                </tr>
                            </thead>
                            <tbody style="text-align: center;">
                                <t t-foreach="keys" t-as="key">
                                    <tr>
                                        <td class="text-left" colspan="13">
                                            <span t-esc="key.name" />
                                        </td>
                                    </tr>

                                    <tr  t-foreach="proposal_status_data[key.id]" t-as="p_status">
                                        <td>
                                            <span t-esc="seq"/>
                                            <t t-set="seq" t-value="seq+1"/>
                                        </td>
                                        <td>
                                            <span t-esc="p_status['date']"/>
                                        </td>
                                        <td>
                                            <span t-esc="p_status['crm_seq']"/> <br/> <span t-esc="p_status['proposal']"/> <br/>  <span t-esc="p_status['crm_seq']"/> 
                                        </td>
                                        <td>
                                            <span t-esc="p_status['name']"/>
                                        </td>

                                        <td> </td>

                                        <td>
                                            <span t-esc="p_status['p_fees']"/>
                                        </td>

                                        <td> <span t-esc="p_status['rank']"/> </td>

                                        <td> <span t-esc="p_status['contract_value']"/> </td>

                                        <td>
                                            <span t-esc="p_status['contract_status']"/>
                                        </td>
                                        <td></td>

                                        <td>
                                            <span t-esc="p_status['project_duration']"/>
                                        </td>

                                    </tr>
                                </t>
                            </tbody>

                        </table>
                    </t>
                </t>
            </div>
        </t>
    </template>
    <report
            id ="action_proposal_status_report_pdf"
            model ="proposal.status.report.wiz"
            string ="Proposal Status Report Pdf"
            report_type ="qweb-pdf"
            name ="sale_custom.proposal_status_report"
            file ="sale_custom.proposal_status_report"
            menu="False" />

    <report id ="action_proposal_status_report_xlsx"
            model ="proposal.status.report.wiz"
            string ="Proposal Status Report XlsX"
            report_type ="xlsx"
            name ="sale_custom.proposal_status_report_xlsx"
            file ="sale_custom.proposal_status_report_xlsx"
            menu="False" />
</odoo>
