Przeglądaj źródła

Boutons de paiement

dev
Guillaume Bourgeois 5 lat temu
rodzic
commit
7eb39983f0
2 zmienionych plików z 16 dodań i 6 usunięć
  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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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')
}})

Ładowanie…
Anuluj
Zapisz