<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2024-2025 Nexa Systems Inc.
    License OPL-1 (Odoo Proprietary License v1.0)
    Part of the Fusion Claim Assistant product family.
-->
<odoo>
    <!-- Extend the payment register wizard form to add card info -->
    <record id="view_account_payment_register_form_fc" model="ir.ui.view">
        <field name="name">account.payment.register.form.fc</field>
        <field name="model">account.payment.register</field>
        <field name="inherit_id" ref="account.view_account_payment_register_form"/>
        <field name="arch" type="xml">
            <!-- Add hidden field for card payment detection -->
            <xpath expr="//field[@name='communication']" position="after">
                <field name="x_fc_is_card_payment" invisible="1"/>
                <field name="x_fc_card_last_four" 
                       placeholder="e.g., 1234"
                       required="x_fc_is_card_payment"
                       invisible="not can_edit_wizard or (can_group_payments and not group_payment)"/>
                <field name="x_fc_payment_note"
                       placeholder="Transaction reference or note"
                       invisible="not can_edit_wizard or (can_group_payments and not group_payment)"/>
            </xpath>
        </field>
    </record>
</odoo>
