improvements, fixes

This commit is contained in:
Loretta 2025-11-01 00:42:54 +01:00
parent 3a8324cace
commit f9cb10556a
9 changed files with 29 additions and 11 deletions

View File

@ -4,6 +4,7 @@ using FruitBank.Common;
using FruitBank.Common.Loggers;
using FruitBankHybrid.Shared.Services.SignalRs;
using Nop.Core.Domain.Orders;
using Nop.Core.Domain.Payments;
namespace FruitBankHybrid.Shared.Tests;
@ -70,7 +71,7 @@ public sealed class OrderClientTests
Assert.IsNotNull(orderDtosForMeasuring);
//Assert.IsTrue(orderDtosForMeasuring.Any(x=>x.Id ==51));
Assert.IsTrue(orderDtosForMeasuring.All(o => o.OrderStatus == OrderStatus.Pending));
Assert.IsTrue(orderDtosForMeasuring.All(o => o.PaymentStatus < PaymentStatus.Paid));
Assert.IsTrue(orderDtosForMeasuring.Count != 0);
}

View File

@ -21,7 +21,7 @@
<DxGridDataColumn FieldName="MeasurementOwnerId" />
<DxGridDataColumn FieldName="DateOfReceipt" />
<DxGridDataColumn FieldName="CreatedOnUtc" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="110"></DxGridCommandColumn>
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>
@if (IsMasterGrid)

View File

@ -35,7 +35,7 @@
<DxGridDataColumn FieldName="IsMeasurable" />
<DxGridDataColumn FieldName="IsMeasured" />
<DxGridDataColumn FieldName="IsAudited" />
<DxGridCommandColumn Visible="IsMasterGrid" Width="120"></DxGridCommandColumn>
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>
<GridDetailOrderItemPallets OrderItemPallets="((OrderItemDto)context.DataItem).OrderItemPallets" />

View File

@ -25,7 +25,7 @@
<DxGridDataColumn FieldName="IsMeasured" />
<DxGridDataColumn FieldName="IsAudited" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="110"></DxGridCommandColumn>
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<GroupSummary>
<DxGridSummaryItem SummaryType="GridSummaryItemType.Sum"

View File

@ -19,7 +19,7 @@
<DxGridDataColumn FieldName="IncomingQuantity" />
<DxGridDataColumn FieldName="NetWeight" />
<DxGridDataColumn FieldName="IsMeasurable" />
<DxGridCommandColumn Visible="!IsMasterGrid"></DxGridCommandColumn>
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>
@if (IsMasterGrid)

View File

@ -22,7 +22,7 @@
<DxGridDataColumn FieldName="Comment" />
<DxGridDataColumn FieldName="Created" />
<DxGridDataColumn FieldName="Modified" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="110"></DxGridCommandColumn>
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>
@if (IsMasterGrid)

View File

@ -35,7 +35,7 @@
<DxGridDataColumn FieldName="Created" />
<DxGridDataColumn FieldName="Modified" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="110"></DxGridCommandColumn>
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>
@* <GridDetailOrderItemPallets OrderItemPallets="((OrderItemDto)context.DataItem).OrderItemPallets" /> *@

View File

@ -110,6 +110,11 @@
*@
<span class="@(ctxShippingitem.DataItem.IsMeasured ? "text-success" : "")">@ctxShippingitem.DisplayText)</span>
</ItemDisplayTemplate>
<Buttons>
<DxEditorButton IconCssClass="editor-icon editor-icon-add" Text="R" Tooltip="Adatok frissítése..."
Click="() => OnOrdersRefreshClick()" />
</Buttons>
</DxComboBox>
</DxFormLayoutItem>
@ -133,7 +138,7 @@
@if (SelectedShippingItem is { ProductId: > 0 })
{
<h3 style="margin-bottom: 30px;" class="@(SelectedShippingItem.IsMeasured && SelectedShippingItem.ShippingItemPallets!.All(x => x.IsMeasuredAndValid(SelectedShippingItem.IsMeasurable)) ? "text-success" : "")">
@SelectedShippingItem.ProductName
#@(SelectedShippingItem.ProductId). @(SelectedShippingItem.ProductName)
</h3>
<DxFormLayout Data="@SelectedShippingItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">

View File

@ -57,6 +57,10 @@ namespace FruitBankHybrid.Shared.Pages
NotMeasuredShippings = shippings.Where(shipping => MeasurementService.DaysEqual(shipping.ShippingDate.Date, dateTime)).ToList();
SelectedShipping = NotMeasuredShippings.FirstOrDefault();
//if (SelectedShipping != null && SelectedShippingItem != null && (SelectedShippingItem.ShippingDocument?.ShippingId ?? 0) == SelectedShipping.Id)
//{
// SelectedShippingItem = _shippingItemsDataSource.
//}
LoadingPanelVisible = false;
}
@ -130,6 +134,13 @@ namespace FruitBankHybrid.Shared.Pages
StateHasChanged();
}
private async Task OnOrdersRefreshClick()
{
LoadingPanelVisible = true;
await RefreshShippingsFromDb(SelectedShipping?.ShippingDate ?? DateTime.Now);
StateHasChanged();
}
private Task OnShippingItemPalletValueChanged(ShippingItemPallet shippingItemPallet, ShippingItem shippingItem)
{
@ -140,17 +151,18 @@ namespace FruitBankHybrid.Shared.Pages
return Task.CompletedTask;
}
private Task OnShippingItemPalletSaved(ShippingItemPallet? responseShippingItemPallet)
private async Task OnShippingItemPalletSaved(ShippingItemPallet? responseShippingItemPallet)
{
if (responseShippingItemPallet != null)
{
SelectedShippingItem!.ShippingItemPallets!.UpdateCollection(responseShippingItemPallet, false);
SelectedShippingItem.IsMeasured = SelectedShippingItem!.ShippingItemPallets!.All(sip => sip.IsMeasuredAndValid(SelectedShippingItem.IsMeasurable));
MeasuringValuesHelper.SetShippingItemTotalMeasuringValues(SelectedShippingItem);
}
else DisplayErrorText($"Sikertelen volt a raklap adatainak mentése!");
StateHasChanged();
return Task.CompletedTask;
await InvokeAsync(StateHasChanged);
}
private bool IsShippingitemPalletMeasuredAndValid(ShippingItemPallet shippingItemPallet)