Sfoglia il codice sorgente

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

dev
parent
commit
f766c2a6f6
3 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  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 Vedi File

@@ -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 Vedi File

@@ -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 Vedi File

@@ -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() ;

Loading…
Annulla
Salva