Django_Basic_Manufacturing/templates/manufacture/bom_list.html
2025-08-19 19:06:26 +07:00

95 lines
4.1 KiB
HTML

{% extends 'base.html' %}
{% load manufacture_extras %}
{% block title %}Bill of Materials{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3 mb-0">
<i class="bi bi-list-check me-2"></i>
Bill of Materials
</h1>
<a href="{% url 'manufacture:bom_create' %}" class="btn btn-primary">
<i class="bi bi-plus-circle me-2"></i>
New BOM Entry (Multiple Components)
</a>
</div>
<div class="card">
<div class="card-body">
{% if boms %}
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-light">
<tr>
<th>Manufactured Product</th>
<th>Component</th>
<th>Quantity</th>
<th>Unit</th>
<th>Created</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for bom in boms %}
<tr>
<td>
<strong>{{ bom.manufactured_product.name }}</strong>
<div class="small text-muted">{{ bom.manufactured_product.code }}</div>
</td>
<td>{{ bom.component.name }}</td>
<td>{{ bom.quantity|format_quantity }}</td>
<td>{{ bom.unit|default:bom.component.unit }}</td>
<td>{{ bom.created_at|date:"d/m/Y" }}</td>
<td>
<a href="{% url 'manufacture:bom_detail' bom.pk %}" class="btn btn-sm btn-outline-primary">
<i class="bi bi-eye"></i>
</a>
<a href="{% url 'manufacture:bom_edit' bom.pk %}" class="btn btn-sm btn-outline-warning ms-1">
<i class="bi bi-pencil"></i>
</a>
<a href="{% url 'manufacture:bom_delete' bom.pk %}" class="btn btn-sm btn-outline-danger ms-1">
<i class="bi bi-trash"></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if is_paginated %}
<nav aria-label="Page navigation" class="mt-4">
<ul class="pagination justify-content-center">
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a>
</li>
{% endif %}
<li class="page-item active">
<span class="page-link">Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</span>
</li>
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% else %}
<div class="text-center py-5">
<i class="bi bi-list-check display-1 text-muted"></i>
<h4 class="mt-3 text-muted">No Bill of Materials Entries</h4>
<p class="text-muted">Start by creating your first BOM entry.</p>
<a href="{% url 'manufacture:bom_create' %}" class="btn btn-primary">
<i class="bi bi-plus-circle me-2"></i>
Create BOM Entry
</a>
</div>
{% endif %}
</div>
</div>
{% endblock %}