diff --git a/Wonky.Client/Components/KmMorningComponent.razor b/Wonky.Client/Components/ActivityKmStartComponent.razor similarity index 90% rename from Wonky.Client/Components/KmMorningComponent.razor rename to Wonky.Client/Components/ActivityKmStartComponent.razor index 36154f8b..28fa5cdc 100644 --- a/Wonky.Client/Components/KmMorningComponent.razor +++ b/Wonky.Client/Components/ActivityKmStartComponent.razor @@ -1,7 +1,7 @@ @using Wonky.Client.Services
- +
diff --git a/Wonky.Client/Components/ActivityTableComponent.razor b/Wonky.Client/Components/ActivityTableComponent.razor index 165947c2..b2a488b7 100644 --- a/Wonky.Client/Components/ActivityTableComponent.razor +++ b/Wonky.Client/Components/ActivityTableComponent.razor @@ -20,6 +20,7 @@ + @@ -36,6 +37,10 @@ @foreach (var activity in Activities) { + @@ -43,9 +48,18 @@ - - - + + + } diff --git a/Wonky.Client/Components/ActivityTableComponent.razor.cs b/Wonky.Client/Components/ActivityTableComponent.razor.cs index 29dbc7d7..aed9701e 100644 --- a/Wonky.Client/Components/ActivityTableComponent.razor.cs +++ b/Wonky.Client/Components/ActivityTableComponent.razor.cs @@ -21,4 +21,16 @@ namespace Wonky.Client.Components; public partial class ActivityTableComponent { [Parameter] public List Activities { get; set; } + + private static string GetProcessStatus(string processStatus) + { + return processStatus.ToLower() switch + { + "none" => "the-draw", + "picked" => "the-good", + "packed" => "the-bad", + "shipped" => "the-ugly", + _ => "the-dead" + }; + } } \ No newline at end of file diff --git a/Wonky.Client/Components/ReportItemComponent.razor b/Wonky.Client/Components/ReportItemComponent.razor index 4d8de30b..e740d039 100644 --- a/Wonky.Client/Components/ReportItemComponent.razor +++ b/Wonky.Client/Components/ReportItemComponent.razor @@ -17,7 +17,7 @@ @using Wonky.Entity.Views -
+
Kunde Bynavn Demo
+ @activity.ProcessStatusEnum + @* *@ + @activity.Company.Name @activity.Company.City @activity.Demo@activity.OfficeNote @($"{activity.SasAmount:N2}") @(activity.StatusTypeEnum == "Quote" ? $"{0:N2}" : $"{activity.OrderAmount:N2}")@if(activity.OurRef.Contains("T:")){}@if(activity.Express){}@if(activity.StatusTypeEnum == "Quote"){} + @if (activity.OurRef.Contains("T:")) + {} + + @if (activity.Express) + {} + + @if (activity.StatusTypeEnum == "Quote") + {} +
diff --git a/Wonky.Client/Pages/ActivityTodayListPage.razor b/Wonky.Client/Pages/ActivityTodayListPage.razor index cbf75b0a..1ad66f3a 100644 --- a/Wonky.Client/Pages/ActivityTodayListPage.razor +++ b/Wonky.Client/Pages/ActivityTodayListPage.razor @@ -28,7 +28,7 @@
- +
@if (_reportExist) diff --git a/Wonky.Client/Pages/ActivityTodayListPage.razor.cs b/Wonky.Client/Pages/ActivityTodayListPage.razor.cs index ad69fbf4..2a5bada2 100644 --- a/Wonky.Client/Pages/ActivityTodayListPage.razor.cs +++ b/Wonky.Client/Pages/ActivityTodayListPage.razor.cs @@ -13,6 +13,7 @@ // along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] // +using System.Text.Json; using Blazored.Toast.Services; using Microsoft.AspNetCore.Components; using Wonky.Client.Components; @@ -58,6 +59,7 @@ public partial class ActivityTodayListPage : IDisposable _workDate = workDate; ReportItemListView = new ReportItemListView(); ReportItemListView = await _activityRepo.GetActivities(workDate); + _logger.LogDebug("Activities => {}", JsonSerializer.Serialize(ReportItemListView)); Loading = false; } diff --git a/Wonky.Client/Pages/CustomerViewPage.razor b/Wonky.Client/Pages/CustomerViewPage.razor index 3face8c0..ea985d24 100644 --- a/Wonky.Client/Pages/CustomerViewPage.razor +++ b/Wonky.Client/Pages/CustomerViewPage.razor @@ -30,7 +30,7 @@ @if (_dk) {
- +
@if (_vInfos.Any()) { diff --git a/Wonky.Client/Pages/CustomerViewPage.razor.cs b/Wonky.Client/Pages/CustomerViewPage.razor.cs index 4ddecf47..0b7be429 100644 --- a/Wonky.Client/Pages/CustomerViewPage.razor.cs +++ b/Wonky.Client/Pages/CustomerViewPage.razor.cs @@ -51,12 +51,12 @@ public partial class CustomerViewPage : IDisposable private DateTime _lastVisit { get; set; } private DateTime _nextVisit { get; set; } private string _vatState { get; set; } = "the-ugly"; - private VatAddress vatAddress = new(); + private VatAddress _vatAddress = new(); private bool _validVat; private bool _hasFolded; private bool _formInvalid = true; private string _orgVat; - private string countryCode = "dk"; + private string _countryCode = "dk"; private string _visitState = "the-ugly"; private int _enableActivity = 1; private bool _hideButtons = false; @@ -64,6 +64,8 @@ public partial class CustomerViewPage : IDisposable private bool _working; private string _btnUpdateText = "Opdater"; private bool _dk { get; set; } = true; + private int _isDirty { get; set; } + private int _vatUpdated { get; set; } private readonly JsonSerializerOptions _options = new () { @@ -73,7 +75,7 @@ public partial class CustomerViewPage : IDisposable protected override async Task OnInitializedAsync() { var ux = await _storage.GetItemAsync("_xu"); - countryCode = ux.CountryCode; + _countryCode = ux.CountryCode; _dk = ux.CountryCode.ToLower() == "dk"; _interceptor.RegisterEvent(); @@ -88,7 +90,7 @@ public partial class CustomerViewPage : IDisposable _enableActivity = 1; if (_dk) - vatAddress = PrepareVatAddress(_company); + _vatAddress = PrepareVatAddress(_company); if (_company.Interval == 0) _company.Interval = 8; @@ -129,7 +131,7 @@ public partial class CustomerViewPage : IDisposable { _nextVisit = _lastVisit.AddDays(_company.Interval * 7); - // simple format validation if CRM indicates invalid vatNumber + // simple validation of VAT format if (!VatUtils.ValidateFormat(_company.CountryCode, _company.VatNumber)) { _formInvalid = true; @@ -138,6 +140,9 @@ public partial class CustomerViewPage : IDisposable { _formInvalid = !_editContext.Validate(); } + if(_vatUpdated == 0) + _isDirty = 1; + StateHasChanged(); } @@ -164,15 +169,18 @@ public partial class CustomerViewPage : IDisposable StateHasChanged(); return; } - + _toast.ShowInfo("Vent venligst ...."); _hideButtons = true; _company.LastVisit = $"{_lastVisit:yyyy-MM-dd}"; _company.NextVisit = $"{_nextVisit:yyyy-MM-dd}"; _company.IsHidden = 0; + // flag if backend should update ERP system - if (_company.VatNumber != _orgVat) - _company.UpdateErpVat = 1; - + _company.UpdateErpVat = _vatUpdated; + + // flag base info has changed + _company.IsDirty = _isDirty; + var success = await _companyRepo.UpdateCompany(CompanyId, _company ); if (success) { @@ -209,10 +217,12 @@ public partial class CustomerViewPage : IDisposable _company.Address2 = _virkRegInfo.CoName; _company.ZipCode = _virkRegInfo.ZipCode; _company.City = _virkRegInfo.City; + _isDirty = 1; } else { _company.VatNumber = _virkRegInfo.VatNumber; + _vatUpdated = 1; } // empty list _vInfos = new List(); diff --git a/Wonky.Client/Pages/ReportViewPageAdvisor.razor b/Wonky.Client/Pages/ReportViewPageAdvisor.razor index 5a68886c..77cc54ac 100644 --- a/Wonky.Client/Pages/ReportViewPageAdvisor.razor +++ b/Wonky.Client/Pages/ReportViewPageAdvisor.razor @@ -20,7 +20,7 @@ @page "/sales-reports/view/{ReportDate}" @attribute [Authorize(Roles = "Advisor,Admin,Supervisor")] -
+

@DateTime.Parse(ReportDate).ToLongDateString()

@@ -58,7 +58,7 @@ }
-
+
 
diff --git a/Wonky.Client/Pages/ReportViewPageOffice.razor b/Wonky.Client/Pages/ReportViewPageOffice.razor index 361bbd05..2997e64f 100644 --- a/Wonky.Client/Pages/ReportViewPageOffice.razor +++ b/Wonky.Client/Pages/ReportViewPageOffice.razor @@ -20,8 +20,7 @@ @page "/admin/users/advisors/{CountryCode}/{UserId}/reports/{ReportDate}" @attribute [Authorize(Roles = "Admin")] -
- +

@DateTime.Parse(ReportDate).ToLongDateString()

@@ -33,7 +32,6 @@
- @if (!string.IsNullOrWhiteSpace(Report.ReportData.DayTypeEnum)) { @Report.ReportData.Name @@ -59,11 +57,6 @@
Ingen data
} - -
- -
-  
@if (_items.Any()) diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index 10a2955a..5571733d 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,13 +1,13 @@ { "appInfo": { "name": "Wonky Client", - "version": "0.11.122", + "version": "0.12.1", "rc": false, "sandBox": false, "image": "grumpy-coder.png" }, "apiConfig": { - "innoBaseUrl": "https://eta.innotec.dk", + "innoBaseUrl": "https://dev.innotec.dk", "glsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=", "glsId": "", "serviceVirk": "api/v2/services/virk", diff --git a/Wonky.Client/wwwroot/css/app-v0.10.101.css b/Wonky.Client/wwwroot/css/app-v0.12.0.css similarity index 94% rename from Wonky.Client/wwwroot/css/app-v0.10.101.css rename to Wonky.Client/wwwroot/css/app-v0.12.0.css index ccf96ea8..1e951d5b 100644 --- a/Wonky.Client/wwwroot/css/app-v0.10.101.css +++ b/Wonky.Client/wwwroot/css/app-v0.12.0.css @@ -148,12 +148,10 @@ footer.version { -webkit-print-color-adjust: exact; color-adjust: exact; } - .report-page { + .report-main { + font-size: 10px; break-after: page; - /*break-before: page;*/ - height: initial; - border: initial; border-radius: initial; box-shadow: initial; @@ -162,10 +160,9 @@ footer.version { -webkit-print-color-adjust: exact; color-adjust: exact; } - .report-page-item { - break-after: page; + .report-visit { + break-before: page; break-inside: avoid-page; - height: initial; border: initial; border-radius: initial; diff --git a/Wonky.Client/wwwroot/index.html b/Wonky.Client/wwwroot/index.html index a64538c1..38df0c92 100644 --- a/Wonky.Client/wwwroot/index.html +++ b/Wonky.Client/wwwroot/index.html @@ -17,7 +17,7 @@ - + diff --git a/Wonky.Entity/DTO/CompanyDto.cs b/Wonky.Entity/DTO/CompanyDto.cs index 33141bbe..c867c406 100644 --- a/Wonky.Entity/DTO/CompanyDto.cs +++ b/Wonky.Entity/DTO/CompanyDto.cs @@ -154,6 +154,8 @@ public class CompanyDto /// Date for last sync of product history /// public string HistorySync { get; set; } = ""; + + public int IsDirty { get; set; } = 0; /// /// Virtual property indicating if timespan is within the defined interval diff --git a/Wonky.Entity/Views/ReportItemView.cs b/Wonky.Entity/Views/ReportItemView.cs index 6bde41c2..b769b4b9 100644 --- a/Wonky.Entity/Views/ReportItemView.cs +++ b/Wonky.Entity/Views/ReportItemView.cs @@ -30,6 +30,10 @@ public class ReportItemView /// public bool Closed { get; set; } /// + /// ProcessStatus as string + /// + public string ProcessStatusEnum { get; set; } = ""; + /// /// express flag /// public bool Express { get; set; }