173 lines
9.4 KiB
HTML
173 lines
9.4 KiB
HTML
{% extends "module_base.html" %}
|
|
{% load static %}
|
|
{% load indonesian_filters %}
|
|
|
|
{% block title %}Bill of Material Details{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4 class="card-title mb-0">
|
|
<i class="fas fa-cogs me-2"></i>Bill of Material Details
|
|
</h4>
|
|
<div class="card-tools">
|
|
<a href="{% url 'manufacturing:edit_bom' bom.id %}" class="btn btn-warning btn-sm">
|
|
<i class="fas fa-edit me-1"></i>Edit
|
|
</a>
|
|
<a href="{% url 'manufacturing:delete_bom' bom.id %}" class="btn btn-danger btn-sm">
|
|
<i class="fas fa-trash me-1"></i>Delete
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<!-- BOM Header Information -->
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<table class="table table-borderless">
|
|
<tr>
|
|
<th class="text-muted">BOM Code:</th>
|
|
<td>{{ bom.bom_code }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="text-muted">Product:</th>
|
|
<td>{{ bom.product.name }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="text-muted">Version:</th>
|
|
<td>{{ bom.version }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<table class="table table-borderless">
|
|
<tr>
|
|
<th class="text-muted">Status:</th>
|
|
<td>
|
|
{% if bom.is_active %}
|
|
<span class="badge bg-success">Active</span>
|
|
{% else %}
|
|
<span class="badge bg-secondary">Inactive</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="text-muted">Created:</th>
|
|
<td>{{ bom.created_at|date:"d M Y H:i" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="text-muted">Updated:</th>
|
|
<td>{{ bom.updated_at|date:"d M Y H:i" }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- BOM Items -->
|
|
<div class="card mt-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Components</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if bom.bomitem_set.exists %}
|
|
<div class="table-responsive">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Component</th>
|
|
<th>Quantity</th>
|
|
<th>Unit of Measure</th>
|
|
<th>Unit Cost</th>
|
|
<th>Total Cost</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in bom.bomitem_set.all %}
|
|
<tr>
|
|
<td>{{ item.component.name }}</td>
|
|
<td>{{ item.quantity|floatformat:2 }}</td>
|
|
<td>{{ item.unit_of_measure.name }}</td>
|
|
<td>{{ item.component.cost|format_rupiah }}</td>
|
|
<td>{{ item.total_cost|format_rupiah }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr class="table-info">
|
|
<th colspan="4" class="text-end">Total Cost:</th>
|
|
<th>{{ bom.total_cost|format_rupiah }}</th>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="text-muted">No components defined for this BOM.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Manufacturing Orders using this BOM -->
|
|
<div class="card mt-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Manufacturing Orders</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if bom.manufacturingorder_set.exists %}
|
|
<div class="table-responsive">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>MO Number</th>
|
|
<th>Quantity to Produce</th>
|
|
<th>Status</th>
|
|
<th>Start Date</th>
|
|
<th>End Date</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for mo in bom.manufacturingorder_set.all %}
|
|
<tr>
|
|
<td>{{ mo.mo_number }}</td>
|
|
<td>{{ mo.quantity_to_produce|floatformat:2 }}</td>
|
|
<td>
|
|
{% if mo.status == 'scheduled' %}
|
|
<span class="badge bg-warning">Scheduled</span>
|
|
{% elif mo.status == 'in_progress' %}
|
|
<span class="badge bg-primary">In Progress</span>
|
|
{% elif mo.status == 'completed' %}
|
|
<span class="badge bg-success">Completed</span>
|
|
{% elif mo.status == 'cancelled' %}
|
|
<span class="badge bg-danger">Cancelled</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ mo.scheduled_start_date|date:"d M Y" }}</td>
|
|
<td>{{ mo.scheduled_end_date|date:"d M Y" }}</td>
|
|
<td>
|
|
<a href="{% url 'manufacturing:mo_detail' mo.mo_number %}" class="btn btn-info btn-sm">
|
|
<i class="fas fa-eye"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="text-muted">No manufacturing orders using this BOM.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer">
|
|
<a href="{% url 'manufacturing:bom_list' %}" class="btn btn-secondary">
|
|
<i class="fas fa-arrow-left me-2"></i>Back to List
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |