add price feature
All checks were successful
/ ls (pull_request) Successful in 1m37s

This commit is contained in:
lubiana 2025-06-29 23:18:23 +02:00
parent 15f8db46a0
commit 64f5341371
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
18 changed files with 484 additions and 157 deletions

View file

@ -39,6 +39,38 @@
</div>
<h2 class="mt-5">Items</h2>
{% if (food_order.isClosed and form) %}
{{ form_start(form) }}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>By</th>
<th>item</th>
<th>extras</th>
<th>price</th>
<th>is paid</th>
</tr>
</thead>
<tbody>
{% for itemForm in form.orderItems %}
<tr>
<td>{{ field_value(itemForm.createdBy) }}</td>
<td>{{ field_value(itemForm.name) }}</td>
<td>{{ field_value(itemForm.extras) }}</td>
<td>{{ form_widget(itemForm.priceCents) }}</td>
<td>{{ form_widget(itemForm.isPaid) }}</td>
</tr>
{% endfor %}
<tr>
<td colspan="4"></td>
<td>{{ form_row(form.save) }} {{ form_row(form._token) }}</td>
</tr>
</tbody>
</table>
</div>
{{ form_end(form, {render_rest: false}) }}
{% else %}
<table class="table table-hover">
<thead class="table-light">
<tr>
@ -68,6 +100,7 @@
{% endfor %}
</tbody>
</table>
{% endif %}
<a class="btn btn-primary mt-2" href="{{ path('app_order_item_new', {'foodOrder': food_order.id}) }}">New Item</a>
{% endblock %}