diff --git a/FruitBankHybrid.Shared/Components/GridShippingDocument.razor b/FruitBankHybrid.Shared/Components/GridShippingDocument.razor index 08c783a9..2fc79752 100644 --- a/FruitBankHybrid.Shared/Components/GridShippingDocument.razor +++ b/FruitBankHybrid.Shared/Components/GridShippingDocument.razor @@ -43,6 +43,7 @@ + Áru bevételezés @@ -19,8 +21,9 @@ IndicatorAnimationType="WaitIndicatorAnimationType.Spin" Text="Adatok szinkronizálása folyamatban..."> - - + + - - - - - @ctxShipping.DisplayText - - - - - @* - - - @ctxShippingDocument.DisplayText - - - - *@ - - - - @*
- - -
- @ctxShippingitem.DisplayText -
-
- *@ - @ctxShippingitem.DisplayText) -
- - - - -
-
- - - @{ - var sd = SelectedShippingItem?.ShippingDocument; - if (sd != null) - { - var partnerName = sd.Partner?.Name; - - - @($"{partnerName}, {sd.ShippingItems?.Count(si => si.IsMeasured) ?? 0}/{sd.ShippingItems?.Count ?? 0} kész.") - - } - } - -
-
- @if (SelectedShippingItem is { ProductId: > 0 }) - { -

- #@(SelectedShippingItem.ProductId). @(SelectedShippingItem.ProductName) -

- - - - @for (var index = 0; index < (SelectedShippingItem?.ShippingItemPallets?.Count ?? 0); index++) - { - var localI = index + 1; - var currentShippingItemPallet = SelectedShippingItem!.ShippingItemPallets![index]; - - - - } - - - - - TOTAL: - - - Rekesz: @(SelectedShippingItem.MeasuredQuantity) db - Br: @(SelectedShippingItem.MeasuredGrossWeight) kg - Net: @(SelectedShippingItem.MeasuredNetWeight) kg - - - - - @* - - *@ - - @if (!_errorText.IsNullOrWhiteSpace()) - { - - HIBA! @_errorText + + +
+ + + + + +
+
@context.LicencePlate
+ @(MeasurementService.GetMeasuringStatusText(MeasurementService.GetShippingMeasuringStatus(context))) +
+
+ @context.ShippingDate.ToString("yyyy.MM.dd") + @if (!string.IsNullOrWhiteSpace(context.CargoCompany)) + { + — @context.CargoCompany + } +
+ @{ + var allItems = context.ShippingDocuments? + .Where(sd => sd.ShippingItems is not null) + .SelectMany(sd => sd.ShippingItems!); + } + @if (allItems is not null) + { + @foreach (var item in allItems) + { +
+ @item.ProductName — @item.MeasuredQuantity/@item.QuantityOnDocument rekesz +
+ } + } + @if (!string.IsNullOrWhiteSpace(context.Comment)) + { +
+ 📝 @context.Comment +
+ } +
+
+
+
+ +
+ + + + + @ctxShipping.DisplayText + + - //_errorText = string.Empty; - } - - } -
+ +@* + + + @ctxShippingDocument.DisplayText + + + *@ + + + + +@*
+ + +
+ @ctxShippingitem.DisplayText +
+
*@ + @ctxShippingitem.DisplayText) +
+ + + +
+
+ + + @{ + var sd = SelectedShippingItem?.ShippingDocument; + if (sd != null) + { + var partnerName = sd.Partner?.Name; + + + @($"{partnerName}, {sd.ShippingItems?.Count(si => si.IsMeasured) ?? 0}/{sd.ShippingItems?.Count ?? 0} kész.") + + } + } + +
+ +
+ @if (SelectedShippingItem is { ProductId: > 0 }) + { +

+ #@(SelectedShippingItem.ProductId). @(SelectedShippingItem.ProductName) +

+ + + + @for (var index = 0; index < (SelectedShippingItem?.ShippingItemPallets?.Count ?? 0); index++) + { + var localI = index + 1; + var currentShippingItemPallet = SelectedShippingItem!.ShippingItemPallets![index]; + + + + } + + + + + TOTAL: + + + Rekesz: @(SelectedShippingItem.MeasuredQuantity) db + Br: @(SelectedShippingItem.MeasuredGrossWeight) kg + Net: @(SelectedShippingItem.MeasuredNetWeight) kg + + + + + @* + + *@ + + @if (!_errorText.IsNullOrWhiteSpace()) + { + + HIBA! @_errorText + + //_errorText = string.Empty; + } + + } +
+
+ + + +@code { +} diff --git a/FruitBankHybrid.Shared/Pages/MeasuringIn.razor.cs b/FruitBankHybrid.Shared/Pages/MeasuringIn.razor.cs index a774466f..42a9d4b0 100644 --- a/FruitBankHybrid.Shared/Pages/MeasuringIn.razor.cs +++ b/FruitBankHybrid.Shared/Pages/MeasuringIn.razor.cs @@ -3,6 +3,7 @@ using AyCode.Core.Loggers; using DevExpress.Blazor; using FruitBank.Common.Dtos; using FruitBank.Common.Entities; +using FruitBank.Common.Enums; using FruitBank.Common.Helpers; using FruitBank.Common.Interfaces; using FruitBank.Common.Models; @@ -26,6 +27,15 @@ namespace FruitBankHybrid.Shared.Pages private ILogger _logger = null!; private string _errorText; + private enum MeasuringTab + { + DailyTasks = 0, + Measuring = 1 + } + + private MeasuringTab _activeTab = MeasuringTab.DailyTasks; + private IEnumerable _statusFilter = []; + private List NotMeasuredShippings { get; set; } = null!; private Shipping? SelectedShipping { get; set; } //private ShippingDocument? SelectedShippingDocument { get; set; } @@ -37,6 +47,12 @@ namespace FruitBankHybrid.Shared.Pages private List? _shippingItemsDataSource; private List _measuringDates = null!; + private IReadOnlyList FilteredShippings => NotMeasuredShippings is null + ? [] + : _statusFilter.Any() + ? NotMeasuredShippings.Where(s => _statusFilter.Contains(MeasurementService.GetShippingMeasuringStatus(s))).ToList() + : NotMeasuredShippings; + protected override async Task OnInitializedAsync() { LoadingPanelVisible = true; @@ -181,6 +197,20 @@ namespace FruitBankHybrid.Shared.Pages //Nem végezhető el a mérés, nincs megadva a ProductId! Jelezze a vezetőségnek... } + /// + /// Navigates from a card click (Napi feladatok tab) to the Mérés tab with the selected shipping. + /// + private void NavigateToMeasuringTab(Shipping shipping) + { + SelectedShipping = shipping; + + PrepareShippingItems(shipping); + _shippingItemsDataSource = GetShippingItemsDataSource(shipping); + SelectedShippingItem = _shippingItemsDataSource?.FirstOrDefault(); + + _activeTab = MeasuringTab.Measuring; + } + private void PrepareShippingItems(Shipping? shipping) { if (shipping?.ShippingDocuments == null) return; diff --git a/FruitBankHybrid.Shared/Pages/MeasuringOut.razor b/FruitBankHybrid.Shared/Pages/MeasuringOut.razor index 74d9231a..b831cded 100644 --- a/FruitBankHybrid.Shared/Pages/MeasuringOut.razor +++ b/FruitBankHybrid.Shared/Pages/MeasuringOut.razor @@ -48,7 +48,7 @@
- + @@ -73,18 +73,27 @@
#@context.CustomOrderNumber
- @GetOrderStatusText(context.MeasuringStatus) + @(MeasurementService.GetMeasuringStatusText(context.MeasuringStatus))
@context.DateOfReceiptOrCreated.ToString("HH:mm") — @context.Customer.Company
@foreach (var item in context.OrderItemDtos) - { -
- @item.ProductName — @item.TrayQuantity/@item.Quantity rekesz -
- } -
+ { +
+ @item.ProductName — @item.TrayQuantity/@item.Quantity rekesz +
+ } + @{ + var cardOrderNote = MeasurementService.GetOrderNote(context.OrderNotes); + } + @if (!string.IsNullOrWhiteSpace(cardOrderNote)) + { +
+ 📝 @cardOrderNote +
+ } + @@ -169,8 +178,8 @@ } else { - string? orderNote; - if (!(orderNote = SelectedOrder?.OrderNotes.LastOrDefault(x => x.Note.StartsWith('*'))?.Note).IsNullOrWhiteSpace()) + var orderNote = MeasurementService.GetOrderNote(SelectedOrder?.OrderNotes); + if (!string.IsNullOrWhiteSpace(orderNote)) {