disable history and statistic button if account contains NY

This commit is contained in:
Frede Hundewadt 2023-06-16 11:18:36 +02:00
parent a09e3ab50e
commit 1597d99bff
3 changed files with 22 additions and 9 deletions

View file

@ -38,8 +38,16 @@
{
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/workplaces/new"><i class="bi-plus-lg"></i> Arbejdssted</a>
}
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/statistic"><i class="bi-activity"></i> Statistik</a>
<button class="btn btn-secondary btn-sm me-2" @onclick="@ReloadHistory" disabled="@_working"><i class="bi-repeat"></i> Historik</button>
@if (_company.Account.StartsWith("NY"))
{
<a type="button" class="btn btn-secondary btn-sm me-2 disabled" aria-disabled="true"><i class="bi-activity"></i> Statistik</a>
}
else
{
<a class="btn btn-secondary btn-sm me-2" href="/advisor/customers/@CompanyId/statistic" disabled="@(_company.Account.StartsWith("NY"))"><i class="bi-activity"></i> Statistik</a>
}
<button class="btn btn-secondary btn-sm me-2" @onclick="@ReloadHistory" disabled="@(_working || _company.Account.StartsWith("NY"))"><i class="bi-repeat"></i> Historik</button>
<a class="btn btn-primary btn-sm me-2" href="/advisor/customers"><i class="bi-chevron-left"></i> Tilbage</a>
</div>

View file

@ -228,11 +228,14 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
if (firstRender)
{
await GetContacts(CompanyId);
_ = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, false);
_ = await DrawerService.GetInvoiceDrawerAsync(CompanyId);
_ = await DrawerService.GetInventoryDrawerAsync(CompanyId);
_ = await DrawerService.GetActivityDrawerAsync(CompanyId);
_ = await DrawerService.GetStatisticDrawerAsync(CompanyId);
if (!_company.Account.StartsWith("NY"))
{
_ = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, false);
_ = await DrawerService.GetInvoiceDrawerAsync(CompanyId);
_ = await DrawerService.GetInventoryDrawerAsync(CompanyId);
_ = await DrawerService.GetStatisticDrawerAsync(CompanyId);
}
}
}
@ -242,6 +245,9 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
Toaster.ShowInfo("Afventer svar fra tjenester ...");
_enableLink = 0;
_enableActivity = 0;
_ = await DrawerService.GetActivityDrawerAsync(CompanyId, true);
var newSync = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, true);
if (!string.IsNullOrWhiteSpace(newSync))
{
@ -249,7 +255,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
_company = _infoDrawer.Content;
_ = await DrawerService.GetInvoiceDrawerAsync(CompanyId, true);
_ = await DrawerService.GetInventoryDrawerAsync(CompanyId, true);
_ = await DrawerService.GetActivityDrawerAsync(CompanyId, true);
_ = await DrawerService.GetStatisticDrawerAsync(CompanyId, true);
}
_enableLink = 1;

View file

@ -24,7 +24,7 @@
<PageSizeComponent />
</div>
</div>
<hr/>
<div class="row mb-2">
<label class="col-md-3 col-form-label">Kunde søgning</label>
<div class="col-md-3">
@ -38,7 +38,7 @@
<SearchCustomerSortColumnComponent />
</div>
</div>
<hr/>
<div class="row mb-2">
<label class="col-md-3 col-form-label">Produkt søgning</label>
<div class="col-md-3">