wip - office report - refactor

This commit is contained in:
Frede Hundewadt 2022-09-19 17:22:47 +02:00
parent dba5d2decb
commit 3b8f8948c1
24 changed files with 84 additions and 391 deletions

View file

@ -44,9 +44,9 @@
<td>@user.FullName</td> <td>@user.FullName</td>
<td>@user.PhoneNumber</td> <td>@user.PhoneNumber</td>
<td>@user.Email</td> <td>@user.Email</td>
<td><a class="btn btn-outline-dark" href="/admin/users/advisors/@user.CountryCode.ToLower()/@user.UserId/reports">Rapporter</a></td> <td><a class="btn btn-outline-dark" href="/office/users/advisors/@user.CountryCode.ToLower()/@user.UserId/reports">Rapporter</a></td>
<td><a class="btn btn-outline-dark" href="/admin/users/advisors/@user.CountryCode.ToLower()/@user.UserId/companies">Kunder</a></td> <td><a class="btn btn-outline-dark" href="/office/users/advisors/@user.CountryCode.ToLower()/@user.UserId/companies">Kunder</a></td>
<td><a class="btn btn-outline-dark" href="/admin/users/advisors/@user.CountryCode.ToLower()/@user.UserId/view">Rediger</a></td> <td><a class="btn btn-outline-dark" href="/office/users/advisors/@user.CountryCode.ToLower()/@user.UserId/view">Rediger</a></td>
</tr> </tr>
} }
</tbody> </tbody>

View file

@ -61,7 +61,7 @@
ActionLink="/office/customers/$ID$/orders/new" ActionLink="/office/customers/$ID$/orders/new"
ButtonText="Telefon Ordre" ButtonText="Telefon Ordre"
ButtonType="primary" ButtonType="primary"
Enabled="true"> Enabled=1>
</ActivityButton> </ActivityButton>
</div> </div>
</div> </div>

View file

@ -41,7 +41,7 @@
</div> </div>
@foreach (var report in ReportList) @foreach (var report in ReportList)
{ {
<a class="list-group-item list-group-item-action" href="/admin/users/advisors/@CountryCode/@UserId/reports/@report.ReportDate"> <a class="list-group-item list-group-item-action" href="/office/users/advisors/@CountryCode/@UserId/reports/@report.ReportDate">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
@report.ReportDate @report.ReportDate

View file

@ -33,7 +33,7 @@
</div> </div>
@foreach (var user in UserList) @foreach (var user in UserList)
{ {
<a class="list-group-item list-group-item-action" href="/admin/users/office/@user.CountryCode.ToLower()/@user.UserId/view"> <a class="list-group-item list-group-item-action" href="/office/users/office/@user.CountryCode.ToLower()/@user.UserId/view">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
@user.FullName @user.FullName

View file

@ -48,12 +48,12 @@ public class OfficeReportHttpRepository : IOfficeReportHttpRepository
public async Task<List<NgSalesReportListView>> GetReports(string userId) public async Task<List<NgSalesReportListView>> GetReports(string userId)
{ {
return await _client.GetFromJsonAsync<List<NgSalesReportListView>>($"{_apiConfig.OfficeAdvisors}/{userId}/reports"); return await _client.GetFromJsonAsync<List<NgSalesReportListView>>($"{_apiConfig.OfficeReports}/{userId}");
} }
public async Task<ReportView> GetReport(string userId, string workDate) public async Task<ReportView> GetReport(string userId, string workDate)
{ {
return await _client.GetFromJsonAsync<ReportView>($"{_apiConfig.OfficeAdvisors}/{userId}/reports/{workDate}"); return await _client.GetFromJsonAsync<ReportView>($"{_apiConfig.OfficeReports}/{userId}/{workDate}");
} }
} }

View file

@ -27,7 +27,6 @@
<div class="card-header bg-dark text-white"> <div class="card-header bg-dark text-white">
<h3>@_company.Account - @_company.Name</h3> <h3>@_company.Account - @_company.Name</h3>
</div> </div>
@*
@if (_dk) @if (_dk)
{ {
<div class="card-body"> <div class="card-body">
@ -67,7 +66,6 @@
</table> </table>
} }
} }
*@
<EditForm EditContext="_editContext" OnValidSubmit="SubmitUpdate"> <EditForm EditContext="_editContext" OnValidSubmit="SubmitUpdate">
<DataAnnotationsValidator/> <DataAnnotationsValidator/>
<div class="card-body"> <div class="card-body">
@ -83,7 +81,7 @@
<td> <td>
<InputText id="vatNumber" class="form-control" @bind-Value="_company.VatNumber"/> <InputText id="vatNumber" class="form-control" @bind-Value="_company.VatNumber"/>
<ValidationMessage For="@(() => _company.VatNumber)"></ValidationMessage> <ValidationMessage For="@(() => _company.VatNumber)"></ValidationMessage>
<button class="btn btn-warning" type="button" @onclick="CallVatLookupModal">CVR opslag</button> @* <button class="btn btn-warning" type="button" @onclick="CallVatLookupModal">CVR opslag</button> *@
</td> </td>
<th> <th>
Telefon Telefon

View file

@ -203,6 +203,22 @@ public partial class CrmViewCompanyPage : IDisposable
_hideButtons = false; _hideButtons = false;
} }
private async Task GetInfoFromAddress(VatAddress address)
{
_toast.ShowInfo("Vent for adresse info ...");
_vInfos = await _vatService.QueryVirkRegistry(
new VirkParams
{
StreetName = address.StreetName,
HouseNumber = address.HouseNumber,
ZipCode = address.ZipCode
});
if (!_vInfos.Any())
{
_toast.ShowWarning($"Ingen data fundet ...");
}
}
private static VatAddress PrepareVatAddress(CompanyDto model) private static VatAddress PrepareVatAddress(CompanyDto model)
{ {
var digits = "1234567890".ToCharArray(); var digits = "1234567890".ToCharArray();
@ -245,49 +261,49 @@ public partial class CrmViewCompanyPage : IDisposable
if (regInfo.SyncAll) if (regInfo.SyncAll)
{ {
_company.VatNumber = this._virkRegInfo.VatNumber; _company.VatNumber = _virkRegInfo.VatNumber;
_company.Name = this._virkRegInfo.Name; _company.Name = _virkRegInfo.Name;
_company.Address1 = this._virkRegInfo.Address; _company.Address1 = _virkRegInfo.Address;
_company.Address2 = this._virkRegInfo.CoName; _company.Address2 = _virkRegInfo.CoName;
_company.ZipCode = this._virkRegInfo.ZipCode; _company.ZipCode = _virkRegInfo.ZipCode;
_company.City = this._virkRegInfo.City; _company.City = _virkRegInfo.City;
_isDirty = 1; _isDirty = 1;
} }
else else
{ {
_company.VatNumber = this._virkRegInfo.VatNumber; _company.VatNumber = _virkRegInfo.VatNumber;
_vatUpdated = 1; _vatUpdated = 1;
} }
StateHasChanged(); StateHasChanged();
} }
// private void SelectCompany(string vatNumber, bool syncAll) private void SelectCompany(string vatNumber, bool syncAll)
// { {
// _virkRegInfo = (from x in _vInfos where x.VatNumber == vatNumber select x).First(); _virkRegInfo = (from x in _vInfos where x.VatNumber == vatNumber select x).First();
// _validVat = _virkRegInfo.States[0].State.ToLower() == "normal"; _validVat = _virkRegInfo.States[0].State.ToLower() == "normal";
// _company.HasFolded = _validVat ? 1 : 0; _company.HasFolded = _validVat ? 1 : 0;
// _enableActivity = _validVat ? 1 : 0; _enableActivity = _validVat ? 1 : 0;
// _vatState = _virkRegInfo.States[0].State.ToLower() == "normal" ? "the-good" : "the-dead"; _vatState = _virkRegInfo.States[0].State.ToLower() == "normal" ? "the-good" : "the-dead";
//
// if (syncAll) if (syncAll)
// { {
// _company.VatNumber = _virkRegInfo.VatNumber; _company.VatNumber = _virkRegInfo.VatNumber;
// _company.Name = _virkRegInfo.Name; _company.Name = _virkRegInfo.Name;
// _company.Address1 = _virkRegInfo.Address; _company.Address1 = _virkRegInfo.Address;
// _company.Address2 = _virkRegInfo.CoName; _company.Address2 = _virkRegInfo.CoName;
// _company.ZipCode = _virkRegInfo.ZipCode; _company.ZipCode = _virkRegInfo.ZipCode;
// _company.City = _virkRegInfo.City; _company.City = _virkRegInfo.City;
// _isDirty = 1; _isDirty = 1;
// } }
// else else
// { {
// _company.VatNumber = _virkRegInfo.VatNumber; _company.VatNumber = _virkRegInfo.VatNumber;
// _vatUpdated = 1; _vatUpdated = 1;
// } }
// // empty list // empty list
// _vInfos = new List<VirkRegInfo>(); _vInfos = new List<VirkRegInfo>();
// StateHasChanged(); StateHasChanged();
// } }
public void Dispose() public void Dispose()
{ {

View file

@ -17,7 +17,7 @@
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin")] @attribute [Authorize(Roles = "Admin")]
@page "/admin/users/advisors" @page "/office/users/advisors"
<div class="card"> <div class="card">
<div class="card-header bg-dark text-white"> <div class="card-header bg-dark text-white">
@ -27,9 +27,9 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="/admin/users/advisors/dk">Danmark</a> <a class="list-group-item list-group-item-action" href="/office/users/advisors/dk">Danmark</a>
<a class="list-group-item list-group-item-action" href="/admin/users/advisors/no">Norge</a> <a class="list-group-item list-group-item-action" href="/office/users/advisors/no">Norge</a>
<a class="list-group-item list-group-item-action" href="/admin/users/advisors/se">Sverige</a> <a class="list-group-item list-group-item-action" href="/office/users/advisors/se">Sverige</a>
</div> </div>
</div> </div>
</div> </div>

View file

@ -17,7 +17,7 @@
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin")] @attribute [Authorize(Roles = "Admin")]
@page "/admin/users/office" @page "/office/users/office"
<div class="card"> <div class="card">
<div class="card-header bg-dark text-white"> <div class="card-header bg-dark text-white">
@ -27,7 +27,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="/admin/users/office/dk">Danmark</a> <a class="list-group-item list-group-item-action" href="/office/users/office/dk">Danmark</a>
</div> </div>
</div> </div>
</div> </div>

View file

@ -17,14 +17,14 @@
@using Wonky.Client.Components @using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin")] @attribute [Authorize(Roles = "Admin,Office")]
@page "/admin/users/advisors/{CountryCode}" @page "/office/users/advisors/{CountryCode}"
<div class="card"> <div class="card">
<div class="card-header bg-dark text-white"> <div class="card-header bg-dark text-white">
<h3>Sælgere</h3> <h3>Sælgere</h3>
</div> </div>
<div class="card-body"> <div class="card-body">
<OfficeAdvisorTableComponent UserList="_salesReps"></OfficeAdvisorTableComponent> <OfficeAdvisorTableComponent UserList="_salesReps" />
</div> </div>
</div> </div>

View file

@ -16,7 +16,7 @@
*@ *@
@using Wonky.Client.Components @using Wonky.Client.Components
@page "/admin/companies" @page "/office/companies"
<div class="sticky-top bg-dark text-light rounded-2 px-3"> <div class="sticky-top bg-dark text-light rounded-2 px-3">
<div class="container-fluid pt-3"> <div class="container-fluid pt-3">

View file

@ -16,7 +16,7 @@
*@ *@
@using Wonky.Client.Components @using Wonky.Client.Components
@page "/admin/companies" @page "/office/companies/{CountryCode}/{UserId}"
<div class="sticky-top bg-dark text-light rounded-2 px-3"> <div class="sticky-top bg-dark text-light rounded-2 px-3">
<div class="container-fluid pt-3"> <div class="container-fluid pt-3">

View file

@ -18,7 +18,7 @@
@using Wonky.Client.Components @using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Admin")] @attribute [Authorize(Roles = "Admin")]
@page "/admin/users/advisors/{CountryCode}/{UserId}/reports" @page "/office/users/advisors/{CountryCode}/{UserId}/reports"
<div class="card"> <div class="card">
<div class="card-header bg-dark text-white"> <div class="card-header bg-dark text-white">

View file

@ -15,7 +15,7 @@
// //
*@ *@
@page "/admin/users/advisors/{CountryCode}/{UserId}/view" @page "/office/users/advisors/{CountryCode}/{UserId}/view"
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@using Wonky.Client.Components @using Wonky.Client.Components
@attribute [Authorize(Roles = "Admin")] @attribute [Authorize(Roles = "Admin")]
@ -97,10 +97,10 @@
<button type="submit" class="btn btn-primary">Gem</button> <button type="submit" class="btn btn-primary">Gem</button>
</div> </div>
<div class="col"> <div class="col">
<a class="btn btn-primary" href="/admin/users/advisors/@CountryCode">Tilbage</a> <a class="btn btn-primary" href="/office/users/advisors/@CountryCode">Tilbage</a>
</div> </div>
<div class="col"> <div class="col">
<a class="btn btn-primary" href="/admin/users/advisors/@CountryCode/@UserId/reports">Salg</a> <a class="btn btn-primary" href="/office/users/advisors/@CountryCode/@UserId/reports">Salg</a>
</div> </div>
</div> </div>
</EditForm> </EditForm>

View file

@ -17,7 +17,7 @@
@using Wonky.Client.Components @using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@page "/admin/users/advisors/{CountryCode}/{UserId}/reports/{ReportDate}" @page "/office/users/advisors/{CountryCode}/{UserId}/reports/{ReportDate}"
@attribute [Authorize(Roles = "Admin")] @attribute [Authorize(Roles = "Admin")]
<div class="report-main"> <div class="report-main">

View file

@ -73,7 +73,7 @@ public partial class OfficeViewReportPage : IDisposable
{ {
if (workDate != ReportDate) if (workDate != ReportDate)
{ {
_navigator.NavigateTo($"/admin/users/advisors/{CountryCode}/{UserId}/reports/{workDate}"); _navigator.NavigateTo($"/office/users/advisors/{CountryCode}/{UserId}/reports/{workDate}");
return; return;
} }

View file

@ -1,51 +0,0 @@
@*
// Copyright (C) 2022 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
//
*@
@page "/price-catalog"
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Advisor,Admin")]
<div class="sticky-top bg-dark rounded-2 px-3">
<div class="container-fluid pt-3">
<div class="row mb-3">
<div class="col">
<ItemGroupComponent OnChanged="SetItemGroup"/>
</div>
<div class="col">
<ItemSearchComponent OnChanged="SetSearchCol"/>
</div>
<div class="col">
<ItemSearchPhraseComponent OnChanged="SetSearchPhrase"/>
</div>
<div class="col">
<ItemSortComponent OnChanged="SetSortCol"/>
</div>
<div class="col-md-2">
<PageSizeComponent OnChanged="SetPageSize" />
</div>
</div>
<div class="row mb-3">
<div class="col-md-10">
<PaginationComponent MetaData="_metaData" Spread="2" SelectedPage="SelectedPage" />
</div>
</div>
</div>
</div>
<ItemTableComponent SalesItems="_items" />

View file

@ -1,110 +0,0 @@
// Copyright (C) 2022 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
//
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Blazored.LocalStorage;
using Wonky.Client.HttpInterceptors;
using Wonky.Client.HttpRepository;
using Microsoft.AspNetCore.Components;
using Wonky.Client.Components;
using Wonky.Client.HttpInterfaces;
using Wonky.Client.Services;
using Wonky.Entity.DTO;
using Wonky.Entity.Requests;
using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
public partial class SalesCatalogNoPage : IDisposable
{
[Inject] public ILocalStorageService _storage { get; set; }
[Inject] public ICatalogHttpRepository _itemRepo { get; set; }
[Inject] public HttpInterceptorService _interceptor { get; set; }
[Inject] public UserPreferenceService _preferenceService { get; set; }
private List<SalesItemView> _items { get; set; } = new();
private MetaData _metaData { get; set; } = new();
private CatalogPagingParams _paging = new();
private Preferences _preferences = new();
protected override async Task OnInitializedAsync()
{
_preferences = await _preferenceService.GetPreferences();
_paging.OrderBy = _preferences.ItemSort;
_paging.SearchColumn = _preferences.ItemSearch;
_paging.PageSize = Convert.ToInt32(_preferences.PageSize);
_interceptor.RegisterEvent();
_interceptor.RegisterBeforeSendEvent();
await GetSalesItems();
}
private async Task GetSalesItems()
{
var pagingResponse = await _itemRepo.GetSalesItemsPaged(_paging);
_items = pagingResponse.Items!;
_metaData = pagingResponse.MetaData;
}
private async Task SetSearchPhrase(string searchTerm)
{
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SearchTerm = searchTerm;
await GetSalesItems();
}
private async Task SetPageSize(string pageSize)
{
_items = new List<SalesItemView>();
_paging.PageSize = Convert.ToInt32(pageSize);
_paging.PageNumber = 1;
await GetSalesItems();
}
private async Task SetSearchCol(string columnName)
{
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SearchColumn = columnName;
await GetSalesItems();
}
private async Task SetSortCol(string orderBy)
{
_items = new List<SalesItemView>();
_paging.OrderBy = orderBy;
await GetSalesItems();
}
private async Task SelectedPage(int page)
{
_items = new List<SalesItemView>();
_paging.PageNumber = page;
await GetSalesItems();
}
private async Task SetItemGroup(string groupFilter)
{
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SelectGroup = groupFilter;
await GetSalesItems();
}
public void Dispose() => _interceptor.DisposeEvent();
}

View file

@ -29,8 +29,9 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages; namespace Wonky.Client.Pages;
public partial class SalesCatalogDkPage : IDisposable public partial class SalesCatalogPage : IDisposable
{ {
[Parameter] public string CountryCode { get; set; } = "";
[Inject] public ILocalStorageService _storage { get; set; } [Inject] public ILocalStorageService _storage { get; set; }
[Inject] public ICatalogHttpRepository _itemRepo { get; set; } [Inject] public ICatalogHttpRepository _itemRepo { get; set; }
[Inject] public HttpInterceptorService _interceptor { get; set; } [Inject] public HttpInterceptorService _interceptor { get; set; }

View file

@ -1,51 +0,0 @@
@*
// Copyright (C) 2022 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
//
*@
@page "/price-catalog"
@using Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(Roles = "Advisor,Admin")]
<div class="sticky-top bg-dark rounded-2 px-3">
<div class="container-fluid pt-3">
<div class="row mb-3">
<div class="col">
<ItemGroupComponent OnChanged="SetItemGroup"/>
</div>
<div class="col">
<ItemSearchComponent OnChanged="SetSearchCol"/>
</div>
<div class="col">
<ItemSearchPhraseComponent OnChanged="SetSearchPhrase"/>
</div>
<div class="col">
<ItemSortComponent OnChanged="SetSortCol"/>
</div>
<div class="col-md-2">
<PageSizeComponent OnChanged="SetPageSize" />
</div>
</div>
<div class="row mb-3">
<div class="col-md-10">
<PaginationComponent MetaData="_metaData" Spread="2" SelectedPage="SelectedPage" />
</div>
</div>
</div>
</div>
<ItemTableComponent SalesItems="_items" />

View file

@ -1,110 +0,0 @@
// Copyright (C) 2022 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
//
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Blazored.LocalStorage;
using Wonky.Client.HttpInterceptors;
using Wonky.Client.HttpRepository;
using Microsoft.AspNetCore.Components;
using Wonky.Client.Components;
using Wonky.Client.HttpInterfaces;
using Wonky.Client.Services;
using Wonky.Entity.DTO;
using Wonky.Entity.Requests;
using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
public partial class SalesCatalogSePage : IDisposable
{
[Inject] public ILocalStorageService _storage { get; set; }
[Inject] public ICatalogHttpRepository _itemRepo { get; set; }
[Inject] public HttpInterceptorService _interceptor { get; set; }
[Inject] public UserPreferenceService _preferenceService { get; set; }
private List<SalesItemView> _items { get; set; } = new();
private MetaData _metaData { get; set; } = new();
private CatalogPagingParams _paging = new();
private Preferences _preferences = new();
protected override async Task OnInitializedAsync()
{
_preferences = await _preferenceService.GetPreferences();
_paging.OrderBy = _preferences.ItemSort;
_paging.SearchColumn = _preferences.ItemSearch;
_paging.PageSize = Convert.ToInt32(_preferences.PageSize);
_interceptor.RegisterEvent();
_interceptor.RegisterBeforeSendEvent();
await GetSalesItems();
}
private async Task GetSalesItems()
{
var pagingResponse = await _itemRepo.GetSalesItemsPaged(_paging);
_items = pagingResponse.Items!;
_metaData = pagingResponse.MetaData;
}
private async Task SetSearchPhrase(string searchTerm)
{
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SearchTerm = searchTerm;
await GetSalesItems();
}
private async Task SetPageSize(string pageSize)
{
_items = new List<SalesItemView>();
_paging.PageSize = Convert.ToInt32(pageSize);
_paging.PageNumber = 1;
await GetSalesItems();
}
private async Task SetSearchCol(string columnName)
{
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SearchColumn = columnName;
await GetSalesItems();
}
private async Task SetSortCol(string orderBy)
{
_items = new List<SalesItemView>();
_paging.OrderBy = orderBy;
await GetSalesItems();
}
private async Task SelectedPage(int page)
{
_items = new List<SalesItemView>();
_paging.PageNumber = page;
await GetSalesItems();
}
private async Task SetItemGroup(string groupFilter)
{
_items = new List<SalesItemView>();
_paging.PageNumber = 1;
_paging.SelectGroup = groupFilter;
await GetSalesItems();
}
public void Dispose() => _interceptor.DisposeEvent();
}

View file

@ -48,7 +48,7 @@
<AuthorizeView Roles="Admin"> <AuthorizeView Roles="Admin">
<div class="nav-item px-3"> <div class="nav-item px-3">
<NavLink class="nav-link ps-2" href="/admin/users/advisors"> <NavLink class="nav-link ps-2" href="/office/users/advisors">
<span class="oi oi-people" aria-hidden="true"></span> Sælgere <span class="oi oi-people" aria-hidden="true"></span> Sælgere
</NavLink> </NavLink>
</div> </div>
@ -61,7 +61,7 @@
<AuthorizeView Roles="Office"> <AuthorizeView Roles="Office">
<div class="nav-item px-3"> <div class="nav-item px-3">
<NavLink class="nav-link ps-2" href="/admin/users/advisors"> <NavLink class="nav-link ps-2" href="/office/users/advisors">
<span class="oi oi-people" aria-hidden="true"></span> Sælgere <span class="oi oi-people" aria-hidden="true"></span> Sælgere
</NavLink> </NavLink>
</div> </div>

View file

@ -1,9 +1,9 @@
{ {
"appInfo": { "appInfo": {
"name": "Wonky Client", "name": "Wonky Client",
"version": "0.19.1", "version": "0.20.20",
"rc": true, "rc": false,
"sandBox": true, "sandBox": false,
"image": "grumpy-coder.png" "image": "grumpy-coder.png"
}, },
"apiConfig": { "apiConfig": {
@ -25,7 +25,7 @@
"crmSync": "history/sync", "crmSync": "history/sync",
"crmWorkplaces": "workplaces", "crmWorkplaces": "workplaces",
"officeAdvisors": "api/v2/office/users/advisors", "officeAdvisors": "api/v2/office/users/advisors",
"officeUsers": "api/v2/office/users/office", "officeUsers": "api/v2/office/users/admin",
"officeUserPasswd": "api/v2/office/users/passwd", "officeUserPasswd": "api/v2/office/users/passwd",
"officeCustomers": "api/v2/office/customers", "officeCustomers": "api/v2/office/customers",
"officeReports": "api/v2/office/reports", "officeReports": "api/v2/office/reports",