diff --git a/Wonky.Client/Pages/ReportView.razor b/Wonky.Client/Pages/ReportView.razor
index 5e6e6e9e..0b9aa170 100644
--- a/Wonky.Client/Pages/ReportView.razor
+++ b/Wonky.Client/Pages/ReportView.razor
@@ -1,105 +1,41 @@
+@*
+// 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 Wonky.Client.Components
@using Microsoft.AspNetCore.Authorization
-@page "/sales-report/view/{reportDate}"
+@page "/sales-reports/view/{ReportDate}"
@attribute [Authorize(Roles = "Adviser,Admin,Supervisor")]
-
-
- @if (_report.Activities.Any())
- {
-
-
-
- Besøg |
- Demo |
- Salg |
- Beløb |
-
-
-
- @foreach (var activity in _report.Activities)
- {
-
- @activity.Company.Name - @activity.Company.ZipCity |
- @activity.Demo |
- @activity.SalesResume |
- @activity.OrderAmount |
-
- }
-
- |
- |
- Total |
- @_report.Report.TotalTurnover |
-
-
-
- }
-
-
-
- |
- Demo @(_report.Report.NewDemoCount + _report.Report.RecallDemoCount) |
- Resultat |
- Resultat Måned |
-
-
-
-
- |
- Besøg |
- Demo |
- Salg |
- Beløb |
- Besøg |
- Demo |
- Salg |
- Beløb |
-
-
- N |
- @_report.Report.NewVisitCount |
- @_report.Report.NewDemoCount |
- @_report.Report.NewSaleCount |
- @_report.Report.NewTurnover |
- @_report.Report.NewVisitCountMonth |
- @_report.Report.NewDemoCountMonth |
- @_report.Report.NewSaleCountMonth |
- @_report.Report.NewTurnoverMonth |
-
-
- R |
- @_report.Report.RecallVisitCount |
- @_report.Report.RecallDemoCount |
- @_report.Report.RecallSaleCount |
- @_report.Report.RecallTurnover |
- @_report.Report.RecallVisitCountMonth |
- @_report.Report.RecallDemoCountMonth |
- @_report.Report.RecallSaleCountMonth |
- @_report.Report.RecallTurnoverMonth |
-
-
- SAS |
- |
- |
- @_report.Report.SasCount |
- @_report.Report.SasTurnover |
- |
- |
- @_report.Report.SasCountMonth |
- @_report.Report.SasTurnoverMonth |
-
-
- TOTAL |
- @(_report.Report.TotalVisitCount) |
- @(_report.Report.TotalDemoCount) |
- @(_report.Report.TotalSaleCount) |
- @(_report.Report.TotalTurnover) |
- @(_report.Report.TotalVisitCountMonth) |
- @(_report.Report.TotalDemoCountMonth) |
- @(_report.Report.TotalSaleCountMonth) |
- @(_report.Report.TotalTurnoverMonth) |
-
-
-
+
\ No newline at end of file
diff --git a/Wonky.Client/Pages/ReportView.razor.cs b/Wonky.Client/Pages/ReportView.razor.cs
index 16177fb0..75c3b730 100644
--- a/Wonky.Client/Pages/ReportView.razor.cs
+++ b/Wonky.Client/Pages/ReportView.razor.cs
@@ -21,6 +21,7 @@ public partial class ReportView
private async Task GetReport(string workDate)
{
+ _report = new NgSalesReportView();
_report = await ReportRepo.GetReport(workDate);
}
}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/SalesReportList.razor b/Wonky.Client/Pages/SalesReportList.razor
new file mode 100644
index 00000000..2816827d
--- /dev/null
+++ b/Wonky.Client/Pages/SalesReportList.razor
@@ -0,0 +1,30 @@
+@*
+// 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 "/sales-reports"
+
SalesReportList
+@if (_reports != null)
+{
+ foreach (var report in _reports)
+ {
+
@report.Name
+ }
+}
+else
+{
+
+}
diff --git a/Wonky.Client/Pages/SalesReportList.razor.cs b/Wonky.Client/Pages/SalesReportList.razor.cs
new file mode 100644
index 00000000..7ee85589
--- /dev/null
+++ b/Wonky.Client/Pages/SalesReportList.razor.cs
@@ -0,0 +1,19 @@
+using Microsoft.AspNetCore.Components;
+using Toolbelt.Blazor;
+using Wonky.Client.HttpRepository;
+using Wonky.Entity.Views;
+
+namespace Wonky.Client.Pages;
+
+public partial class SalesReportList
+{
+ [Inject] public IReportHttpRepository ReportRepo { get; set; }
+ [Inject] public IHttpClientInterceptor Interceport { get; set; }
+
+ private List
_reports { get; set; }
+
+ protected override async Task OnInitializedAsync()
+ {
+ _reports = await ReportRepo.GetReports();
+ }
+}
\ No newline at end of file
diff --git a/Wonky.Client/Pages/ErrorReport.razor b/Wonky.Client/Pages/SiteErrorReport.razor
similarity index 100%
rename from Wonky.Client/Pages/ErrorReport.razor
rename to Wonky.Client/Pages/SiteErrorReport.razor
diff --git a/Wonky.Client/Pages/ErrorReport.razor.cs b/Wonky.Client/Pages/SiteErrorReport.razor.cs
similarity index 96%
rename from Wonky.Client/Pages/ErrorReport.razor.cs
rename to Wonky.Client/Pages/SiteErrorReport.razor.cs
index 4f84d389..ee6104c5 100644
--- a/Wonky.Client/Pages/ErrorReport.razor.cs
+++ b/Wonky.Client/Pages/SiteErrorReport.razor.cs
@@ -17,7 +17,7 @@ using Microsoft.AspNetCore.Components;
namespace Wonky.Client.Pages
{
- public partial class ErrorReport
+ public partial class SiteErrorReport
{
[Parameter]
public int ErrorCode { get; set; }
diff --git a/Wonky.Client/Shared/NavMenu.razor b/Wonky.Client/Shared/NavMenu.razor
index e461763d..769198d9 100644
--- a/Wonky.Client/Shared/NavMenu.razor
+++ b/Wonky.Client/Shared/NavMenu.razor
@@ -63,8 +63,8 @@
-
- Dagsrapport
+
+ Dagsrapporter
diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json
index 71707855..b13007ce 100644
--- a/Wonky.Client/wwwroot/appsettings.json
+++ b/Wonky.Client/wwwroot/appsettings.json
@@ -18,12 +18,12 @@
},
"appInfo": {
"name": "Wonky Client",
- "version": "0.8.7",
+ "version": "0.8.10",
"isBeta": true,
"image": "grumpy-coder.png"
},
"apiConfig": {
- "baseAddress": "https://staging.innotec.dk",
+ "baseAddress": "https://dev.innotec.dk",
"tokenPath": "token",
"userInfo": "api/auth/userinfo",
"customerEndpoint": "api/v2/crm/companies",
diff --git a/Wonky.Client/wwwroot/css/app.css b/Wonky.Client/wwwroot/css/app.css
index c7068748..31605ce2 100644
--- a/Wonky.Client/wwwroot/css/app.css
+++ b/Wonky.Client/wwwroot/css/app.css
@@ -6,7 +6,9 @@
.spinner {
height: 48px;
}
-
+.workDate {
+ font-variant: small-caps;
+}
/* visit / vat state classes */
.state {
width: 16px;
diff --git a/Wonky.Entity/DTO/CompanyDto.cs b/Wonky.Entity/DTO/CompanyDto.cs
index 5cc80e47..95c13851 100644
--- a/Wonky.Entity/DTO/CompanyDto.cs
+++ b/Wonky.Entity/DTO/CompanyDto.cs
@@ -21,34 +21,65 @@ namespace Wonky.Entity.DTO;
public class CompanyDto
{
- [Required(ErrorMessage = "Navn skal udfyldes")] [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ [Required(ErrorMessage = "Navn skal udfyldes")]
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Name { get; set; }
- [Required(ErrorMessage = "Postnummer skal udfyldes")] [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+
+ [Required(ErrorMessage = "Postnummer skal udfyldes")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ZipCode { get; set; }
- [Required(ErrorMessage = "Bynavn skal udfyldes")] [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
+
+ [Required(ErrorMessage = "Bynavn skal udfyldes")]
+ [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
public string City { get; set; }
+
[Required(ErrorMessage = "ORG/VAT/CVR er ikke et gyldigt nummer")]
public string VatNumber { get; set; } = "";
+
public string CompanyId { get; set; } = "";
+
public string SalesRepId { get; set; } = "";
+
public string BcId { get; set; } = "";
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Address1 { get; set; } = "";
- [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")] public string Address2 { get; set; } = "";
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Account { get; set; } = "";
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Phone { get; set; } = "";
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")] public string Mobile { get; set; } = "";
- [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")] public string Email { get; set; } = "";
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string Attention { get; set; } = "";
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ public string Address1 { get; set; } = "";
+
+ [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
+ public string Address2 { get; set; } = "";
+
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ public string Account { get; set; } = "";
+
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ public string Phone { get; set; } = "";
+
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ public string Mobile { get; set; } = "";
+
+ [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")]
+ public string Email { get; set; } = "";
+
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ public string Attention { get; set; } = "";
+
public string CountryCode { get; set; } = "";
+
public string LastVisit { get; set; } = "";
+
public string NextVisit { get; set; } = "";
+
[Range(1, 52, ErrorMessage = "Angiv interval mellem 1 og 52 uger")]
public int Interval { get; set; } = 8;
+
public int HasFolded { get; set; }
+
public int IsHidden { get; set; }
+
public int ValidVat { get; set; }
+
public int UpdateErpVat { get; set; }
- public bool ValidDateSpan()
+
+ public virtual bool ValidDateSpan()
{
var notAllowed = new List
{"1970-01-01", "0001-01-01"};
if (notAllowed.Contains(LastVisit) || notAllowed.Contains(NextVisit))
diff --git a/Wonky.Entity/DTO/ReportDto.cs b/Wonky.Entity/DTO/ReportDto.cs
index 26dc56e1..f96a481a 100644
--- a/Wonky.Entity/DTO/ReportDto.cs
+++ b/Wonky.Entity/DTO/ReportDto.cs
@@ -5,9 +5,16 @@ namespace Wonky.Entity.DTO;
public class ReportDto
{
public string Name { get; set; } = "";
- [MaxLength(1000, ErrorMessage = "Du kan højst bruge 1000 tegn")] public string Description { get; set; } = "";
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")] public string SupervisedBy { get; set; } = "";
- [Required(ErrorMessage = "Dagtype skal angives")] public string DayTypeEnum { get; set; } = "";
+
+ [MaxLength(1000, ErrorMessage = "Du kan højst bruge 1000 tegn")]
+ public string Description { get; set; } = "";
+
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ public string SupervisedBy { get; set; } = "";
+
+ [Required(ErrorMessage = "Dagtype skal angives")]
+ public string DayTypeEnum { get; set; } = "";
+
// Date interval (used for leave, sickLeave and work hours
public string FromDateTime { get; set; } = "";
public string ToDateTime { get; set; } = "";
diff --git a/Wonky.Entity/Requests/ReportPagingParams.cs b/Wonky.Entity/Requests/ReportPagingParams.cs
new file mode 100644
index 00000000..14fa749b
--- /dev/null
+++ b/Wonky.Entity/Requests/ReportPagingParams.cs
@@ -0,0 +1,30 @@
+// 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]
+//
+namespace Wonky.Entity.Requests;
+
+public class ReportPagingParams
+{
+ private int _pageSize = 5;
+ private const int MaxPageSize = 50;
+ public int PageNumber { get; set; } = 1;
+ public int PageSize
+ {
+ get => _pageSize;
+ set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value;
+ }
+ public string SearchTerm { get; set; } = "";
+ public string SearchColumn { get; set; } = "name";
+ public string OrderBy { get; set; } = "name";
+}
\ No newline at end of file