Added order item comment

This commit is contained in:
2025-11-30 16:05:31 +01:00
parent 7098530cf4
commit 90306e8944
8 changed files with 492 additions and 21 deletions

View File

@@ -54,6 +54,11 @@
<input type="number" class="form-control" id="quantity" name="quantity" value="1" min="1" required>
</div>
<div class="mb-3">
<label for="comments" class="form-label">@Localizer["Comments"]</label>
<input class="form-control" id="comments" name="comments"></input>
</div>
<div class="alert alert-info">
<strong>@Localizer["Total"]:</strong> @Html.Raw(Localizer["Currency", "<span id=\"totalPrice\">0.00</span>"])
</div>
@@ -78,27 +83,37 @@
<div class="card-body">
@if (Model.OrderItems.Any())
{
<table class="table table-sm table-hover">
<thead>
<tr>
<th>@Localizer["Participant"]</th>
<th>@Localizer["Item"]</th>
<th>@Localizer["Qty"]</th>
<th>@Localizer["Total"]</th>
</tr>
</thead>
<tbody>
@foreach (var orderItem in Model.OrderItems)
{
<div class="table-responsive">
<table class="table table-sm table-hover">
<thead>
<tr>
<td>@orderItem.ParticipantName</td>
<td>@orderItem.MenuItem?.Name</td>
<td>@orderItem.Quantity</td>
<td>@Localizer["Currency", (orderItem.MenuItem?.Price * orderItem.Quantity ?? 0).ToString("F2")]</td>
<th>@Localizer["Person"]</th>
<th>@Localizer["Item"]</th>
<th>@Localizer["Qty"]</th>
@if (Model.OrderItems.Any(oi => !string.IsNullOrEmpty(oi.Comments)))
{
<th>@Localizer["Comments"]</th>
}
<th>@Localizer["Total"]</th>
</tr>
}
</tbody>
</table>
</thead>
<tbody>
@foreach (var orderItem in Model.OrderItems)
{
<tr>
<td>@orderItem.ParticipantName</td>
<td>@orderItem.MenuItem?.Name</td>
<td>@orderItem.Quantity</td>
@if (Model.OrderItems.Any(oi => !string.IsNullOrEmpty(oi.Comments)))
{
<td style="word-break: break-word;">@orderItem.Comments</td>
}
<td>@Localizer["Currency", (orderItem.MenuItem?.Price * orderItem.Quantity ?? 0).ToString("F2")]</td>
</tr>
}
</tbody>
</table>
</div>
<hr>