<?xml version="1.0"?>
<data name="Payment on My Invoices" inherit_id="account.portal_my_invoices">
        <xpath expr="//t[@t-call='portal.portal_table']/thead/tr/th[last()]" position="before">
            <th/>
        </xpath>
        <xpath expr="//t[@t-foreach='invoices']/tr/td[last()]" position="before">
            <td class="text-center">
                <t t-set="tx_ids" t-value="invoice.transaction_ids.filtered(lambda tx: tx.state in ('pending', 'authorized'))"/>
                <t t-set="pending_manual_txs" t-value="tx_ids.filtered(lambda tx: tx.state == 'pending' and tx.provider_code in ('none', 'custom'))"/>
                <a t-if="invoice.state == 'posted' and invoice.payment_state in ('not_paid', 'partial') and invoice.amount_total and invoice.move_type == 'out_invoice' and (pending_manual_txs or not tx_ids or invoice.amount_paid &lt; invoice.amount_total)" t-att-href="invoice.get_portal_url(anchor='portal_pay')" title="Pay Now" aria-label="Pay now" class="btn btn-sm btn-primary" role="button">
                    <i class="fa fa-arrow-circle-right"/><span class="d-none d-md-inline"> Pay Now</span>
                </a>
            </td>
        </xpath>
        <xpath expr="//t[@t-foreach='invoices']/tr/td[hasclass('tx_status')]" position="replace">
            <t t-set="last_tx" t-value="invoice.get_portal_last_transaction()"/>
            <td class="tx_status text-center">
                <t t-if="invoice.state == 'posted' and invoice.payment_state in ('not_paid', 'partial') and (last_tx.state not in ['pending', 'authorized'] or (last_tx.state == 'pending' and last_tx.provider_code in ('none', 'custom')))">
                    <span class="badge rounded-pill text-bg-info"><i class="fa fa-fw fa-clock-o"/><span class="d-none d-md-inline"> Waiting for Payment</span></span>
                </t>
                <t t-if="invoice.state == 'posted' and last_tx.state == 'authorized'">
                    <span class="badge rounded-pill text-bg-primary"><i class="fa fa-fw fa-check"/><span class="d-none d-md-inline"> Authorized</span></span>
                </t>
                <t t-if="invoice.state == 'posted' and last_tx.state == 'pending' and last_tx.provider_code not in ('none', 'custom')">
                  <span class="badge rounded-pill text-bg-warning"><span class="d-none d-md-inline"> Pending</span></span>
                </t>
                <t t-if="invoice.state == 'posted' and invoice.payment_state in ('paid', 'in_payment')">
                    <span class="badge rounded-pill text-bg-success"><i class="fa fa-fw fa-check"/><span class="d-none d-md-inline"> Paid</span></span>
                </t>
                <t t-if="invoice.state == 'posted' and invoice.payment_state == 'reversed'">
                    <span class="badge rounded-pill text-bg-success"><i class="fa fa-fw fa-check"/><span class="d-none d-md-inline"> Reversed</span></span>
                </t>
                <t t-if="invoice.state == 'cancel'">
                    <span class="badge rounded-pill text-bg-danger"><i class="fa fa-fw fa-remove"/><span class="d-none d-md-inline"> Cancelled</span></span>
                </t>
            </td>
        </xpath>
    </data>

    