wip
This commit is contained in:
parent
66c13df83f
commit
232b61949a
19 changed files with 336 additions and 152 deletions
|
@ -1,3 +1,5 @@
|
||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bestilling/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=kontrolleres/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=kontrolleres/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Venligst/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Venligst/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Virk/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
|
@ -48,6 +48,7 @@ public partial class ProductInventoryTableComponent
|
||||||
private async Task OnSelectedItem(DraftItem draftItem)
|
private async Task OnSelectedItem(DraftItem draftItem)
|
||||||
{
|
{
|
||||||
// add item to order draft
|
// add item to order draft
|
||||||
|
DraftStateProvider.Draft.DraftType = "order";
|
||||||
DraftStateProvider.Draft.Items.Add(draftItem);
|
DraftStateProvider.Draft.Items.Add(draftItem);
|
||||||
await DraftStateProvider.SaveChangesAsync();
|
await DraftStateProvider.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,39 @@ namespace Wonky.Client.HttpInterfaces;
|
||||||
|
|
||||||
public interface ICatalogHttpRepository
|
public interface ICatalogHttpRepository
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get a paged sales item list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pagingParameters"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<PagingResponse<SalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters);
|
Task<PagingResponse<SalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get sales item by id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="salesItemId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<SalesItemView> GetSalesItemId(string salesItemId);
|
Task<SalesItemView> GetSalesItemId(string salesItemId);
|
||||||
Task<SalesItemView> GetSalesVariantId(string variantId);
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get sales item by sku
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sku"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<SalesItemView> GetSalesItemSku(string sku);
|
Task<SalesItemView> GetSalesItemSku(string sku);
|
||||||
Task<SalesItemView> GetSalesItemSku(string countryCode, string sku);
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overload Get sales item by id and country code
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sku"></param>
|
||||||
|
/// <param name="countryCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<SalesItemView> GetSalesItemSku(string sku, string countryCode);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get sales item by variant id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variantId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<SalesItemView> GetSalesVariantId(string variantId);
|
||||||
}
|
}
|
|
@ -20,12 +20,58 @@ namespace Wonky.Client.HttpInterfaces;
|
||||||
|
|
||||||
public interface ICrmActivityHttpRepository
|
public interface ICrmActivityHttpRepository
|
||||||
{
|
{
|
||||||
Task<ReportItemView> GetReportItem(string salesHeadId);
|
/// <summary>
|
||||||
Task<ActivityDto> GetActivity(string salesHeadId);
|
/// Convert quote to sale
|
||||||
Task<ApiResponseView> CreateActivity(ActivityDto model);
|
/// </summary>
|
||||||
Task<ApiResponseView> AcceptOffer(string id);
|
/// <param name="activity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ApiResponseView> AcceptQuote(ActivityDto activity);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get activities by date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityDate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<ReportStatusView> GetActivities(string activityDate);
|
Task<ReportStatusView> GetActivities(string activityDate);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create new activity
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ApiResponseView> CreateActivity(ActivityDto model);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get activity data by id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ActivityDto> GetActivity(string activityId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get activity by id formatted for report
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ReportItemView> GetReportItem(string activityId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get activities for customer Id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="customerId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
Task<List<ReportItemView>> GetCustomerActivities(string customerId);
|
Task<List<ReportItemView>> GetCustomerActivities(string customerId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set backend process state to express
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityId"></param>
|
||||||
|
/// <returns>ApiResponseView</returns>
|
||||||
|
Task<ApiResponseView> SetProcessStateExpress(string activityId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update office note for activity
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model"></param>
|
||||||
Task UpdateOfficeNote(ActivityOfficeNote model);
|
Task UpdateOfficeNote(ActivityOfficeNote model);
|
||||||
Task<ApiResponseView> GetExpressStatus(string id);
|
|
||||||
}
|
}
|
|
@ -52,7 +52,12 @@ public class CatalogHttpRepository : ICatalogHttpRepository
|
||||||
_navigation = navigation;
|
_navigation = navigation;
|
||||||
_apiConfig = configuration.Value;
|
_apiConfig = configuration.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a paged sales item list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pagingParameters"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<PagingResponse<SalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters)
|
public async Task<PagingResponse<SalesItemView>> GetSalesItemsPaged(CatalogPagingParams pagingParameters)
|
||||||
{
|
{
|
||||||
var queryString = new Dictionary<string, string>
|
var queryString = new Dictionary<string, string>
|
||||||
|
@ -65,7 +70,7 @@ public class CatalogHttpRepository : ICatalogHttpRepository
|
||||||
["selectGroup"] = pagingParameters.SelectGroup == "0" ? "" : pagingParameters.SelectGroup,
|
["selectGroup"] = pagingParameters.SelectGroup == "0" ? "" : pagingParameters.SelectGroup,
|
||||||
};
|
};
|
||||||
var response = await _client
|
var response = await _client
|
||||||
.GetAsync(QueryHelpers.AddQueryString($"{_apiConfig.Catalog}/page", queryString));
|
.GetAsync(QueryHelpers.AddQueryString($"{_apiConfig.Catalog}/page", queryString));
|
||||||
|
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
@ -78,28 +83,50 @@ public class CatalogHttpRepository : ICatalogHttpRepository
|
||||||
return pagingResponse;
|
return pagingResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get sales item by id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="salesItemId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<SalesItemView> GetSalesItemId(string salesItemId)
|
public async Task<SalesItemView> GetSalesItemId(string salesItemId)
|
||||||
{
|
{
|
||||||
var salesItem = await _client
|
var salesItem = await _client
|
||||||
.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/{salesItemId}");
|
.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/{salesItemId}");
|
||||||
return salesItem ?? new SalesItemView();
|
return salesItem ?? new SalesItemView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get sales item by sku
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sku"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<SalesItemView> GetSalesItemSku(string sku)
|
||||||
|
{
|
||||||
|
var salesItem = await _client.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/sku/{sku}");
|
||||||
|
return salesItem ?? new SalesItemView();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overload Get sales item by id and country code
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sku"></param>
|
||||||
|
/// <param name="countryCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<SalesItemView> GetSalesItemSku(string sku, string countryCode)
|
||||||
|
{
|
||||||
|
var salesItem = await _client.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/{countryCode}/sku/{sku}");
|
||||||
|
return salesItem ?? new SalesItemView();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get sales item by variant id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="variantId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public async Task<SalesItemView> GetSalesVariantId(string variantId)
|
public async Task<SalesItemView> GetSalesVariantId(string variantId)
|
||||||
{
|
{
|
||||||
var salesItem = await _client
|
var salesItem = await _client
|
||||||
.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/variant/{variantId}");
|
.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/variant/{variantId}");
|
||||||
return salesItem ?? new SalesItemView();
|
return salesItem ?? new SalesItemView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<SalesItemView> GetSalesItemSku(string sku)
|
|
||||||
{
|
|
||||||
var salesItem = await _client.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/sku/{sku}");
|
|
||||||
return salesItem ?? new SalesItemView();
|
|
||||||
}
|
|
||||||
public async Task<SalesItemView> GetSalesItemSku(string countryCode, string sku)
|
|
||||||
{
|
|
||||||
var salesItem = await _client.GetFromJsonAsync<SalesItemView>($"{_apiConfig.Catalog}/{countryCode}/sku/{sku}");
|
|
||||||
return salesItem ?? new SalesItemView();
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -13,22 +13,13 @@
|
||||||
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
// 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.Http.Json;
|
||||||
using System.Net.Mime;
|
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Wonky.Client.Features;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.AspNetCore.WebUtilities;
|
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Wonky.Client.HttpInterfaces;
|
using Wonky.Client.HttpInterfaces;
|
||||||
using Wonky.Entity.Configuration;
|
using Wonky.Entity.Configuration;
|
||||||
using Wonky.Entity.DTO;
|
using Wonky.Entity.DTO;
|
||||||
using Wonky.Entity.Models;
|
|
||||||
using Wonky.Entity.Requests;
|
|
||||||
using Wonky.Entity.Views;
|
using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.HttpRepository;
|
namespace Wonky.Client.HttpRepository;
|
||||||
|
@ -44,7 +35,7 @@ public class CrmActivityHttpRepository : ICrmActivityHttpRepository
|
||||||
private ILogger<CrmActivityHttpRepository> _logger;
|
private ILogger<CrmActivityHttpRepository> _logger;
|
||||||
private readonly HttpClient _client;
|
private readonly HttpClient _client;
|
||||||
private readonly ApiConfig _api;
|
private readonly ApiConfig _api;
|
||||||
|
|
||||||
public CrmActivityHttpRepository(HttpClient client,
|
public CrmActivityHttpRepository(HttpClient client,
|
||||||
ILogger<CrmActivityHttpRepository> logger,
|
ILogger<CrmActivityHttpRepository> logger,
|
||||||
NavigationManager navigation, IOptions<ApiConfig> configuration)
|
NavigationManager navigation, IOptions<ApiConfig> configuration)
|
||||||
|
@ -55,44 +46,29 @@ public class CrmActivityHttpRepository : ICrmActivityHttpRepository
|
||||||
_api = configuration.Value;
|
_api = configuration.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ApiResponseView> GetExpressStatus(string id)
|
/// <summary>
|
||||||
|
/// Convert quote to sale
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<ApiResponseView> AcceptQuote(ActivityDto activity)
|
||||||
{
|
{
|
||||||
var response = await _client.GetFromJsonAsync<ApiResponseView>($"{_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<ReportStatusView> GetActivities(string activityDate)
|
|
||||||
{
|
|
||||||
var response = await _client
|
|
||||||
.GetAsync($"{_api.CrmSales}/date/{activityDate}");
|
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
return string.IsNullOrWhiteSpace(content)
|
var result = JsonSerializer.Deserialize<ApiResponseView>(content);
|
||||||
? new ReportStatusView()
|
return result!;
|
||||||
: JsonSerializer.Deserialize<ReportStatusView>(content, _options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<ReportItemView>> GetCustomerActivities(string customerId)
|
/// <summary>
|
||||||
{
|
/// Create new activity
|
||||||
var response = await _client.GetAsync($"{_api.CrmSales}/company/{customerId}");
|
/// </summary>
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
/// <param name="model"></param>
|
||||||
return JsonSerializer.Deserialize<List<ReportItemView>>(content, _options);
|
/// <returns></returns>
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ApiResponseView> CreateActivity(ActivityDto model)
|
public async Task<ApiResponseView> 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 content = await response.Content.ReadAsStringAsync();
|
||||||
var result = JsonSerializer.Deserialize<ApiResponseView>(content, _options);
|
var result = JsonSerializer.Deserialize<ApiResponseView>(content, _options);
|
||||||
if (result.IsSuccess) return result!;
|
if (result.IsSuccess) return result!;
|
||||||
|
@ -100,26 +76,84 @@ public class CrmActivityHttpRepository : ICrmActivityHttpRepository
|
||||||
result.Message = msg.ToString();
|
result.Message = msg.ToString();
|
||||||
return result!;
|
return result!;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ReportItemView> GetReportItem(string salesHeadId)
|
/// <summary>
|
||||||
|
/// Get activities by date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityDate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<ReportStatusView> GetActivities(string activityDate)
|
||||||
{
|
{
|
||||||
var salesItem = await _client
|
var response = await _client
|
||||||
.GetFromJsonAsync<ReportItemView>($"{_api.CrmSales}/{salesHeadId}");
|
.GetAsync($"{_api.CrmActivities}/date/{activityDate}");
|
||||||
return salesItem ?? new ReportItemView();
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
return string.IsNullOrWhiteSpace(content)
|
||||||
|
? new ReportStatusView()
|
||||||
|
: JsonSerializer.Deserialize<ReportStatusView>(content, _options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ActivityDto> GetActivity(string salesHeadId)
|
/// <summary>
|
||||||
|
/// Get activity data by id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<ActivityDto> GetActivity(string activityId)
|
||||||
{
|
{
|
||||||
var salesItem = await _client
|
var salesItem = await _client
|
||||||
.GetFromJsonAsync<ActivityDto>($"{_api.CrmSales}/{salesHeadId}");
|
.GetFromJsonAsync<ActivityDto>($"{_api.CrmActivities}/{activityId}");
|
||||||
return salesItem ?? new ActivityDto();
|
return salesItem ?? new ActivityDto();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ApiResponseView> AcceptOffer(string id)
|
/// <summary>
|
||||||
|
/// Get activities for customer Id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="customerId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<ReportItemView>> 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 content = await response.Content.ReadAsStringAsync();
|
||||||
var result = JsonSerializer.Deserialize<ApiResponseView>(content);
|
return JsonSerializer.Deserialize<List<ReportItemView>>(content, _options);
|
||||||
return result!;
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get activity by id formatted for report
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<ReportItemView> GetReportItem(string activityId)
|
||||||
|
{
|
||||||
|
var salesItem = await _client
|
||||||
|
.GetFromJsonAsync<ReportItemView>($"{_api.CrmActivities}/{activityId}");
|
||||||
|
return salesItem ?? new ReportItemView();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Set backend process state to express
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityId"></param>
|
||||||
|
/// <returns>ApiResponseView</returns>
|
||||||
|
public async Task<ApiResponseView> 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<ApiResponseView>(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update office note for activity
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model"></param>
|
||||||
|
public async Task UpdateOfficeNote(ActivityOfficeNote model)
|
||||||
|
{
|
||||||
|
await _client.PutAsJsonAsync($"{_api.CrmActivities}/note/{model.ActivityId}", model, _options);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -79,7 +79,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository
|
||||||
/// <returns>List of products</returns>
|
/// <returns>List of products</returns>
|
||||||
public async Task<List<ProductInventoryView>> FetchInventory(string companyId)
|
public async Task<List<ProductInventoryView>> 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();
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
return response.IsSuccessStatusCode
|
return response.IsSuccessStatusCode
|
||||||
? JsonSerializer.Deserialize<List<ProductInventoryView>>(content, _options)
|
? JsonSerializer.Deserialize<List<ProductInventoryView>>(content, _options)
|
||||||
|
@ -94,7 +94,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository
|
||||||
public async Task<List<ProductHistoryView>> FetchHistory(string companyId)
|
public async Task<List<ProductHistoryView>> FetchHistory(string companyId)
|
||||||
{
|
{
|
||||||
return await _client.GetFromJsonAsync<List<ProductHistoryView>>(
|
return await _client.GetFromJsonAsync<List<ProductHistoryView>>(
|
||||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}", _options);
|
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProductExt}", _options);
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -106,7 +106,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository
|
||||||
public async Task<List<ProductHistoryView>> FetchHistory(string companyId, string sku)
|
public async Task<List<ProductHistoryView>> FetchHistory(string companyId, string sku)
|
||||||
{
|
{
|
||||||
return await _client.GetFromJsonAsync<List<ProductHistoryView>>(
|
return await _client.GetFromJsonAsync<List<ProductHistoryView>>(
|
||||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}/{sku}", _options);
|
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProductExt}/{sku}", _options);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// execute a remote procedure designed to update crm database from erp system based on a date string
|
/// 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
|
||||||
/// <returns>date string</returns>
|
/// <returns>date string</returns>
|
||||||
public async Task<string> RpcSyncErpToCrm(string companyId, string syncDate)
|
public async Task<string> 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}");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -50,32 +50,32 @@ public class CrmWorkplaceHttpRepository : ICrmWorkplaceHttpRepository
|
||||||
public async Task<List<WorkplaceListView>> GetWorkplaces(string companyId)
|
public async Task<List<WorkplaceListView>> GetWorkplaces(string companyId)
|
||||||
{
|
{
|
||||||
var result = await _client.GetFromJsonAsync<List<WorkplaceListView>>(
|
var result = await _client.GetFromJsonAsync<List<WorkplaceListView>>(
|
||||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}", _options);
|
$"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}", _options);
|
||||||
return result ?? new List<WorkplaceListView>();
|
return result ?? new List<WorkplaceListView>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<WorkplaceDto> GetWorkplace(string companyId, string workplaceId)
|
public async Task<WorkplaceDto> GetWorkplace(string companyId, string workplaceId)
|
||||||
{
|
{
|
||||||
var result = await _client.GetFromJsonAsync<WorkplaceDto>(
|
var result = await _client.GetFromJsonAsync<WorkplaceDto>(
|
||||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}/{workplaceId}", _options);
|
$"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}/{workplaceId}", _options);
|
||||||
return result ?? new WorkplaceDto();
|
return result ?? new WorkplaceDto();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task CreateWorkplace(string companyId, WorkplaceDto workplace)
|
public async Task CreateWorkplace(string companyId, WorkplaceDto workplace)
|
||||||
{
|
{
|
||||||
await _client.PostAsJsonAsync(
|
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)
|
public async Task UpdateWorkplace(string companyId, WorkplaceDto workplace)
|
||||||
{
|
{
|
||||||
await _client.PutAsJsonAsync(
|
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)
|
public async Task DeleteWorkplace(string companyId, string workplaceId)
|
||||||
{
|
{
|
||||||
await _client.DeleteAsync(
|
await _client.DeleteAsync(
|
||||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaces}/{workplaceId}");
|
$"{_api.CrmCustomers}/{companyId}/{_api.CrmWorkplaceExt}/{workplaceId}");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ public class SendMailService : ISendMailService
|
||||||
|
|
||||||
public async Task<ApiResponseView> SendMail(string messageType, EmailMessage message)
|
public async Task<ApiResponseView> 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)
|
if (!response.IsSuccessStatusCode)
|
||||||
return new ApiResponseView
|
return new ApiResponseView
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,7 @@ public class DraftItem
|
||||||
public class Draft
|
public class Draft
|
||||||
{
|
{
|
||||||
public string DraftId { get; set; } = "";
|
public string DraftId { get; set; } = "";
|
||||||
|
public string DraftType { get; set; } = "noSale";
|
||||||
public List<DraftItem> Items { get; set; } = new ();
|
public List<DraftItem> Items { get; set; } = new ();
|
||||||
public decimal Total
|
public decimal Total
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,8 +50,8 @@ else
|
||||||
<div class="row mb-1">
|
<div class="row mb-1">
|
||||||
<label for="activityType" class="col-md-2 col-form-label">Ordre Type</label>
|
<label for="activityType" class="col-md-2 col-form-label">Ordre Type</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<InputSelect id="activityType" class="form-select" @bind-Value="@Activity.ActivityTypeEnum">
|
<InputSelect id="activityType" class="form-select bg-info" @bind-Value="@Activity.ActivityTypeEnum">
|
||||||
<option value="">→ TAG MIG ←</option>
|
<option value=""></option>
|
||||||
<option value="onSite">Besøg</option>
|
<option value="onSite">Besøg</option>
|
||||||
<option value="phone">Telefon</option>
|
<option value="phone">Telefon</option>
|
||||||
</InputSelect>
|
</InputSelect>
|
||||||
|
@ -60,19 +60,27 @@ else
|
||||||
|
|
||||||
<label for="statusType" class="col-md-2 col-form-label">Status</label>
|
<label for="statusType" class="col-md-2 col-form-label">Status</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<InputSelect id="statusType" class="form-select" @bind-Value="@Activity.ActivityStatusEnum">
|
<InputSelect id="statusType" class="form-select bg-info" @bind-Value="@Activity.ActivityStatusEnum">
|
||||||
<option value="noSale">Ingen salg</option>
|
<option value="noSale">Ingen salg</option>
|
||||||
@if (!string.IsNullOrEmpty(Activity.VatNumber) && !string.IsNullOrWhiteSpace(Activity.Address1) && Company.HasFolded == 0)
|
@if (!string.IsNullOrEmpty(Activity.VatNumber) && !string.IsNullOrWhiteSpace(Activity.Address1) && Company.HasFolded == 0)
|
||||||
{
|
{
|
||||||
@if (DraftStateProvider.Draft.Items.Any())
|
@if (DraftStateProvider.Draft.DraftType == "quote")
|
||||||
{
|
{
|
||||||
<option value="order" selected>Bestilling</option>
|
<option selected value="order">Bestilling</option>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<option value="order">Bestilling</option>
|
<option value="order">Bestilling</option>
|
||||||
}
|
}
|
||||||
<option value="quote">Tilbud</option>
|
|
||||||
|
@if(DraftStateProvider.Draft.DraftType == "offer")
|
||||||
|
{
|
||||||
|
<option selected value="quote">Tilbud</option>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<option value="quote">Tilbud</option>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</InputSelect>
|
</InputSelect>
|
||||||
<ValidationMessage For="@(() => Activity.ActivityStatusEnum)"></ValidationMessage>
|
<ValidationMessage For="@(() => Activity.ActivityStatusEnum)"></ValidationMessage>
|
||||||
|
@ -322,13 +330,10 @@ else
|
||||||
</div>
|
</div>
|
||||||
</EditForm>
|
</EditForm>
|
||||||
<div class="row mt-2 mb-2">
|
<div class="row mt-2 mb-2">
|
||||||
<div class="col">
|
<div class="col text-end">
|
||||||
<a class="btn btn-info" href="/companies">Til Oversigt</a>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<a class="btn btn-warning" href="/companies/@Company.CompanyId">Tilbage</a>
|
<a class="btn btn-warning" href="/companies/@Company.CompanyId">Tilbage</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col text-end">
|
||||||
<button type="button" class="btn btn-primary" @onclick="CreateActivity" disabled="@PoFormInvalid">Opret besøg</button>
|
<button type="button" class="btn btn-primary" @onclick="CreateActivity" disabled="@PoFormInvalid">Opret besøg</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -100,6 +100,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
{
|
{
|
||||||
Company.Phone = Company.Account[..8];
|
Company.Phone = Company.Account[..8];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populate base activity information
|
// Populate base activity information
|
||||||
Activity.BcId = Company.BcId;
|
Activity.BcId = Company.BcId;
|
||||||
Activity.ActivityStatusEnum = "noSale";
|
Activity.ActivityStatusEnum = "noSale";
|
||||||
|
@ -135,7 +136,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
ConfirmWorkDate.Show();
|
ConfirmWorkDate.Show();
|
||||||
}
|
}
|
||||||
// Lines may already have been added from the company inventory page
|
// 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
|
// set dropdown selection accordingly
|
||||||
Activity.ActivityTypeEnum = "onSite";
|
Activity.ActivityTypeEnum = "onSite";
|
||||||
|
@ -144,6 +145,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
}
|
}
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Work Date confirm callback
|
/// Work Date confirm callback
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -153,6 +155,18 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
ConfirmWorkDate.Hide();
|
ConfirmWorkDate.Hide();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Work Date component callback
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="workDate"></param>
|
||||||
|
private async Task WorkDateComponentCallback(string workDate)
|
||||||
|
{
|
||||||
|
ReportClosed = await CrmReportRepo.ReportExist(workDate);
|
||||||
|
SelectedDate = DateTime.Parse(workDate);
|
||||||
|
Activity.ActivityDate = workDate;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show Price list modal
|
/// Show Price list modal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -160,6 +174,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
{
|
{
|
||||||
PriceListModal.Show();
|
PriceListModal.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Price List modal callback
|
/// Price List modal callback
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -177,6 +192,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
|
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show Price History modal
|
/// Show Price History modal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -185,6 +201,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
if(ShowItem)
|
if(ShowItem)
|
||||||
PriceHistoryModal.Show();
|
PriceHistoryModal.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Price History modal callback
|
/// Price History modal callback
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -198,16 +215,6 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Work Date component callback
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="workDate"></param>
|
|
||||||
private async Task WorkDateComponentCallback(string workDate)
|
|
||||||
{
|
|
||||||
ReportClosed = await CrmReportRepo.ReportExist(workDate);
|
|
||||||
SelectedDate = DateTime.Parse(workDate);
|
|
||||||
Activity.ActivityDate = workDate;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Validate and Create Activity
|
/// Validate and Create Activity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -294,6 +301,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
PoFormInvalid = false;
|
PoFormInvalid = false;
|
||||||
Toast.ShowError(result.Message, "ORDRE FEJL");
|
Toast.ShowError(result.Message, "ORDRE FEJL");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete current draft
|
/// Delete current draft
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -302,6 +310,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
await DraftStateProvider.DeleteDraftAsync();
|
await DraftStateProvider.DeleteDraftAsync();
|
||||||
Activity.ActivityStatusEnum = "noSale";
|
Activity.ActivityStatusEnum = "noSale";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add item to draft
|
/// Add item to draft
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -330,6 +339,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
// save the item using the CartStateProvider's save method
|
// save the item using the CartStateProvider's save method
|
||||||
await DraftStateProvider.SaveChangesAsync();
|
await DraftStateProvider.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove item from draft
|
/// Remove item from draft
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -343,6 +353,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
if (!DraftStateProvider.Draft.Items.Any())
|
if (!DraftStateProvider.Draft.Items.Any())
|
||||||
Activity.ActivityStatusEnum = "noSale";
|
Activity.ActivityStatusEnum = "noSale";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Edit Context handle field change
|
/// Edit Context handle field change
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -350,6 +361,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void HandleFieldChanged(object sender, FieldChangedEventArgs e)
|
private void HandleFieldChanged(object sender, FieldChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
DraftStateProvider.Draft.DraftType = Activity.ActivityStatusEnum;
|
||||||
// InvalidCanvas = InvalidActivityType;
|
// InvalidCanvas = InvalidActivityType;
|
||||||
InvalidActivity = InvalidActivityType
|
InvalidActivity = InvalidActivityType
|
||||||
|| PoFormInvalid
|
|| PoFormInvalid
|
||||||
|
@ -368,6 +380,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
PoFormInvalid = !ActivityContext.Validate();
|
PoFormInvalid = !ActivityContext.Validate();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Edit Context handle validation change
|
/// Edit Context handle validation change
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -387,6 +400,7 @@ public partial class CrmActivityNewPage : IDisposable
|
||||||
ActivityContext.OnFieldChanged += HandleFieldChanged;
|
ActivityContext.OnFieldChanged += HandleFieldChanged;
|
||||||
ActivityContext.OnValidationStateChanged += ValidationChanged;
|
ActivityContext.OnValidationStateChanged += ValidationChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implement Dispose from IDisposable
|
/// Implement Dispose from IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
15
Wonky.Client/Pages/CrmCompanyQuotes.razor
Normal file
15
Wonky.Client/Pages/CrmCompanyQuotes.razor
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
@page "/companies/{CompanyId}/quotes"
|
||||||
|
@using Wonky.Client.HttpInterfaces
|
||||||
|
<div class="row">
|
||||||
|
<h3>Åbne tilbud</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Inject] ICrmHistoryHttpRepository HistoryRepo { get; set; }
|
||||||
|
|
||||||
|
protected override Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
return base.OnParametersSetAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -98,7 +98,7 @@
|
||||||
<button type="button" class="btn btn-primary" disabled="@(Company.HasFolded == 0)" onclick="@ForceActivity">Aktiver besøg</button>
|
<button type="button" class="btn btn-primary" disabled="@(Company.HasFolded == 0)" onclick="@ForceActivity">Aktiver besøg</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2 text-end">
|
<div class="col-sm-2 text-end">
|
||||||
<button type="button" class="btn btn-primary" onclick="@UpdateErpData" disabled="@(Working)">Gem STAM data</button>
|
<button type="button" class="btn btn-primary" onclick="@UpdateErpData" disabled="@(Working)">STAM data <i class="bi-save"></i></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* account *@
|
@* account *@
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
</div>
|
</div>
|
||||||
@* save vat number *@
|
@* save vat number *@
|
||||||
<div class="col-sm-2 text-end">
|
<div class="col-sm-2 text-end">
|
||||||
<button type="button" class="btn btn-primary" @onclick="UpdateVatNumber">Gem MOMS Nr</button>
|
<button type="button" class="btn btn-primary" @onclick="UpdateVatNumber">MOMS Nr<i class="bi-save"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -131,7 +131,10 @@
|
||||||
@* activity buttons *@
|
@* activity buttons *@
|
||||||
<div class="row mt-3 mb-2">
|
<div class="row mt-3 mb-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<a class="btn btn-light border-dark d-block" href="/companies/@Company.CompanyId/invoices">Faktura</a>
|
<a class="btn btn-light border-dark d-block" href="/companies/@Company.CompanyId/invoices">Poster</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<a class="btn btn-light border-dark d-block" href="/companies/@Company.CompanyId/quotes">Tilbud</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<a class="btn btn-light border-dark d-block" href="/companies/@Company.CompanyId/activities">Besøg</a>
|
<a class="btn btn-light border-dark d-block" href="/companies/@Company.CompanyId/activities">Besøg</a>
|
||||||
|
@ -165,7 +168,7 @@
|
||||||
</div>
|
</div>
|
||||||
@* Save CRM data button *@
|
@* Save CRM data button *@
|
||||||
<div class="col-sm-3 text-end">
|
<div class="col-sm-3 text-end">
|
||||||
<button type="button" class="btn btn-primary" @onclick="UpdateCrmData">Gem CRM data</button>
|
<button type="button" class="btn btn-primary" @onclick="UpdateCrmData">CRM <i class="bi-save"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@* crm context - contacts *@
|
@* crm context - contacts *@
|
||||||
|
|
|
@ -57,10 +57,13 @@ public partial class OfficeOrderViewPage : IDisposable
|
||||||
Logger.LogDebug("ReportItem => \n {}", JsonSerializer.Serialize(_reportItem, _options));
|
Logger.LogDebug("ReportItem => \n {}", JsonSerializer.Serialize(_reportItem, _options));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set activity process state to express. Send confirmation notification to salesRep
|
||||||
|
/// </summary>
|
||||||
private async Task SetExpressState()
|
private async Task SetExpressState()
|
||||||
{
|
{
|
||||||
Logger.LogDebug("SetExpressState => \n {}", JsonSerializer.Serialize(_reportItem, _options));
|
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 );
|
Logger.LogDebug("SetExpressState => \n {}", responseView.Message );
|
||||||
|
|
||||||
if (!responseView.IsSuccess)
|
if (!responseView.IsSuccess)
|
||||||
|
@ -105,12 +108,15 @@ public partial class OfficeOrderViewPage : IDisposable
|
||||||
var sendMail = await MailService.SendMail("System", msg);
|
var sendMail = await MailService.SendMail("System", msg);
|
||||||
if (sendMail.IsSuccess)
|
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
|
else
|
||||||
{
|
{
|
||||||
Toast.ShowWarning($"Notifikation til {salesRep.FirstName} kunne ikke sendes. {sendMail.Message}",
|
Toast
|
||||||
"ADVARSEL");
|
.ShowWarning(
|
||||||
|
$"Notifikation til {salesRep.FirstName} kunne ikke sendes. {sendMail.Message}", "ADVARSEL");
|
||||||
}
|
}
|
||||||
|
|
||||||
_isNotified = true;
|
_isNotified = true;
|
||||||
|
|
|
@ -41,7 +41,7 @@ builder.Services.AddScoped(sp =>
|
||||||
builder.Services.AddHttpClient("InnoAPI", (sp, cl) =>
|
builder.Services.AddHttpClient("InnoAPI", (sp, cl) =>
|
||||||
{
|
{
|
||||||
var apiConfig = sp.GetRequiredService<IOptions<ApiConfig>>();
|
var apiConfig = sp.GetRequiredService<IOptions<ApiConfig>>();
|
||||||
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.CacheControl = CacheControlHeaderValue.Parse("no-cache, no-store, must-revalidate");
|
||||||
cl.DefaultRequestHeaders.Add("Pragma", "no-cache");
|
cl.DefaultRequestHeaders.Add("Pragma", "no-cache");
|
||||||
cl.EnableIntercept(sp);
|
cl.EnableIntercept(sp);
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class VatInfoLookupService
|
||||||
["zipCode"] = $"{query.ZipCode}",
|
["zipCode"] = $"{query.ZipCode}",
|
||||||
["entityName"] = $"{query.EntityName}"
|
["entityName"] = $"{query.EntityName}"
|
||||||
};
|
};
|
||||||
var endpoint = QueryHelpers.AddQueryString(_config.ServiceVirk, queryString);
|
var endpoint = QueryHelpers.AddQueryString(_config.ServicesVatDk, queryString);
|
||||||
var response = await _client.GetAsync(endpoint);
|
var response = await _client.GetAsync(endpoint);
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class VatInfoLookupService
|
||||||
["vatNumber"] = $"{vatNumber}"
|
["vatNumber"] = $"{vatNumber}"
|
||||||
};
|
};
|
||||||
|
|
||||||
var endpoint = QueryHelpers.AddQueryString(_config.ServiceBrReg, queryString);
|
var endpoint = QueryHelpers.AddQueryString(_config.ServicesVatNo, queryString);
|
||||||
var response = await _client.GetAsync(endpoint);
|
var response = await _client.GetAsync(endpoint);
|
||||||
|
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
@ -102,7 +102,7 @@ public class VatInfoLookupService
|
||||||
{
|
{
|
||||||
["vatNumber"] = $"{vatNumber}"
|
["vatNumber"] = $"{vatNumber}"
|
||||||
};
|
};
|
||||||
var endpoint = QueryHelpers.AddQueryString(_config.ServiceVies, queryString);
|
var endpoint = QueryHelpers.AddQueryString(_config.ServicesVatEu, queryString);
|
||||||
var response = await _client.GetAsync(endpoint);
|
var response = await _client.GetAsync(endpoint);
|
||||||
|
|
||||||
var content = await response.Content.ReadAsStringAsync();
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
{
|
{
|
||||||
"appInfo": {
|
"appInfo": {
|
||||||
"name": "Wonky Client",
|
"name": "Wonky Client",
|
||||||
"version": "0.52.1",
|
"version": "0.53.2",
|
||||||
"rc": false,
|
"rc": true,
|
||||||
"sandBox": false,
|
"sandBox": false,
|
||||||
"image": "grumpy-coder.png"
|
"image": "grumpy-coder.png"
|
||||||
},
|
},
|
||||||
"apiConfig": {
|
"apiConfig": {
|
||||||
"innoBaseUrl": "https://zeta.innotec.dk",
|
"apiBaseUrl": "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",
|
|
||||||
"catalog": "api/v2/catalog",
|
"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",
|
"crmCustomers": "api/v2/crm/companies",
|
||||||
"crmInventory": "history/inventory",
|
"crmInventoryExt": "history/inventory",
|
||||||
"crmProducts": "history/products",
|
"crmProductExt": "history/products",
|
||||||
"crmSync": "invoices/sync",
|
"crmReports": "api/v2/crm/advisors/reports",
|
||||||
"crmWorkplaces": "workplaces",
|
"crmActivities": "api/v2/crm/advisors/activities",
|
||||||
|
"crmRpcSyncExt": "invoices/sync",
|
||||||
|
"crmBaseTasks": "api/v2/crm/advisors/tasks",
|
||||||
|
"crmWorkplaceExt": "workplaces",
|
||||||
"officeAdvisors": "api/v2/office/users/advisors",
|
"officeAdvisors": "api/v2/office/users/advisors",
|
||||||
"officeUsers": "api/v2/office/users/admin",
|
|
||||||
"officeUserPasswd": "api/v2/office/users/passwd",
|
|
||||||
"officeCustomers": "api/v2/office/customers",
|
"officeCustomers": "api/v2/office/customers",
|
||||||
"officeReports": "api/v2/office/reports",
|
"officeReports": "api/v2/office/reports",
|
||||||
"warehouse": "api/v2/warehouse/packages",
|
"officeUserPasswd": "api/v2/office/users/passwd",
|
||||||
"sendMail": "api/v2/services/sendmail"
|
"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": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
|
|
|
@ -19,32 +19,32 @@ public class ApiConfig
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application base url
|
/// Application base url
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string InnoBaseUrl { get; set; } = "";
|
public string ApiBaseUrl { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// GLS tracking url
|
/// GLS tracking url
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string GlsTrackUrl { get; set; } = "";
|
public string ServicesGlsTrackUrl { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// GLS customer entity
|
/// GLS customer entity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string GlsId { get; set; } = "";
|
public string ServicesGlsId { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// VAT registrar url Denmark
|
/// VAT registrar url Denmark
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ServiceVirk { get; set; } = "";
|
public string ServicesVatDk { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// VAT registrar url Norway
|
/// VAT registrar url Norway
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ServiceBrReg { get; set; } = "";
|
public string ServicesVatNo { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// VAT registrar url EU
|
/// VAT registrar url EU
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ServiceVies { get; set; } = "";
|
public string ServicesVatEu { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for token request
|
/// Application uri for token request
|
||||||
|
@ -64,7 +64,7 @@ public class ApiConfig
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for activity request
|
/// Application uri for activity request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CrmSales { get; set; } = "";
|
public string CrmActivities { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for sales report request
|
/// Application uri for sales report request
|
||||||
|
@ -84,22 +84,22 @@ public class ApiConfig
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for customer product inventory request
|
/// Application uri for customer product inventory request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CrmInventory { get; set; } = "";
|
public string CrmInventoryExt { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for customer product sale request
|
/// Application uri for customer product sale request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CrmProducts { get; set; } = "";
|
public string CrmProductExt { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for updating customer product sale request
|
/// Application uri for updating customer product sale request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CrmSync { get; set; } = "";
|
public string CrmRpcSyncExt { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for getting workplace(s)
|
/// Application uri for getting workplace(s)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CrmWorkplaces { get; set; } = "";
|
public string CrmWorkplaceExt { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application uri for administration of sales representatives
|
/// Application uri for administration of sales representatives
|
||||||
|
@ -134,7 +134,7 @@ public class ApiConfig
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// url for sending mail message
|
/// url for sending mail message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SendMail { get; set; } = "";
|
public string ServicesMail { get; set; } = "";
|
||||||
// /// <summary>
|
// /// <summary>
|
||||||
// /// Application uri for reading salesReports
|
// /// Application uri for reading salesReports
|
||||||
// /// </summary>
|
// /// </summary>
|
||||||
|
|
Loading…
Reference in a new issue