Wonky.Client/Wonky.Client/OverlayOffice/OfficeCustomerOrderInventoryReorderOverlay.razor
2023-06-07 17:12:39 +02:00

125 lines
No EOL
6.5 KiB
Text

@* Copyright (C) 2022 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
*@
@using Wonky.Client.Components
@using Wonky.Client.Helpers
<div class="modal" tabindex="-1" role="dialog" style="display:@_modalDisplay">
@* <div class="modal-dialog modal-dialog-scrollable modal-fullscreen-lg-down modal-xl modal-lg"> *@
<div class="modal-dialog modal-dialog-scrollable modal-fullscreen">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">@SalesItem.Name @SalesItem.Sku (@SalesItem.BoxSize stk/colli)</h4>
<button type="button" class="btn btn-danger" @onclick="@Hide" data-bs-dismiss="modal" aria-label="Luk"><i class="bi-x-lg"></i></button>
</div>
<div class="modal-body">
@if (SalesItem.Discontinued)
{
<h3>Udgået produkt</h3>
}
else
{
@* draft line ----------------------------------------------------- *@
<div class="row">
<div class="col">
<table id="draft-line" class="table table-bordered">
<thead>
<tr class="bg-dark text-white">
<th scope="col" colspan="6">BESTILLING</th>
</tr>
<tr>
<th scope="col">Antal</th>
<th scope="col">Pris</th>
<th scope="col">Rabat</th>
<th class="align-content-center justify-content-center" scope="col">SAS</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr>
<td class="align-middle">
<input type="number" class="form-control" @bind-value="SelectedItem.Quantity"/>
</td>
<td class="align-middle">
<div class="input-group">
<input type="number" class="form-control" @bind-value="SelectedItem.Price"/>
</div>
</td>
<td class="align-middle">
<input type="number" class="form-control" @bind-value="SelectedItem.Discount"/>
</td>
<td class="align-middle align-content-center justify-content-center">
<input type="checkbox" class="form-check" @bind-value="SelectedItem.Sas"/>
</td>
<td class="align-middle">
<button type="button" class="btn btn-warning text-nowrap d-block" @onclick="@(() => SendToOrder(SelectedItem))">BESTIL</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
@* end draft line ------------------------------------------------- *@
@* price list item ------------------------------------------------ *@
<div class="row align-middle">
@foreach (var rate in SalesItem.Rates)
{
<div class="col">
<button type="button" class="btn btn-primary btn-sm" data-bs-dismiss="modal" @onclick="@(() => SelectPrice(rate.Quantity, rate.Rate))">
@rate.Quantity <i class="bi-at"></i> @rate.Rate/stk
</button>
</div>
}
</div>
@* end price list item -------------------------------------------- *@
}
@* product history ------------------------------------------------ *@
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Dato</th>
<th scope="col">Antal</th>
<th scope="col">Rabat</th>
<th scope="col">Pris</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach (var entry in ProductHistory)
{
<tr>
<td class="align-middle">@entry.DeliveryDate</td>
<td class="align-middle">@entry.Quantity</td>
<td class="align-middle">@entry.Discount</td>
<td class="align-middle">@entry.Price</td>
<td class="align-middle">
@if (!SalesItem.Discontinued)
{
<button type="button" class="btn btn-primary btn-sm" data-bs-dismiss="modal" @onclick="@(() => SelectHistory(entry))"><i class="bi-plus"></i> VÆLG</button>
}
</td>
</tr>
}
</tbody>
</table>
@* end product history -------------------------------------------- *@
</div>
</div>
</div>
</div>
@if (_showBackdrop)
{
<div class="modal-backdrop fade show"></div>
}