Django_Basic_Manufacturing_3/templates/purchasing/po_confirm_delete.html
2025-08-22 17:05:22 +07:00

157 lines
7.2 KiB
HTML

{% extends 'base.html' %}
{% load indonesian_filters %}
{% block title %}Delete Purchase Order - {{ po.po_number }}{% endblock %}
{% block content %}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Delete Purchase Order</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<a href="{% url 'purchasing:po_detail' po.po_number %}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left"></i> Cancel
</a>
</div>
</div>
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="card border-warning">
<div class="card-header bg-warning">
<h5 class="mb-0 text-dark">
<i class="fas fa-exclamation-triangle"></i> Confirm Purchase Order Deletion
</h5>
</div>
<div class="card-body">
<div class="alert alert-warning">
<h6>⚠️ Warning: This action cannot be undone!</h6>
<p class="mb-0">You are about to permanently delete the purchase order and all associated data.</p>
</div>
<div class="row">
<div class="col-md-6">
<h6>Purchase Order Information:</h6>
<table class="table table-sm">
<tr>
<th width="40%">PO Number:</th>
<td><strong>{{ po.po_number }}</strong></td>
</tr>
<tr>
<th>Supplier:</th>
<td>{{ po.supplier.name }}</td>
</tr>
<tr>
<th>Order Date:</th>
<td>{{ po.order_date|date:"M d, Y" }}</td>
</tr>
<tr>
<th>Expected Delivery:</th>
<td>
{% if po.expected_delivery_date %}
{{ po.expected_delivery_date|date:"M d, Y" }}
{% else %}
-
{% endif %}
</td>
</tr>
<tr>
<th>Status:</th>
<td>
{% if po.status == 'ordered' %}
<span class="badge bg-warning">Ordered</span>
{% elif po.status == 'completed' %}
<span class="badge bg-success">Completed</span>
{% elif po.status == 'cancelled' %}
<span class="badge bg-danger">Cancelled</span>
{% else %}
<span class="badge bg-secondary">{{ po.get_status_display }}</span>
{% endif %}
</td>
</tr>
<tr>
<th>Items Count:</th>
<td>{{ po.items.count }} items</td>
</tr>
</table>
</div>
<div class="col-md-6">
<h6>Financial Summary:</h6>
<div class="bg-light p-3 rounded">
<table class="table table-sm mb-0">
<tr>
<th>Subtotal:</th>
<td>{{ po.subtotal|format_rupiah }}</td>
</tr>
<tr>
<th>Tax Amount:</th>
<td>{{ po.tax_amount|format_rupiah }}</td>
</tr>
<tr class="table-info">
<th><strong>Total Amount:</strong></th>
<td><strong>{{ po.total_amount|format_rupiah }}</strong></td>
</tr>
</table>
</div>
</div>
</div>
{% if po.notes %}
<div class="mt-3">
<h6>Notes:</h6>
<p class="mb-0">{{ po.notes|linebreaks }}</p>
</div>
{% endif %}
<div class="mt-4">
<p><strong>What happens when you delete this purchase order:</strong></p>
<ul class="text-muted">
<li>The purchase order record will be permanently removed from the database</li>
<li>All associated line items will be deleted</li>
<li>Related goods receipts may lose PO reference</li>
<li>Historical data will be preserved where possible</li>
<li>This action cannot be reversed</li>
</ul>
</div>
</div>
<div class="card-footer">
<form method="post" class="d-inline">
{% csrf_token %}
<button type="submit" class="btn btn-danger btn-lg">
<i class="fas fa-trash"></i> Yes, Delete Purchase Order
</button>
</form>
<a href="{% url 'purchasing:po_detail' po.po_number %}" class="btn btn-secondary btn-lg ms-2">
<i class="fas fa-times"></i> Cancel
</a>
</div>
</div>
<div class="card mt-4">
<div class="card-header">
<h6 class="mb-0">Alternative Actions</h6>
</div>
<div class="card-body">
<p class="mb-2">Instead of deleting, consider these alternatives:</p>
<div class="row">
<div class="col-md-4">
<a href="{% url 'purchasing:edit_po' po.po_number %}" class="btn btn-outline-primary w-100 mb-2">
<i class="fas fa-edit"></i> Edit Purchase Order
</a>
</div>
<div class="col-md-4">
{% if po.status == 'ordered' %}
<a href="{% url 'purchasing:approve_po' po.po_number %}" class="btn btn-outline-success w-100 mb-2">
<i class="fas fa-check"></i> Approve Order
</a>
{% endif %}
</div>
<div class="col-md-4">
<a href="{% url 'purchasing:po_list' %}" class="btn btn-outline-secondary w-100 mb-2">
<i class="fas fa-list"></i> Return to PO List
</a>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}