183 lines
7.9 KiB
HTML
183 lines
7.9 KiB
HTML
{% extends 'base.html' %}
|
|
{% load indonesian_filters %}
|
|
|
|
{% block title %}Sales Order {{ so.so_number }} - Details{% 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">Sales Order: {{ so.so_number }}</h1>
|
|
<div class="btn-toolbar mb-2 mb-md-0">
|
|
<a href="{% url 'sales:edit_so' so.so_number %}" class="btn btn-outline-secondary">
|
|
<i class="fas fa-edit"></i> Edit
|
|
</a>
|
|
<a href="{% url 'sales:delete_so' so.so_number %}" class="btn btn-outline-danger ms-2">
|
|
<i class="fas fa-trash"></i> Delete
|
|
</a>
|
|
<a href="{% url 'sales:so_list' %}" class="btn btn-outline-primary ms-2">
|
|
<i class="fas fa-arrow-left"></i> Back to List
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-lg-8">
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Sales Order Information</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<table class="table table-borderless">
|
|
<tr>
|
|
<th width="40%">SO Number:</th>
|
|
<td>{{ so.so_number }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Customer:</th>
|
|
<td><strong>{{ so.customer.name }}</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Order Date:</th>
|
|
<td>{{ so.order_date|date:"M d, Y" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Expected Delivery:</th>
|
|
<td>
|
|
{% if so.expected_delivery_date %}
|
|
{{ so.expected_delivery_date|date:"M d, Y" }}
|
|
{% else %}
|
|
<em>Not specified</em>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Status:</th>
|
|
<td>
|
|
{% if so.status == 'processing' %}
|
|
<span class="badge bg-info">Processing</span>
|
|
{% elif so.status == 'completed' %}
|
|
<span class="badge bg-success">Completed</span>
|
|
{% elif so.status == 'cancelled' %}
|
|
<span class="badge bg-danger">Cancelled</span>
|
|
{% else %}
|
|
<span class="badge bg-secondary">{{ so.get_status_display }}</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<table class="table table-borderless">
|
|
<tr>
|
|
<th width="40%">Subtotal:</th>
|
|
<td>{{ so.subtotal|format_rupiah }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Tax (11%):</th>
|
|
<td>{{ so.tax_amount|format_rupiah }}</td>
|
|
</tr>
|
|
<tr class="table-info">
|
|
<th><strong>Total Amount:</strong></th>
|
|
<td><strong>{{ so.total_amount|format_rupiah }}</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Items Count:</th>
|
|
<td>{{ so.items.count }} items</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Created:</th>
|
|
<td>{{ so.created_at|date:"M d, Y H:i" }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
{% if so.notes %}
|
|
<div class="mt-3">
|
|
<h6>Notes:</h6>
|
|
<p class="mb-0">{{ so.notes|linebreaks }}</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Order Items</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if so.items.all %}
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Product</th>
|
|
<th>Quantity</th>
|
|
<th>Unit Price</th>
|
|
<th>Total Price</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in so.items.all %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ item.product.name }}</strong><br>
|
|
<small class="text-muted">{{ item.product.code }}</small>
|
|
</td>
|
|
<td>{{ item.quantity|floatformat:0 }}</td>
|
|
<td>{{ item.unit_price|format_rupiah }}</td>
|
|
<td>{{ item.total_price|format_rupiah }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="text-muted">No items in this order.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-4">
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Customer Information</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<h6>{{ so.customer.name }}</h6>
|
|
<p class="mb-1"><i class="fas fa-map-marker-alt"></i> {{ so.customer.address|default:"No address" }}</p>
|
|
{% if so.customer.phone %}
|
|
<p class="mb-1"><i class="fas fa-phone"></i> {{ so.customer.phone }}</p>
|
|
{% endif %}
|
|
{% if so.customer.email %}
|
|
<p class="mb-1"><i class="fas fa-envelope"></i> {{ so.customer.email }}</p>
|
|
{% endif %}
|
|
<a href="{% url 'sales:customer_detail' so.customer.id %}" class="btn btn-sm btn-outline-primary">
|
|
View Customer Details
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Quick Actions</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if so.status == 'processing' %}
|
|
<a href="{% url 'sales:create_delivery' so.so_number %}" class="btn btn-success w-100 mb-2">
|
|
<i class="fas fa-truck"></i> Create Delivery
|
|
</a>
|
|
{% endif %}
|
|
<a href="{% url 'sales:delete_so' so.so_number %}" class="btn btn-danger w-100 mb-2">
|
|
<i class="fas fa-trash"></i> Delete Order
|
|
</a>
|
|
<a href="{% url 'sales:so_list' %}" class="btn btn-secondary w-100">
|
|
<i class="fas fa-list"></i> View All Orders
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |