[IMP]pms:improve portal custom payment custom amount -incomplete-

This commit is contained in:
Darío Lodeiros
2024-04-16 09:45:55 +02:00
parent 4693e1b749
commit 0e433b6a65
2 changed files with 17 additions and 9 deletions

View File

@@ -122,7 +122,7 @@ class PortalFolio(CustomerPortal):
"subscription payments will be made automatically." "subscription payments will be made automatically."
), ),
}, },
amount=custom_amount, custom_amount=custom_amount,
) )
@http.route( @http.route(

View File

@@ -128,7 +128,7 @@
/> />
<t <t
t-set="prepare_tx_url" t-set="prepare_tx_url"
t-value="'/folio/pay/' + str(folio.id) + '?custom_amount=' + custom_amount + '/form_tx/'" t-value="'/folio/pay/' + str(folio.id) + '/form_tx/'"
/> />
<t t-if="custom_amount" t.set="submit_txt"> <t t-if="custom_amount" t.set="submit_txt">
Pay <t t-esc="custom_amount" /> Pay <t t-esc="custom_amount" />
@@ -159,20 +159,28 @@
<div> <div>
<a <a
href="#" href="#"
t-if="folio.payment_state in ('not_paid', 'partial') and folio.pending_amount and not custom_amount" t-if="folio.payment_state in ('not_paid', 'partial') and folio.pending_amount and custom_amount"
class="btn btn-primary btn-block mb-2" class="btn btn-primary btn-block mb-2"
data-toggle="modal" data-toggle="modal"
data-target="#pay_with" data-target="#pay_with"
> >
<i class="fa fa-fw fa-arrow-circle-right" /> Pay Now <i class="fa fa-fw fa-arrow-circle-right" /> Pay Now <t
t-esc="custom_amount"
t-options="{'widget': 'monetary', 'display_currency': folio.currency_id}"
/>
</a> </a>
<div <a
href="#"
t-if="folio.payment_state in ('not_paid', 'partial') and folio.pending_amount" t-if="folio.payment_state in ('not_paid', 'partial') and folio.pending_amount"
class="alert alert-info py-1 mb-2" class="btn btn-primary btn-block mb-2"
data-toggle="modal"
data-target="#pay_with"
> >
<!-- añadimos el importe en el boton--> <i class="fa fa-fw fa-arrow-circle-right" /> Pay Now <t
<i class="fa fa-fw fa-check-circle" /> Pay <t t-esc="custom_amount" /> t-esc="folio.pending_amount"
</div> t-options="{'widget': 'monetary', 'display_currency': folio.currency_id}"
/>
</a>
<div <div
t-if="folio.payment_state in ('paid', 'overpayment')" t-if="folio.payment_state in ('paid', 'overpayment')"
class="alert alert-success py-1 mb-2" class="alert alert-success py-1 mb-2"