diff --git a/Wonky.Client.sln.DotSettings b/Wonky.Client.sln.DotSettings index 3a5c349c..559779d8 100644 --- a/Wonky.Client.sln.DotSettings +++ b/Wonky.Client.sln.DotSettings @@ -1,3 +1,5 @@  + True True - True \ No newline at end of file + True + True \ No newline at end of file diff --git a/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs b/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs index e137a71d..cc53c993 100644 --- a/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs +++ b/Wonky.Client/Components/ProductInventoryTableComponent.razor.cs @@ -48,6 +48,7 @@ public partial class ProductInventoryTableComponent private async Task OnSelectedItem(DraftItem draftItem) { // add item to order draft + DraftStateProvider.Draft.DraftType = "order"; DraftStateProvider.Draft.Items.Add(draftItem); await DraftStateProvider.SaveChangesAsync(); } diff --git a/Wonky.Client/HttpInterfaces/ICatalogHttpRepository.cs b/Wonky.Client/HttpInterfaces/ICatalogHttpRepository.cs index ca991aa6..9f4d0021 100644 --- a/Wonky.Client/HttpInterfaces/ICatalogHttpRepository.cs +++ b/Wonky.Client/HttpInterfaces/ICatalogHttpRepository.cs @@ -21,9 +21,39 @@ namespace Wonky.Client.HttpInterfaces; public interface ICatalogHttpRepository { + /// + /// Get a paged sales item list + /// + /// + /// Task> GetSalesItemsPaged(CatalogPagingParams pagingParameters); + + /// + /// Get sales item by id + /// + /// + /// Task GetSalesItemId(string salesItemId); - Task GetSalesVariantId(string variantId); + + /// + /// Get sales item by sku + /// + /// + /// Task GetSalesItemSku(string sku); - Task GetSalesItemSku(string countryCode, string sku); + + /// + /// Overload Get sales item by id and country code + /// + /// + /// + /// + Task GetSalesItemSku(string sku, string countryCode); + + /// + /// Get sales item by variant id + /// + /// + /// + Task GetSalesVariantId(string variantId); } \ No newline at end of file diff --git a/Wonky.Client/HttpInterfaces/ICrmActivityHttpRepository.cs b/Wonky.Client/HttpInterfaces/ICrmActivityHttpRepository.cs index 9f97988a..a3807d2d 100644 --- a/Wonky.Client/HttpInterfaces/ICrmActivityHttpRepository.cs +++ b/Wonky.Client/HttpInterfaces/ICrmActivityHttpRepository.cs @@ -20,12 +20,58 @@ namespace Wonky.Client.HttpInterfaces; public interface ICrmActivityHttpRepository { - Task GetReportItem(string salesHeadId); - Task GetActivity(string salesHeadId); - Task CreateActivity(ActivityDto model); - Task AcceptOffer(string id); + /// + /// Convert quote to sale + /// + /// + /// + Task AcceptQuote(ActivityDto activity); + + /// + /// Get activities by date + /// + /// + /// Task GetActivities(string activityDate); + + /// + /// Create new activity + /// + /// + /// + Task CreateActivity(ActivityDto model); + + /// + /// Get activity data by id + /// + /// + /// + Task GetActivity(string activityId); + + /// + /// Get activity by id formatted for report + /// + /// + /// + Task GetReportItem(string activityId); + + /// + /// Get activities for customer Id + /// + /// + /// Task> GetCustomerActivities(string customerId); + + /// + /// Set backend process state to express + /// + /// + /// ApiResponseView + Task SetProcessStateExpress(string activityId); + + /// + /// Update office note for activity + /// + /// Task UpdateOfficeNote(ActivityOfficeNote model); - Task GetExpressStatus(string id); } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/CatalogHttpRepository.cs b/Wonky.Client/HttpRepository/CatalogHttpRepository.cs index cc4ca443..74dbc788 100644 --- a/Wonky.Client/HttpRepository/CatalogHttpRepository.cs +++ b/Wonky.Client/HttpRepository/CatalogHttpRepository.cs @@ -52,7 +52,12 @@ public class CatalogHttpRepository : ICatalogHttpRepository _navigation = navigation; _apiConfig = configuration.Value; } - + + /// + /// Get a paged sales item list + /// + /// + /// public async Task> GetSalesItemsPaged(CatalogPagingParams pagingParameters) { var queryString = new Dictionary @@ -65,7 +70,7 @@ public class CatalogHttpRepository : ICatalogHttpRepository ["selectGroup"] = pagingParameters.SelectGroup == "0" ? "" : pagingParameters.SelectGroup, }; var response = await _client - .GetAsync(QueryHelpers.AddQueryString($"{_apiConfig.Catalog}/page", queryString)); + .GetAsync(QueryHelpers.AddQueryString($"{_apiConfig.Catalog}/page", queryString)); var content = await response.Content.ReadAsStringAsync(); @@ -78,28 +83,50 @@ public class CatalogHttpRepository : ICatalogHttpRepository return pagingResponse; } + /// + /// Get sales item by id + /// + /// + /// public async Task GetSalesItemId(string salesItemId) { var salesItem = await _client .GetFromJsonAsync($"{_apiConfig.Catalog}/{salesItemId}"); return salesItem ?? new SalesItemView(); } - + + /// + /// Get sales item by sku + /// + /// + /// + public async Task GetSalesItemSku(string sku) + { + var salesItem = await _client.GetFromJsonAsync($"{_apiConfig.Catalog}/sku/{sku}"); + return salesItem ?? new SalesItemView(); + } + + /// + /// Overload Get sales item by id and country code + /// + /// + /// + /// + public async Task GetSalesItemSku(string sku, string countryCode) + { + var salesItem = await _client.GetFromJsonAsync($"{_apiConfig.Catalog}/{countryCode}/sku/{sku}"); + return salesItem ?? new SalesItemView(); + } + + /// + /// Get sales item by variant id + /// + /// + /// public async Task GetSalesVariantId(string variantId) { var salesItem = await _client .GetFromJsonAsync($"{_apiConfig.Catalog}/variant/{variantId}"); return salesItem ?? new SalesItemView(); } - - public async Task GetSalesItemSku(string sku) - { - var salesItem = await _client.GetFromJsonAsync($"{_apiConfig.Catalog}/sku/{sku}"); - return salesItem ?? new SalesItemView(); - } - public async Task GetSalesItemSku(string countryCode, string sku) - { - var salesItem = await _client.GetFromJsonAsync($"{_apiConfig.Catalog}/{countryCode}/sku/{sku}"); - return salesItem ?? new SalesItemView(); - } } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/CrmActivityHttpRepository.cs b/Wonky.Client/HttpRepository/CrmActivityHttpRepository.cs index 5e9211ff..e13f1ca1 100644 --- a/Wonky.Client/HttpRepository/CrmActivityHttpRepository.cs +++ b/Wonky.Client/HttpRepository/CrmActivityHttpRepository.cs @@ -13,22 +13,13 @@ // along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] // -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; using System.Net.Http.Json; -using System.Net.Mime; using System.Text.Json; -using System.Threading.Tasks; -using Wonky.Client.Features; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Options; using Wonky.Client.HttpInterfaces; using Wonky.Entity.Configuration; using Wonky.Entity.DTO; -using Wonky.Entity.Models; -using Wonky.Entity.Requests; using Wonky.Entity.Views; namespace Wonky.Client.HttpRepository; @@ -44,7 +35,7 @@ public class CrmActivityHttpRepository : ICrmActivityHttpRepository private ILogger _logger; private readonly HttpClient _client; private readonly ApiConfig _api; - + public CrmActivityHttpRepository(HttpClient client, ILogger logger, NavigationManager navigation, IOptions configuration) @@ -55,44 +46,29 @@ public class CrmActivityHttpRepository : ICrmActivityHttpRepository _api = configuration.Value; } - public async Task GetExpressStatus(string id) + /// + /// Convert quote to sale + /// + /// + /// + public async Task AcceptQuote(ActivityDto activity) { - var response = await _client.GetFromJsonAsync($"{_api.CrmSales}/express/{id}?status=Express"); + var response = await _client.PutAsJsonAsync( + $"{_api.CrmActivities}/{activity.SalesHeadId}/accept", activity, _options); - if (response.IsSuccess) return response; - - var msg = JsonSerializer.SerializeToElement(response.Message, _options); - response.Message = msg.ToString(); - return response; - } - - public async Task UpdateOfficeNote(ActivityOfficeNote model) - { - // _logger.LogDebug("UpdateOfficeNote => model \n{}", JsonSerializer.Serialize(model) ); - // _logger.LogDebug("UpdateOfficeNote => url \n{}", $"{_api.CrmSales}/activity/{model.ActivityId}" ); - await _client.PostAsJsonAsync($"{_api.CrmSales}/activity/{model.ActivityId}", model, _options); - } - public async Task GetActivities(string activityDate) - { - var response = await _client - .GetAsync($"{_api.CrmSales}/date/{activityDate}"); var content = await response.Content.ReadAsStringAsync(); - return string.IsNullOrWhiteSpace(content) - ? new ReportStatusView() - : JsonSerializer.Deserialize(content, _options); + var result = JsonSerializer.Deserialize(content); + return result!; } - public async Task> GetCustomerActivities(string customerId) - { - var response = await _client.GetAsync($"{_api.CrmSales}/company/{customerId}"); - var content = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize>(content, _options); - - } - + /// + /// Create new activity + /// + /// + /// public async Task CreateActivity(ActivityDto model) { - var response = await _client.PostAsJsonAsync($"{_api.CrmSales}", model, _options); + var response = await _client.PostAsJsonAsync($"{_api.CrmActivities}", model, _options); var content = await response.Content.ReadAsStringAsync(); var result = JsonSerializer.Deserialize(content, _options); if (result.IsSuccess) return result!; @@ -100,26 +76,84 @@ public class CrmActivityHttpRepository : ICrmActivityHttpRepository result.Message = msg.ToString(); return result!; } - - public async Task GetReportItem(string salesHeadId) + + /// + /// Get activities by date + /// + /// + /// + public async Task GetActivities(string activityDate) { - var salesItem = await _client - .GetFromJsonAsync($"{_api.CrmSales}/{salesHeadId}"); - return salesItem ?? new ReportItemView(); + var response = await _client + .GetAsync($"{_api.CrmActivities}/date/{activityDate}"); + var content = await response.Content.ReadAsStringAsync(); + return string.IsNullOrWhiteSpace(content) + ? new ReportStatusView() + : JsonSerializer.Deserialize(content, _options); } - - public async Task GetActivity(string salesHeadId) + + /// + /// Get activity data by id + /// + /// + /// + public async Task GetActivity(string activityId) { var salesItem = await _client - .GetFromJsonAsync($"{_api.CrmSales}/{salesHeadId}"); + .GetFromJsonAsync($"{_api.CrmActivities}/{activityId}"); return salesItem ?? new ActivityDto(); } - public async Task AcceptOffer(string id) + /// + /// Get activities for customer Id + /// + /// + /// + public async Task> GetCustomerActivities(string customerId) { - var response = await _client.PostAsJsonAsync($"{_api.CrmSales}/{id}/accept", id); + var response = await _client.GetAsync($"{_api.CrmActivities}/company/{customerId}"); var content = await response.Content.ReadAsStringAsync(); - var result = JsonSerializer.Deserialize(content); - return result!; + return JsonSerializer.Deserialize>(content, _options); + } + + /// + /// Get activity by id formatted for report + /// + /// + /// + public async Task GetReportItem(string activityId) + { + var salesItem = await _client + .GetFromJsonAsync($"{_api.CrmActivities}/{activityId}"); + return salesItem ?? new ReportItemView(); + } + + /// Set backend process state to express + /// + /// + /// ApiResponseView + public async Task SetProcessStateExpress(string activityId) + { + var response = await _client.PutAsync( + $"{_api.CrmActivities}/express/{activityId}?status=Express", null); + var content = await response.Content.ReadAsStringAsync(); + return string.IsNullOrWhiteSpace(content) + ? new ApiResponseView + { + Code = (int)response.StatusCode, + Id = activityId, + Message = "Resoursen returnerede fejl", + IsSuccess = false + } + : JsonSerializer.Deserialize(content); + } + + /// + /// Update office note for activity + /// + /// + public async Task UpdateOfficeNote(ActivityOfficeNote model) + { + await _client.PutAsJsonAsync($"{_api.CrmActivities}/note/{model.ActivityId}", model, _options); } } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/CrmHistoryHttpRepository.cs b/Wonky.Client/HttpRepository/CrmHistoryHttpRepository.cs index 77529134..5fc71e73 100644 --- a/Wonky.Client/HttpRepository/CrmHistoryHttpRepository.cs +++ b/Wonky.Client/HttpRepository/CrmHistoryHttpRepository.cs @@ -79,7 +79,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository /// List of products public async Task> FetchInventory(string companyId) { - var response = await _client.GetAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmInventory}"); + var response = await _client.GetAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmInventoryExt}"); var content = await response.Content.ReadAsStringAsync(); return response.IsSuccessStatusCode ? JsonSerializer.Deserialize>(content, _options) @@ -94,7 +94,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository public async Task> FetchHistory(string companyId) { return await _client.GetFromJsonAsync>( - $"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}", _options); + $"{_api.CrmCustomers}/{companyId}/{_api.CrmProductExt}", _options); } /// @@ -106,7 +106,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository public async Task> FetchHistory(string companyId, string sku) { return await _client.GetFromJsonAsync>( - $"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}/{sku}", _options); + $"{_api.CrmCustomers}/{companyId}/{_api.CrmProductExt}/{sku}", _options); } /// /// execute a remote procedure designed to update crm database from erp system based on a date string @@ -116,6 +116,6 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository /// date string public async Task RpcSyncErpToCrm(string companyId, string syncDate) { - return await _client.GetStringAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmSync}/{syncDate}"); + return await _client.GetStringAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmRpcSyncExt}/{syncDate}"); } } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/CrmWorkplaceHttpRepository.cs b/Wonky.Client/HttpRepository/CrmWorkplaceHttpRepository.cs index 6d1206cd..ea91b497 100644 --- a/Wonky.Client/HttpRepository/CrmWorkplaceHttpRepository.cs +++ b/Wonky.Client/HttpRepository/CrmWorkplaceHttpRepository.cs @@ -50,32 +50,32 @@ public class CrmWorkplaceHttpRepository : ICrmWorkplaceHttpRepository public async Task> GetWorkplaces(string companyId) { var result = await _client.GetFromJsonAsync>( - $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}", _options); + $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}", _options); return result ?? new List(); } public async Task GetWorkplace(string companyId, string workplaceId) { var result = await _client.GetFromJsonAsync( - $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}/{workplaceId}", _options); + $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}/{workplaceId}", _options); return result ?? new WorkplaceDto(); } public async Task CreateWorkplace(string companyId, WorkplaceDto workplace) { await _client.PostAsJsonAsync( - $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}", workplace, _options); + $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}", workplace, _options); } public async Task UpdateWorkplace(string companyId, WorkplaceDto workplace) { await _client.PutAsJsonAsync( - $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}/{workplace.WorkplaceId}", workplace, _options); + $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}/{workplace.WorkplaceId}", workplace, _options); } public async Task DeleteWorkplace(string companyId, string workplaceId) { await _client.DeleteAsync( - $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}/{workplaceId}"); + $"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}/{workplaceId}"); } } \ No newline at end of file diff --git a/Wonky.Client/HttpRepository/SendMailService.cs b/Wonky.Client/HttpRepository/SendMailService.cs index e6081cf5..3281b434 100644 --- a/Wonky.Client/HttpRepository/SendMailService.cs +++ b/Wonky.Client/HttpRepository/SendMailService.cs @@ -33,7 +33,7 @@ public class SendMailService : ISendMailService public async Task SendMail(string messageType, EmailMessage message) { - var response = await _client.PostAsJsonAsync($"{_api.SendMail}/{messageType}", message, _options); + var response = await _client.PostAsJsonAsync($"{_api.ServicesMail}/{messageType}", message, _options); if (!response.IsSuccessStatusCode) return new ApiResponseView { diff --git a/Wonky.Client/Models/Draft.cs b/Wonky.Client/Models/Draft.cs index d1862dd8..d09b3dfa 100644 --- a/Wonky.Client/Models/Draft.cs +++ b/Wonky.Client/Models/Draft.cs @@ -31,6 +31,7 @@ public class DraftItem public class Draft { public string DraftId { get; set; } = ""; + public string DraftType { get; set; } = "noSale"; public List Items { get; set; } = new (); public decimal Total { diff --git a/Wonky.Client/Pages/CrmActivityNewPage.razor b/Wonky.Client/Pages/CrmActivityNewPage.razor index 5ad861c6..aae98fb9 100644 --- a/Wonky.Client/Pages/CrmActivityNewPage.razor +++ b/Wonky.Client/Pages/CrmActivityNewPage.razor @@ -50,8 +50,8 @@ else
- - + + @@ -60,19 +60,27 @@ else
- + @if (!string.IsNullOrEmpty(Activity.VatNumber) && !string.IsNullOrWhiteSpace(Activity.Address1) && Company.HasFolded == 0) { - @if (DraftStateProvider.Draft.Items.Any()) + @if (DraftStateProvider.Draft.DraftType == "quote") { - + } else { } - + + @if(DraftStateProvider.Draft.DraftType == "offer") + { + + } + else + { + + } } @@ -322,13 +330,10 @@ else
- -
+ -
+
diff --git a/Wonky.Client/Pages/CrmActivityNewPage.razor.cs b/Wonky.Client/Pages/CrmActivityNewPage.razor.cs index 330bfa1e..3dd11fec 100644 --- a/Wonky.Client/Pages/CrmActivityNewPage.razor.cs +++ b/Wonky.Client/Pages/CrmActivityNewPage.razor.cs @@ -100,6 +100,7 @@ public partial class CrmActivityNewPage : IDisposable { Company.Phone = Company.Account[..8]; } + // Populate base activity information Activity.BcId = Company.BcId; Activity.ActivityStatusEnum = "noSale"; @@ -135,7 +136,7 @@ public partial class CrmActivityNewPage : IDisposable ConfirmWorkDate.Show(); } // Lines may already have been added from the company inventory page - if (DraftStateProvider.Draft.Items.Any()) + if (DraftStateProvider.Draft.DraftType == "order") { // set dropdown selection accordingly Activity.ActivityTypeEnum = "onSite"; @@ -144,6 +145,7 @@ public partial class CrmActivityNewPage : IDisposable } StateHasChanged(); } + /// /// Work Date confirm callback /// @@ -153,6 +155,18 @@ public partial class CrmActivityNewPage : IDisposable ConfirmWorkDate.Hide(); StateHasChanged(); } + + /// + /// Work Date component callback + /// + /// + private async Task WorkDateComponentCallback(string workDate) + { + ReportClosed = await CrmReportRepo.ReportExist(workDate); + SelectedDate = DateTime.Parse(workDate); + Activity.ActivityDate = workDate; + } + /// /// Show Price list modal /// @@ -160,6 +174,7 @@ public partial class CrmActivityNewPage : IDisposable { PriceListModal.Show(); } + /// /// Price List modal callback /// @@ -177,6 +192,7 @@ public partial class CrmActivityNewPage : IDisposable StateHasChanged(); } + /// /// Show Price History modal /// @@ -185,6 +201,7 @@ public partial class CrmActivityNewPage : IDisposable if(ShowItem) PriceHistoryModal.Show(); } + /// /// Price History modal callback /// @@ -198,16 +215,6 @@ public partial class CrmActivityNewPage : IDisposable StateHasChanged(); } - /// - /// Work Date component callback - /// - /// - private async Task WorkDateComponentCallback(string workDate) - { - ReportClosed = await CrmReportRepo.ReportExist(workDate); - SelectedDate = DateTime.Parse(workDate); - Activity.ActivityDate = workDate; - } /// /// Validate and Create Activity /// @@ -294,6 +301,7 @@ public partial class CrmActivityNewPage : IDisposable PoFormInvalid = false; Toast.ShowError(result.Message, "ORDRE FEJL"); } + /// /// Delete current draft /// @@ -302,6 +310,7 @@ public partial class CrmActivityNewPage : IDisposable await DraftStateProvider.DeleteDraftAsync(); Activity.ActivityStatusEnum = "noSale"; } + /// /// Add item to draft /// @@ -330,6 +339,7 @@ public partial class CrmActivityNewPage : IDisposable // save the item using the CartStateProvider's save method await DraftStateProvider.SaveChangesAsync(); } + /// /// Remove item from draft /// @@ -343,6 +353,7 @@ public partial class CrmActivityNewPage : IDisposable if (!DraftStateProvider.Draft.Items.Any()) Activity.ActivityStatusEnum = "noSale"; } + /// /// Edit Context handle field change /// @@ -350,6 +361,7 @@ public partial class CrmActivityNewPage : IDisposable /// private void HandleFieldChanged(object sender, FieldChangedEventArgs e) { + DraftStateProvider.Draft.DraftType = Activity.ActivityStatusEnum; // InvalidCanvas = InvalidActivityType; InvalidActivity = InvalidActivityType || PoFormInvalid @@ -368,6 +380,7 @@ public partial class CrmActivityNewPage : IDisposable PoFormInvalid = !ActivityContext.Validate(); StateHasChanged(); } + /// /// Edit Context handle validation change /// @@ -387,6 +400,7 @@ public partial class CrmActivityNewPage : IDisposable ActivityContext.OnFieldChanged += HandleFieldChanged; ActivityContext.OnValidationStateChanged += ValidationChanged; } + /// /// Implement Dispose from IDisposable /// diff --git a/Wonky.Client/Pages/CrmCompanyQuotes.razor b/Wonky.Client/Pages/CrmCompanyQuotes.razor new file mode 100644 index 00000000..c102c516 --- /dev/null +++ b/Wonky.Client/Pages/CrmCompanyQuotes.razor @@ -0,0 +1,15 @@ +@page "/companies/{CompanyId}/quotes" +@using Wonky.Client.HttpInterfaces +
+

Åbne tilbud

+
+ +@code { + [Inject] ICrmHistoryHttpRepository HistoryRepo { get; set; } + + protected override Task OnParametersSetAsync() + { + return base.OnParametersSetAsync(); + } + +} \ No newline at end of file diff --git a/Wonky.Client/Pages/CrmCompanyViewPage.razor b/Wonky.Client/Pages/CrmCompanyViewPage.razor index a3760abf..ff44c841 100644 --- a/Wonky.Client/Pages/CrmCompanyViewPage.razor +++ b/Wonky.Client/Pages/CrmCompanyViewPage.razor @@ -98,7 +98,7 @@
- +
@* account *@ @@ -123,7 +123,7 @@
@* save vat number *@
- +
@@ -131,7 +131,10 @@ @* activity buttons *@
- Faktura + Poster +
+
+ Tilbud
Besøg @@ -165,7 +168,7 @@
@* Save CRM data button *@
- +
@* crm context - contacts *@ diff --git a/Wonky.Client/Pages/OfficeOrderViewPage.razor.cs b/Wonky.Client/Pages/OfficeOrderViewPage.razor.cs index c668fe07..1edbe038 100644 --- a/Wonky.Client/Pages/OfficeOrderViewPage.razor.cs +++ b/Wonky.Client/Pages/OfficeOrderViewPage.razor.cs @@ -57,10 +57,13 @@ public partial class OfficeOrderViewPage : IDisposable Logger.LogDebug("ReportItem => \n {}", JsonSerializer.Serialize(_reportItem, _options)); } + /// + /// Set activity process state to express. Send confirmation notification to salesRep + /// private async Task SetExpressState() { Logger.LogDebug("SetExpressState => \n {}", JsonSerializer.Serialize(_reportItem, _options)); - var responseView = await ActivityRepo.GetExpressStatus(_reportItem.ActivityId); + var responseView = await ActivityRepo.SetProcessStateExpress(_reportItem.ActivityId); Logger.LogDebug("SetExpressState => \n {}", responseView.Message ); if (!responseView.IsSuccess) @@ -105,12 +108,15 @@ public partial class OfficeOrderViewPage : IDisposable var sendMail = await MailService.SendMail("System", msg); if (sendMail.IsSuccess) { - Toast.ShowSuccess($"Status er opdateret og notifikation sendt til {salesRep.FirstName}.", "OK"); + Toast + .ShowSuccess( + $"Status er opdateret og notifikation sendt til {salesRep.FirstName}.", "OK"); } else { - Toast.ShowWarning($"Notifikation til {salesRep.FirstName} kunne ikke sendes. {sendMail.Message}", - "ADVARSEL"); + Toast + .ShowWarning( + $"Notifikation til {salesRep.FirstName} kunne ikke sendes. {sendMail.Message}", "ADVARSEL"); } _isNotified = true; diff --git a/Wonky.Client/Program.cs b/Wonky.Client/Program.cs index c554f327..74c60f25 100644 --- a/Wonky.Client/Program.cs +++ b/Wonky.Client/Program.cs @@ -41,7 +41,7 @@ builder.Services.AddScoped(sp => builder.Services.AddHttpClient("InnoAPI", (sp, cl) => { var apiConfig = sp.GetRequiredService>(); - cl.BaseAddress = new Uri(apiConfig.Value.InnoBaseUrl); + cl.BaseAddress = new Uri(apiConfig.Value.ApiBaseUrl); cl.DefaultRequestHeaders.CacheControl = CacheControlHeaderValue.Parse("no-cache, no-store, must-revalidate"); cl.DefaultRequestHeaders.Add("Pragma", "no-cache"); cl.EnableIntercept(sp); diff --git a/Wonky.Client/Services/VatInfoLookupService.cs b/Wonky.Client/Services/VatInfoLookupService.cs index 1a943760..0e6785a1 100644 --- a/Wonky.Client/Services/VatInfoLookupService.cs +++ b/Wonky.Client/Services/VatInfoLookupService.cs @@ -52,7 +52,7 @@ public class VatInfoLookupService ["zipCode"] = $"{query.ZipCode}", ["entityName"] = $"{query.EntityName}" }; - var endpoint = QueryHelpers.AddQueryString(_config.ServiceVirk, queryString); + var endpoint = QueryHelpers.AddQueryString(_config.ServicesVatDk, queryString); var response = await _client.GetAsync(endpoint); var content = await response.Content.ReadAsStringAsync(); @@ -80,7 +80,7 @@ public class VatInfoLookupService ["vatNumber"] = $"{vatNumber}" }; - var endpoint = QueryHelpers.AddQueryString(_config.ServiceBrReg, queryString); + var endpoint = QueryHelpers.AddQueryString(_config.ServicesVatNo, queryString); var response = await _client.GetAsync(endpoint); var content = await response.Content.ReadAsStringAsync(); @@ -102,7 +102,7 @@ public class VatInfoLookupService { ["vatNumber"] = $"{vatNumber}" }; - var endpoint = QueryHelpers.AddQueryString(_config.ServiceVies, queryString); + var endpoint = QueryHelpers.AddQueryString(_config.ServicesVatEu, queryString); var response = await _client.GetAsync(endpoint); var content = await response.Content.ReadAsStringAsync(); diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json index ba106ad1..415b10e8 100644 --- a/Wonky.Client/wwwroot/appsettings.json +++ b/Wonky.Client/wwwroot/appsettings.json @@ -1,36 +1,36 @@ { "appInfo": { "name": "Wonky Client", - "version": "0.52.1", - "rc": false, + "version": "0.53.2", + "rc": true, "sandBox": false, "image": "grumpy-coder.png" }, "apiConfig": { - "innoBaseUrl": "https://zeta.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", - "serviceBrReg": "api/v2/services/brReg", - "serviceVies": "api/v2/services/vies", - "token": "token", - "userInfo": "api/auth/userinfo", + "apiBaseUrl": "https://zeta.innotec.dk", "catalog": "api/v2/catalog", - "crmSales": "api/v2/crm/advisors/sales", - "crmReports": "api/v2/crm/advisors/reports", - "crmTasks": "api/v2/crm/advisors/tasks", "crmCustomers": "api/v2/crm/companies", - "crmInventory": "history/inventory", - "crmProducts": "history/products", - "crmSync": "invoices/sync", - "crmWorkplaces": "workplaces", + "crmInventoryExt": "history/inventory", + "crmProductExt": "history/products", + "crmReports": "api/v2/crm/advisors/reports", + "crmActivities": "api/v2/crm/advisors/activities", + "crmRpcSyncExt": "invoices/sync", + "crmBaseTasks": "api/v2/crm/advisors/tasks", + "crmWorkplaceExt": "workplaces", "officeAdvisors": "api/v2/office/users/advisors", - "officeUsers": "api/v2/office/users/admin", - "officeUserPasswd": "api/v2/office/users/passwd", "officeCustomers": "api/v2/office/customers", "officeReports": "api/v2/office/reports", - "warehouse": "api/v2/warehouse/packages", - "sendMail": "api/v2/services/sendmail" + "officeUserPasswd": "api/v2/office/users/passwd", + "officeUsers": "api/v2/office/users/admin", + "servicesGlsId": "", + "servicesGlsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=", + "servicesMail": "api/v2/services/sendmail", + "servicesVatDk": "api/v2/services/virk", + "serviceVatEu": "api/v2/services/vies", + "servicesVatNo": "api/v2/services/brReg", + "token": "token", + "userInfo": "api/auth/userinfo", + "warehouse": "api/v2/warehouse/packages" }, "Logging": { "LogLevel": { diff --git a/Wonky.Entity/Configuration/ApiConfig.cs b/Wonky.Entity/Configuration/ApiConfig.cs index 4078ee33..68383d8c 100644 --- a/Wonky.Entity/Configuration/ApiConfig.cs +++ b/Wonky.Entity/Configuration/ApiConfig.cs @@ -19,32 +19,32 @@ public class ApiConfig /// /// Application base url /// - public string InnoBaseUrl { get; set; } = ""; + public string ApiBaseUrl { get; set; } = ""; /// /// GLS tracking url /// - public string GlsTrackUrl { get; set; } = ""; + public string ServicesGlsTrackUrl { get; set; } = ""; /// /// GLS customer entity /// - public string GlsId { get; set; } = ""; + public string ServicesGlsId { get; set; } = ""; /// /// VAT registrar url Denmark /// - public string ServiceVirk { get; set; } = ""; + public string ServicesVatDk { get; set; } = ""; /// /// VAT registrar url Norway /// - public string ServiceBrReg { get; set; } = ""; + public string ServicesVatNo { get; set; } = ""; /// /// VAT registrar url EU /// - public string ServiceVies { get; set; } = ""; + public string ServicesVatEu { get; set; } = ""; /// /// Application uri for token request @@ -64,7 +64,7 @@ public class ApiConfig /// /// Application uri for activity request /// - public string CrmSales { get; set; } = ""; + public string CrmActivities { get; set; } = ""; /// /// Application uri for sales report request @@ -84,22 +84,22 @@ public class ApiConfig /// /// Application uri for customer product inventory request /// - public string CrmInventory { get; set; } = ""; + public string CrmInventoryExt { get; set; } = ""; /// /// Application uri for customer product sale request /// - public string CrmProducts { get; set; } = ""; + public string CrmProductExt { get; set; } = ""; /// /// Application uri for updating customer product sale request /// - public string CrmSync { get; set; } = ""; + public string CrmRpcSyncExt { get; set; } = ""; /// /// Application uri for getting workplace(s) /// - public string CrmWorkplaces { get; set; } = ""; + public string CrmWorkplaceExt { get; set; } = ""; /// /// Application uri for administration of sales representatives @@ -134,7 +134,7 @@ public class ApiConfig /// /// url for sending mail message /// - public string SendMail { get; set; } = ""; + public string ServicesMail { get; set; } = ""; // /// // /// Application uri for reading salesReports // ///