2017-05-20 13:57:21 +02:00
|
|
|
{% extends 'kfet/base_col_2.html' %}
|
2017-06-12 01:51:10 +02:00
|
|
|
{% load staticfiles kfet_tags %}
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2017-04-02 05:17:26 +02:00
|
|
|
{% block extra_head %}
|
2020-02-08 10:47:55 +01:00
|
|
|
<script type="text/javascript" src="{% static 'kfet/vendor/Chart.min.js' %}"></script>
|
2017-04-02 05:17:26 +02:00
|
|
|
<script type="text/javascript" src="{% static 'kfet/js/statistic.js' %}"></script>
|
|
|
|
{% endblock %}
|
|
|
|
|
2017-05-20 13:57:21 +02:00
|
|
|
{% block title %}Article - {{ article.name }}{% endblock %}
|
|
|
|
{% block header-title %}Informations sur l'article {{ article.name }}{% endblock %}
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2017-06-12 01:51:10 +02:00
|
|
|
{% block fixed %}
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2017-06-12 01:51:10 +02:00
|
|
|
<aside>
|
|
|
|
<div class="heading">
|
|
|
|
<div>{{ article.name }}</div>
|
|
|
|
<div class="sub">{{ article.category }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="buttons">
|
|
|
|
<a class="btn btn-default" href="{% url 'kfet.article.update' article.pk %}">
|
|
|
|
<span class="glyphicon glyphicon-cog"></span><span>Éditer</span>
|
|
|
|
</a>
|
2019-05-24 19:32:57 +02:00
|
|
|
{% if perms.kfet.delete_account %}
|
|
|
|
<button class="btn btn-default" id="button-delete">
|
|
|
|
<span class="glyphicon glyphicon-remove"></span><span>Supprimer</span>
|
|
|
|
</button>
|
|
|
|
<form method="post" action="{% url 'kfet.article.delete' article.pk %}" id="article-delete-form">
|
|
|
|
{% csrf_token %}
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2017-06-12 01:51:10 +02:00
|
|
|
</div>
|
|
|
|
<div class="text">
|
|
|
|
<ul class="list-unstyled">
|
|
|
|
<li>
|
|
|
|
<b>Prix:</b> <span>{{ article.price }}€</span>
|
2019-05-24 19:32:57 +02:00
|
|
|
<span data-toggle="tooltip" data-placement="right" class="glyphicon glyphicon-question-sign"
|
|
|
|
title="Hors réduction COF"></span>
|
2017-06-12 01:51:10 +02:00
|
|
|
</li>
|
|
|
|
<li><b>Stock:</b> {{ article.stock }}</li>
|
|
|
|
<li><b>En vente:</b> {{ article.is_sold|yesno|title }}</li>
|
|
|
|
<li><b>Affiché:</b> {{ article.hidden|yesno|title }}</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</aside>
|
|
|
|
|
|
|
|
<div class="buttons tabs-buttons">
|
|
|
|
<div>
|
|
|
|
<a href="#tab_summary" data-toggle="pill" class="btn btn-primary-w focus">
|
|
|
|
Résumé
|
|
|
|
<span class="hidden-xs glyphicon glyphicon-chevron-right"></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a href="#tab_inventories" data-toggle="pill" class="btn btn-primary-w">
|
|
|
|
Inventaires
|
|
|
|
<span class="hidden-xs glyphicon glyphicon-chevron-right"></span>
|
2017-05-30 20:44:30 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
2017-06-12 01:51:10 +02:00
|
|
|
<div>
|
|
|
|
<a href="#tab_suppliers" data-toggle="pill" class="btn btn-primary-w">
|
|
|
|
Fournisseurs
|
|
|
|
<span class="hidden-xs glyphicon glyphicon-chevron-right"></span>
|
|
|
|
</a>
|
2016-08-30 18:56:42 +02:00
|
|
|
</div>
|
2017-05-20 13:57:21 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
2017-06-12 01:51:10 +02:00
|
|
|
{% block main %}
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
|
|
|
|
<div id="tab_summary" class="tab-pane fade in active">
|
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
<section>
|
|
|
|
<div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6">
|
2017-06-12 01:51:10 +02:00
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
<h3>Inventaires récents</h3>
|
|
|
|
<div class="table-responsive">
|
|
|
|
{% include "kfet/article_inventories_snippet.html" with inventoryarts=inventoryarts|slice:5 %}
|
|
|
|
</div>
|
2017-06-12 01:51:10 +02:00
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
</div><!-- col -->
|
|
|
|
<div class="col-lg-6">
|
2017-06-12 01:51:10 +02:00
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
<h3>Derniers prix fournisseurs</h3>
|
|
|
|
<div class="table-responsive">
|
|
|
|
{% include "kfet/article_suppliers_snippet.html" with supplierarts=supplierarts|slice:5 %}
|
|
|
|
</div>
|
2017-06-12 01:51:10 +02:00
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
</div><!-- col -->
|
|
|
|
</div><!-- row -->
|
|
|
|
</div>
|
|
|
|
</section>
|
2017-06-12 01:51:10 +02:00
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
<section>
|
|
|
|
<div>
|
|
|
|
<h3>Ventes</h3>
|
|
|
|
<div id="stat_last"></div>
|
|
|
|
</div>
|
|
|
|
</section>
|
2017-06-12 01:51:10 +02:00
|
|
|
|
|
|
|
</div><!-- summary tab -->
|
|
|
|
|
|
|
|
<div id="tab_inventories" class="tab-pane fade">
|
|
|
|
<div class="table-responsive">
|
|
|
|
{% include "kfet/article_inventories_snippet.html" %}
|
|
|
|
</div>
|
|
|
|
</div><!-- inventories tab -->
|
|
|
|
|
|
|
|
<div id="tab_suppliers" class="tab-pane fade">
|
|
|
|
<div class="table-responsive">
|
|
|
|
{% include "kfet/article_suppliers_snippet.html" %}
|
|
|
|
</div>
|
|
|
|
</div><!-- suppliers tab -->
|
|
|
|
|
2016-08-12 10:03:39 +02:00
|
|
|
</div>
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2017-04-02 05:17:26 +02:00
|
|
|
<script type="text/javascript">
|
2019-05-24 19:32:57 +02:00
|
|
|
$(document).ready(function () {
|
2017-04-02 05:17:26 +02:00
|
|
|
var stat_last = new StatsGroup(
|
2019-05-24 19:32:57 +02:00
|
|
|
"{% url 'kfet.article.stat.sales.list' article.id %}",
|
|
|
|
$("#stat_last")
|
2017-04-02 05:17:26 +02:00
|
|
|
);
|
2017-06-12 01:51:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
$("table .more").click(function () {
|
|
|
|
$(this).hide();
|
|
|
|
$(this).siblings(".hidden").removeClass("hidden");
|
2017-06-12 01:51:10 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
let tabs_buttons = $('.tabs-buttons a');
|
2019-05-24 19:32:57 +02:00
|
|
|
tabs_buttons.click(function () {
|
|
|
|
tabs_buttons.removeClass('focus');
|
|
|
|
$(this).addClass('focus');
|
2017-06-12 01:51:10 +02:00
|
|
|
});
|
2019-05-24 19:32:57 +02:00
|
|
|
|
|
|
|
// Delete button
|
|
|
|
$('#button-delete').click(function () {
|
|
|
|
$.confirm({
|
|
|
|
title: 'Confirmer la suppression',
|
|
|
|
content: `
|
|
|
|
<div class="warning">
|
|
|
|
<span class='glyphicon glyphicon-warning-sign'></span><span>Cette opération est irréversible !</span>
|
|
|
|
</div>
|
|
|
|
`,
|
|
|
|
backgroundDismiss: true,
|
|
|
|
animation: 'top',
|
|
|
|
closeAnimation: 'bottom',
|
|
|
|
keyboardEnabled: true,
|
|
|
|
confirm: function () {
|
|
|
|
$('#article-delete-form').submit();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|
2016-12-10 17:33:24 +01:00
|
|
|
</script>
|
2017-04-03 03:12:52 +02:00
|
|
|
|
2019-05-24 19:32:57 +02:00
|
|
|
{% endblock %}
|