This commit is contained in:
lubiana 2025-06-09 19:56:08 +02:00
parent 66c4c1fe4f
commit 2c2e34b71e
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
42 changed files with 910 additions and 939 deletions

View file

@ -8,9 +8,6 @@
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>CreatedAt</th>
<th>UpdatedAt</th>
<th>Name</th>
<th>Description</th>
<th>DesiredStock</th>
@ -22,9 +19,6 @@
{% for drink_stock in drink_stocks %}
{% set drink_type = drink_stock.record.drinkType %}
<tr>
<td>{{ drink_type.id }}</td>
<td>{{ drink_type.createdAt ? drink_type.createdAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ drink_type.updatedAt ? drink_type.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ drink_type.name }}</td>
<td>{{ drink_type.description }}</td>
<td>{{ drink_type.desiredStock }}</td>
@ -36,7 +30,7 @@
</tr>
{% else %}
<tr>
<td colspan="7">no records found</td>
<td colspan="5">no records found</td>
</tr>
{% endfor %}
</tbody>

View file

@ -1,42 +1,157 @@
{% extends 'base.html.twig' %}
{% block title %}DrinkType{% endblock %}
{% block title %}{{ drink_type.name }}{% endblock %}
{% block body %}
<h1>DrinkType</h1>
<div class="container">
<h1>{{ drink_type.name }}</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ drink_type.id }}</td>
</tr>
<tr>
<th>CreatedAt</th>
<td>{{ drink_type.createdAt ? drink_type.createdAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>UpdatedAt</th>
<td>{{ drink_type.updatedAt ? drink_type.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ drink_type.name }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ drink_type.description }}</td>
</tr>
<tr>
<th>DesiredStock</th>
<td>{{ drink_type.desiredStock }}</td>
</tr>
</tbody>
</table>
<div class="row mb-4">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-title">Drink Details</h5>
</div>
<div class="card-body">
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ drink_type.id }}</td>
</tr>
<tr>
<th>CreatedAt</th>
<td>{{ drink_type.createdAt ? drink_type.createdAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>UpdatedAt</th>
<td>{{ drink_type.updatedAt ? drink_type.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ drink_type.name }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ drink_type.description }}</td>
</tr>
<tr>
<th>DesiredStock</th>
<td>{{ drink_type.desiredStock }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<a href="{{ path('app_drink_type_index') }}">back to list</a>
<div class="row mb-4">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-title">Orders Containing This Drink</h5>
</div>
<div class="card-body">
{% if order_items|length > 0 %}
<table class="table table-striped">
<thead>
<tr>
<th>Order ID</th>
<th>Date</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
{% for item in order_items %}
<tr>
<td>{{ item.order.id }}</td>
<td>{{ item.order.createdAt|date('Y-m-d H:i:s') }}</td>
<td>{{ item.quantity }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No orders found for this drink.</p>
{% endif %}
</div>
</div>
</div>
</div>
<a href="{{ path('app_drink_type_edit', {'id': drink_type.id}) }}">edit</a>
<div class="row mb-4">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-title">Inventory History</h5>
</div>
<div class="card-body">
{% if inventory_records|length > 0 %}
<table class="table table-striped">
<thead>
<tr>
<th>Date</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
{% for record in inventory_records %}
<tr>
<td>{{ record.createdAt|date('Y-m-d H:i:s') }}</td>
<td>{{ record.quantity }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No inventory history found for this drink.</p>
{% endif %}
</div>
</div>
</div>
</div>
{{ include('drink_type/_delete_form.html.twig') }}
<div class="row mb-4">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-title">Desired Stock History</h5>
</div>
<div class="card-body">
{% if desired_stock_history|length > 0 %}
<table class="table table-striped">
<thead>
<tr>
<th>Date</th>
<th>Old Value</th>
<th>New Value</th>
</tr>
</thead>
<tbody>
{% for log in desired_stock_history %}
<tr>
<td>{{ log.changeDate|date('Y-m-d H:i:s') }}</td>
<td>{{ log.oldValue }}</td>
<td>{{ log.newValue }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No desired stock history found for this drink.</p>
{% endif %}
</div>
</div>
</div>
</div>
<div class="row mb-4">
<div class="col-md-12">
<a href="{{ path('app_drink_type_index') }}" class="btn btn-secondary">Back to list</a>
<a href="{{ path('app_drink_type_edit', {'id': drink_type.id}) }}" class="btn btn-primary">Edit</a>
{{ include('drink_type/_delete_form.html.twig') }}
</div>
</div>
</div>
{% endblock %}