<?xml version="1.0"?>
<t name="Sales Order Portal Pay Modal" t-name="sale.sale_order_portal_pay_modal">
        <div class="modal-content">
            <header class="modal-header">
                <h4 class="modal-title">Pay Order</h4>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"/>
            </header>
            <main class="modal-body" id="sign-dialog">
                <t t-set="prepayment_amount" t-value="sale_order._get_prepayment_required_amount()"/>
                <t t-set="prepayment_available" t-value="sale_order.prepayment_percent                              and sale_order.prepayment_percent != 1.0"/>
                <t t-if="sale_order._has_to_be_paid() and prepayment_available" t-call="sale.sale_order_portal_pay_modal_amount_selector"/>
                <div t-if="sale_order._has_to_be_paid()" class="mb-3">
                    <!-- The widget associated with this modal will hide and show spans depending of the selected option. -->
                    <span t-if="prepayment_available">
                        <span id="o_sale_portal_use_amount_prepayment">
                            By paying a <u>down payment</u> of
                            <span t-out="amount" t-options="{                                     'widget': 'monetary',                                     'display_currency': sale_order.currency_id                                 }" class="fw-bold"/>
                            <t t-if="sale_order._get_prepayment_required_amount() == amount">
                                (<b t-esc="sale_order.prepayment_percent * 100"/>%),
                            </t>
                        </span>
                        <span id="o_sale_portal_use_amount_total">By paying,</span>
                    </span>
                    <span t-else="">
                        By paying,
                        <span t-out="amount" t-options="{                                 'widget': 'monetary',                                 'display_currency': sale_order.currency_id,                             }" class="fw-bold"/>
                    </span>
                    you confirm acceptance on behalf of
                    <b t-field="sale_order.partner_id.commercial_partner_id"/>
                    for the <b data-id="total_amount" t-field="sale_order.amount_total"/> quote.
                    <b t-if="sale_order.payment_term_id" t-field="sale_order.payment_term_id.note" class="o_sale_payment_terms"/>
                </div>
                <div t-if="payment_amount and not sale_order._has_to_be_paid()" class="mb-3">
                    Amount:
                    <span t-out="payment_amount" t-options="{                             'widget': 'monetary',                             'display_currency': sale_order.currency_id,                         }" class="fw-bold"/>
                </div>
                <div t-if="company_mismatch" t-call="payment.company_mismatch_warning"/>
                <div t-elif="not sale_order._has_to_be_paid() and not payment_amount" class="alert alert-danger">
                    The order is not in a state requiring customer payment.
                </div>
                <div t-else="" id="payment_method" t-call="payment.form" class="text-start mt-0">
                    <!-- Inject the order ID to allow Stripe to check if tokenization is required. -->
                    <t t-set="sale_order_id" t-value="sale_order.id"/>
                </div>
            </main>
        </div>
    </t>

    