diff --git a/Wonky.Client/Components/OfficeCountrySalesRepListComponent.razor b/Wonky.Client/Components/OfficeCountryAdvisorListComponent.razor similarity index 84% rename from Wonky.Client/Components/OfficeCountrySalesRepListComponent.razor rename to Wonky.Client/Components/OfficeCountryAdvisorListComponent.razor index c3afd16f..63e0165e 100644 --- a/Wonky.Client/Components/OfficeCountrySalesRepListComponent.razor +++ b/Wonky.Client/Components/OfficeCountryAdvisorListComponent.razor @@ -32,7 +32,11 @@ Kunder
- Rediger + + + Rediger + +
diff --git a/Wonky.Client/Components/OfficeCountrySalesRepListComponent.razor.cs b/Wonky.Client/Components/OfficeCountryAdvisorListComponent.razor.cs similarity index 94% rename from Wonky.Client/Components/OfficeCountrySalesRepListComponent.razor.cs rename to Wonky.Client/Components/OfficeCountryAdvisorListComponent.razor.cs index 8ed8f858..b8a57bbc 100644 --- a/Wonky.Client/Components/OfficeCountrySalesRepListComponent.razor.cs +++ b/Wonky.Client/Components/OfficeCountryAdvisorListComponent.razor.cs @@ -19,7 +19,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Components; -public partial class OfficeCountrySalesRepListComponent +public partial class OfficeCountryAdvisorListComponent { [Parameter] public List UserList { get; set; } = new(); } \ No newline at end of file diff --git a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor index 8f048c84..c9f96d25 100644 --- a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor +++ b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor @@ -220,7 +220,7 @@ else @($"{DraftProvider.Draft.Total:N2}") - @@ -256,7 +256,7 @@ else
-
@@ -330,20 +330,26 @@ else Kundekort
- +
} - - - + + + + + + - + OnSelected="PriceHistoryCallback" @ref="PriceOverlay"/> + + + + \ No newline at end of file diff --git a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs index a587620b..51c672a8 100644 --- a/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs +++ b/Wonky.Client/Pages/AdvisorActivityCreatePage.razor.cs @@ -69,21 +69,24 @@ public partial class AdvisorActivityCreatePage : IDisposable private DateTime SelectedDate { get; set; } private string OldPhone { get; set; } = ""; private string PromptDateConfirm { get; set; } = ""; - // MODAL DIALOGS - private PriceCatalogModal PriceCatalogModal { get; set; } = new(); - private ProductHistoryModal HistoryModal { get; set; } = new(); - private ProductPriceHistoryModal PriceHistoryModal { get; set; } = new(); - private ConfirmWorkDateModal ConfirmWorkDateModal { get; set; } = new(); - private ConfirmProductCheckModal ConfirmProductCheckModal { get; set; } = new(); + + // OVERLAY PAGES + private PriceCatalogOverlay CatalogOverlay { get; set; } = new(); + private ProductHistoryOverlay ProductOverlay { get; set; } = new(); + private ProductPriceHistoryModal PriceOverlay { get; set; } = new(); + private ConfirmWorkDateOverlay WorkDateOverlay { get; set; } = new(); + private ConfirmProductCheckOverlay ProductCheckOverlay { get; set; } = new(); + private CustomerInvoiceOverlay InvoiceOverlay { get; set; } = new(); + private CustomerInventoryOverlay InventoryOverlay { get; set; } = new(); + + private List Inventory { get; set; } = new(); private List CheckList { get; set; } = new(); + private InvoiceListView CompanyInvoices { get; set; } = new(); + + private string ButtonText { get; set; } = "Gem besøg"; private bool OrgWarning { get; set; } - private CustomerInvoiceOverlay InvoiceOverlay { get; set; } - private InvoiceListView CompanyInvoices { get; set; } = new(); - private CustomerInventoryOverlay InventoryOverlay { get; set; } = new(); - private List Inventory { get; set; } = new(); - - + /// /// Page initialization /// @@ -146,7 +149,7 @@ public partial class AdvisorActivityCreatePage : IDisposable if (!UserPrefs.DateConfirmed) { PromptDateConfirm = $"Aktiviteter oprettes med dato {SelectedDate.ToShortDateString()}. Er dette OK?"; - ConfirmWorkDateModal.Show(); + WorkDateOverlay.Show(); } // Lines may already have been added from the company inventory page if (DraftProvider.Draft.DraftType == "order") @@ -164,6 +167,7 @@ public partial class AdvisorActivityCreatePage : IDisposable Logger.LogDebug("ShowInventoryOverlay - wait for inventory"); InventoryOverlay.Show(); + Inventory = await HistoryRepo.FetchInventory(CompanyId); await Task.Delay(500); } @@ -223,7 +227,7 @@ public partial class AdvisorActivityCreatePage : IDisposable } } - private async Task CallConfirmProductCheckModel() + private async Task CallConfirmCheckOverlay() { // check if new account if (string.IsNullOrWhiteSpace(Company.Account) @@ -241,9 +245,10 @@ public partial class AdvisorActivityCreatePage : IDisposable Logger.LogDebug("pStorage => {}", pStorage); // fetch pDate from storage var pDate = await Storage.GetItemAsync($"{CompanyId}-pDate"); + if (string.IsNullOrWhiteSpace(pDate)) + pDate = $"{DateTime.Now.AddDays(-1):yyyy-MM-dd}"; Logger.LogDebug("pDate => {}", pDate); - if (string.IsNullOrWhiteSpace(pStorage)) - await Task.Delay(1000); + // check if product data is valid and updated today if (string.IsNullOrWhiteSpace(pStorage) || pDate.Replace("\"", "") != $"{DateTime.Now:yyyy-MM-dd}") { @@ -277,12 +282,12 @@ public partial class AdvisorActivityCreatePage : IDisposable } // Show CheckList modal - ConfirmProductCheckModal.Show(); + ProductCheckOverlay.Show(); } private async Task ConfirmProductCheckCallback() { - ConfirmProductCheckModal.Hide(); + ProductCheckOverlay.Hide(); await CreateActivity(); foreach (var item in CheckList) { @@ -298,7 +303,7 @@ public partial class AdvisorActivityCreatePage : IDisposable private async Task WorkDateConfirmCallback() { await Profiles.SetDateConfirmed(true); - ConfirmWorkDateModal.Hide(); + WorkDateOverlay.Hide(); StateHasChanged(); } @@ -316,9 +321,9 @@ public partial class AdvisorActivityCreatePage : IDisposable /// /// Show Price list modal /// - private void CallPriceListModal() + private void ShowPriceListOverlay() { - PriceCatalogModal.Show(); + CatalogOverlay.Show(); } /// @@ -340,10 +345,10 @@ public partial class AdvisorActivityCreatePage : IDisposable /// /// Show Price History modal /// - private void CallPriceHistoryModal() + private void ShowPriceHistoryOverlay() { if(ShowItem) - PriceHistoryModal.Show(); + PriceOverlay.Show(); } /// diff --git a/Wonky.Client/Pages/AdvisorCustomerInvoiceListPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerInvoiceListPage.razor.cs index 97ffce46..16c3b976 100644 --- a/Wonky.Client/Pages/AdvisorCustomerInvoiceListPage.razor.cs +++ b/Wonky.Client/Pages/AdvisorCustomerInvoiceListPage.razor.cs @@ -80,13 +80,18 @@ public partial class AdvisorCustomerInvoiceListPage : IDisposable } Logger.LogDebug("pulling invoices from backend"); // pull invoices - var invoices = await HistoryRepo.FetchInvoiceList(_companyId); + var companyInvoices = await HistoryRepo.FetchInvoiceList(_companyId); + if (companyInvoices.Invoices.Any()) + companyInvoices.Invoices = companyInvoices.Invoices + .OrderByDescending(x => x.DocumentDate) + .ToList(); + // send invoices to storage - await Storage.SetItemAsync($"{_companyId}-invoices", invoices); + await Storage.SetItemAsync($"{_companyId}-invoices", companyInvoices); await Storage.SetItemAsync($"{_companyId}-iDate", $"{DateTime.Now:yyyy-MM-dd}"); Logger.LogDebug("return invoices from backend"); Working = false; - return invoices; + return companyInvoices; } public void Dispose() diff --git a/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor b/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor index 5e5f1a3b..6ad6b026 100644 --- a/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor +++ b/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor @@ -225,4 +225,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor.cs b/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor.cs index d4056bf0..0ceabe67 100644 --- a/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor.cs +++ b/Wonky.Client/Pages/OfficeCustomerCreatePhoneOrderPage.razor.cs @@ -59,7 +59,7 @@ public partial class OfficeCustomerCreatePhoneOrderPage : IDisposable private bool ReportClosed { get; set; } private bool PoFormInvalid { get; set; } = true; private bool Working { get; set; } - private PriceCatalogModal PriceCatalog { get; set; } = new(); + private PriceCatalogOverlay PriceCatalog { get; set; } = new(); protected override async Task OnInitializedAsync() diff --git a/Wonky.Client/Pages/OfficeUserAdvisorListPage.razor b/Wonky.Client/Pages/OfficeUserAdvisorListPage.razor index 8f25c563..eb5dcc36 100644 --- a/Wonky.Client/Pages/OfficeUserAdvisorListPage.razor +++ b/Wonky.Client/Pages/OfficeUserAdvisorListPage.razor @@ -27,7 +27,7 @@

Sælgere

- +
diff --git a/Wonky.Client/Pages/OfficeUserAdvisorViewEditPage.razor b/Wonky.Client/Pages/OfficeUserAdvisorViewEditPage.razor index 4326eb50..0afeab52 100644 --- a/Wonky.Client/Pages/OfficeUserAdvisorViewEditPage.razor +++ b/Wonky.Client/Pages/OfficeUserAdvisorViewEditPage.razor @@ -107,6 +107,11 @@

NULSTIL ADGANGSKODE

+
+

Password politik

+

Mindst 10 tegn bestående af store og små bogstaver samt tal.

+

Du kan teste pasword og danne stærke password på pw.nix.dk

+
diff --git a/Wonky.Client/Shared/ConfirmProductCheckModal.razor b/Wonky.Client/Shared/ConfirmProductCheckOverlay.razor similarity index 100% rename from Wonky.Client/Shared/ConfirmProductCheckModal.razor rename to Wonky.Client/Shared/ConfirmProductCheckOverlay.razor diff --git a/Wonky.Client/Shared/ConfirmProductCheckModal.razor.cs b/Wonky.Client/Shared/ConfirmProductCheckOverlay.razor.cs similarity index 96% rename from Wonky.Client/Shared/ConfirmProductCheckModal.razor.cs rename to Wonky.Client/Shared/ConfirmProductCheckOverlay.razor.cs index ccee0e0d..2fc90c97 100644 --- a/Wonky.Client/Shared/ConfirmProductCheckModal.razor.cs +++ b/Wonky.Client/Shared/ConfirmProductCheckOverlay.razor.cs @@ -18,7 +18,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Shared; -public partial class ConfirmProductCheckModal +public partial class ConfirmProductCheckOverlay { private string _modalDisplay = ""; private bool _showBackdrop; diff --git a/Wonky.Client/Shared/ConfirmWorkDateModal.razor b/Wonky.Client/Shared/ConfirmWorkDateOverlay.razor similarity index 100% rename from Wonky.Client/Shared/ConfirmWorkDateModal.razor rename to Wonky.Client/Shared/ConfirmWorkDateOverlay.razor diff --git a/Wonky.Client/Shared/ConfirmWorkDateModal.razor.cs b/Wonky.Client/Shared/ConfirmWorkDateOverlay.razor.cs similarity index 96% rename from Wonky.Client/Shared/ConfirmWorkDateModal.razor.cs rename to Wonky.Client/Shared/ConfirmWorkDateOverlay.razor.cs index 55ca48fb..63f0b047 100644 --- a/Wonky.Client/Shared/ConfirmWorkDateModal.razor.cs +++ b/Wonky.Client/Shared/ConfirmWorkDateOverlay.razor.cs @@ -17,7 +17,7 @@ using Microsoft.AspNetCore.Components; namespace Wonky.Client.Shared; -public partial class ConfirmWorkDateModal +public partial class ConfirmWorkDateOverlay { private string _modalDisplay = ""; private bool _showBackdrop; diff --git a/Wonky.Client/Shared/CustomerInvoiceOverlay.razor.cs b/Wonky.Client/Shared/CustomerInvoiceOverlay.razor.cs index a90eaf81..fe28f524 100644 --- a/Wonky.Client/Shared/CustomerInvoiceOverlay.razor.cs +++ b/Wonky.Client/Shared/CustomerInvoiceOverlay.razor.cs @@ -22,7 +22,8 @@ public partial class CustomerInvoiceOverlay { Company = CustomerInvoices.Company; Logger.LogDebug("company => {}", JsonSerializer.Serialize(Company)); - Invoices = CustomerInvoices.Invoices; + if (CustomerInvoices.Invoices.Any()) + Invoices = CustomerInvoices.Invoices.OrderByDescending(x => x.DocumentDate).ToList(); Logger.LogDebug("invoices => {}", JsonSerializer.Serialize(Invoices)); } diff --git a/Wonky.Client/Shared/PriceCatalogModal.razor b/Wonky.Client/Shared/PriceCatalogOverlay.razor similarity index 100% rename from Wonky.Client/Shared/PriceCatalogModal.razor rename to Wonky.Client/Shared/PriceCatalogOverlay.razor diff --git a/Wonky.Client/Shared/PriceCatalogModal.razor.cs b/Wonky.Client/Shared/PriceCatalogOverlay.razor.cs similarity index 98% rename from Wonky.Client/Shared/PriceCatalogModal.razor.cs rename to Wonky.Client/Shared/PriceCatalogOverlay.razor.cs index 9312d158..6624cc16 100644 --- a/Wonky.Client/Shared/PriceCatalogModal.razor.cs +++ b/Wonky.Client/Shared/PriceCatalogOverlay.razor.cs @@ -24,7 +24,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Shared; -public partial class PriceCatalogModal : IDisposable +public partial class PriceCatalogOverlay : IDisposable { [Parameter] public string CountryCode { get; set; } = ""; [Parameter] public EventCallback OnSelected { get; set; } diff --git a/Wonky.Client/Shared/ProductHistoryModal.razor b/Wonky.Client/Shared/ProductHistoryOverlay.razor similarity index 100% rename from Wonky.Client/Shared/ProductHistoryModal.razor rename to Wonky.Client/Shared/ProductHistoryOverlay.razor diff --git a/Wonky.Client/Shared/ProductHistoryModal.razor.cs b/Wonky.Client/Shared/ProductHistoryOverlay.razor.cs similarity index 98% rename from Wonky.Client/Shared/ProductHistoryModal.razor.cs rename to Wonky.Client/Shared/ProductHistoryOverlay.razor.cs index 6decf23b..e3145378 100644 --- a/Wonky.Client/Shared/ProductHistoryModal.razor.cs +++ b/Wonky.Client/Shared/ProductHistoryOverlay.razor.cs @@ -24,7 +24,7 @@ using Wonky.Entity.Views; namespace Wonky.Client.Shared; -public partial class ProductHistoryModal +public partial class ProductHistoryOverlay { // [Parameter] public EventCallback OnSelected { get; set; } [Parameter] public string CompanyId { get; set; } = ""; diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index dabe3896..56e6b0fb 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,14 +1,14 @@ { "appInfo": { "name": "Wonky Online", - "version": "0.106.6", + "version": "0.106.13", "rc": true, "sandBox": false, "image": "grumpy-coder.png" }, "Logging": { "LogLevel": { - "Default": "Information", + "Default": "Debug", "System": "Information", "Microsoft": "Information" },