<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="sos_travel_reimbursement_bills_view_tree" model="ir.ui.view">
    <field name="name">sos_travel_reimbursement_bills.view.tree</field>
    <field name="model">sos_travel_reimbursement_bills</field>
    <field name="arch" type="xml">
    <tree>
    <field name="plan_id"/>
    <field name="claimed_by"/>
    <field name="customer_name"/>
    <field name="customer_location"/>
    <field name="write_uid" string="Last Edited By" optional="hide"/>
    <field name="write_date" string="Last Edited On" optional="hide"/>
    </tree>
    </field>
    </record>

 <record id="action_travel_reimbursement_bills" model="ir.actions.act_window">
    <field name="name">Travel Reimbursement</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sos_travel_reimbursement_bills</field>
    <field name="view_mode">tree,form</field>
    <field name="view_id" ref="sos_travel_reimbursement_bills_view_tree"/>
</record>
<record id="sos_travel_reimbursement_bills_form_view" model="ir.ui.view">
    <field name="name">Form</field>
    <field name="model">sos_travel_reimbursement_bills</field>
    <field name="arch" type="xml">
        <form>
        <header>
<button class="btn btn-primary" type="object"
name="action_report_travel_reimbursement_btn"><i class="fa fa-print"></i> Print</button>


</header>
            <sheet>
        <h2 style="text-align: center;text-transform: uppercase;text-shadow: 1px 1p 1px #140718;color: #65407c;padding:5px;">Travel Reimbursement</h2><hr></hr><br></br>  
        <group>
        <group>
        <field name="plan_id"/>
        <field name="travel_type"/>
        <field name="claimed_by"/>
      

        </group>
        <group>
         <field name="customer_name"/>
        <field name="customer_location"/>
        <field name="persons" widget="many2many_tags"/>
        </group>

        </group>
        <notebook>
        <page string="Expenses">
        <field name="line_ids">
        <tree editable="bottom">
        <field name="date_of_expense"/>
        <field name="purpose"/>
        <field name="expense_type"/>
        <field name="cost"/>
        <field name="remarks"/>
        </tree>
        </field>
        <group colspan="2"
                                   class="oe_subtotal_footer oe_right">
<label for="total_expense"/><field name="total_expense" nolabel="1" widget="monetary" readonly="True"/>
                            </group>
                         <div class="oe_clear"/>
        </page>
        <page string="Summary">
                <group>
                <field name="total_expense" style="font-size:22px;font-weight:bold"/>
                </group>
                </page>
        </notebook>
                 <br></br> <hr></hr>
                 <templates>
    <div class="row">
    <div class="col-md-5" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">
       <table class="table">
     <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">User</span></td></tr>

        <tr>
            <td style="padding: 8px;" class="column"><b>Prepared by Sign</b>
                <button string="Approve" invisible="prepared_by_image" class="btn-primary custom_btn" type="object" name="action_report_esign_btn"></button>
            </td>
            <td><field name="prepared_by_image" widget="image"/></td>
        </tr>
        <tr invisible="prepared_by_image == False">
            <td style="padding: 8px;" class="column"><b>Prepared On</b></td>
            <td><field name="prepared_on" readonly="1"/></td>
        </tr>
        <tr invisible="prepared_by_image == False">
            <td style="padding: 8px;" class="column"><b>Prepared By</b></td>
            <td><field name="prepared_by_name" readonly="1"/></td>
        </tr>
    </table>
    </div>
    <div class="col-md-2"></div>
    <div class="col-md-5" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">
       <table class="table">
         <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">Department Incharge</span></td></tr>

        <tr>
            <td style="padding: 8px;" class="column"><b>Department Incharge</b>
                <button string="Approve" invisible="dept_in_charge_image" class="btn-primary custom_btn" type="object" name="action_report_esign_btn1"></button>

            </td>
            <td><field name="dept_in_charge_image" widget="image"/></td>
        </tr>
        <tr invisible="dept_in_charge_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="dept_in_charge_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="dept_in_charge_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="dept_in_charge_name" readonly="1"/></td>
        </tr>
    </table>
    </div>
    </div>
    <br></br>
    <div class="row">
         <div class="col-md-5" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">
       <table  class="table">
             <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">Accounts</span> Team</td></tr>


        <tr>
            <td style="padding: 8px;" class="column"><b>Accounts approved By</b>
                <button string="Approve" invisible="accounts_approved_by_image" class="btn-primary custom_btn" type="object" name="action_acc_esign_btn"></button>
            </td>
            <td><field name="accounts_approved_by_image" widget="image"/></td>
        </tr>
        <tr invisible="accounts_approved_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="accounts_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="accounts_approved_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="accounts_approved_name" readonly="1"/></td>
        </tr>
    </table>
    </div>

 <div class="col-md-2"></div>
  <div class="col-md-5" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">

       <table class="table">
     <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">Top Management</span></td></tr>

        <tr>
            <td style="padding: 8px;" class="column"><b>Top Management</b>
                <button string="Approve" invisible="top_management_approval_image" class="btn-primary custom_btn" type="object" name="action_top_esign"></button>
            </td>
            <td><field name="top_management_approval_image" widget="image"/></td>
        </tr>
        <tr invisible="top_management_approval_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="top_management_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="top_management_approval_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="top_management_name" readonly="1"/></td>
        </tr>
    </table>
    </div>
      
</div>
                            </templates>        
            </sheet>
        </form>
    </field>
</record>


              <menuitem id="travel_bills_menu"
              name="Expense Reimbursement"
              parent="travel_root_menu"
              action="action_travel_reimbursement_bills" groups="sos_inventory.sos_ce_user,sos_inventory.sos_ce_head,sos_inventory.sos_finance_user,sos_inventory.sos_management_user"/>
              
</odoo>
