52 lines
2.3 KiB
HTML
52 lines
2.3 KiB
HTML
{% extends "tenant/layouts/base.html" %}
|
|
{% block title %}Inventory{% endblock %}
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h4 class="fw-bold mb-0"><i class="bi bi-box-seam me-2"></i>Inventory</h4>
|
|
<a href="{{ url_for('inventory.create') }}" class="btn btn-primary btn-sm">+ Add Item</a>
|
|
</div>
|
|
|
|
{% if low_stock %}
|
|
<div class="alert alert-warning d-flex align-items-center mb-3">
|
|
<i class="bi bi-exclamation-triangle-fill me-2"></i>
|
|
<div>
|
|
<strong>{{ low_stock|length }} item(s) at or below reorder level:</strong>
|
|
{{ low_stock|map(attribute='name')|join(', ') }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover mb-0">
|
|
<thead class="table-light">
|
|
<tr><th>Name</th><th>SKU</th><th>Category</th><th>On Hand</th><th>Reorder At</th><th>Cost</th><th>Sale</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in items %}
|
|
<tr class="{{ 'table-warning' if item.qty_on_hand <= item.reorder_level else '' }}">
|
|
<td class="fw-semibold">{{ item.name }}</td>
|
|
<td class="small text-muted font-monospace">{{ item.sku or '—' }}</td>
|
|
<td class="small">{{ item.category or '—' }}</td>
|
|
<td>
|
|
<span class="fw-bold {{ 'text-danger' if item.qty_on_hand <= item.reorder_level else '' }}">
|
|
{{ item.qty_on_hand }}
|
|
</span>
|
|
</td>
|
|
<td class="small">{{ item.reorder_level }}</td>
|
|
<td class="small">{{ '$' ~ "%.2f"|format(item.cost_price) if item.cost_price else '—' }}</td>
|
|
<td class="small">{{ '$' ~ "%.2f"|format(item.sale_price) if item.sale_price else '—' }}</td>
|
|
<td class="d-flex gap-1">
|
|
<a href="{{ url_for('inventory.adjust', item_id=item.id) }}" class="btn btn-outline-primary btn-sm">Adjust</a>
|
|
<a href="{{ url_for('inventory.edit', item_id=item.id) }}" class="btn btn-outline-secondary btn-sm">Edit</a>
|
|
<a href="{{ url_for('inventory.log', item_id=item.id) }}" class="btn btn-outline-secondary btn-sm">Log</a>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="8" class="text-center text-muted py-4">No inventory items yet.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |