From 5258adfa072bbc8851488cb864b045bea85a67b6 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Wed, 28 Jun 2023 11:20:08 +0200 Subject: [PATCH] cosmetic update of company list add history reload to activity page allow km morning to be edited --- .../OfficeCountryCustomerListComponent.razor | 11 +- .../Pages/AdvisorActivityCreatePage.razor | 11 +- .../Pages/AdvisorActivityCreatePage.razor.cs | 59 +++- .../AdvisorCustomerViewEditPage.razor.cs | 1 + .../Pages/AdvisorReportCreatePage.razor | 2 +- .../Pages/AdvisorReportCreatePage.razor.cs | 16 +- Wonky.Client/wwwroot/appsettings.json | 2 +- Wonky.Client/wwwroot/css/20230614.css | 252 ------------------ .../wwwroot/css/{20230607.css => app.css} | 25 +- Wonky.Client/wwwroot/index.html | 2 +- 10 files changed, 93 insertions(+), 288 deletions(-) delete mode 100644 Wonky.Client/wwwroot/css/20230614.css rename Wonky.Client/wwwroot/css/{20230607.css => app.css} (89%) diff --git a/Wonky.Client/Components/OfficeCountryCustomerListComponent.razor b/Wonky.Client/Components/OfficeCountryCustomerListComponent.razor index 8ce63e9b..3e7da759 100644 --- a/Wonky.Client/Components/OfficeCountryCustomerListComponent.razor +++ b/Wonky.Client/Components/OfficeCountryCustomerListComponent.razor @@ -17,6 +17,7 @@ @using Wonky.Client.Components; @using Wonky.Client.Helpers; @using Wonky.Client.OverlayOffice + @if (CompanyList.Any()) {
@@ -24,8 +25,8 @@ {
-
- @company.Name +
+ @company.Name @(company.HasFolded == 1 ? "(OPHØRT)" : "")
@@ -33,7 +34,7 @@ - + @@ -58,13 +59,13 @@
Konto @company.Account Org Nr.@(string.IsNullOrWhiteSpace(@company.VatNumber) ? "~/~" : @company.VatNumber) @(string.IsNullOrWhiteSpace(@company.VatNumber) ? "mangler" : @company.VatNumber)
Telefon
Sidst besøgt - @company.LastVisit + @(Utils.MapVisitState(company.LastVisit) == "the-draw" ? "?" : company.LastVisit)
Næste besøg - @company.NextVisit + @(Utils.MapVisitState(company.LastVisit) == "the-draw" ? "?" : company.NextVisit)
diff --git a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor index a5f4b45b..b1684818 100644 --- a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor +++ b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor @@ -48,9 +48,12 @@ else
}
-
+
@_activity.Name (@_activity.Account)
+
+ +
@@ -204,19 +207,19 @@ else @* ***************** Invoice history overlay ***************************** *@ - +
@* ***************** Visit hisotry overlay ***************************** *@ - +
@* ***************** Product Inventory overlay ***************************** *@ - +
diff --git a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs index 321b165b..1c39ce3d 100644 --- a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs +++ b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs @@ -84,7 +84,6 @@ public partial class AdvisorActivityCreatePage : IDisposable private CompanyDto _company = new(); private bool _kanvas; private bool _hideDeliveryAddress = true; - private InfoDrawer _infoDrawer = new(); private ActivityDrawer _activityDrawer = new(); private InventoryDrawer _inventoryDrawer = new(); private InvoiceDrawer _invoiceDrawer = new(); @@ -94,6 +93,7 @@ public partial class AdvisorActivityCreatePage : IDisposable private EditContext _formContext; private UserManagerEditView _salesRep = new(); private bool _formInvalid = true; + private bool _disableButtons = true; protected override async Task OnInitializedAsync() @@ -110,18 +110,6 @@ public partial class AdvisorActivityCreatePage : IDisposable _company = await CompanyRepo.GetCompanyById(CompanyId); - if (!_company.Account.StartsWith("NY")) - { - _inventoryDrawer = await DrawerService.GetInventoryDrawerAsync(CompanyId, true); - _invoiceDrawer = await DrawerService.GetInvoiceDrawerAsync(CompanyId, true); - } - - _infoDrawer.Content = _company; - _infoDrawer.LastDateModified = DateTime.Today; - await DrawerService.StoreInfoDrawerAsync(CompanyId, _infoDrawer); - - _activityDrawer = await DrawerService.GetActivityDrawerAsync(CompanyId, true); - if (_company.Account.StartsWith("KANVAS")) { _kanvas = true; @@ -221,6 +209,51 @@ public partial class AdvisorActivityCreatePage : IDisposable StateHasChanged(); } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + if (!_company.Account.StartsWith("NY")) + { + _inventoryDrawer = await DrawerService.GetInventoryDrawerAsync(CompanyId, true); + _invoiceDrawer = await DrawerService.GetInvoiceDrawerAsync(CompanyId, true); + } + _activityDrawer = await DrawerService.GetActivityDrawerAsync(CompanyId, true); + } + if (!_company.Account.StartsWith("NY")) + { + _disableButtons = false; + } + } + + + private async Task ReloadHistory(bool force = false) + { + if (force) + { + Toaster.ShowInfo("Afventer svar fra tjenester ..."); + } + + _disableButtons = true; + var newSync = await HistoryRepo.RequestErpSync(CompanyId, _company.HistorySync, force); + await Task.Delay(500); + if (!string.IsNullOrWhiteSpace(newSync)) + { + _company.HistorySync = newSync; + _invoiceDrawer = await DrawerService.GetInvoiceDrawerAsync(CompanyId, force); + _inventoryDrawer = await DrawerService.GetInventoryDrawerAsync(CompanyId, force); + _activityDrawer = await DrawerService.GetActivityDrawerAsync(CompanyId, force); + } + StateHasChanged(); + if (force) + { + Toaster.ShowSuccess("Alle tjenester har svaret."); + } + + _disableButtons = false; + } + private async Task TestOrgNumber() { diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs index 5c5829d1..6afe79c3 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs +++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs @@ -247,6 +247,7 @@ public partial class AdvisorCustomerViewEditPage : IDisposable await Task.Delay(500); if (!string.IsNullOrWhiteSpace(newSync)) { + _company.HistorySync = newSync; if (!_company.Account.StartsWith("NY")) { _ = await DrawerService.GetInvoiceDrawerAsync(CompanyId, force); diff --git a/Wonky.Client/Pages/AdvisorReportCreatePage.razor b/Wonky.Client/Pages/AdvisorReportCreatePage.razor index 96ed11f3..712b1a20 100644 --- a/Wonky.Client/Pages/AdvisorReportCreatePage.razor +++ b/Wonky.Client/Pages/AdvisorReportCreatePage.razor @@ -149,7 +149,7 @@ + disabled="@(NoFigures)"/> /// Field data change event /// @@ -169,10 +171,14 @@ public partial class AdvisorReportCreatePage : IDisposable { // Console.WriteLine($"e FieldName => {e.FieldIdentifier.FieldName}"); FormInvalid = !ReportContext.Validate(); + if (KmMorning == 0) + { + KmMorning = Report.Figures.KmMorning; + } Report.Figures.Distance = Report.Figures.KmEvening - Report.Figures.KmMorning; Report.Figures.DistanceMonth = Report.Figures.Distance + CurrKmMonth; Report.Figures.DistancePrivateMonth = Report.Figures.DistancePrivate + CurrKmPrivate; - if (Report.Figures.Distance is > 1000 or < 0) + if (Report.Figures.Distance is > 1000 or < 0 && Report.Figures.KmMorning > 0) { Toaster.ShowError($"Kørte km for rapporten er '{Report.Figures.Distance}'. Er du sikker på at det er rigtigt?"); } @@ -268,8 +274,8 @@ public partial class AdvisorReportCreatePage : IDisposable // pop confirmation // create a prompt for popup confirmation - var warning = Report.Figures.KmEvening - Report.Figures.KmMorning > 1000 - ? $"Kørte km for rapporten er '{Report.Figures.KmEvening - Report.Figures.KmMorning}'. Er du sikker på at det er rigtigt?
" + var warning = Report.Figures.KmEvening - Report.Figures.KmMorning is > 1000 or < 0 + ? $"Kørte km for rapporten er '{Report.Figures.KmEvening - Report.Figures.KmMorning}'. Er du sikker på at det er rigtigt?
" : ""; Prompt = $"{warning}
Gem rapport for {ThisWorkDate.ToLongDateString()}?"; diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index 0c8e1074..c22f13bb 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,7 +1,7 @@ { "appInfo": { "name": "Wonky Online", - "version": "177.1", + "version": "179.1", "rc": true, "sandBox": true, "image": "grumpy-coder.png", diff --git a/Wonky.Client/wwwroot/css/20230614.css b/Wonky.Client/wwwroot/css/20230614.css deleted file mode 100644 index 619127ef..00000000 --- a/Wonky.Client/wwwroot/css/20230614.css +++ /dev/null @@ -1,252 +0,0 @@ -body { - font-size: 16px; -} - -.draft-expires-msg { - font-size: 0.8em; -} -.busy-signal { - float: right; - z-index: 100; - position: relative; - top: 1px; - right: 10px; -} -.workDate { - font-variant: small-caps; -} - -.action-link-element { - cursor: pointer; -} - -.i-larger { - font-size: 1.3rem; -} - -.btn.btn-edit { - color: #030303; - background-color: #a2a2ec; -} - -html, body { - font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; -} - -h1,h2:focus { - outline: none; -} - -a, .btn-link { - color: #0071c1; -} - -/*.btn-primary {*/ -/* color: #fff;*/ -/* background-color: #1b6ec2;*/ -/* border-color: #1861ac;*/ -/*}*/ - -.inno { - color: #ffaa00; -} - -.inno-display { - display: block; -} - -.inno-hidden { - display: none; -} - -.content { - padding-top: 1.1rem; -} - -.valid.modified:not([type=checkbox]) { - outline: 1px solid #26b050; -} - -.invalid { - outline: 1px solid red; -} - -.validation-message { - color: red; -} - -/* begin state elements */ -.state { - width: 16px; - height: 16px; - min-width: 16px; - min-height: 16px; -} -.the-good { - color: green; -} -.the-bad { - color: orange; -} -.the-ugly { - color: red; -} -.the-dead { - color: black; -} -.the-fast { - color: orange; -} -.the-draw { - color: mediumpurple; -} -.the-good-bg { - background-color: green; -} -.the-bad-bg { - background-color: orange; -} -.the-ugly-bg { - background-color: red; -} -.the-draw-bg { - background-color: mediumpurple; -} -.no-vat-bg { - background-color: lightskyblue; -} -.the-dead-bg { - background-color: black; -} -/* end state elements */ - -/* led elements */ -.led-box { - height: 24px; - width: 24px; - margin: auto; - float: left; -} - -.led-red { - margin: 5px; - width: 24px; - height: 24px; - background-color: #F00; - border-radius: 50%; - box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 12px; - -webkit-animation: blinkRed 0.5s infinite; - -moz-animation: blinkRed 0.5s infinite; - -ms-animation: blinkRed 0.5s infinite; - -o-animation: blinkRed 0.5s infinite; - animation: blinkRed 0.5s infinite; - animation-iteration-count: infinite; -} - -@-webkit-keyframes blinkRed { - from { background-color: #F00; } - 50% { background-color: #A00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;} - to { background-color: #F00; } -} -@-moz-keyframes blinkRed { - from { background-color: #F00; } - 50% { background-color: #A00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;} - to { background-color: #F00; } -} -@-ms-keyframes blinkRed { - from { background-color: #F00; } - 50% { background-color: #A00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;} - to { background-color: #F00; } -} -@-o-keyframes blinkRed { - from { background-color: #F00; } - 50% { background-color: #A00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;} - to { background-color: #F00; } -} -@keyframes blinkRed { - from { background-color: #F00; } - 50% { background-color: #A00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;} - to { background-color: #F00; } -} - -.led-yellow { - margin: 0 auto; - width: 24px; - height: 24px; - background-color: #FF0; - border-radius: 50%; - box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FF0 0 2px 12px; - -webkit-animation: blinkYellow 1s infinite; - -moz-animation: blinkYellow 1s infinite; - -ms-animation: blinkYellow 1s infinite; - -o-animation: blinkYellow 1s infinite; - animation: blinkYellow 1s infinite; -} - -@-webkit-keyframes blinkYellow { - from { background-color: #FF0; } - 50% { background-color: #AA0; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FF0 0 2px 0; } - to { background-color: #FF0; } -} -@-moz-keyframes blinkYellow { - from { background-color: #FF0; } - 50% { background-color: #AA0; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FF0 0 2px 0; } - to { background-color: #FF0; } -} -@-ms-keyframes blinkYellow { - from { background-color: #FF0; } - 50% { background-color: #AA0; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FF0 0 2px 0; } - to { background-color: #FF0; } -} -@-o-keyframes blinkYellow { - from { background-color: #FF0; } - 50% { background-color: #AA0; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FF0 0 2px 0; } - to { background-color: #FF0; } -} -@keyframes blinkYellow { - from { background-color: #FF0; } - 50% { background-color: #AA0; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FF0 0 2px 0; } - to { background-color: #FF0; } -} - -.led-green { - margin: 0 auto; - width: 24px; - height: 24px; - background-color: #ABFF00; - border-radius: 50%; - box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #304701 0 -1px 9px, #89FF00 0 2px 12px; -} - -.led-blue { - margin: 0 auto; - width: 24px; - height: 24px; - background-color: #24E0FF; - border-radius: 50%; - box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #006 0 -1px 9px, #3F8CFF 0 2px 14px; -} -/* end led elements */ - -.footer { - border-top: 2px solid orange; - position: relative; - margin-top: -150px; - height: 150px; - width: 100%; - clear: both; - padding-top: 20px; -} - -footer.version { - display: block; - font-weight: bold; - padding: 0 10px 0 0; -} - -.back-to-top { - position: fixed; - bottom: 25px; - right: 25px; - display: none; -} diff --git a/Wonky.Client/wwwroot/css/20230607.css b/Wonky.Client/wwwroot/css/app.css similarity index 89% rename from Wonky.Client/wwwroot/css/20230607.css rename to Wonky.Client/wwwroot/css/app.css index 619127ef..1b7867d7 100644 --- a/Wonky.Client/wwwroot/css/20230607.css +++ b/Wonky.Client/wwwroot/css/app.css @@ -83,39 +83,52 @@ a, .btn-link { min-height: 16px; } .the-good { - color: green; + color: white; + background-color: green;; } .the-bad { - color: orange; + color: black; + background-color: orange; } .the-ugly { - color: red; + color: black; + background-color: red; } .the-dead { - color: black; + color: white; + background-color: black; } .the-fast { - color: orange; + color: black; + background-color: orange; } .the-draw { - color: mediumpurple; + color: black; + background-color: mediumpurple; } + .the-good-bg { + color: white; background-color: green; } .the-bad-bg { + color: black; background-color: orange; } .the-ugly-bg { + color: black; background-color: red; } .the-draw-bg { + color: white; background-color: mediumpurple; } .no-vat-bg { + color: black; background-color: lightskyblue; } .the-dead-bg { + color: white; background-color: black; } /* end state elements */ diff --git a/Wonky.Client/wwwroot/index.html b/Wonky.Client/wwwroot/index.html index fefc6ffd..fef2e004 100644 --- a/Wonky.Client/wwwroot/index.html +++ b/Wonky.Client/wwwroot/index.html @@ -14,7 +14,7 @@ - +