Bläddra i källkod

Boutons de paiement

dev
Guillaume Bourgeois 5 år sedan
förälder
incheckning
7eb39983f0
2 ändrade filer med 16 tillägg och 6 borttagningar
  1. +12
    -5
      backend/views/distribution/index.php
  2. +4
    -1
      backend/web/js/vuejs/distribution-index.js

+ 12
- 5
backend/views/distribution/index.php Visa fil

@@ -265,12 +265,19 @@ $this->setPageTitle('Distributions') ;
</td>
<td>
<div class="btn-group" v-if="order.user">
<button class="btn btn-xs btn-default" :data-id-order="order.id">
<span class="glyphicon glyphicon-euro"></span>
<span v-if="order.amount_paid == order.amount">Rembourser</span>
<span v-else-if="order.amount_paid == 0 || order.amount_paid < order.amount">Payer</span>
<span v-else-if="order.amount_paid > order.amount">Rembourser</span>
<button class="btn btn-xs btn-default" v-if="order.amount_paid == order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount">
<span class="glyphicon glyphicon-euro"></span> Rembourser
</button>
<button class="btn btn-xs btn-default" v-else-if="order.amount_paid == 0" @click="orderPaymentClick" :data-id-order="order.id" data-type="payment" :data-amount="order.amount">
<span class="glyphicon glyphicon-euro"></span> Payer
</button>
<button class="btn btn-xs btn-default" v-else-if="order.amount_paid < order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="payment" :data-amount="order.amount_remaining">
<span class="glyphicon glyphicon-euro"></span> Payer
</button>
<button class="btn btn-xs btn-default" v-else-if="order.amount_paid > order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount_surplus">
<span class="glyphicon glyphicon-euro"></span> Rembourser
</button>
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>

+ 4
- 1
backend/web/js/vuejs/distribution-index.js Visa fil

@@ -313,8 +313,11 @@ var app = new Vue({
orderPaymentClick: function(event) {
var app = this ;
var idOrder = event.currentTarget.getAttribute('data-id-order') ;
if(!idOrder) {
idOrder = this.idOrderPayment ;
}
axios.get(UrlManager.getBaseUrlAbsolute()+"order/ajax-payment",{params: {
idOrder: this.idOrderPayment,
idOrder: idOrder,
type: event.currentTarget.getAttribute('data-type'),
amount: event.currentTarget.getAttribute('data-amount')
}})

Laddar…
Avbryt
Spara