diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor index e8fea5c1..a8df4043 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor +++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor @@ -34,309 +34,290 @@
- @if (!_kanvas) + @if (_userInfo.CountryCode is "DK") { - @if (_userInfo.CountryCode is "DK") - { - Arbejdssted - } - @if (_company.Account.StartsWith("NY")) - { - Statistik - } - else - { - Statistik - } - + Arbejdssted } + @if (_company.Account.StartsWith("NY")) + { + Statistik + } + else + { + Statistik + } + Tilbage
// erp context - -
- @* Company Name *@ - -
- - -
- @* Company Attention *@ - -
- - -
- @* Address 1 *@ - -
- - -
- @* Address 2 *@ - -
- - -
- @* Post Code *@ - -
- - -
- @* City Name *@ - -
- - -
- @* Email *@ - -
- - -
- @* Phone *@ - -
- - -
- @* Mobile *@ - -
- - -
- @* Email *@ - -
- - -
+ +
+ @* 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 *@ -
- -
- } - -
- -
- @* activity buttons *@ -
-
- @if (!_kanvas) - { - - } -
-
- @if (!_kanvas) - { - - } -
-
- @if (!_kanvas ) - { - - } -
-
- - -
-
- - @if (!_kanvas) + @if (_userInfo.CountryCode.ToLower() == "dk") { -
- @* crm context - OBS note *@ -
- -
- @if (string.IsNullOrWhiteSpace(_company.Note)) - { - - } - 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 *@ -
- -
-
- - - - -
-
- -
- -
- -
- - -
-
-
- -
- +
+
+
} - - @if (!_kanvas) - { -
-
-
- + else + { +
+ @* placeholder *@
-
- @if (_userInfo.CountryCode is "DK") + } + @* 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 *@ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+ @* crm context - OBS note *@ +
+ +
+ @if (string.IsNullOrWhiteSpace(_company.Note)) + { + + } + else + { + + } + +
+ @* Save CRM data button *@ +
+ +
+
+ @* crm context - contacts *@ +
+ +
+
+
+
+
Stilling
+
Navn
+
Direkte
+
+ +
+
+
+ @if (_contacts.Any()) { - Kemi Dokumentation + @foreach (var contact in _contacts) + { +
+
+
@contact.JobTitle
+
@contact.FirstName @contact.LastName
+
+ @contact.PhoneDirect +
+
+ +
+
+
+ } }
-
- } +
+
+ @* crm context - dates and interval *@ +
+ +
+
+ + + + +
+
+ +
+ +
+ +
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ @if (_userInfo.CountryCode is "DK") + { + Kemi Dokumentation + } +
+
} @if (_working) @@ -348,4 +329,4 @@ @ref="_vatLookupPopup" OnSelectedCompany="SelectedCompanyCallback"/> + @ref="_contactViewPopup" OnSaveClicked="WriteContactCallback" OnDeleteClicked="DeleteContactCallback"/> \ No newline at end of file diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs index adda36ac..7023632a 100644 --- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs +++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs @@ -77,7 +77,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable private bool _erpEditDisabled = true; private bool _vatEditDisabled = true; private string _toggleButtonText = ""; - private bool _kanvas; private string _inventoryLink = ""; private string _activitiesLink = ""; private string _invoiceLink = ""; @@ -117,13 +116,23 @@ public partial class AdvisorCustomerViewEditPage : IDisposable _erpFormContext = new EditContext(_company); _erpFormContext.OnFieldChanged += HandleFieldChanged; _erpFormContext.OnValidationStateChanged += ValidationChanged!; + /* + * fetch company + */ + _company = await AdvisorCustomerRepo.GetCompanyById(CompanyId); + /* + * redirect if KANVAS + */ + if (_company.Account.StartsWith("KANVAS")) + { + Navigator.NavigateTo($"/advisor/customers/{CompanyId}/activities/new"); + } /* * fetch user info from local storage */ _userInfo = await UserInfoService.GetUserInfo(); _countryCode = _userInfo.CountryCode.ToLower(); _countryIsDk = _countryCode == "dk"; - _company = await AdvisorCustomerRepo.GetCompanyById(CompanyId); _infoDrawer = await DrawerService.GetInfoDrawerAsync(CompanyId); _infoDrawer.Content = _company; await DrawerService.StoreInfoDrawerAsync(CompanyId, _infoDrawer); @@ -139,16 +148,9 @@ public partial class AdvisorCustomerViewEditPage : IDisposable { _enableActivity = 1; } - if (_company.Account.StartsWith("KANVAS")) - { - _kanvas = true; - Navigator.NavigateTo($"/advisor/customers/{CompanyId}/activities/new"); - } /* * only execute if the InfoDrawer.Company is not KANVAS */ - if (!_kanvas) - { Logger.LogDebug("_company => {}", JsonSerializer.Serialize(_company)); /* * toggle view button text @@ -213,7 +215,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable _companyVatAddress = PrepareVatAddress(_company); } // await GetContacts(CompanyId); - } /* * remove loading image */ @@ -223,9 +224,6 @@ public partial class AdvisorCustomerViewEditPage : IDisposable protected override async Task OnAfterRenderAsync(bool firstRender) { - if (_kanvas) - return; - if (firstRender) { await GetContacts(CompanyId); @@ -240,9 +238,6 @@ 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.cs b/Wonky.Client/Pages/CatalogProductDetailPage.razor.cs index f6f8b5ba..35aa9287 100644 --- a/Wonky.Client/Pages/CatalogProductDetailPage.razor.cs +++ b/Wonky.Client/Pages/CatalogProductDetailPage.razor.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Components; -using Toolbelt.Blazor; using Wonky.Client.HttpInterceptors; using Wonky.Client.HttpRepository; using Wonky.Entity.Views; @@ -16,6 +15,7 @@ public partial class CatalogProductDetailPage // ############################################################## [Parameter] public string SalesItemId { get; set; } = ""; + [Parameter] public string CustomerId { get; set; } = ""; // ############################################################## private ProductDetailView _item = new(); diff --git a/Wonky.Client/Wonky.Client.csproj b/Wonky.Client/Wonky.Client.csproj index 13d00f92..84bb4aee 100644 --- a/Wonky.Client/Wonky.Client.csproj +++ b/Wonky.Client/Wonky.Client.csproj @@ -11,11 +11,11 @@ - - - - - + + + + + diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index 044ebee4..338532f2 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,8 +1,8 @@ { "appInfo": { "name": "Wonky Online", - "version": "211.0", - "rc": true, + "version": "213.0", + "rc": false, "sandBox": true, "image": "grumpy-coder.png", "sdk": "dotnet 7.0" @@ -21,7 +21,7 @@ }, "apiConfig": { "assetUrl": "https://files.innotec.dk", - "baseUrl": "https://eta.innotec.dk", + "baseUrl": "https://dev.innotec.dk", "catalog": "api/v2/catalog/country", "crmCustomers": "api/v2/crm/companies", "crmReports": "api/v2/crm/advisors/reports",