From 23c492b63713a340d2c196302c49cec81b6358d3 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt <22748698+fhdk@users.noreply.github.com> Date: Thu, 30 Jun 2022 13:47:01 +0200 Subject: [PATCH] wip --- .../Components/ActivityTableComponent.razor | 4 +- .../Components/ReportSummaryComponent.razor | 42 ++-- .../Components/TopbarDisplayUser.razor | 4 +- .../Components/TopbarNavigation.razor | 6 +- Wonky.Client/Pages/ActivityVisitNew.razor | 23 +- Wonky.Client/Pages/ActivityVisitNew.razor.cs | 11 +- Wonky.Client/Pages/AdminSalesReportView.razor | 9 +- Wonky.Client/Pages/SalesReportView.razor | 11 +- Wonky.Client/Shared/MainLayout.razor | 11 +- Wonky.Client/wwwroot/appsettings.json | 2 +- Wonky.Client/wwwroot/css/report-print.css | 30 +++ Wonky.Client/wwwroot/index.html | 3 +- Wonky.Entity/DTO/ActivityDto.cs | 199 +++++++++++++++--- 13 files changed, 275 insertions(+), 80 deletions(-) create mode 100644 Wonky.Client/wwwroot/css/report-print.css diff --git a/Wonky.Client/Components/ActivityTableComponent.razor b/Wonky.Client/Components/ActivityTableComponent.razor index 7224d1a4..9535f6c8 100644 --- a/Wonky.Client/Components/ActivityTableComponent.razor +++ b/Wonky.Client/Components/ActivityTableComponent.razor @@ -17,9 +17,9 @@ @if (Activities.Any()) { - +
- + diff --git a/Wonky.Client/Components/ReportSummaryComponent.razor b/Wonky.Client/Components/ReportSummaryComponent.razor index 2e77f0ec..e1dd7056 100644 --- a/Wonky.Client/Components/ReportSummaryComponent.razor +++ b/Wonky.Client/Components/ReportSummaryComponent.razor @@ -15,9 +15,9 @@ // *@ -
Besøg Demo Salg
+
- + @@ -25,7 +25,7 @@ - + @@ -82,9 +82,9 @@
Dagens Demo @(Report.NewDemoCount + Report.RecallDemoCount) Dagens Resultat
Besøg Demo
- +
- + @@ -116,20 +116,18 @@
Km Aften
-@if (!string.IsNullOrWhiteSpace(Report.Description) || !string.IsNullOrWhiteSpace(Report.SupervisedBy)) -{ - - - - - - - - - - - - - -
TekstMedkørende Supervisor
@Report.Description@Report.SupervisedBy
-} + + + + + + + + + + + + + + +
BeskrivelseMedkørende Supervisor
@Report.Description@Report.SupervisedBy
diff --git a/Wonky.Client/Components/TopbarDisplayUser.razor b/Wonky.Client/Components/TopbarDisplayUser.razor index 8625b54b..f6331a3c 100644 --- a/Wonky.Client/Components/TopbarDisplayUser.razor +++ b/Wonky.Client/Components/TopbarDisplayUser.razor @@ -18,6 +18,8 @@ @using System.Security.Claims - @context.User.Identity?.Name +
+ @context.User.Identity?.Name +
\ No newline at end of file diff --git a/Wonky.Client/Components/TopbarNavigation.razor b/Wonky.Client/Components/TopbarNavigation.razor index 995c5f35..cff72bfb 100644 --- a/Wonky.Client/Components/TopbarNavigation.razor +++ b/Wonky.Client/Components/TopbarNavigation.razor @@ -18,7 +18,9 @@ @using System.Security.Claims - LOG AF - HJÆLP +
+ LOG AF + HJÆLP +
\ No newline at end of file diff --git a/Wonky.Client/Pages/ActivityVisitNew.razor b/Wonky.Client/Pages/ActivityVisitNew.razor index 7240d436..a2f27512 100644 --- a/Wonky.Client/Pages/ActivityVisitNew.razor +++ b/Wonky.Client/Pages/ActivityVisitNew.razor @@ -52,7 +52,7 @@
- @if (!string.IsNullOrEmpty(_draft.VatNumber)) + @if (!string.IsNullOrEmpty(_draft.VatNumber) && string.IsNullOrWhiteSpace(_draft.Address1)) { @@ -70,43 +70,38 @@
- - + +
- +
- +
- +
- +
- +
- +
diff --git a/Wonky.Client/Pages/ActivityVisitNew.razor.cs b/Wonky.Client/Pages/ActivityVisitNew.razor.cs index 512158cd..3f8b5e9f 100644 --- a/Wonky.Client/Pages/ActivityVisitNew.razor.cs +++ b/Wonky.Client/Pages/ActivityVisitNew.razor.cs @@ -118,7 +118,7 @@ public partial class ActivityVisitNew : IDisposable _draft.SalesRep = _ux.Adviser; _draft.Account = _company.Account; _draft.VatNumber = _company.VatNumber; - _draft.EMail = _company.Email; + _draft.Email = _company.Email; _draft.Phone = _company.Phone; _draft.Mobile = _company.Mobile; @@ -146,9 +146,14 @@ public partial class ActivityVisitNew : IDisposable private async Task CreateActivity() { + if (string.IsNullOrWhiteSpace(_draft.Address1)) + { + _toast.ShowError("Kunde adresse er ufuldstændig."); + return; + } + HideButtons = true; _draft.ActivityDate = _prefs.WorkDate; - var activityType = _draft.ActivityTypeEnum switch { "phone" => "T:", @@ -279,7 +284,7 @@ public partial class ActivityVisitNew : IDisposable InvalidActivity = InvalidActivityType || _poFormInvalid || DraftStateProvider.Draft.Items.Count == 0 - || (_draft.ActivityStatusEnum == "offer" && string.IsNullOrWhiteSpace(_draft.EMail)); + || (_draft.ActivityStatusEnum == "offer" && string.IsNullOrWhiteSpace(_draft.Email)); if (InvalidActivity) { diff --git a/Wonky.Client/Pages/AdminSalesReportView.razor b/Wonky.Client/Pages/AdminSalesReportView.razor index 3a1d44b2..1cfb15ca 100644 --- a/Wonky.Client/Pages/AdminSalesReportView.razor +++ b/Wonky.Client/Pages/AdminSalesReportView.razor @@ -20,18 +20,23 @@ @page "/admin/users/advisers/{CountryCode}/{UserId}/reports/{ReportDate}" @attribute [Authorize(Roles = "Admin")] +@_report.Report.Name +
-
+
@if (!string.IsNullOrWhiteSpace(ReportDate)) {

@DateTime.Parse(ReportDate).ToLongDateString()

}
-
+
+
+

@_report.Report.Name

+
diff --git a/Wonky.Client/Pages/SalesReportView.razor b/Wonky.Client/Pages/SalesReportView.razor index ef1ff83c..c45bfa29 100644 --- a/Wonky.Client/Pages/SalesReportView.razor +++ b/Wonky.Client/Pages/SalesReportView.razor @@ -20,18 +20,23 @@ @page "/sales-reports/view/{ReportDate}" @attribute [Authorize(Roles = "Adviser,Admin,Supervisor")] +@_report.Report.Name +
-
+
-
+
@if (!string.IsNullOrWhiteSpace(ReportDate)) {

@DateTime.Parse(ReportDate).ToLongDateString()

}
-
+
+
+

@_report.Report.Name

+
diff --git a/Wonky.Client/Shared/MainLayout.razor b/Wonky.Client/Shared/MainLayout.razor index 9b0e1eb7..34fcc81b 100644 --- a/Wonky.Client/Shared/MainLayout.razor +++ b/Wonky.Client/Shared/MainLayout.razor @@ -18,16 +18,17 @@ @using Wonky.Client.Components
-