ensure no duplicates

This commit is contained in:
Frede Hundewadt 2022-12-14 16:45:49 +01:00
parent 6323461b75
commit a43ec43e7f
2 changed files with 16 additions and 2 deletions

View file

@ -43,6 +43,7 @@ public partial class CrmCompanyInventoryPage : IDisposable
Interceptor.RegisterBeforeSendEvent(); Interceptor.RegisterBeforeSendEvent();
Company = await CompanyRepo.GetCompanyById(CompanyId); Company = await CompanyRepo.GetCompanyById(CompanyId);
while (string.IsNullOrWhiteSpace(Company.HistorySync)) while (string.IsNullOrWhiteSpace(Company.HistorySync))
{ {
await Task.Delay(1000); await Task.Delay(1000);
@ -52,6 +53,7 @@ public partial class CrmCompanyInventoryPage : IDisposable
{ {
await Task.Delay(1000); await Task.Delay(1000);
} }
await FetchInventory(); await FetchInventory();
Working = false; Working = false;
} }
@ -68,4 +70,4 @@ public partial class CrmCompanyInventoryPage : IDisposable
{ {
Interceptor.DisposeEvent(); Interceptor.DisposeEvent();
} }
} }

View file

@ -24,6 +24,18 @@ public partial class CrmCompanyInvoiceListPage : IDisposable
{ {
Interceptor.RegisterEvent(); Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent(); 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); Company = await CompanyRepo.GetCompanyById(CompanyId);
@ -44,4 +56,4 @@ public partial class CrmCompanyInvoiceListPage : IDisposable
{ {
Interceptor.DisposeEvent(); Interceptor.DisposeEvent();
} }
} }