Merge branch 'main' of https://git.aycode.com/Adam/FruitBankHybridApp
This commit is contained in:
commit
9a3a7174db
|
|
@ -67,5 +67,8 @@ public class ProductDto : MgProductDto, IProductDto
|
|||
set => throw new Exception($"ProductDto.IncomingQuantity not set");
|
||||
}
|
||||
|
||||
[NotColumn, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
||||
public int AvailableQuantity => StockQuantity + IncomingQuantity;
|
||||
|
||||
public bool HasMeasuringValues() => Id > 0 && NetWeight != 0 && IsMeasurable;
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
using Nop.Core.Domain.Catalog;
|
||||
using DataType = LinqToDB.DataType;
|
||||
using FruitBank.Common.Dtos;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace FruitBank.Common.Entities;
|
||||
|
||||
|
|
@ -21,6 +22,12 @@ public class ShippingItem : MgEntityBase, IShippingItem
|
|||
public int? ProductId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// get => ProductDto?.Name ?? Name
|
||||
/// </summary>
|
||||
[NotColumn, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ProductName => ProductDto?.Name ?? Name;
|
||||
|
||||
public int PalletsOnDocument { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
namespace FruitBank.Common.Interfaces;
|
||||
|
||||
public interface IAvailableQuantity
|
||||
{
|
||||
int AvailableQuantity { get; }
|
||||
}
|
||||
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
namespace FruitBank.Common.Interfaces;
|
||||
|
||||
public interface IProductDto : IMgProductDto, ITare, IIncomingQuantity, IMeasuringAttributeValues
|
||||
public interface IProductDto : IMgProductDto, ITare, IIncomingQuantity, IAvailableQuantity, IMeasuringAttributeValues
|
||||
{
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
@bind-Value="@SelectedShippingItem"
|
||||
Text="Select item"
|
||||
ValueFieldName="@nameof(ShippingItem.Id)"
|
||||
TextFieldName="@(nameof(ShippingItem.Name))"
|
||||
TextFieldName="@(nameof(ShippingItem.ProductName))"
|
||||
CssClass="cw-480"
|
||||
SearchMode="ListSearchMode.AutoSearch"
|
||||
SearchFilterCondition="ListSearchFilterCondition.Contains"
|
||||
|
|
@ -133,7 +133,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.Name
|
||||
@SelectedShippingItem.ProductName
|
||||
</h3>
|
||||
|
||||
<DxFormLayout Data="@SelectedShippingItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ namespace FruitBankHybrid.Shared.Pages
|
|||
}
|
||||
|
||||
private static List<ShippingItem>? GetShippingItemsDataSource(Shipping? shipping)
|
||||
=> shipping?.ShippingDocuments?.SelectMany(sd => sd.ShippingItems!).OrderBy(si => si.Name).ToList() ?? null;
|
||||
=> shipping?.ShippingDocuments?.SelectMany(sd => sd.ShippingItems!).OrderBy(si => si.ProductName).ToList() ?? null;
|
||||
|
||||
private async Task OnMeasuringDateChanged(DateTime selectedDateTime)
|
||||
=> await RefreshShippingsFromDb(selectedDateTime);
|
||||
|
|
|
|||
Loading…
Reference in New Issue