98 lines
4.1 KiB
HTML
98 lines
4.1 KiB
HTML
{% extends 'base.html' %}
|
|
{% load manufacture_extras %}
|
|
|
|
{% block title %}Manufacturing Orders{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1 class="h3 mb-0">
|
|
<i class="bi bi-tools me-2"></i>
|
|
Manufacturing Orders
|
|
</h1>
|
|
<a href="{% url 'manufacture:manufacture_create' %}" class="btn btn-primary">
|
|
<i class="bi bi-plus-circle me-2"></i>
|
|
New Order
|
|
</a>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
{% if manufacturing_orders %}
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Order Number</th>
|
|
<th>Date</th>
|
|
<th>Product</th>
|
|
<th>Quantity</th>
|
|
<th>Status</th>
|
|
<th>Total Cost</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for order in manufacturing_orders %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ order.order_number }}</strong>
|
|
</td>
|
|
<td>{{ order.date|date:"d/m/Y" }}</td>
|
|
<td>{{ order.product.name }}</td>
|
|
<td>{{ order.quantity }}</td>
|
|
<td>
|
|
<span class="badge bg-{% if order.status == 'completed' %}success{% elif order.status == 'in_progress' %}warning{% else %}secondary{% endif %}">
|
|
{{ order.get_status_display }}
|
|
</span>
|
|
</td>
|
|
<td>Rp {{ order.total_cost|format_currency }}</td>
|
|
<td>
|
|
<a href="{% url 'manufacture:manufacture_detail' order.pk %}" class="btn btn-sm btn-outline-primary">
|
|
<i class="bi bi-eye"></i>
|
|
</a>
|
|
<a href="{% url 'manufacture:manufacture_delete' order.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-tools display-1 text-muted"></i>
|
|
<h4 class="mt-3 text-muted">No Manufacturing Orders</h4>
|
|
<p class="text-muted">Start by creating your first manufacturing order.</p>
|
|
<a href="{% url 'manufacture:manufacture_create' %}" class="btn btn-primary">
|
|
<i class="bi bi-plus-circle me-2"></i>
|
|
Create Order
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|