<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2024-2026 Nexa Systems Inc.
    License OPL-1 (Odoo Proprietary License v1.0)
-->
<odoo>
    <record id="view_sa_mobility_wizard_form" model="ir.ui.view">
        <field name="name">fusion_claims.sa.mobility.wizard.form</field>
        <field name="model">fusion_claims.sa.mobility.wizard</field>
        <field name="arch" type="xml">
            <form string="SA Mobility Form">
                <sheet>
                    <group string="Vendor Information">
                        <group>
                            <field name="sale_order_id" invisible="1"/>
                            <field name="vendor_name"/>
                            <field name="order_number"/>
                            <field name="vendor_address"/>
                            <field name="primary_email"/>
                        </group>
                        <group>
                            <field name="phone"/>
                            <field name="secondary_email"/>
                            <field name="form_date"/>
                            <field name="salesperson_name"/>
                            <field name="service_date"/>
                        </group>
                    </group>
                    <group string="Client Information">
                        <group>
                            <field name="client_first_name"/>
                            <field name="client_last_name"/>
                            <field name="member_id"/>
                        </group>
                        <group>
                            <field name="client_address"/>
                            <field name="client_phone"/>
                            <field name="relationship"/>
                        </group>
                    </group>
                    <group string="Device Information">
                        <group>
                            <field name="device_type"/>
                            <field name="device_other_description"
                                   invisible="device_type != 'other'"/>
                            <field name="serial_number"/>
                            <field name="year"/>
                        </group>
                        <group>
                            <field name="make"/>
                            <field name="model_name"/>
                            <field name="warranty_in_effect"/>
                            <field name="warranty_description"
                                   invisible="not warranty_in_effect"/>
                            <field name="after_hours"/>
                        </group>
                    </group>
                    <group string="Request Details">
                        <field name="sa_request_type"/>
                    </group>
                    <group string="Notes / Comments">
                        <field name="notes" nolabel="1" colspan="2"
                               placeholder="Additional details about the request..."/>
                    </group>
                    <group string="Email Body Notes">
                        <field name="email_body_notes" nolabel="1" colspan="2"
                               placeholder="e.g. URGENT: Client needs equipment by March 1st..."
                               help="These notes appear at the top of the email body, below the title. Use for urgency or priority information."/>
                    </group>
                    <notebook>
                        <page string="Parts" name="parts">
                            <field name="part_line_ids">
                                <list editable="bottom">
                                    <field name="sequence" widget="handle"/>
                                    <field name="qty"/>
                                    <field name="description"/>
                                    <field name="unit_price"/>
                                    <field name="tax_id" string="Tax Type"/>
                                    <field name="taxes" readonly="1"/>
                                    <field name="amount" readonly="1"/>
                                </list>
                            </field>
                            <group class="oe_subtotal_footer">
                                <field name="parts_total" class="oe_subtotal_footer_separator"/>
                            </group>
                        </page>
                        <page string="Labour" name="labour">
                            <field name="labour_line_ids">
                                <list editable="bottom">
                                    <field name="sequence" widget="handle"/>
                                    <field name="hours"/>
                                    <field name="rate"/>
                                    <field name="tax_id" string="Tax Type"/>
                                    <field name="taxes" readonly="1"/>
                                    <field name="amount" readonly="1"/>
                                </list>
                            </field>
                            <group class="oe_subtotal_footer">
                                <field name="labour_total" class="oe_subtotal_footer_separator"/>
                            </group>
                        </page>
                        <page string="Additional Fees" name="fees">
                            <field name="fee_line_ids">
                                <list editable="bottom">
                                    <field name="sequence" widget="handle"/>
                                    <field name="description"/>
                                    <field name="rate"/>
                                    <field name="tax_id" string="Tax Type"/>
                                    <field name="taxes" readonly="1"/>
                                    <field name="amount" readonly="1"/>
                                </list>
                            </field>
                            <group class="oe_subtotal_footer">
                                <field name="fees_total" class="oe_subtotal_footer_separator"/>
                            </group>
                        </page>
                    </notebook>
                    <group string="Totals Summary" class="oe_subtotal_footer">
                        <field name="parts_total" string="Parts"/>
                        <field name="labour_total" string="Labour"/>
                        <field name="fees_total" string="Additional Fees"/>
                        <field name="grand_total" class="oe_subtotal_footer_separator"/>
                    </group>
                </sheet>
                <footer>
                    <button name="action_fill_and_attach" type="object"
                            string="Fill &amp; Attach Form" class="btn-primary"/>
                    <button name="action_fill_attach_and_send" type="object"
                            string="Fill, Attach &amp; Send" class="btn-secondary"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_sa_mobility_wizard" model="ir.actions.act_window">
        <field name="name">SA Mobility Form</field>
        <field name="res_model">fusion_claims.sa.mobility.wizard</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>
</odoo>
