fix: ADP portal sign/pay modal text - show client portion, not full total
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
- Shows client portion in sidebar instead of full order total
|
||||
- Displays ADP claim details (Client Type, Authorizer, Dates, etc.)
|
||||
- Payment amount selector shows client portion
|
||||
- Fixes confirmation text in sign and pay modals
|
||||
-->
|
||||
<odoo>
|
||||
|
||||
@@ -17,18 +18,13 @@
|
||||
<template id="sale_order_portal_sidebar_adp"
|
||||
inherit_id="sale.sale_order_portal_template"
|
||||
name="Fusion: ADP Sidebar Amount">
|
||||
|
||||
<!-- Replace the data attribute with client portion for ADP -->
|
||||
<xpath expr="//div[hasclass('o_portal_sale_sidebar')]" position="attributes">
|
||||
<attribute name="t-att-data-order-amount-total">
|
||||
sale_order.x_fc_client_portion_total if sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type == 'REG' else sale_order.amount_total
|
||||
</attribute>
|
||||
</xpath>
|
||||
|
||||
<!-- Replace the sidebar title (amount display) -->
|
||||
<xpath expr="//div[hasclass('o_portal_sale_sidebar')]//t[@t-set='title']" position="replace">
|
||||
<t t-set="title">
|
||||
<!-- ADP REG: show client portion -->
|
||||
<t t-if="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type == 'REG'">
|
||||
<small class="text-muted d-block">Your Portion</small>
|
||||
<h2 class="mb-0 text-break">
|
||||
@@ -36,12 +32,10 @@
|
||||
t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>
|
||||
</h2>
|
||||
</t>
|
||||
<!-- ADP non-REG (100% funded): no payment needed -->
|
||||
<t t-elif="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type and sale_order.x_fc_client_type != 'REG'">
|
||||
<small class="text-muted d-block">Fully ADP Funded</small>
|
||||
<h2 class="mb-0 text-break text-success">$ 0.00</h2>
|
||||
</t>
|
||||
<!-- Standard Odoo behavior for non-ADP -->
|
||||
<t t-elif="sale_order._has_to_be_paid() and sale_order.prepayment_percent != 1.0">
|
||||
<h4>Down payment</h4>
|
||||
<h2>
|
||||
@@ -62,8 +56,6 @@
|
||||
<template id="sale_order_portal_content_adp"
|
||||
inherit_id="sale.sale_order_portal_content"
|
||||
name="Fusion: ADP Details on Portal">
|
||||
|
||||
<!-- Add ADP details section after sale_info -->
|
||||
<xpath expr="//div[@id='sale_info']" position="after">
|
||||
<t t-if="sale_order.x_fc_is_adp_sale">
|
||||
<div class="col-12 col-lg-6 mb-4">
|
||||
@@ -73,82 +65,53 @@
|
||||
<tbody style="white-space:nowrap">
|
||||
<tr t-if="sale_order.x_fc_client_type">
|
||||
<th class="ps-0 pb-0">Client Type:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_client_type"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_client_type"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_claim_number">
|
||||
<th class="ps-0 pb-0">Claim Number:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_claim_number"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_claim_number"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_authorizer_id">
|
||||
<th class="ps-0 pb-0">Authorizer:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_authorizer_id"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_authorizer_id"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_client_ref_1">
|
||||
<th class="ps-0 pb-0">Client Ref 1:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_client_ref_1"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_client_ref_1"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_client_ref_2">
|
||||
<th class="ps-0 pb-0">Client Ref 2:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_client_ref_2"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_client_ref_2"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_assessment_end_date">
|
||||
<th class="ps-0 pb-0">Assessment Date:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_assessment_end_date"
|
||||
t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_assessment_end_date" t-options="{'widget': 'date'}"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_claim_authorization_date">
|
||||
<th class="ps-0 pb-0">Authorization Date:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_claim_authorization_date"
|
||||
t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_claim_authorization_date" t-options="{'widget': 'date'}"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_claim_approval_date">
|
||||
<th class="ps-0 pb-0">Approval Date:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_claim_approval_date"
|
||||
t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_claim_approval_date" t-options="{'widget': 'date'}"/></td>
|
||||
</tr>
|
||||
<tr t-if="sale_order.x_fc_adp_delivery_date">
|
||||
<th class="ps-0 pb-0">Delivery Date:</th>
|
||||
<td class="w-100 pb-0 text-wrap">
|
||||
<span t-field="sale_order.x_fc_adp_delivery_date"
|
||||
t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
<td class="w-100 pb-0 text-wrap"><span t-field="sale_order.x_fc_adp_delivery_date" t-options="{'widget': 'date'}"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</xpath>
|
||||
|
||||
<!-- Add funding breakdown before totals -->
|
||||
<xpath expr="//div[@id='total']" position="before">
|
||||
<t t-if="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type == 'REG'">
|
||||
<div class="alert alert-info mb-3 py-2">
|
||||
<strong>ADP Assisted Devices Program Order</strong><br/>
|
||||
This order is partially funded through ADP.<br/>
|
||||
<strong>Your portion:</strong>
|
||||
<span t-esc="sale_order.x_fc_client_portion_total"
|
||||
t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>
|
||||
<span class="text-muted ms-2">
|
||||
(ADP covers
|
||||
<span t-esc="sale_order.x_fc_adp_portion_total"
|
||||
t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>)
|
||||
</span>
|
||||
<span t-esc="sale_order.x_fc_client_portion_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>
|
||||
<span class="text-muted ms-2">(ADP covers <span t-esc="sale_order.x_fc_adp_portion_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>)</span>
|
||||
</div>
|
||||
</t>
|
||||
<t t-if="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type and sale_order.x_fc_client_type != 'REG'">
|
||||
@@ -171,28 +134,88 @@
|
||||
<button name="o_sale_portal_amount_total_button" class="btn btn-light">
|
||||
<t t-if="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type == 'REG'">
|
||||
Client Portion <br/>
|
||||
<span
|
||||
t-out="sale_order.x_fc_client_portion_total"
|
||||
t-options="{
|
||||
'widget': 'monetary',
|
||||
'display_currency': sale_order.currency_id,
|
||||
}"
|
||||
class="fw-bold"
|
||||
/>
|
||||
<span t-out="sale_order.x_fc_client_portion_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}" class="fw-bold"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
Full amount <br/>
|
||||
<span
|
||||
t-out="sale_order.amount_total"
|
||||
t-options="{
|
||||
'widget': 'monetary',
|
||||
'display_currency': sale_order.currency_id,
|
||||
}"
|
||||
class="fw-bold"
|
||||
/>
|
||||
<span t-out="sale_order.amount_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}" class="fw-bold"/>
|
||||
</t>
|
||||
</button>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- ================================================================
|
||||
4. PAY MODAL: Fix confirmation text for ADP orders
|
||||
================================================================ -->
|
||||
<template id="sale_order_portal_pay_modal_adp"
|
||||
inherit_id="sale.sale_order_portal_pay_modal"
|
||||
name="Fusion: ADP Pay Modal Confirmation Text">
|
||||
<xpath expr="//div[hasclass('mb-3')][.//b[@data-id='total_amount']]" position="replace">
|
||||
<div t-if="sale_order._has_to_be_paid()" class="mb-3">
|
||||
<t t-if="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type == 'REG'">
|
||||
By paying
|
||||
<span t-out="sale_order.x_fc_client_portion_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}" class="fw-bold"/>,
|
||||
you confirm acceptance on behalf of
|
||||
<b t-field="sale_order.partner_id.commercial_partner_id"/>
|
||||
for quotation <b t-field="sale_order.name"/>.
|
||||
This payment covers your client portion. The remaining
|
||||
<span t-out="sale_order.x_fc_adp_portion_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}" class="fw-bold"/>
|
||||
is funded by ADP.
|
||||
</t>
|
||||
<t t-else="">
|
||||
<span t-if="sale_order.prepayment_percent and sale_order.prepayment_percent != 1.0">
|
||||
<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.
|
||||
</t>
|
||||
<b t-if="sale_order.payment_term_id" t-field="sale_order.payment_term_id.note" class="o_sale_payment_terms"/>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- ================================================================
|
||||
5. SIGN MODAL: Fix confirmation text for ADP orders
|
||||
================================================================ -->
|
||||
<template id="sale_order_portal_sign_modal_adp"
|
||||
inherit_id="sale.sale_order_portal_sign_modal"
|
||||
name="Fusion: ADP Sign Modal Confirmation Text">
|
||||
<xpath expr="//main[@id='sign-dialog']/span[.//b[@data-id='total_amount']]" position="replace">
|
||||
<span>
|
||||
<t t-if="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type == 'REG'">
|
||||
By signing, you confirm acceptance on behalf of
|
||||
<b t-field="sale_order.partner_id.commercial_partner_id"/>
|
||||
for quotation <b t-field="sale_order.name"/>.
|
||||
Your client portion is
|
||||
<b t-out="sale_order.x_fc_client_portion_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>.
|
||||
The remaining
|
||||
<span t-out="sale_order.x_fc_adp_portion_total" t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>
|
||||
is funded by ADP.
|
||||
</t>
|
||||
<t t-elif="sale_order.x_fc_is_adp_sale and sale_order.x_fc_client_type and sale_order.x_fc_client_type != 'REG'">
|
||||
By signing, you confirm acceptance on behalf of
|
||||
<b t-field="sale_order.partner_id.commercial_partner_id"/>
|
||||
for quotation <b t-field="sale_order.name"/>.
|
||||
This order is fully funded by ADP.
|
||||
</t>
|
||||
<t t-else="">
|
||||
By signing, 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.
|
||||
</t>
|
||||
</span>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user