From 7b87fa6b882dacd87486de6a7e8946ce3a6b5077 Mon Sep 17 00:00:00 2001 From: Frede Hundewadt Date: Wed, 9 Aug 2023 09:44:48 +0200 Subject: [PATCH] fix kanvas --- .../CustomerInventoryListComponent.razor | 2 +- .../Pages/AdvisorActivityCreatePage.razor.cs | 2 + .../AdvisorCustomerInventoryListPage.razor | 10 +- .../Pages/AdvisorCustomerViewEditPage.razor | 557 +++++++++--------- .../AdvisorCustomerViewEditPage.razor.cs | 7 + .../Pages/CatalogProductDetailPage.razor | 2 +- Wonky.Client/wwwroot/appsettings.json | 6 +- Wonky.Entity/Views/ProductDetailView.cs | 1 + Wonky.Entity/Views/SalesItemView.cs | 1 + 9 files changed, 305 insertions(+), 283 deletions(-) diff --git a/Wonky.Client/Components/CustomerInventoryListComponent.razor b/Wonky.Client/Components/CustomerInventoryListComponent.razor index 35ec2ba1..d4f6f058 100644 --- a/Wonky.Client/Components/CustomerInventoryListComponent.razor +++ b/Wonky.Client/Components/CustomerInventoryListComponent.razor @@ -85,7 +85,7 @@
diff --git a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs index b8f12558..b72e6229 100644 --- a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs +++ b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs @@ -212,6 +212,8 @@ public partial class AdvisorActivityCreatePage : IDisposable protected override async Task OnAfterRenderAsync(bool firstRender) { + if (_kanvas) + return; if (firstRender) { if (!_company.Account.StartsWith("NY")) diff --git a/Wonky.Client/Pages/AdvisorCustomerInventoryListPage.razor b/Wonky.Client/Pages/AdvisorCustomerInventoryListPage.razor index 511a4595..4f4c038f 100644 --- a/Wonky.Client/Pages/AdvisorCustomerInventoryListPage.razor +++ b/Wonky.Client/Pages/AdvisorCustomerInventoryListPage.razor @@ -36,8 +36,14 @@ - - +
+ +
+ +@* reorder overlay *@ + @if (Working) { diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor index 5bdc8694..e8fea5c1 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor +++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor @@ -34,304 +34,309 @@
- @if (_userInfo.CountryCode is "DK") + @if (!_kanvas) { - Arbejdssted + @if (_userInfo.CountryCode is "DK") + { + Arbejdssted + } + @if (_company.Account.StartsWith("NY")) + { + Statistik + } + else + { + Statistik + } + } - @if (_company.Account.StartsWith("NY")) - { - Statistik - } - else - { - Statistik - } - Tilbage
- // erp context - -
- @* Company Name *@ - -
- - + +
+ @* Company Name *@ + +
+ + +
+ @* Company Attention *@ + +
+ + +
+ @* Address 1 *@ + +
+ + +
+ @* Address 2 *@ + +
+ + +
+ @* Post Code *@ + +
+ + +
+ @* City Name *@ + +
+ + +
+ @* Email *@ + +
+ + +
+ @* Phone *@ + +
+ + +
+ @* Mobile *@ + +
+ + +
+ @* Email *@ + +
+ + +
+ + @if (!_kanvas) + { + @* entity segment *@ + @if (_userInfo.CountryCode.ToLower() == "dk") + { + +
+ + + + + + +
+
+
+
+
+
+ } + else + { +
+ @* placeholder *@ +
+ } + @* Enable edit/save *@ +
+ +
+ @* Force enable visit *@ +
+ +
+ @* Save erp data *@ +
+ +
+ @* vat number*@ +
+ +
+
+ + + + + +
+
+ @* Enable edit/save vatnumber *@ +
+ +
+ @* vat lookup *@ +
+ @switch (_countryCode) + { + case "dk": + + break; + case "no": + brreg.no + break; + case "se": + allabolag.se + break; + } +
+ @* save vat number *@ +
+ +
+ } +
- @* Company Attention *@ - -
- - -
- @* Address 1 *@ - -
- - -
- @* Address 2 *@ - -
- - -
- @* Post Code *@ - -
- - -
- @* City Name *@ - -
- - -
- @* Email *@ - -
- - -
- @* Phone *@ - -
- - -
- @* Mobile *@ - -
- - -
- @* Email *@ - -
- - + +
+ @* activity buttons *@ +
+
+ @if (!_kanvas) + { + + } +
+
+ @if (!_kanvas) + { + + } +
+
+ @if (!_kanvas ) + { + + } +
+
+ + +
@if (!_kanvas) { - @* entity segment *@ - @if (_userInfo.CountryCode.ToLower() == "dk") - { - -
- - - - - - -
-
-
-
-
-
- } - else - { -
- @* placeholder *@ -
- } - @* Enable edit/save *@ -
- -
- @* Force enable visit *@ -
- -
- @* Save erp data *@ -
- -
- @* vat number*@ -
- -
-
- - - - - -
-
- @* Enable edit/save vatnumber *@ -
- -
- @* vat lookup *@ -
- @switch (_countryCode) - { - case "dk": - - break; - case "no": - brreg.no - break; - case "se": - allabolag.se - break; - } -
- @* save vat number *@ -
- -
- } - -
- -
- @* activity buttons *@ -
-
- @if (!_kanvas) - { - - } -
-
- @if (!_kanvas) - { - - } -
-
- @if (!_kanvas ) - { - - } -
-
- - -
-
- - @if (!_kanvas) - { -
- @* crm context - OBS note *@ -
- -
- @if (string.IsNullOrWhiteSpace(_company.Note)) - { - - } - else - { - - } - -
- @* Save CRM data button *@ -
- -
-
- @* crm context - contacts *@ -
- -
-
-
-
-
Stilling
-
Navn
-
Direkte
-
- -
-
-
- @if (_contacts.Any()) +
+ @* crm context - OBS note *@ +
+ +
+ @if (string.IsNullOrWhiteSpace(_company.Note)) { - @foreach (var contact in _contacts) - { -
-
-
@contact.JobTitle
-
@contact.FirstName @contact.LastName
-
- @contact.PhoneDirect -
-
- -
+ + } + else + { + + } + +
+ @* Save CRM data button *@ +
+ +
+
+ @* crm context - contacts *@ +
+ +
+
+
+
+
Stilling
+
Navn
+
Direkte
+
+
+
+ @if (_contacts.Any()) + { + @foreach (var contact in _contacts) + { +
+
+
@contact.JobTitle
+
@contact.FirstName @contact.LastName
+
+ @contact.PhoneDirect +
+
+ +
+
+
+ } } - } +
-
- @* crm context - dates and interval *@ -
- -
-
- - - - + @* crm context - dates and interval *@ +
+ +
+
+ + + + +
+
+ +
+ +
+ +
+ +
- -
- +
+ +
+ +
- -
- - -
-
-
- -
- -
-
- } + } -
-
-
- -
-
- @if (_userInfo.CountryCode is "DK") - { - Kemi Dokumentation - } -
-
+ @if (!_kanvas) + { +
+
+
+ +
+
+ @if (_userInfo.CountryCode is "DK") + { + Kemi Dokumentation + } +
+
+ } } @if (_working) diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs index 907092ea..adda36ac 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs +++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs @@ -142,6 +142,7 @@ public partial class AdvisorCustomerViewEditPage : IDisposable if (_company.Account.StartsWith("KANVAS")) { _kanvas = true; + Navigator.NavigateTo($"/advisor/customers/{CompanyId}/activities/new"); } /* * only execute if the InfoDrawer.Company is not KANVAS @@ -222,6 +223,9 @@ public partial class AdvisorCustomerViewEditPage : IDisposable protected override async Task OnAfterRenderAsync(bool firstRender) { + if (_kanvas) + return; + if (firstRender) { await GetContacts(CompanyId); @@ -236,6 +240,9 @@ public partial class AdvisorCustomerViewEditPage : IDisposable private async Task ReloadHistory(bool force = false) { + if (_kanvas) + return; + if (force) { Toaster.ShowInfo("Afventer svar fra tjenester ..."); diff --git a/Wonky.Client/Pages/CatalogProductDetailPage.razor b/Wonky.Client/Pages/CatalogProductDetailPage.razor index 5a30638b..1516fd71 100644 --- a/Wonky.Client/Pages/CatalogProductDetailPage.razor +++ b/Wonky.Client/Pages/CatalogProductDetailPage.razor @@ -1,7 +1,7 @@ @using Wonky.Client.Components @using System.Text.Json @page "/catalog/item/{SalesItemId}" - +@page "/advisor/customers/{CustomerId}/history/inventory/{SalesItemId}" @if (!string.IsNullOrWhiteSpace(_item.Sku)) { diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index f0b67023..044ebee4 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,7 +1,7 @@ { "appInfo": { "name": "Wonky Online", - "version": "208.0", + "version": "211.0", "rc": true, "sandBox": true, "image": "grumpy-coder.png", @@ -15,13 +15,13 @@ }, "Debug": { "LogLevel": { - "Default": "Critical" + "Default": "" } } }, "apiConfig": { "assetUrl": "https://files.innotec.dk", - "baseUrl": "https://dev.innotec.dk", + "baseUrl": "https://eta.innotec.dk", "catalog": "api/v2/catalog/country", "crmCustomers": "api/v2/crm/companies", "crmReports": "api/v2/crm/advisors/reports", diff --git a/Wonky.Entity/Views/ProductDetailView.cs b/Wonky.Entity/Views/ProductDetailView.cs index e81f33a0..87d19ca1 100644 --- a/Wonky.Entity/Views/ProductDetailView.cs +++ b/Wonky.Entity/Views/ProductDetailView.cs @@ -26,6 +26,7 @@ public class ProductDetailView public string PictureLink { get; set; } = ""; public string ProductGroup { get; set; } = ""; public bool Discontinued { get; set; } + public bool OnDemand { get; set; } public int BoxSize { get; set; } public List Documents { get; set; } = new(); } diff --git a/Wonky.Entity/Views/SalesItemView.cs b/Wonky.Entity/Views/SalesItemView.cs index aed9771a..3edb97f5 100644 --- a/Wonky.Entity/Views/SalesItemView.cs +++ b/Wonky.Entity/Views/SalesItemView.cs @@ -28,6 +28,7 @@ public class SalesItemView public string PictureLink { get; set; } = ""; public string Location { get; set; } = ""; public bool Discontinued { get; set; } + public bool OnDemand { get; set; } public int BoxSize { get; set; } public List Rates { get; set; } = new(); } \ No newline at end of file