Pārlūkot izejas kodu

[Administration] Distributions : alerte produit disponible au niveau des produits

develop
Guillaume Bourgeois pirms 4 mēnešiem
vecāks
revīzija
a5df6e2e64
2 mainītis faili ar 21 papildinājumiem un 1 dzēšanām
  1. +4
    -1
      backend/views/distribution/index.php
  2. +17
    -0
      backend/web/js/vuejs/distribution-index.js

+ 4
- 1
backend/views/distribution/index.php Parādīt failu

@@ -395,6 +395,8 @@ $this->setPageTitle('Distributions') ;
<span v-if="order.order_status_alias == 'canceled'" class="label label-danger" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-trash"></span></span>
<span v-if="order.order_status_alias == 'updated'" class="label label-warning" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-pencil"></span></span>
<span v-if="order.order_status_alias == 'ordered'" class="label label-success" :title="order.orderStatusHistorySummaryTitleTag"><span class="glyphicon glyphicon-check"></span></span>

<span v-if="containUnactiveProduct(order)" class="glyphicon glyphicon-warning-sign" title="Cette commande contient un produit qui n'est pas activé"></span>
</td>
<td class="column-origin" v-html="order.labelOrigin"></td>
<td class="column-user">
@@ -627,7 +629,8 @@ $this->setPageTitle('Distributions') ;
<strong><span class="glyphicon glyphicon-menu-right"></span> Produits</strong>
<ul>
<li v-for="product in products" v-if="getProductDistribution(product) && order.productOrder[product.id].quantity > 0">
{{ product.name }} : {{ order.productOrder[product.id].quantity }} {{ order.productOrder[product.id].unit == 'piece' ? ' pièce(s)' : ' '+order.productOrder[product.id].unit }} <span v-if="getProductDistribution(product).active == 0" class="glyphicon glyphicon-warning-sign" title="Ce produit n'est pas activé"></span>
{{ product.name }} : {{ order.productOrder[product.id].quantity }} {{ order.productOrder[product.id].unit == 'piece' ? ' pièce(s)' : ' '+order.productOrder[product.id].unit }}
<span v-if="getProductDistribution(product).active == 0" class="glyphicon glyphicon-warning-sign" title="Ce produit n'est pas activé"></span>
</li>
</ul>
<div v-if="order.comment && order.comment.length > 0" class="comment">

+ 17
- 0
backend/web/js/vuejs/distribution-index.js Parādīt failu

@@ -1067,6 +1067,23 @@ if($(selector).length) {
$event.preventDefault();
navigator.clipboard.writeText(urlOrder);
appAlerts.alert('success', 'Lien vers la page de commande de la distribution copié.');
return false;
},
containUnactiveProduct: function(order) {
var app = this;
var product = null;
var productDistribution = false;
for(key in app.products) {
product = app.products[key];
productDistribution = app.getProductDistribution(product);
if(productDistribution
&& order.productOrder[product.id].quantity > 0
&& productDistribution.active == 0) {

return true;
}
}

return false;
}
},

Notiek ielāde…
Atcelt
Saglabāt