2025-06-11 15:07:00 +03:00

74 lines
2.8 KiB
HTML

<!-- po_list.html -->
{% extends "base.html" %}
{% block title %}
Purchase Orders - {{ block.super }}
{% endblock %}
{% block content %}
<div class="container mt-4">
<h2 class="mb-4">Purchase Orders</h2>
<!-- Success Message -->
{% if messages %}
{% for message in messages %}
<div class="alert alert-success">{{ message }}</div>
{% endfor %}
{% endif %}
<!-- Add New PO Button -->
<div class="d-flex justify-content-between align-items-center mb-3">
<a href="{% url 'purchase_order_create' %}" class="btn btn-primary">
<i class="bi bi-plus-lg"></i> Create New PO
</a>
</div>
<!-- PO Table -->
<div class="table-responsive">
<table class="table table-striped table-hover align-middle">
<thead class="table-dark">
<tr>
<th scope="col">PO Number</th>
<th scope="col">Description</th>
<th scope="col">Status</th>
<th scope="col">Created At</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% if purchase_orders %}
{% for po in purchase_orders %}
<tr>
<td>{{ po.po_number }}</td>
<td>{{ po.po_title }}</td>
<td>
<span class="">
{{ po.po_status|capfirst }}
</span>
</td>
<td>{{ po.created|date:"M d, Y" }}</td>
<td>
<a href="{% url 'purchase_order_detail' po.pk %}" class="btn btn-sm btn-info me-1">
View
</a>
{% comment %} <a href="{% url 'purchase_order_detail' po.id %}" class="btn btn-sm btn-info me-1">
View
</a>
<a href="{% url 'purchase_order_update' po.id %}" class="btn btn-sm btn-warning me-1">
Edit
</a>
<a href="{% url 'purchase_order_delete' po.id %}" class="btn btn-sm btn-danger">
Delete
</a> {% endcomment %}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="6" class="text-center">No purchase orders found.</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
{% endblock %}