121 lines
6.6 KiB
HTML
121 lines
6.6 KiB
HTML
{% extends "base.html" %}
|
||
{% load static %}
|
||
{% load i18n %}
|
||
|
||
{% block content %}
|
||
<div class="container-fluid mt-3">
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<!-- En-t<EFBFBD>te -->
|
||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||
<h3>
|
||
<i class="bi bi-tools"></i> {% translate "Bons de confection" %}
|
||
</h3>
|
||
<a href="{% url 'stock:production_order_create' %}" class="btn btn-primary">
|
||
<i class="bi bi-plus-lg"></i> {% translate "Nouveau bon de confection" %}
|
||
</a>
|
||
</div>
|
||
|
||
<div class="card shadow-sm bg-white">
|
||
<div class="card-body p-3">
|
||
<!-- Filtres production -->
|
||
<form method="get" class="row g-2 align-items-end mb-4 mt-1" id="form-production">
|
||
<div class="col-md-3">
|
||
<label class="form-label small mb-1">{% translate "Statut" %}</label>
|
||
<select name="prod_status" class="form-select form-select-sm">
|
||
<option value="">{% translate "Tous" %}</option>
|
||
{% for value, label in prod_status_choices %}
|
||
<option value="{{ value }}" {% if prod_status_filter == value %}selected{% endif %}>
|
||
{{ label }}
|
||
</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
<div class="col-md-2">
|
||
<button type="submit" class="btn btn-outline-primary btn-sm w-100">
|
||
<i class="bi bi-search"></i> {% translate "Filtrer" %}
|
||
</button>
|
||
</div>
|
||
{% if prod_status_filter %}
|
||
<div class="col-md-1">
|
||
<a href="{% url 'stock:production_center' %}" class="btn btn-outline-secondary btn-sm w-100">
|
||
<i class="bi bi-x"></i>
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
</form>
|
||
|
||
<!-- Tableau des bons de confection -->
|
||
<div class="table-responsive">
|
||
<table class="table table-hover mb-0">
|
||
<thead class="table-light">
|
||
<tr>
|
||
<th>{% translate "Code" %}</th>
|
||
<th>{% translate "Entrep<65>t" %}</th>
|
||
<th class="text-center">{% translate "Qt<51>" %}</th>
|
||
<th>{% translate "Statut" %}</th>
|
||
<th>{% translate "Bon de pr<70>p." %}</th>
|
||
<th>{% translate "Cr<43><72> le" %}</th>
|
||
<th>{% translate "Termin<69> le" %}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for order in orders %}
|
||
<tr>
|
||
<td>
|
||
<a href="{% url 'stock:production_order_detail' order.pk %}">
|
||
<strong>{{ order.code }}</strong>
|
||
</a>
|
||
</td>
|
||
<td>{{ order.warehouse.name }}</td>
|
||
<td class="text-center">{{ order.quantity }}</td>
|
||
<td>
|
||
{% if order.status == 'draft' %}
|
||
<span class="badge bg-secondary">
|
||
<i class="bi bi-pencil"></i> {{ order.get_status_display }}
|
||
</span>
|
||
{% elif order.status == 'in_production' %}
|
||
<span class="badge bg-primary">
|
||
<i class="bi bi-gear-wide-connected"></i> {{ order.get_status_display }}
|
||
</span>
|
||
{% elif order.status == 'completed' %}
|
||
<span class="badge bg-success">
|
||
<i class="bi bi-check-circle"></i> {{ order.get_status_display }}
|
||
</span>
|
||
{% else %}
|
||
<span class="badge bg-danger">
|
||
<i class="bi bi-x-circle"></i> {{ order.get_status_display }}
|
||
</span>
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
{% if order.preparation_order %}
|
||
<a href="{% url 'stock:preparation_order_detail' order.preparation_order.pk %}">
|
||
#{{ order.preparation_order.order_number }}
|
||
</a>
|
||
{% else %}
|
||
<span class="text-muted">-</span>
|
||
{% endif %}
|
||
</td>
|
||
<td>{{ order.created_at|date:"d/m/Y" }}</td>
|
||
<td>{{ order.completed_at|date:"d/m/Y"|default:"-" }}</td>
|
||
</tr>
|
||
{% empty %}
|
||
<tr>
|
||
<td colspan="7" class="text-center text-muted py-4">
|
||
{% translate "Aucun bon de confection." %}
|
||
<a href="{% url 'stock:production_order_create' %}">
|
||
{% translate "Cr<43>er le premier" %}
|
||
</a>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endblock content %}
|