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

$format = 'Y-m-d' ; $format = 'Y-m-d' ;
$dateObject = DateTime::createFromFormat($format, $date); $dateObject = DateTime::createFromFormat($format, $date);
$producer = Producer::getCurrent() ;
$json['producer'] = [
'credit' => $producer->credit
];
$distributionsArray = Distribution::searchAll([ $distributionsArray = Distribution::searchAll([
'active' => 1 'active' => 1
], [ ], [

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

<span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à payer</span> <span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à payer</span>
</div> </div>
</td> </td>
<td class="column-payment">
<td class="column-payment" v-if="producer.credit">
<div class="btn-group" v-if="order.user && !order.date_delete"> <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"> <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 <span class="glyphicon glyphicon-euro"></span> Rembourser

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

distribution: { distribution: {
active: false, active: false,
}, },
producer: null,
oneDistributionWeekActive: false, oneDistributionWeekActive: false,
products: [], products: [],
countActiveProducts: 0, countActiveProducts: 0,
axios.get("ajax-infos",{params: {date : this.getDate()}}) axios.get("ajax-infos",{params: {date : this.getDate()}})
.then(function(response) { .then(function(response) {
app.distribution = response.data.distribution ; app.distribution = response.data.distribution ;
app.producer = response.data.producer ;
app.products = response.data.products ; app.products = response.data.products ;
app.initCountActiveProducts() ; app.initCountActiveProducts() ;

Cargando…
Cancelar
Guardar