diff --git a/Wonky.Client/Components/CustomerInventoryListComponent.razor b/Wonky.Client/Components/CustomerInventoryListComponent.razor index e24ad16c..35ec2ba1 100644 --- a/Wonky.Client/Components/CustomerInventoryListComponent.razor +++ b/Wonky.Client/Components/CustomerInventoryListComponent.razor @@ -84,7 +84,10 @@
- @product.Description +
+ Produkt Info @product.Description +
+
diff --git a/Wonky.Client/Components/ProductPriceListComponent.razor b/Wonky.Client/Components/ProductPriceListComponent.razor index 94d632bf..5ea09682 100644 --- a/Wonky.Client/Components/ProductPriceListComponent.razor +++ b/Wonky.Client/Components/ProductPriceListComponent.razor @@ -36,16 +36,10 @@ onerror="this.onerror=null;this.src='@(_config.AssetUrl)/images/no-image.png?height=100'" alt="@salesItem.Name"/> - - @salesItem.Name - + @salesItem.Name @salesItem.ShortName - - @salesItem.Sku - - - @salesItem.BoxSize - + @salesItem.Sku + @salesItem.BoxSize
- + @if (Working) { diff --git a/Wonky.Client/Pages/CatalogCountryProductPage.razor b/Wonky.Client/Pages/CatalogCountryProductPage.razor index 59d99534..5b68f11f 100644 --- a/Wonky.Client/Pages/CatalogCountryProductPage.razor +++ b/Wonky.Client/Pages/CatalogCountryProductPage.razor @@ -1,6 +1,6 @@ @using Wonky.Client.Components @using System.Text.Json -@page "/catalog/{CountryCode}/{sku}" +@page "/catalog/item/{SalesItemId}"

CatalogCountryProductPage

diff --git a/Wonky.Client/Pages/CatalogCountryProductPage.razor.cs b/Wonky.Client/Pages/CatalogCountryProductPage.razor.cs index ac5b6bf3..766902c3 100644 --- a/Wonky.Client/Pages/CatalogCountryProductPage.razor.cs +++ b/Wonky.Client/Pages/CatalogCountryProductPage.razor.cs @@ -15,11 +15,10 @@ public partial class CatalogCountryProductPage [Inject] public ICountryCatalogRepository Catalog { get; set; } // ############################################################## - [Parameter] public string CountryCode { get; set; } = ""; - [Parameter] public string Sku { get; set; } = ""; + [Parameter] public string SalesItemId { get; set; } = ""; // ############################################################## - private SalesItemView _item = new(); + private ProductDetailView _item = new(); private bool _working = true; protected override async Task OnInitializedAsync() @@ -27,7 +26,7 @@ public partial class CatalogCountryProductPage Interceptor.RegisterEvent(); Interceptor.RegisterBeforeSendEvent(); - _item = await Catalog.GetSalesItemSku(CountryCode, Sku); + _item = await Catalog.GetProductDetailView(SalesItemId); _working = false; } } \ No newline at end of file diff --git a/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs b/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs index 3669681c..9692a4e8 100644 --- a/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs +++ b/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs @@ -205,15 +205,15 @@ public partial class OfficeOrderCreatePage : IDisposable } - private async Task PriceListCallback(SelectedSku sku) + private async Task PriceListCallback(ItemSelect selectedItem) { // get selected item - if (string.IsNullOrWhiteSpace(sku.ItemId)) + if (string.IsNullOrWhiteSpace(selectedItem.ItemNo)) return; - SelectedItem = await Catalog.GetSalesItemId(CountryCode, sku.ItemId); + SelectedItem = await Catalog.GetSalesItemSku(CountryCode, selectedItem.ItemNo); ShowItem = true; - Price = sku.Rate; - Quantity = sku.Quantity; + Price = selectedItem.Rate; + Quantity = selectedItem.Quantity; StateHasChanged(); } diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index 54c5adfe..4a80d975 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,7 +1,7 @@ { "appInfo": { "name": "Wonky Online", - "version": "203.0", + "version": "205.0", "rc": true, "sandBox": true, "image": "grumpy-coder.png", diff --git a/Wonky.Entity/Views/ProductDetailView.cs b/Wonky.Entity/Views/ProductDetailView.cs new file mode 100644 index 00000000..e81f33a0 --- /dev/null +++ b/Wonky.Entity/Views/ProductDetailView.cs @@ -0,0 +1,38 @@ +// 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 System.Collections.Generic; + +namespace Wonky.Entity.Views; + +public class ProductDetailView +{ + public string Name { get; set; } = ""; + public string Sku { get; set; } = ""; + public string VendorItemNo { get; set; } = ""; + public string ShortName { get; set; } = ""; + public string PictureLink { get; set; } = ""; + public string ProductGroup { get; set; } = ""; + public bool Discontinued { get; set; } + public int BoxSize { get; set; } + public List Documents { get; set; } = new(); +} + +public class DocumentView +{ + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + public string DocumentTypeEnum { get; set; } = ""; +} \ No newline at end of file diff --git a/Wonky.Entity/Views/ProductInventoryItemView.cs b/Wonky.Entity/Views/ProductInventoryItemView.cs index 3ae7c600..307b8f37 100644 --- a/Wonky.Entity/Views/ProductInventoryItemView.cs +++ b/Wonky.Entity/Views/ProductInventoryItemView.cs @@ -29,4 +29,5 @@ public class ProductInventoryItemView public string LastInvoiceDate { get; set; } = ""; public string Sku { get; set; } = ""; public string VendorItemNo { get; set; } = ""; + public string SalesItemId { get; set; } = ""; } \ No newline at end of file