Django_Basic_Manufacturing_3/templates/sales/customer_confirm_delete.html
2025-08-22 17:05:22 +07:00

117 lines
5.3 KiB
HTML

{% extends 'base.html' %}
{% load indonesian_filters %}
{% block title %}Delete Customer - {{ customer.name }}{% 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 Customer</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<a href="{% url 'sales:customer_detail' customer.id %}" 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 Customer 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 customer and all associated data.</p>
</div>
<div class="row">
<div class="col-md-6">
<h6>Customer Information:</h6>
<table class="table table-sm">
<tr>
<th width="40%">Code:</th>
<td>{{ customer.code }}</td>
</tr>
<tr>
<th>Name:</th>
<td><strong>{{ customer.name }}</strong></td>
</tr>
<tr>
<th>Contact Person:</th>
<td>{{ customer.contact_person|default:"-" }}</td>
</tr>
<tr>
<th>Email:</th>
<td>{{ customer.email|default:"-" }}</td>
</tr>
<tr>
<th>Status:</th>
<td>
{% if customer.is_active %}
<span class="badge bg-success">Active</span>
{% else %}
<span class="badge bg-secondary">Inactive</span>
{% endif %}
</td>
</tr>
</table>
</div>
<div class="col-md-6">
<h6>Data Impact:</h6>
<div class="bg-light p-3 rounded">
<p class="mb-2"><strong>Sales Orders:</strong> {{ customer_order_count }} orders will be affected</p>
<p class="mb-2"><strong>Total Value:</strong> {{ customer_total_value|format_rupiah }} in orders</p>
<p class="mb-0"><strong>Related Records:</strong> All associated data will be deleted</p>
</div>
</div>
</div>
<div class="mt-4">
<p><strong>What happens when you delete this customer:</strong></p>
<ul class="text-muted">
<li>The customer record will be permanently removed from the database</li>
<li>All associated sales orders will remain but may lose customer 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 Customer
</button>
</form>
<a href="{% url 'sales:customer_detail' customer.id %}" 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-6">
<a href="{% url 'sales:edit_customer' customer.id %}" class="btn btn-outline-primary w-100 mb-2">
<i class="fas fa-edit"></i> Edit Customer Details
</a>
</div>
<div class="col-md-6">
<a href="{% url 'sales:customer_list' %}" class="btn btn-outline-secondary w-100 mb-2">
<i class="fas fa-list"></i> Return to Customer List
</a>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}