Explorar el Código

[backend] distribution/index : afficher les boutons liés au crédit uniquement si cette option est activée

dev
Guillaume Bourgeois hace 5 años
padre
commit
f766c2a6f6
Se han modificado 3 ficheros con 8 adiciones y 2 borrados
  1. +5
    -0
      backend/controllers/DistributionController.php
  2. +1
    -1
      backend/views/distribution/index.php
  3. +2
    -1
      backend/web/js/vuejs/distribution-index.js

+ 5
- 0
backend/controllers/DistributionController.php Ver fichero

@@ -104,6 +104,11 @@ class DistributionController extends BackendController
$format = 'Y-m-d' ;
$dateObject = DateTime::createFromFormat($format, $date);
$producer = Producer::getCurrent() ;
$json['producer'] = [
'credit' => $producer->credit
];
$distributionsArray = Distribution::searchAll([
'active' => 1
], [

+ 1
- 1
backend/views/distribution/index.php Ver fichero

@@ -263,7 +263,7 @@ $this->setPageTitle('Distributions') ;
<span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à payer</span>
</div>
</td>
<td class="column-payment">
<td class="column-payment" v-if="producer.credit">
<div class="btn-group" v-if="order.user && !order.date_delete">
<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

+ 2
- 1
backend/web/js/vuejs/distribution-index.js Ver fichero

@@ -10,6 +10,7 @@ var app = new Vue({
distribution: {
active: false,
},
producer: null,
oneDistributionWeekActive: false,
products: [],
countActiveProducts: 0,
@@ -113,7 +114,7 @@ var app = new Vue({
axios.get("ajax-infos",{params: {date : this.getDate()}})
.then(function(response) {
app.distribution = response.data.distribution ;
app.producer = response.data.producer ;
app.products = response.data.products ;
app.initCountActiveProducts() ;

Cargando…
Cancelar
Guardar