<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_odsp_ready_delivery_wizard_form" model="ir.ui.view">
        <field name="name">fusion_claims.odsp.ready.delivery.wizard.form</field>
        <field name="model">fusion_claims.odsp.ready.delivery.wizard</field>
        <field name="arch" type="xml">
            <form string="Ready for Delivery - Signature Setup">
                <field name="sale_order_id" invisible="1"/>
                <field name="approval_form" invisible="1"/>
                <field name="approval_form_filename" invisible="1"/>
                <field name="total_pages" invisible="1"/>
                <sheet>
                    <group>
                        <group string="Signature Settings">
                            <div class="text-muted mb-2" colspan="2">
                                Select the page containing the signature area. Positions are managed in
                                Configuration &gt; PDF Templates (ODSP category).
                            </div>
                            <label for="signature_page"/>
                            <div class="d-flex align-items-center">
                                <field name="signature_page" class="oe_inline" style="width: 60px;"/>
                                <span class="ms-2 text-muted">of <field name="total_pages" class="oe_inline" widget="integer" readonly="1"/> pages</span>
                            </div>
                            <div colspan="2" class="mt-2">
                                <button name="action_preview_full" type="object"
                                        string="Preview Full PDF" class="btn-link"
                                        icon="fa-file-pdf-o"/>
                            </div>
                        </group>
                        <group string="Signature Preview">
                            <div colspan="2">
                                <field name="preview_image" widget="image"
                                       class="o_kanban_image" style="max-height: 500px; max-width: 100%;"/>
                            </div>
                        </group>
                    </group>
                </sheet>
                <footer>
                    <button name="action_confirm" type="object"
                            string="Confirm &amp; Schedule Delivery" class="btn-primary"
                            icon="fa-truck"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>
</odoo>
