diff --git a/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs b/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs index b016b5e5..af1224ea 100644 --- a/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs +++ b/Wonky.Client/Pages/CrmCompanyInventoryPage.razor.cs @@ -43,6 +43,7 @@ public partial class CrmCompanyInventoryPage : IDisposable Interceptor.RegisterBeforeSendEvent(); Company = await CompanyRepo.GetCompanyById(CompanyId); + while (string.IsNullOrWhiteSpace(Company.HistorySync)) { await Task.Delay(1000); @@ -52,6 +53,7 @@ public partial class CrmCompanyInventoryPage : IDisposable { await Task.Delay(1000); } + await FetchInventory(); Working = false; } @@ -68,4 +70,4 @@ public partial class CrmCompanyInventoryPage : IDisposable { Interceptor.DisposeEvent(); } -} \ No newline at end of file +} diff --git a/Wonky.Client/Pages/CrmCompanyInvoiceListPage.razor.cs b/Wonky.Client/Pages/CrmCompanyInvoiceListPage.razor.cs index c570f0f4..36056ffa 100644 --- a/Wonky.Client/Pages/CrmCompanyInvoiceListPage.razor.cs +++ b/Wonky.Client/Pages/CrmCompanyInvoiceListPage.razor.cs @@ -24,6 +24,18 @@ public partial class CrmCompanyInvoiceListPage : IDisposable { Interceptor.RegisterEvent(); Interceptor.RegisterBeforeSendEvent(); + + Company = await CompanyRepo.GetCompanyById(CompanyId); + + while (string.IsNullOrWhiteSpace(Company.HistorySync)) + { + await Task.Delay(1000); + } + var ts = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, Company.HistorySync); + while (string.IsNullOrWhiteSpace(ts)) + { + await Task.Delay(1000); + } Company = await CompanyRepo.GetCompanyById(CompanyId); @@ -44,4 +56,4 @@ public partial class CrmCompanyInvoiceListPage : IDisposable { Interceptor.DisposeEvent(); } -} \ No newline at end of file +}