|
|
@@ -1,94 +0,0 @@ |
|
|
|
{% embed "@LcSov/adminlte/embed/modal.twig" %} |
|
|
|
{% import '@LcCaracole/admin/product/macro/product_family_macro.html.twig' as pfm %} |
|
|
|
|
|
|
|
{% block size %}modal-xl{% endblock %} |
|
|
|
{% block id %}modal-products-sales-statistic{% endblock %} |
|
|
|
{% block title %}Total ventes/semaines : {{ productFamily.title }}{% endblock %} |
|
|
|
|
|
|
|
{% block body %} |
|
|
|
<div class="row"> |
|
|
|
<div class="col-10"> |
|
|
|
{{ _self.btn_pss(productsSalesStatistic, productFamily, 'Global', 'total_sales') }} |
|
|
|
{% if productFamily.activeProducts %} |
|
|
|
{% for product in productFamily.products %} |
|
|
|
{% if product.status >= 0 %} |
|
|
|
{{ _self.btn_pss(productsSalesStatistic, productFamily, product.title , product.id ) }} |
|
|
|
{% endif %} |
|
|
|
{% endfor %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-2"> |
|
|
|
<h5>Stock actuel</h5> |
|
|
|
{% include 'admin/product/field/product_family_available_quantity.html.twig' with {item:productFamily, value: productFamily.availableQuantity} %} |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="col-12"> |
|
|
|
{{ _self.table_pss(productsSalesStatistic, productFamily, 'total_sales') }} |
|
|
|
{% for product in productFamily.products %} |
|
|
|
{% if product.status >= 0 %} |
|
|
|
{{ _self.table_pss(productsSalesStatistic, productFamily, product.id) }} |
|
|
|
{% endif %} |
|
|
|
{% endfor %} |
|
|
|
</div> |
|
|
|
<div class="col-12"> |
|
|
|
<canvas id="chart"></canvas> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
{% endblock %} |
|
|
|
|
|
|
|
{% block footer %}{% endblock %} |
|
|
|
|
|
|
|
{% macro btn_pss(productsSalesStatistic,productFamily, label, propertyName) %} |
|
|
|
<button style="margin-bottom: 10px;" type="button" data-property-name="{{ propertyName }}" |
|
|
|
class="btn btn-sm btn-primary btn-products-sales-statistic"> |
|
|
|
{{ label }} <br/> |
|
|
|
{{ productsSalesStatistic['data'][propertyName]['average_period'] }} |
|
|
|
{% if propertyName== 'total_sales' and productFamily and (productFamily.behaviorDisplaySale== constant('Lc\\CaracoleBundle\\Model\\Product\\ProductFamilyModel::BEHAVIOR_DISPLAY_SALE_BY_MEASURE')) %} |
|
|
|
{{ productFamily.unit.unitReference }} |
|
|
|
{% endif %} |
|
|
|
<br/> |
|
|
|
<small>(en moyenne)</small> |
|
|
|
</button> |
|
|
|
{% endmacro btn_pss %} |
|
|
|
|
|
|
|
{% macro table_pss(productsSalesStatistic, productFamily, propertyName) %} |
|
|
|
<div style="margin:20px 0;" class="table-products-sales-statistic" id="table-products-sales-statistic-{{ propertyName }}"> |
|
|
|
|
|
|
|
<table class="table table-bordered table-striped"> |
|
|
|
<tbody> |
|
|
|
<tr> |
|
|
|
<th class="text-success"> |
|
|
|
<i class="fa fa-calendar"></i> Semaine |
|
|
|
</th> |
|
|
|
{% for weekNumber, weekNumberQuantity in productsSalesStatistic['data'][propertyName]['data'] %} |
|
|
|
<td class="text-success align-right"> |
|
|
|
{{ weekNumber }} |
|
|
|
</td> |
|
|
|
{% endfor %} |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<th class="text-info"> |
|
|
|
<i class="fa fa-shopping-basket"></i> Commandés |
|
|
|
</th> |
|
|
|
{% for weekNumber, weekNumberQuantity in productsSalesStatistic['data'][propertyName]['data'] %} |
|
|
|
<td class="text-info align-right"> |
|
|
|
<strong> |
|
|
|
{{ weekNumberQuantity is null ? 0 : weekNumberQuantity }} |
|
|
|
{% if propertyName== 'total_sales' and productFamily and (productFamily.behaviorDisplaySale== constant('Lc\\CaracoleBundle\\Model\\Product\\ProductFamilyModel::BEHAVIOR_DISPLAY_SALE_BY_MEASURE')) %} |
|
|
|
{{ productFamily.unit.unitReference }} |
|
|
|
{% endif %} |
|
|
|
</strong> |
|
|
|
</td> |
|
|
|
{% endfor %} |
|
|
|
</tr> |
|
|
|
|
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
{% endmacro table_pss %} |
|
|
|
{% endembed %} |
|
|
|
|