Walkthrough step 11 said shipment records came through the API or the admin area, because the portal was read-only. The list and detail pages now carry New shipment and Edit shipment controls, with /ops/shipments/new/ and /ops/shipments/<uuid>/edit/ mirroring the intake and batch screens. The form requires the fields the buyer's page reads — status, vessel, container, ETD and ETA — and refuses a departure after the arrival. The bill of lading and the forwarder stay optional, and the ports keep their model defaults. A batch that already has a shipment is flagged in the dropdown and warned about after saving rather than blocked, because a split consignment is legitimate. The batch dropdown labels each batch with its own journey status, and a card explains that the two statuses are independent. Also fixes a pre-existing defect the new screen would have shared: the native date inputs were rendered in the en-gb d/m/Y format, which the browser discards, so the intake and batch edit forms silently opened with empty dates. They now carry the ISO format a native date input requires.
37 lines
2.2 KiB
HTML
37 lines
2.2 KiB
HTML
{% extends 'ops/base_ops.html' %}
|
|
{% block title %}Shipment Detail - IXG Operations{% endblock %}
|
|
{% block content %}
|
|
|
|
<div class="page-header d-flex justify-content-between align-items-center">
|
|
<h2>Shipment: {{ shipment.batch.batch_reference }}</h2>
|
|
<div>
|
|
<a href="{% url 'ops:shipment_update' shipment.pk %}" class="btn btn-sm btn-outline-primary"><i class="bi bi-pencil"></i> Edit shipment</a>
|
|
<a href="{% url 'ops:shipment_list' %}" class="btn btn-sm btn-outline-secondary"><i class="bi bi-arrow-left"></i> Back</a>
|
|
</div>
|
|
</div>
|
|
|
|
{% if messages %}
|
|
{% for m in messages %}<div class="alert alert-{{ m.tags }} py-2">{{ m }}</div>{% endfor %}
|
|
{% endif %}
|
|
|
|
<div class="row g-3">
|
|
<div class="col-md-6">
|
|
<div class="stat-card">
|
|
<table class="table table-sm table-borderless mb-0">
|
|
<tr><td class="text-secondary">Batch</td><td><a href="{% url 'ops:batch_detail' shipment.batch.pk %}">{{ shipment.batch.batch_reference }}</a></td></tr>
|
|
<tr><td class="text-secondary">Batch status</td><td><span class="badge bg-secondary badge-status">{{ shipment.batch.get_status_display }}</span></td></tr>
|
|
<tr><td class="text-secondary">Shipment status</td><td><span class="badge bg-secondary badge-status">{{ shipment.get_status_display }}</span></td></tr>
|
|
<tr><td class="text-secondary">Origin Port</td><td>{{ shipment.origin_port }}</td></tr>
|
|
<tr><td class="text-secondary">Destination Port</td><td>{{ shipment.destination_port }}</td></tr>
|
|
<tr><td class="text-secondary">Vessel Name</td><td>{{ shipment.vessel_name|default:'-' }}</td></tr>
|
|
<tr><td class="text-secondary">Container Ref</td><td>{{ shipment.container_ref|default:'-' }}</td></tr>
|
|
<tr><td class="text-secondary">ETD Nigeria</td><td>{{ shipment.etd_nigeria|date:'d/m/Y'|default:'-' }}</td></tr>
|
|
<tr><td class="text-secondary">ETA UK</td><td>{{ shipment.eta_uk|date:'d/m/Y'|default:'-' }}</td></tr>
|
|
<tr><td class="text-secondary">Bill of Lading</td><td>{{ shipment.bl_number|default:'-' }}</td></tr>
|
|
<tr><td class="text-secondary">Freight Forwarder</td><td>{{ shipment.freight_forwarder|default:'-' }}</td></tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|