new attempt to prevent doubled history

This commit is contained in:
Frede Hundewadt 2022-12-13 11:29:34 +01:00
parent 0b0be1a247
commit 743c96972d
4 changed files with 23 additions and 11 deletions

View file

@ -53,7 +53,7 @@
@product.Quantity @product.Quantity
</td> </td>
<td class="align-middle"> <td class="align-middle">
<a class="btn btn-info d-block" type="button" @onclick="() => CallShowReorderModal(product.Sku)"><i class="bi-arrow-right-circle"></i> Se Historik</a> <a class="btn btn-info d-block" type="button" @onclick="() => CallShowReorderModal(product.Sku)"><i class="bi-pen"></i> Genbestil</a>
</td> </td>
</tr> </tr>
} }

View file

@ -43,9 +43,15 @@ public partial class CrmCompanyInventoryPage : IDisposable
Interceptor.RegisterBeforeSendEvent(); Interceptor.RegisterBeforeSendEvent();
Company = await CompanyRepo.GetCompanyById(CompanyId); Company = await CompanyRepo.GetCompanyById(CompanyId);
while (string.IsNullOrWhiteSpace(Company.HistorySync))
var _ = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, Company.HistorySync); {
await Task.Delay(1000);
}
var ts = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, Company.HistorySync);
while (string.IsNullOrWhiteSpace(ts))
{
await Task.Delay(1000);
}
await FetchInventory(); await FetchInventory();
Working = false; Working = false;
} }

View file

@ -24,13 +24,19 @@ public partial class CrmCompanyInvoiceListPage : IDisposable
{ {
Interceptor.RegisterEvent(); Interceptor.RegisterEvent();
Interceptor.RegisterBeforeSendEvent(); Interceptor.RegisterBeforeSendEvent();
Company = await CompanyRepo.GetCompanyById(CompanyId); Company = await CompanyRepo.GetCompanyById(CompanyId);
var _ = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, Company.HistorySync);
History = await HistoryRepo.FetchInvoiceList(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);
}
History = await HistoryRepo.FetchInvoiceList(CompanyId);
Working = false; Working = false;
} }

View file

@ -1,13 +1,13 @@
{ {
"appInfo": { "appInfo": {
"name": "Wonky Client", "name": "Wonky Client",
"version": "0.84.1", "version": "0.84.3",
"rc": true, "rc": true,
"sandBox": false, "sandBox": false,
"image": "grumpy-coder.png" "image": "grumpy-coder.png"
}, },
"apiConfig": { "apiConfig": {
"baseUrl": "https://eta.innotec.dk", "baseUrl": "https://zeta.innotec.dk",
"catalog": "api/v2/catalog", "catalog": "api/v2/catalog",
"crmCustomers": "api/v2/crm/companies", "crmCustomers": "api/v2/crm/companies",
"crmInventoryExt": "history/inventory", "crmInventoryExt": "history/inventory",