From 97331a0467435262da292b37d14f4bbe10a7d7e2 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Tue, 7 Nov 2023 13:39:20 +0100 Subject: [PATCH] refactor activity header into component - testing --- .../Components/ActivityHeaderComponent.razor | 92 +++++++++++++++ .../ReportLedgerActivityComponent.razor | 10 +- .../Components/ReportVisitComponent.razor | 10 +- .../AdvisorCustomerActivityViewEditPage.razor | 16 ++- Wonky.Client/Pages/OfficeOrderViewPage.razor | 107 ++++-------------- Wonky.Client/wwwroot/appsettings.json | 2 +- Wonky.Client/wwwroot/css/app.css | 3 + Wonky.Entity/Views/ReportItemView.cs | 103 +---------------- 8 files changed, 142 insertions(+), 201 deletions(-) create mode 100644 Wonky.Client/Components/ActivityHeaderComponent.razor diff --git a/Wonky.Client/Components/ActivityHeaderComponent.razor b/Wonky.Client/Components/ActivityHeaderComponent.razor new file mode 100644 index 00000000..1c1b22e1 --- /dev/null +++ b/Wonky.Client/Components/ActivityHeaderComponent.razor @@ -0,0 +1,92 @@ +@using Wonky.Entity.Views + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

@ReportItem.Company.Name

+

@ReportItem.ESalesNumber

+ @if (ReportItem.Express) + { +

HASTER

+ } + @if (ReportItem.VisitTypeEnum.ToLower() == "phone" || ReportItem.OurRef.Contains("T:")) + { +
TELEFONORDRE
+ } + @if (ReportItem.StatusTypeEnum is "Quote") + { +
TILBUD
+ } +
+
Dato@ReportItem.OrderDateKonto@ReportItem.Company.Account
Telefon@ReportItem.Company.PhoneKøber@ReportItem.YourRef
CVR/VAT@ReportItem.Company.VatNumberRekvisition@ReportItem.ReferenceNumber
Navn@ReportItem.Company.NameLev.Navn@ReportItem.DlvName
Adresse@ReportItem.Company.Address1Lev.Adresse@ReportItem.DlvAddress1
Adresse@ReportItem.Company.Address2Lev.Adresse@ReportItem.DlvAddress2
Postnr By@ReportItem.Company.ZipCode @ReportItem.Company.CityLev.Postnr By@ReportItem.DlvZipCity
Email@ReportItem.Company.Email
Vores Ref@ReportItem.OurRefOprettet af@ReportItem.CreatedBy
+ +@code { + + [Parameter] + public ReportItemView ReportItem { get; set; } = new(); + +} \ No newline at end of file diff --git a/Wonky.Client/Components/ReportLedgerActivityComponent.razor b/Wonky.Client/Components/ReportLedgerActivityComponent.razor index e13fc8c8..e5468d72 100644 --- a/Wonky.Client/Components/ReportLedgerActivityComponent.razor +++ b/Wonky.Client/Components/ReportLedgerActivityComponent.razor @@ -41,7 +41,7 @@ @* NEW row *@ - NY + N @ReportDataView.NewVisitCount @ReportDataView.NewDemoCount @ReportDataView.NewSaleCount @@ -53,7 +53,7 @@ @* RECALL row *@ - SALG + R @ReportDataView.RecallVisitCount @ReportDataView.RecallDemoCount @ReportDataView.RecallSaleCount @@ -87,17 +87,17 @@ @ReportDataView.WebCountMonth @ReportDataView.WebTurnoverMonth - @* SUMMARY arow *@ + @* SUMMARY row *@ NORMAL SALG - @(ReportDataView.NormalTurnover + ReportDataView.PhoneTurnover) + @(ReportDataView.NormalTurnover) - @(ReportDataView.NormalTurnoverMonth + ReportDataView.PhoneTurnoverMonth) + @(ReportDataView.NormalTurnoverMonth) @* SAS row *@ diff --git a/Wonky.Client/Components/ReportVisitComponent.razor b/Wonky.Client/Components/ReportVisitComponent.razor index 82cdc7c0..95551ca8 100644 --- a/Wonky.Client/Components/ReportVisitComponent.razor +++ b/Wonky.Client/Components/ReportVisitComponent.razor @@ -118,23 +118,23 @@ @($"{line.Price:N2}") @($"{line.Discount:N2}") @($"{line.LineSum:N2}") - + } - + - + SAS @ReportItem.SasAmount - + NORMAL @ReportItem.OrderAmount - + TOTAL @(ReportItem.SasAmount + ReportItem.OrderAmount) diff --git a/Wonky.Client/Pages/AdvisorCustomerActivityViewEditPage.razor b/Wonky.Client/Pages/AdvisorCustomerActivityViewEditPage.razor index c4c3163b..8a7bf296 100644 --- a/Wonky.Client/Pages/AdvisorCustomerActivityViewEditPage.razor +++ b/Wonky.Client/Pages/AdvisorCustomerActivityViewEditPage.razor @@ -34,7 +34,9 @@ {

TILBUD

} - @if (ReportItem.VisitTypeEnum.ToLower() == "phone" || ReportItem.OurRef.Contains("T:")) + @if (ReportItem.VisitTypeEnum.ToLower() == "phone" || + ReportItem.OurRef.Contains("T:") || + ReportItem.OurRef.Contains("TLF:")) {

TELEFONORDRE

} @@ -89,8 +91,20 @@ Lev.Postnr By @ReportItem.DlvZipCity + + Email + @ReportItem.Company.Email + + + Vores Ref + @ReportItem.OurRef + Oprettet af + @ReportItem.CreatedBy + + + diff --git a/Wonky.Client/Pages/OfficeOrderViewPage.razor b/Wonky.Client/Pages/OfficeOrderViewPage.razor index 35226a75..89d83448 100644 --- a/Wonky.Client/Pages/OfficeOrderViewPage.razor +++ b/Wonky.Client/Pages/OfficeOrderViewPage.razor @@ -21,94 +21,27 @@ @page "/office/customers/{CompanyId}/orders/{OrderId}" @ReportItem.ESalesNumber - @ReportItem.Company.Name -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- + +
+
+
+ +
+ @if (ReportItem is { Express: true, ProcessStatusEnum: "None" }) + { + + +
+
- @if (ReportItem is { Express: true, ProcessStatusEnum: "None" }) - { - - -
- -
-
-
- } -
-
-
-

@ReportItem.Company.Name

- @if (ReportItem.Express) - { -

HASTER

- } - @if (ReportItem.VisitTypeEnum.ToLower() == "phone" || ReportItem.OurRef.Contains("T:")) - { -
TELEFONORDRE
- } - @if (ReportItem.StatusTypeEnum is "Quote") - { -
TILBUD
- } -
-
Dato@ReportItem.OrderDateKonto@ReportItem.Company.Account
Telefon@ReportItem.Company.PhoneKøber@ReportItem.YourRef
CVR/VAT@ReportItem.Company.VatNumberRekvisition@ReportItem.ReferenceNumber
Navn@ReportItem.Company.NameLev.Navn@ReportItem.DlvName
Adresse@ReportItem.Company.Address1Lev.Adresse@ReportItem.DlvAddress1
Adresse@ReportItem.Company.Address2Lev.Adresse@ReportItem.DlvAddress2
Postnr By@ReportItem.Company.ZipCode @ReportItem.Company.CityLev.Postnr By@ReportItem.DlvZipCity
Email@ReportItem.Company.Email
+ + + } + + + + + diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index ddb7161a..fdd45629 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,7 +1,7 @@ { "appInfo": { "name": "Wonky Online", - "version": "292.0", + "version": "294.0", "rc": true, "sandBox": true, "image": "grumpy-coder.png", diff --git a/Wonky.Client/wwwroot/css/app.css b/Wonky.Client/wwwroot/css/app.css index ff0cf0d5..19353776 100644 --- a/Wonky.Client/wwwroot/css/app.css +++ b/Wonky.Client/wwwroot/css/app.css @@ -25,6 +25,9 @@ .i-larger { font-size: 1.3rem; } +.sas-check { + font-size: 2rem; +} .btn.btn-edit { color: #030303; diff --git a/Wonky.Entity/Views/ReportItemView.cs b/Wonky.Entity/Views/ReportItemView.cs index 872cde8b..430f2b48 100644 --- a/Wonky.Entity/Views/ReportItemView.cs +++ b/Wonky.Entity/Views/ReportItemView.cs @@ -19,132 +19,31 @@ namespace Wonky.Entity.Views; public class ReportItemView { - /// - /// Customer company info - /// public ReportItemCustomer Company { get; set; } = new(); - - /// - /// Lines - /// public List Lines { get; set; } = new(); - - /// - /// Activity entity id - /// public string ActivityId { get; set; } = ""; - - /// - /// Closed sale - /// public bool Closed { get; set; } - - /// - /// Entity CreateTimestamp as string - /// + public string CreatedBy { get; set; } = ""; public string CreateTimestamp { get; set; } = ""; - - /// - /// CRM Note - /// public string CrmNote { get; set; } = ""; - - /// - /// Product demo - /// public string Demo { get; set; } = ""; - - /// - /// Customer delivery address line 1 - /// public string DlvAddress1 { get; set; } = ""; - - /// - /// Customer delivery address line 2 - /// public string DlvAddress2 { get; set; } = ""; - - /// - /// Customer deliver name - /// public string DlvName { get; set; } = ""; - - /// - /// Customer delivery post code and city name - /// public string DlvZipCity { get; set; } = ""; - /// - /// ESales number - /// public string ESalesNumber { get; set; } = ""; - - /// - /// express flag - /// public bool Express { get; set; } - - /// - /// Office note - /// public string OfficeNote { get; set; } = ""; - - /// - /// Order amount - /// public decimal OrderAmount { get; set; } - - /// - /// Order date - /// public string OrderDate { get; set; } = ""; - - /// - /// Our reference - /// public string OurRef { get; set; } = ""; - - /// - /// ProcessStatus as string - /// public string ProcessStatusEnum { get; set; } = ""; - - /// - /// QuoteStatus as string - /// public string QuoteStatusEnum { get; set; } = ""; - - /// - /// Customer reference number - /// public string ReferenceNumber { get; set; } = ""; - - /// - /// Product sale resume - /// public string Sales { get; set; } = ""; - - /// - /// entity id for sales rep - /// public string SalesRepId { get; set; } = ""; - - /// - /// Order safe seal amount - /// public decimal SasAmount { get; set; } - - /// - /// Status type enum as string - /// public string StatusTypeEnum { get; set; } = ""; - - /// - /// Visit type enum as string - /// public string VisitTypeEnum { get; set; } = ""; - - /// - /// Customer reference - /// public string YourRef { get; set; } = ""; } \ No newline at end of file