96 lines
4.4 KiB
HTML
96 lines
4.4 KiB
HTML
<!-- templates/purchase_orders/po_detail.html -->
|
|
{% extends "base.html" %}
|
|
{% load static i18n %}
|
|
{% block title %}
|
|
{{ po.po_number }} - Purchase Order - {{ block.super }}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
<h2>Purchase Order: {{ po.po_number }}</h2>
|
|
<p><strong>Status:</strong>
|
|
<span class="">
|
|
{{ po.po_status }}
|
|
</span>
|
|
</p>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<dl class="row">
|
|
<dt class="col-sm-4">Supplier</dt>
|
|
<dd class="col-sm-8">{{ po.supplier.name }}</dd>
|
|
|
|
<dt class="col-sm-4">Created At</dt>
|
|
<dd class="col-sm-8">{{ po.created|date:"M d, Y H:i" }}</dd>
|
|
|
|
<dt class="col-sm-4">Total Amount</dt>
|
|
<dd class="col-sm-8">${{ po.total_amount|floatformat:2 }}</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<h4 class="mt-4">Ordered Items</h4>
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Item Number</th>
|
|
<th>Item</th>
|
|
<th>Unit of Measure</th>
|
|
<th>Account</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in inventory_items %}
|
|
<tr>
|
|
<td>{{ item.item_number }}</td>
|
|
<td>{{ item.name }}</td>
|
|
<td>${{ item.uom.name }}</td>
|
|
<td>${{ item.inventory_account }}</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="4" class="text-center">No items found.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="mt-3">
|
|
|
|
|
|
<button class="btn btn-phoenix-primary" data-bs-toggle="modal" data-bs-target="#POModal"><span class="d-none d-sm-inline-block"><i class="fa-solid fa-receipt"></i> {% trans 'View Purchase Order' %}</span></button>
|
|
<a href="{% url 'purchase_order_list' request.dealer.slug request.dealer.entity.slug %}" class="btn btn-phoenix-secondary">Back to List</a>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="POModal" data-bs-keyboard="true" tabindex="-1" aria-labelledby="POModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
|
|
<h4 class="mb-0 me-2 text-primary"><i class="fas text-info ms-2"></i></h4>
|
|
<button class="btn p-0 text-body-quaternary fs-6" data-bs-dismiss="modal" aria-label="Close"><span class="fas fa-times"></span></button>
|
|
</div>
|
|
<div class="modal-body p-4">
|
|
<form action="{% url 'inventory_item_create' po.pk %}" method="post">
|
|
{% csrf_token %}
|
|
{% include "purchase_orders/partials/po-select.html" with name="make" target="model" data=make_data pk=po.pk %}
|
|
{% include "purchase_orders/partials/po-select.html" with name="model" target="serie" data=model_data pk=po.pk %}
|
|
{% include "purchase_orders/partials/po-select.html" with name="serie" target="trim" data=serie_data pk=po.pk %}
|
|
{% include "purchase_orders/partials/po-select.html" with name="trim" target="none" data=trim_data pk=po.pk %}
|
|
<div class="form-group">
|
|
<label for="account">Account</label>
|
|
<select class="form-control" name="account" id="account">
|
|
{% for account in inventory_accounts %}
|
|
<option value="{{ account.pk }}">{{ account }}"></option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="quantity">Quantity</label>
|
|
<input type="number" class="form-control" id="quantity" name="quantity" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-phoenix-primary">Add New Item To Inventory</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|