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