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 @@
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 |
@foreach (var rate in salesItem.Rates)
diff --git a/Wonky.Client/Components/ProductPriceListComponent.razor.cs b/Wonky.Client/Components/ProductPriceListComponent.razor.cs
index 3895044a..8d728440 100644
--- a/Wonky.Client/Components/ProductPriceListComponent.razor.cs
+++ b/Wonky.Client/Components/ProductPriceListComponent.razor.cs
@@ -24,10 +24,16 @@ namespace Wonky.Client.Components;
public partial class ProductPriceListComponent
{
- [Parameter] public List ItemList { get; set; } = new();
- [Inject] public IToastService ToastService { get; set; }
+ // ##############################################################
[Inject] private IOptions Config { get; set; }
+
+ // ##############################################################
+ [Parameter] public List ItemList { get; set; } = new();
+
+ // ##############################################################
private ApiConfig _config = new();
+
+
protected override void OnInitialized()
{
_config = Config.Value;
diff --git a/Wonky.Client/HttpRepository/CountryCatalogRepository.cs b/Wonky.Client/HttpRepository/CountryCatalogRepository.cs
index 2d262bfd..e1e7346e 100644
--- a/Wonky.Client/HttpRepository/CountryCatalogRepository.cs
+++ b/Wonky.Client/HttpRepository/CountryCatalogRepository.cs
@@ -48,6 +48,20 @@ public class CountryCatalogRepository : ICountryCatalogRepository
_api = configuration.Value;
}
+
+ ///
+ /// Complete catalog for print country
+ ///
+ ///
+ ///
+ public async Task> GetPriceList(string countryCode)
+ {
+ var result = await _client.GetFromJsonAsync>(
+ $"{_api.Catalog}/{countryCode}", _options);
+ return result ?? new List();
+ }
+
+
///
/// Get a paged sales item list
///
@@ -89,19 +103,6 @@ public class CountryCatalogRepository : ICountryCatalogRepository
}
- ///
- /// Get sales item by id
- ///
- ///
- ///
- ///
- public async Task GetSalesItemId(string countryCode, string salesItemId)
- {
- var salesItem = await _client
- .GetFromJsonAsync($"{_api.Catalog}/{countryCode}/{salesItemId}");
- return salesItem ?? new SalesItemView();
- }
-
///
/// Overload Get sales item by sku and country code
///
@@ -114,28 +115,29 @@ public class CountryCatalogRepository : ICountryCatalogRepository
return salesItem ?? new SalesItemView();
}
+
+ ///
+ /// Get sales item by id
+ ///
+ ///
+ ///
+ public async Task GetProductDetailView(string salesItemId)
+ {
+ var detailView = await _client
+ .GetFromJsonAsync($"{_api.Catalog}/{salesItemId}");
+ return detailView ?? new ProductDetailView();
+ }
+
+
///
/// Get sales item by variant id
///
- ///
///
///
- public async Task GetSalesVariantId(string countryCode, string variantId)
+ public async Task GetVariantDetailView(string variantId)
{
- var salesItem = await _client
- .GetFromJsonAsync($"{_api.Catalog}/{countryCode}/variant/{variantId}");
- return salesItem ?? new SalesItemView();
- }
-
- ///
- /// Complete catalog for print country
- ///
- ///
- ///
- public async Task> GetPriceList(string countryCode)
- {
- var result = await _client.GetFromJsonAsync>(
- $"{_api.Catalog}/{countryCode}", _options);
- return result ?? new List();
+ var detailView = await _client
+ .GetFromJsonAsync($"{_api.Catalog}/variant/{variantId}");
+ return detailView ?? new ProductDetailView();
}
}
\ No newline at end of file
diff --git a/Wonky.Client/HttpRepository/ICountryCatalogRepository.cs b/Wonky.Client/HttpRepository/ICountryCatalogRepository.cs
index 75478edb..366ca6b3 100644
--- a/Wonky.Client/HttpRepository/ICountryCatalogRepository.cs
+++ b/Wonky.Client/HttpRepository/ICountryCatalogRepository.cs
@@ -24,6 +24,14 @@ namespace Wonky.Client.HttpRepository;
///
public interface ICountryCatalogRepository
{
+ ///
+ /// Complete catalog for print country
+ ///
+ ///
+ ///
+ Task> GetPriceList(string countryCode);
+
+
///
/// Get a paged sales item list
///
@@ -32,14 +40,7 @@ public interface ICountryCatalogRepository
///
Task> GetSalesItemsPaged(string countryCode, CatalogPager pager);
- ///
- /// Get sales item by id
- ///
- ///
- ///
- ///
- Task GetSalesItemId(string countryCode, string salesItemId);
-
+
///
/// Overload Get sales item by sku and country code
///
@@ -48,18 +49,19 @@ public interface ICountryCatalogRepository
///
Task GetSalesItemSku(string countryCode, string sku);
+
+ ///
+ /// Get sales item by id
+ ///
+ ///
+ ///
+ Task GetProductDetailView(string salesItemId);
+
+
///
/// Get sales item by variant id
///
- ///
///
///
- Task GetSalesVariantId(string countryCode, string variantId);
-
- ///
- /// Complete catalog for print country
- ///
- ///
- ///
- Task> GetPriceList(string countryCode);
+ Task GetVariantDetailView(string variantId);
}
\ No newline at end of file
diff --git a/Wonky.Client/Local.Services/CabinetDrawerService.cs b/Wonky.Client/Local.Services/CabinetDrawerService.cs
index 0cb88f62..f1d03cff 100644
--- a/Wonky.Client/Local.Services/CabinetDrawerService.cs
+++ b/Wonky.Client/Local.Services/CabinetDrawerService.cs
@@ -7,10 +7,11 @@ namespace Wonky.Client.Local.Services;
public class CabinetDrawerService : ICabinetDrawerService
{
- private readonly JsonSerializerOptions _options = new ()
+ private readonly JsonSerializerOptions _options = new()
{
PropertyNameCaseInsensitive = true
};
+
private readonly ILogger _logger;
private readonly ILocalStorageService _asyncStorageService;
private readonly IAdvisorActivityRepository _activityRepo;
@@ -30,9 +31,9 @@ public class CabinetDrawerService : ICabinetDrawerService
public CabinetDrawerService(
ILogger logger,
ILocalStorageService asyncStorageService,
- ICountryCatalogRepository catalogRepo,
- IAdvisorCustomerHistoryRepository historyRepo,
- IAdvisorCustomerRepository customerRepo,
+ ICountryCatalogRepository catalogRepo,
+ IAdvisorCustomerHistoryRepository historyRepo,
+ IAdvisorCustomerRepository customerRepo,
IAdvisorActivityRepository activityRepo)
{
_logger = logger;
@@ -65,7 +66,7 @@ public class CabinetDrawerService : ICabinetDrawerService
return drawer ?? new ActivityDrawer();
}
-
+
///
/// Sales Catalog
///
@@ -76,7 +77,7 @@ public class CabinetDrawerService : ICabinetDrawerService
{
var drawer = await _asyncStorageService
.GetItemAsync($"{countryCode}.{CatalogDrawer.Label}");
-
+
if (drawer == null) force = true;
if (!force) return drawer ?? new CatalogDrawer();
var result = await _catalogRepo.GetPriceList(countryCode);
@@ -89,7 +90,7 @@ public class CabinetDrawerService : ICabinetDrawerService
return drawer ?? new CatalogDrawer();
}
-
+
///
/// Company Info
///
@@ -100,7 +101,7 @@ public class CabinetDrawerService : ICabinetDrawerService
{
var drawer = await _asyncStorageService
.GetItemAsync($"{companyId}.{InfoDrawer.Label}");
-
+
if (drawer == null) force = true;
if (!force) return drawer ?? new InfoDrawer();
var result = await _customerRepo.GetCompanyById(companyId);
@@ -112,7 +113,7 @@ public class CabinetDrawerService : ICabinetDrawerService
await StoreInfoDrawerAsync(companyId, drawer);
return drawer ?? new InfoDrawer();
}
-
+
///
/// Inventory
@@ -124,7 +125,7 @@ public class CabinetDrawerService : ICabinetDrawerService
{
var drawer = await _asyncStorageService
.GetItemAsync($"{companyId}.{InventoryDrawer.Label}");
-
+
if (drawer == null) force = true;
if (!force) return drawer ?? new InventoryDrawer();
var result = await _historyRepo.GetInventory(companyId);
@@ -136,7 +137,7 @@ public class CabinetDrawerService : ICabinetDrawerService
await StoreInventoryDrawerAsync(companyId, drawer);
return drawer ?? new InventoryDrawer();
}
-
+
///
/// Invoices
@@ -159,8 +160,8 @@ public class CabinetDrawerService : ICabinetDrawerService
await StoreInvoiceDrawerAsync(companyId, drawer);
return drawer ?? new InvoiceDrawer();
}
-
-
+
+
///
/// Statistic (invoice lines)
///
@@ -171,7 +172,7 @@ public class CabinetDrawerService : ICabinetDrawerService
{
var drawer = await _asyncStorageService
.GetItemAsync($"{companyId}.{StatisticDrawer.Label}");
-
+
if (drawer == null) force = true;
if (!force) return drawer ?? new StatisticDrawer();
var result = await _historyRepo.GetProductInvoiceLines(companyId);
@@ -205,10 +206,11 @@ public class CabinetDrawerService : ICabinetDrawerService
{
drawer.Content = drawer.Content.OrderByDescending(x => x.OrderDate).ToList();
}
+
await _asyncStorageService.SetItemAsync($"{companyId}.{ActivityDrawer.Label}", drawer);
}
-
-
+
+
///
/// Store Sales Catalog
///
@@ -218,8 +220,8 @@ public class CabinetDrawerService : ICabinetDrawerService
{
await _asyncStorageService.SetItemAsync($"{countryCode}.{CatalogDrawer.Label}", drawer);
}
-
-
+
+
///
/// Store Company Info
///
@@ -229,8 +231,8 @@ public class CabinetDrawerService : ICabinetDrawerService
{
await _asyncStorageService.SetItemAsync($"{companyId}.{InfoDrawer.Label}", drawer);
}
-
-
+
+
///
/// Store Inventory
///
@@ -242,10 +244,11 @@ public class CabinetDrawerService : ICabinetDrawerService
{
drawer.Content = drawer.Content.OrderByDescending(x => x.LastInvoiceDate).ToList();
}
+
await _asyncStorageService.SetItemAsync($"{companyId}.{InventoryDrawer.Label}", drawer);
}
-
-
+
+
///
/// Store Invoices
///
@@ -257,10 +260,11 @@ public class CabinetDrawerService : ICabinetDrawerService
{
drawer.Content = drawer.Content.OrderByDescending(x => x.DocumentDate).ToList();
}
+
await _asyncStorageService.SetItemAsync($"{companyId}.{InvoiceDrawer.Label}", drawer);
}
-
-
+
+
///
/// Store statistic (invoice lines)
///
@@ -272,6 +276,7 @@ public class CabinetDrawerService : ICabinetDrawerService
{
drawer.Content = drawer.Content.OrderByDescending(x => x.DeliveryDate).ToList();
}
+
await _asyncStorageService.SetItemAsync($"{companyId}.{StatisticDrawer.Label}", drawer);
}
}
\ No newline at end of file
diff --git a/Wonky.Client/Models/SelectedSku.cs b/Wonky.Client/Models/ItemSelect.cs
similarity index 92%
rename from Wonky.Client/Models/SelectedSku.cs
rename to Wonky.Client/Models/ItemSelect.cs
index d5b83e32..1356ca34 100644
--- a/Wonky.Client/Models/SelectedSku.cs
+++ b/Wonky.Client/Models/ItemSelect.cs
@@ -16,12 +16,12 @@
namespace Wonky.Client.Models;
-public class SelectedSku
+public class ItemSelect
{
///
- /// ItemId
+ /// ItemNo
///
- public string ItemId { get; set; } = "";
+ public string ItemNo { get; set; } = "";
///
/// Quantity
diff --git a/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor b/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor
index 612be832..eeee7cf4 100644
--- a/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor
+++ b/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor
@@ -20,7 +20,7 @@
@@ -33,4 +33,4 @@
}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor.cs b/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor.cs
index 4b2d3640..8ff39e66 100644
--- a/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor.cs
+++ b/Wonky.Client/OverlayCustomer/CustomerInventoryListOverlay.razor.cs
@@ -39,6 +39,7 @@ public partial class CustomerInventoryListOverlay : IDisposable
[Parameter] public string CountryCode { get; set; } = "";
[Parameter] public List Inventory { get; set; } = new();
[Parameter] public EventCallback OnSelected { get; set; }
+ [Parameter] public EventCallback OnReload { get; set; }
/*
* Private Variables
*/
@@ -72,7 +73,7 @@ public partial class CustomerInventoryListOverlay : IDisposable
Interceptor.RegisterBeforeSendEvent();
StateHasChanged();
}
-
+
///
/// Inventory Reorder Overlay Callback
diff --git a/Wonky.Client/OverlayCustomer/CustomerInventoryReorderOverlay.razor b/Wonky.Client/OverlayCustomer/CustomerInventoryReorderOverlay.razor
index cdcb7e1d..5fbb1647 100644
--- a/Wonky.Client/OverlayCustomer/CustomerInventoryReorderOverlay.razor
+++ b/Wonky.Client/OverlayCustomer/CustomerInventoryReorderOverlay.razor
@@ -20,11 +20,11 @@
|