fix: ADP portal - sidebar amount, claim details, signature report

This commit is contained in:
2026-03-09 21:25:37 +00:00
parent f362fbd915
commit 512aedce69

View File

@@ -5,13 +5,137 @@
Part of the Fusion Claim Assistant product family.
Portal template overrides for ADP orders:
Shows client portion amount instead of full order total.
- 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
-->
<odoo>
<!-- Override portal content to show ADP client portion info -->
<!-- ================================================================
1. SIDEBAR: Show client portion instead of full amount
================================================================ -->
<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">
<t t-out="sale_order.x_fc_client_portion_total"
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>
<t t-out="sale_order._get_prepayment_required_amount()"
t-options="{'widget': 'monetary', 'display_currency': sale_order.currency_id}"/>
(<t t-out="sale_order.prepayment_percent * 100"/>%)
</h2>
</t>
<h2 t-else="" t-field="sale_order.amount_total" class="mb-0 text-break"/>
</t>
</xpath>
</template>
<!-- ================================================================
2. CONTENT: Show ADP claim details + funding breakdown
================================================================ -->
<template id="sale_order_portal_content_adp"
inherit_id="sale.sale_order_portal_content"
name="Fusion: ADP Client Portion on Portal">
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">
<h5 class="mb-1">ADP Claim Details</h5>
<hr class="mt-1 mb-2"/>
<table class="table table-borderless table-sm">
<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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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">
@@ -27,10 +151,19 @@
</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'">
<div class="alert alert-success mb-3 py-2">
<strong>ADP Assisted Devices Program Order</strong><br/>
This order is fully funded through ADP. No payment is required from you.
</div>
</t>
</xpath>
</template>
<!-- Override payment amount selector to show client portion for ADP -->
<!-- ================================================================
3. PAYMENT MODAL: Show client portion in amount selector
================================================================ -->
<template id="sale_order_portal_pay_amount_adp"
inherit_id="sale.sale_order_portal_pay_modal_amount_selector"
name="Fusion: ADP Payment Amount Selector">
@@ -61,4 +194,5 @@
</button>
</xpath>
</template>
</odoo>