-
-
@Company.Name
-
-
+
+
+
@Company.Name
-
-}
+
+
@if (Loading)
{
-
+
}
-
+else
+{
+
+}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs b/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs
index 4a1f6c2c..69f6975a 100644
--- a/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs
+++ b/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs
@@ -14,6 +14,7 @@
//
+using System.Text.Json;
using Blazored.Toast.Services;
using Microsoft.AspNetCore.Components;
using Wonky.Client.HttpInterceptors;
@@ -31,25 +32,27 @@ public partial class CrmCompanyInventoryPage : IDisposable
[Inject] public ICrmCompanyHttpRepository CompanyRepo { get; set; }
[Inject] public HttpInterceptorService Interceptor { get; set; }
[Inject] public IToastService Toaster { get; set; }
+ [Inject] public ILogger
Logger { get; set; }
private CompanyDto Company { get; set; } = new();
- private List Inventory { get; set; } = new();
+ private List? Inventory { get; set; } = new();
private bool Loading { get; set; } = true;
- protected override async Task OnParametersSetAsync()
- {
- Interceptor.RegisterEvent();
- Interceptor.RegisterBeforeSendEvent();
- Company = await CompanyRepo.GetCompanyById(CompanyId);
- }
-
protected override async Task OnInitializedAsync()
{
+ Interceptor.RegisterEvent();
+ Interceptor.RegisterBeforeSendEvent();
+
+ Company = await CompanyRepo.GetCompanyById(CompanyId);
+
await RefreshHistory();
}
private async Task RefreshHistory()
{
Toaster.ShowInfo("Varekøb opdateres ....", "Vent venligst");
+
+ await CrmHistoryRepo.RpcSyncErpToCrm(CompanyId, Company.HistorySync);
+
Inventory = await CrmHistoryRepo.FetchInventory(CompanyId);
Inventory = Inventory.OrderBy(x => x.Description).ToList();
Loading = false;
diff --git a/Wonky.Client/Shared/InventoryReorderModal.razor.cs b/Wonky.Client/Shared/InventoryReorderModal.razor.cs
index 1a96cfb2..1f1f55ce 100644
--- a/Wonky.Client/Shared/InventoryReorderModal.razor.cs
+++ b/Wonky.Client/Shared/InventoryReorderModal.razor.cs
@@ -31,7 +31,7 @@ public partial class InventoryReorderModal
[Parameter] public SalesItemView SalesItem { get; set; } = new();
[Inject] public ICrmHistoryHttpRepository CrmHistoryRepo { get; set; }
[Parameter] public EventCallback OnSelected { get; set; }
- private List History { get; set; } = new();
+ private List? History { get; set; } = new();
private DraftItem SelectedItem { get; set; } = new();
private string ProductName { get; set; } = "";
private string _modalDisplay = "";
diff --git a/Wonky.Client/Shared/MainLayout.razor b/Wonky.Client/Shared/MainLayout.razor
index 7115255a..bb572576 100644
--- a/Wonky.Client/Shared/MainLayout.razor
+++ b/Wonky.Client/Shared/MainLayout.razor
@@ -32,6 +32,6 @@
@Body
-
+
diff --git a/Wonky.Client/Shared/ProductHistoryModal.razor.cs b/Wonky.Client/Shared/ProductHistoryModal.razor.cs
index 2351b56f..e4bf2793 100644
--- a/Wonky.Client/Shared/ProductHistoryModal.razor.cs
+++ b/Wonky.Client/Shared/ProductHistoryModal.razor.cs
@@ -30,7 +30,7 @@ public partial class ProductHistoryModal
[Parameter] public string CompanyId { get; set; } = "";
[Parameter] public string ItemSku { get; set; } = "";
[Inject] public ICrmHistoryHttpRepository CrmHistoryRepo { get; set; }
- private List