diff --git a/Wonky.Client/Components/ReportActivityLedgerComponent.razor b/Wonky.Client/Components/ReportActivityLedgerComponent.razor
index 5192b7bc..0f93b8df 100644
--- a/Wonky.Client/Components/ReportActivityLedgerComponent.razor
+++ b/Wonky.Client/Components/ReportActivityLedgerComponent.razor
@@ -19,7 +19,7 @@
- Dagens Demo @(Report.NewDemoCount + Report.RecallDemoCount)
+ Dagens Demo @(ReportData.NewDemoCount + ReportData.RecallDemoCount)
Dagens Resultat
Måneds Resultat
@@ -38,47 +38,47 @@
N
- @Report.NewVisitCount
- @Report.NewDemoCount
- @Report.NewSaleCount
- @Report.NewTurnover
- @Report.NewVisitCountMonth
- @Report.NewDemoCountMonth
- @Report.NewSaleCountMonth
- @Report.NewTurnoverMonth
+ @ReportData.NewVisitCount
+ @ReportData.NewDemoCount
+ @ReportData.NewSaleCount
+ @ReportData.NewTurnover
+ @ReportData.NewVisitCountMonth
+ @ReportData.NewDemoCountMonth
+ @ReportData.NewSaleCountMonth
+ @ReportData.NewTurnoverMonth
R
- @Report.RecallVisitCount
- @Report.RecallDemoCount
- @Report.RecallSaleCount
- @Report.RecallTurnover
- @Report.RecallVisitCountMonth
- @Report.RecallDemoCountMonth
- @Report.RecallSaleCountMonth
- @Report.RecallTurnoverMonth
+ @ReportData.RecallVisitCount
+ @ReportData.RecallDemoCount
+ @ReportData.RecallSaleCount
+ @ReportData.RecallTurnover
+ @ReportData.RecallVisitCountMonth
+ @ReportData.RecallDemoCountMonth
+ @ReportData.RecallSaleCountMonth
+ @ReportData.RecallTurnoverMonth
SAS
- @Report.SasCount
- @Report.SasTurnover
+ @ReportData.SasCount
+ @ReportData.SasTurnover
- @Report.SasCountMonth
- @Report.SasTurnoverMonth
+ @ReportData.SasCountMonth
+ @ReportData.SasTurnoverMonth
TOTAL
- @Report.TotalVisitCount
- @Report.TotalDemoCount
- @Report.TotalSaleCount
- @Report.TotalTurnover
- @Report.TotalVisitCountMonth
- @Report.TotalDemoCountMonth
- @Report.TotalSaleCountMonth
- @Report.TotalTurnoverMonth
+ @ReportData.TotalVisitCount
+ @ReportData.TotalDemoCount
+ @ReportData.TotalSaleCount
+ @ReportData.TotalTurnover
+ @ReportData.TotalVisitCountMonth
+ @ReportData.TotalDemoCountMonth
+ @ReportData.TotalSaleCountMonth
+ @ReportData.TotalTurnoverMonth
diff --git a/Wonky.Client/Components/ReportActivityLedgerComponent.razor.cs b/Wonky.Client/Components/ReportActivityLedgerComponent.razor.cs
index d0ccf0af..5f5633fc 100644
--- a/Wonky.Client/Components/ReportActivityLedgerComponent.razor.cs
+++ b/Wonky.Client/Components/ReportActivityLedgerComponent.razor.cs
@@ -6,5 +6,5 @@ namespace Wonky.Client.Components;
public partial class ReportActivityLedgerComponent
{
[Parameter]
- public NgSalesReport Report { get; set; }
+ public SalesReportDataViewModel ReportData { get; set; }
}
\ No newline at end of file
diff --git a/Wonky.Client/Components/ReportDistanceLedgerComponent.razor b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor
index d4269bee..16f239e0 100644
--- a/Wonky.Client/Components/ReportDistanceLedgerComponent.razor
+++ b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor
@@ -17,35 +17,36 @@
-
-
- Km Aften
-
-
- Km Morgen
-
-
- Km Kørt Dag
-
-
- Km Kørt Md.
-
-
- Km Privat
-
-
- Km Privat Md.
+
+
+ Km regnskab
- @Report.KmEvening
- @Report.KmMorning
- @Report.Distance
- @Report.DistanceMonth
- @Report.DistancePrivate
- @Report.DistancePrivateMonth
+ Km Aften
+ @ReportData.KmEvening
+
+
+ Km Morgen
+ @ReportData.KmMorning
+
+
+ Km Kørt Dag
+ @ReportData.Distance
+
+
+ Km Kørt Md.
+ @ReportData.DistanceMonth
+
+
+ Km Privat
+ @ReportData.DistancePrivate
+
+
+ Km Privat Md.
+ @ReportData.DistancePrivateMonth
diff --git a/Wonky.Client/Components/ReportDistanceLedgerComponent.razor.cs b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor.cs
index 05019f4b..7b451820 100644
--- a/Wonky.Client/Components/ReportDistanceLedgerComponent.razor.cs
+++ b/Wonky.Client/Components/ReportDistanceLedgerComponent.razor.cs
@@ -6,6 +6,6 @@ namespace Wonky.Client.Components;
public partial class ReportDistanceLedgerComponent
{
[Parameter]
- public NgSalesReport Report { get; set; }
+ public SalesReportDataViewModel ReportData { get; set; }
}
\ No newline at end of file
diff --git a/Wonky.Client/Components/ReportSummaryComponent.razor b/Wonky.Client/Components/ReportSummaryComponent.razor
index 8d70c704..3ee84d57 100644
--- a/Wonky.Client/Components/ReportSummaryComponent.razor
+++ b/Wonky.Client/Components/ReportSummaryComponent.razor
@@ -17,16 +17,46 @@
-
- Beskrivelse
- Medkørende Supervisor
+
+
+ Rapport
+
- @Report.Description
- @Report.SupervisedBy
+ Beskrivelse
+ @ReportData.Description
+
+
+ Supervisor
+ @ReportData.SupervisedBy
+
+
+ Dagtype
+
+ @{
+ switch (ReportData.DayTypeEnum)
+ {
+ case "Sales":
+ Salgsdag: @ReportData.SalesDayNumber
+ break;
+ case "SickLeave":
+ Sygdom
+ break;
+ case "Office":
+ Kontordag
+ break;
+ case "Meeting":
+ Salgsmøde
+ break;
+ case "Leave":
+ Ferie
+ break;
+ }
+ }
+
-
-
+
+
\ No newline at end of file
diff --git a/Wonky.Client/Components/ReportSummaryComponent.razor.cs b/Wonky.Client/Components/ReportSummaryComponent.razor.cs
index bf196367..b8f26d05 100644
--- a/Wonky.Client/Components/ReportSummaryComponent.razor.cs
+++ b/Wonky.Client/Components/ReportSummaryComponent.razor.cs
@@ -6,6 +6,6 @@ namespace Wonky.Client.Components;
public partial class ReportSummaryComponent
{
[Parameter]
- public NgSalesReport Report { get; set; }
+ public SalesReportDataViewModel ReportData { get; set; }
}
\ No newline at end of file
diff --git a/Wonky.Client/HttpRepository/AdminReportHttpRepository.cs b/Wonky.Client/HttpRepository/AdminReportHttpRepository.cs
index 50423b49..34d7b6cb 100644
--- a/Wonky.Client/HttpRepository/AdminReportHttpRepository.cs
+++ b/Wonky.Client/HttpRepository/AdminReportHttpRepository.cs
@@ -35,9 +35,9 @@ public class AdminReportHttpRepository : IAdminReportHttpRepository
return await _client.GetFromJsonAsync>($"{_apiConfig.AdminAdviserUri}/{userId}/reports");
}
- public async Task GetReport(string userId, string workDate)
+ public async Task GetReport(string userId, string workDate)
{
- return await _client.GetFromJsonAsync($"{_apiConfig.AdminAdviserUri}/{userId}/reports/{workDate}");
+ return await _client.GetFromJsonAsync($"{_apiConfig.AdminAdviserUri}/{userId}/reports/{workDate}");
}
}
\ No newline at end of file
diff --git a/Wonky.Client/HttpRepository/IAdminReportHttpRepository.cs b/Wonky.Client/HttpRepository/IAdminReportHttpRepository.cs
index 62a99fee..8c7362e4 100644
--- a/Wonky.Client/HttpRepository/IAdminReportHttpRepository.cs
+++ b/Wonky.Client/HttpRepository/IAdminReportHttpRepository.cs
@@ -7,5 +7,5 @@ namespace Wonky.Client.HttpRepository;
public interface IAdminReportHttpRepository
{
Task> GetReports(string userId);
- Task GetReport(string userId, string workDate);
+ Task GetReport(string userId, string workDate);
}
\ No newline at end of file
diff --git a/Wonky.Client/HttpRepository/IReportHttpRepository.cs b/Wonky.Client/HttpRepository/IReportHttpRepository.cs
index ad5b60b6..9271fb5b 100644
--- a/Wonky.Client/HttpRepository/IReportHttpRepository.cs
+++ b/Wonky.Client/HttpRepository/IReportHttpRepository.cs
@@ -8,7 +8,7 @@ public interface IReportHttpRepository
{
Task ReportExist(string workDate);
Task> GetReports();
- Task GetReport(string workDate);
+ Task GetReport(string workDate);
Task InitializeReportData(string workDate);
Task PostReport(string workDate, ReportDto reportDto);
}
\ No newline at end of file
diff --git a/Wonky.Client/HttpRepository/ReportHttpRepository.cs b/Wonky.Client/HttpRepository/ReportHttpRepository.cs
index 2fc470b2..03156da9 100644
--- a/Wonky.Client/HttpRepository/ReportHttpRepository.cs
+++ b/Wonky.Client/HttpRepository/ReportHttpRepository.cs
@@ -38,13 +38,13 @@ public class ReportHttpRepository :IReportHttpRepository
{
var result =
await _client
- .GetFromJsonAsync($"{_apiConfig.ReportUri}/exist/{workDate}");
+ .GetFromJsonAsync($"{_apiConfig.ReportUri}/exist/{workDate}");
return result.ReportClosed;
}
- public async Task GetReport(string workDate)
+ public async Task GetReport(string workDate)
{
- return await _client.GetFromJsonAsync($"{_apiConfig.ReportUri}/{workDate}");
+ return await _client.GetFromJsonAsync($"{_apiConfig.ReportUri}/{workDate}");
}
public async Task InitializeReportData(string workDate)
diff --git a/Wonky.Client/Pages/ActivityVisitNew.razor b/Wonky.Client/Pages/ActivityVisitNew.razor
index 545ebb7f..136528ef 100644
--- a/Wonky.Client/Pages/ActivityVisitNew.razor
+++ b/Wonky.Client/Pages/ActivityVisitNew.razor
@@ -52,7 +52,7 @@
Ingen salg
- @if (!string.IsNullOrEmpty(_draft.VatNumber) && string.IsNullOrWhiteSpace(_draft.Address1))
+ @if (!string.IsNullOrEmpty(_draft.VatNumber) && !string.IsNullOrWhiteSpace(_draft.Address1))
{
Bestilling
Tilbud
@@ -118,21 +118,27 @@
- @* Order draft lines *@
-
-
-
-
+
+
+ @* Order draft lines *@
+
-
- @* draft line *@
- @if (_selectedItem != null && ShowItem)
- {
-
-
-
-
-
- Varenavn
-
-
- Varenr
-
-
- Antal
-
-
- Pris
-
-
- Rabat
-
-
- SAS
-
-
-
-
-
-
-
- @_selectedItem.Name
-
-
- @_selectedItem.Sku
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AddItem(_selectedItem))">Læg til
-
-
-
+
+
+ @* draft line *@
+ @if (_selectedItem != null && ShowItem)
+ {
+
+ }
- }
- @* catalog *@
-
-
-
-
-
+
+
+
+ @* catalog *@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- @if (_caltalog.Any())
+ @if (_catalog.Any())
{
-
+
Navn
Varenr
Fork
@@ -266,7 +255,7 @@
- @foreach (var item in _caltalog)
+ @foreach (var item in _catalog)
{
@item.Name
@@ -279,9 +268,9 @@
@rate.Quantity
@rate.Rate
- SelectItem(item.ItemId, rate.Quantity, rate.Rate))">
+ SelectItem(item.ItemId, rate.Quantity, rate.Rate))">
Vælg
-
+
}
@@ -293,7 +282,7 @@
}
else
{
-
+ Der er ingen data
}
diff --git a/Wonky.Client/Pages/ActivityVisitNew.razor.cs b/Wonky.Client/Pages/ActivityVisitNew.razor.cs
index b118d569..5add12ee 100644
--- a/Wonky.Client/Pages/ActivityVisitNew.razor.cs
+++ b/Wonky.Client/Pages/ActivityVisitNew.razor.cs
@@ -50,7 +50,7 @@ public partial class ActivityVisitNew : IDisposable
// variables
private readonly JsonSerializerOptions? _options = new JsonSerializerOptions{PropertyNameCaseInsensitive = true};
private SalesItemView _selectedItem { get; set; } = new();
- private List _caltalog { get; set; } = new();
+ private List _catalog { get; set; } = new();
private MetaData _metaData { get; set; } = new();
private Preferences _prefs { get; set; } = new();
private ActivityDto _draft { get; set; } = new();
@@ -194,7 +194,7 @@ public partial class ActivityVisitNew : IDisposable
private void SelectItem(string itemId, string quantity, string price)
{
ShowItem = true;
- _selectedItem = (from x in _caltalog where x.ItemId == itemId select x).First();
+ _selectedItem = (from x in _catalog where x.ItemId == itemId select x).First();
Price = price;
Quantity = quantity;
}
@@ -230,14 +230,14 @@ public partial class ActivityVisitNew : IDisposable
}
private async Task SetItemGroup(string groupFilter)
{
- _caltalog = new List();
+ _catalog = new List();
_paging.PageNumber = 1;
_paging.SelectGroup = groupFilter;
await GetSalesItems();
}
private async Task SetSearchCol(string columnName)
{
- _caltalog = new List();
+ _catalog = new List();
_paging.PageNumber = 1;
_paging.SearchTerm = "";
_paging.SearchColumn = columnName;
@@ -245,27 +245,27 @@ public partial class ActivityVisitNew : IDisposable
}
private async Task SetSortCol(string orderBy)
{
- _caltalog = new List();
+ _catalog = new List();
_paging.OrderBy = orderBy;
await GetSalesItems();
}
private async Task SetSearchPhrase(string searchTerm)
{
- _caltalog = new List();
+ _catalog = new List();
_paging.PageNumber = 1;
_paging.SearchTerm = searchTerm;
await GetSalesItems();
}
private async Task SelectedPage(int page)
{
- _caltalog = new List();
+ _catalog = new List();
_paging.PageNumber = page;
await GetSalesItems();
}
private async Task SetPageSize(string pageSize)
{
- _caltalog = new List();
+ _catalog = new List();
_paging.PageSize = Convert.ToInt32(pageSize);
_paging.PageNumber = 1;
await GetSalesItems();
@@ -274,7 +274,7 @@ public partial class ActivityVisitNew : IDisposable
private async Task GetSalesItems()
{
var response = await _itemRepo.GetSalesItemsPaged(_paging);
- _caltalog = response.Items!;
+ _catalog = response.Items!;
_metaData = response.MetaData;
}
diff --git a/Wonky.Client/Pages/AdminSalesReportView.razor b/Wonky.Client/Pages/AdminSalesReportView.razor
index cb9ac4b0..ba6bad02 100644
--- a/Wonky.Client/Pages/AdminSalesReportView.razor
+++ b/Wonky.Client/Pages/AdminSalesReportView.razor
@@ -20,7 +20,7 @@
@page "/admin/users/advisers/{CountryCode}/{UserId}/reports/{ReportDate}"
@attribute [Authorize(Roles = "Admin")]
-@_report.Report.Name
+@_report.ReportData.Name
-
-
-
Print
-
@_report.Report.Name
+ @_report.ReportData.Name
\ No newline at end of file
diff --git a/Wonky.Client/Pages/AdminSalesReportView.razor.cs b/Wonky.Client/Pages/AdminSalesReportView.razor.cs
index 600cee68..c23d1593 100644
--- a/Wonky.Client/Pages/AdminSalesReportView.razor.cs
+++ b/Wonky.Client/Pages/AdminSalesReportView.razor.cs
@@ -11,24 +11,21 @@ public partial class AdminSalesReportView
[Parameter] public string UserId { get; set; } = "";
[Parameter] public string CountryCode { get; set; } = "";
[Inject] private IAdminReportHttpRepository _reportRepo { get; set; }
- private NgSalesReportView _report { get; set; } = new();
-
- protected override async Task OnInitializedAsync()
- {
- if (!string.IsNullOrWhiteSpace(ReportDate))
- {
- await GetReport(ReportDate);
- }
- }
+ private SalesReportViewModel _report { get; set; } = new();
+ protected override async Task OnParametersSetAsync()
+ {
+ await GetReport(ReportDate);
+ }
+
private async Task GetReport(string workDate)
{
ReportDate = workDate;
- _report = new NgSalesReportView();
+ _report = new SalesReportViewModel();
_report = await GetUserReport(UserId, workDate);
}
- private async Task GetUserReport(string userId, string workDate)
+ private async Task GetUserReport(string userId, string workDate)
{
return _report = await _reportRepo.GetReport(userId, workDate);
}
diff --git a/Wonky.Client/Pages/SalesReportNew.razor b/Wonky.Client/Pages/SalesReportNew.razor
index 13cd901b..7c61a175 100644
--- a/Wonky.Client/Pages/SalesReportNew.razor
+++ b/Wonky.Client/Pages/SalesReportNew.razor
@@ -24,13 +24,13 @@