WIP - admin office front end

This commit is contained in:
Frede Hundewadt 2023-01-12 18:09:18 +01:00
parent bd3d62f029
commit be52137c15
11 changed files with 51 additions and 35 deletions

View file

@ -1,4 +1,6 @@
.color-code {
max-width: 40px;
.pictogram {
max-width: 30px;
}
.color-code {
max-width: 30px;
}

View file

@ -1,4 +1,6 @@
.color-code {
max-width: 40px;
.pictogram {
max-width: 30px;
}
.color-code {
max-width: 30px;
}

View file

@ -66,5 +66,5 @@ public interface IAdvisorCustomerHistoryRepository
/// <param name="companyId"></param>
/// <param name="syncDate"></param>
/// <returns></returns>
Task<string> ErpInvoiceToCrmRpc(string companyId, string syncDate);
Task<string> InvoiceErpToCrmRpc(string companyId, string syncDate);
}

View file

@ -66,5 +66,5 @@ public interface ICountryCustomerHistoryRepository
/// <param name="companyId"></param>
/// <param name="syncDate"></param>
/// <returns></returns>
Task<string> ErpInvoiceToCrmRpc(string countryCode, string companyId, string syncDate);
Task<string> InvoiceErpToCrmRpc(string countryCode, string companyId, string syncDate);
}

View file

@ -128,9 +128,9 @@ public class AdvisorCustomerHistoryRepository : IAdvisorCustomerHistoryRepositor
/// <param name="companyId"></param>
/// <param name="syncDate"></param>
/// <returns></returns>
public async Task<string> ErpInvoiceToCrmRpc(string companyId, string syncDate)
public async Task<string> InvoiceErpToCrmRpc(string companyId, string syncDate)
{
var x = await _client.GetAsync($"{_api.CrmCustomers}/{companyId}/{_api.CrmRpcSyncExt}/{syncDate}");
var x = await _client.GetAsync($"{_api.SyncRpc}/companies/{companyId}/{_api.SyncRpcInvoiceExt}/{syncDate}");
if (!x.IsSuccessStatusCode)
return string.Empty;
var content = await x.Content.ReadAsStringAsync();

View file

@ -134,9 +134,9 @@ public class CountryCustomerHistoryRepository : ICountryCustomerHistoryRepositor
/// <param name="companyId"></param>
/// <param name="syncDate"></param>
/// <returns></returns>
public async Task<string> ErpInvoiceToCrmRpc(string countryCode, string companyId, string syncDate)
public async Task<string> InvoiceErpToCrmRpc(string countryCode, string companyId, string syncDate)
{
var x = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.CrmRpcSyncExt}/{syncDate}");
var x = await _client.GetAsync($"{_api.OfficeCustomers}/{countryCode}/{companyId}/{_api.SyncRpcInvoiceExt}/{syncDate}");
if (!x.IsSuccessStatusCode)
return string.Empty;
var content = await x.Content.ReadAsStringAsync();

View file

@ -182,7 +182,7 @@ public partial class AdvisorCreateActivityPage : IDisposable
// product inventory has not been updated
// send rpc call to sync ERP to CRM
Toast.ShowInfo("Vent mens data synkroniseres ...", "ERP til CRM ...");
var ts = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, _company.HistorySync);
var ts = await HistoryRepo.InvoiceErpToCrmRpc(CompanyId, _company.HistorySync);
while (string.IsNullOrWhiteSpace(ts))
await Task.Delay(500);
// save pDate

View file

@ -139,7 +139,7 @@ public partial class AdvisorCustomerViewPage : IDisposable
await FetchContacts(CompanyId);
var ts = await HistoryRepo.ErpInvoiceToCrmRpc(CompanyId, Company.HistorySync);
var ts = await HistoryRepo.InvoiceErpToCrmRpc(CompanyId, Company.HistorySync);
// remove loading image
Working = false;

View file

@ -70,7 +70,7 @@ public partial class CountryCreateNewOrderPage : IDisposable
var today = $"{DateTime.Now:yyyy-MM-dd}";
var ts = _company.HistorySync;
if (ts != today)
ts = await InventoryRepo.ErpInvoiceToCrmRpc(CountryCode, CompanyId, ts);
ts = await InventoryRepo.InvoiceErpToCrmRpc(CountryCode, CompanyId, ts);
while (ts != today)
await Task.Delay(500);
// raise flag if report is closed

View file

@ -7,16 +7,16 @@
"image": "grumpy-coder.png"
},
"apiConfig": {
"baseUrl": "https://zeta.innotec.dk",
"baseUrl": "https://eta.innotec.dk",
"catalog": "api/v2/catalog",
"crmCustomers": "api/v2/crm/companies",
"crmInventoryExt": "history/inventory",
"crmProductExt": "history/products",
"crmReports": "api/v2/crm/advisors/reports",
"crmActivities": "api/v2/crm/advisors/activities",
"crmRpcSyncExt": "invoices/rpc",
"crmTasks": "api/v2/crm/advisors/tasks",
"crmWorkplaceExt": "workplaces",
"officeBase": "api/v2/office",
"officeAdvisors": "api/v2/office/users/advisors",
"officeCustomers": "api/v2/office/customers",
"officeReports": "api/v2/office/reports",
@ -29,6 +29,8 @@
"serviceVatEu": "api/v2/services/vies",
"servicesVatNo": "api/v2/services/brReg",
"servicesAuth": "token",
"syncRpc": "api/v2/rpc",
"syncRpcInvoiceExt": "invoices/rpc",
"userInfo": "api/auth/userinfo",
"warehouse": "api/v2/warehouse/packages"
},

View file

@ -12,6 +12,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
//
namespace Wonky.Entity.Configuration;
public class ApiConfig
@ -56,16 +57,16 @@ public class ApiConfig
/// </summary>
public string CrmProductExt { get; set; } = "";
/// <summary>
/// Application uri for updating customer product sale request
/// </summary>
public string CrmRpcSyncExt { get; set; } = "";
/// <summary>
/// Application uri for getting workplace(s)
/// </summary>
public string CrmWorkplaceExt { get; set; } = "";
/// <summary>
/// Office base url
/// </summary>
public string OfficeBase { get; set; } = "";
/// <summary>
/// Application uri for administration of sales representatives
/// </summary>
@ -126,6 +127,16 @@ public class ApiConfig
/// </summary>
public string ServicesVatEu { get; set; } = "";
/// <summary>
/// Base sync url
/// </summary>
public string SyncRpc { get; set; } = "";
/// <summary>
/// Application uri for updating customer product sale request
/// </summary>
public string SyncRpcInvoiceExt { get; set; } = "";
/// <summary>
/// Application uri for user information request
/// </summary>
@ -135,5 +146,4 @@ public class ApiConfig
/// Uri for warehouse requests
/// </summary>
public string Warehouse { get; set; } = "";
}