-
-
-
-
-
-
-
+ *@
+ }
-
-
-
-
-
}
@if (Working)
diff --git a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs
index 99a1a30a..3c9fb10e 100644
--- a/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs
+++ b/Wonky.Client/Pages/AdvisorCustomerViewEditPage.razor.cs
@@ -71,6 +71,7 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
private ContactModal ContactPopup { get; set; } = new();
private UserManagerEditView UserInfo { get; set; } = new();
private string ToggleButtonText { get; set; } = "";
+ private bool Kanvas { get; set; }
protected override async Task OnInitializedAsync()
{
@@ -96,60 +97,67 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
Company = await CustomerRepo.GetCompanyById(CompanyId);
- Logger.LogDebug("company => {}", JsonSerializer.Serialize(Company));
- // toggle view button text
- ToggleButtonText = Company.IsHidden == 0 ? "Udelad kunde i oversigt" : "Brug Normal Visning";
- CurrentVat = Company.VatNumber;
- Company.CountryCode = UserInfo.CountryCode.ToLower();
+ if (Company.Account.StartsWith("KANVAS"))
+ Kanvas = true;
+
// internal flag
EnableActivity = Company.ValidVat;
// override if canvas which has account property as empty string or "NY"
- if (Company.Account == "NY" || string.IsNullOrWhiteSpace(Company.Account))
+ if (Company.Account == "NY" || Company.Account.StartsWith("KANVAS") || string.IsNullOrWhiteSpace(Company.Account))
EnableActivity = 1;
- // visit interval init
- if (Company.Interval == 0)
- Company.Interval = 8;
- // visit date init
- LastVisit = DateTime.Parse(Company.LastVisit);
- NextVisit = DateTime.Parse(Company.NextVisit);
- // if no previous visit is registered - force last visit date to 2020
- if (LastVisit.Year < 2020)
- LastVisit = DateTime.Parse("2020-01-01");
- // set next visit according to last visit and interval
- if (!Company.ValidDateSpan())
- NextVisit = LastVisit.AddDays(Company.Interval * 7);
- // display urgency of next visit
- VisitState = Utils.GetVisitState($"{NextVisit:yyyy-MM-dd}");
// action link passed to activity button component
ActionLink = $"/advisor/customers/{CompanyId}/activities/new"; // used when drawing visit button
- // handle company out of business case
- if (Company.HasFolded == 1)
+ // only execute if the company a 'real' customer
+ if (!Kanvas)
{
- // this is only used if user has selected to show closed companies
- HasFolded = true;
- VatState = "the-dead";
- VisitState = "the-dead";
+ Logger.LogDebug("company => {}", JsonSerializer.Serialize(Company));
+ // toggle view button text
+ ToggleButtonText = Company.IsHidden == 0 ? "Udelad kunde i oversigt" : "Brug Normal Visning";
+ CurrentVat = Company.VatNumber;
+ Company.CountryCode = UserInfo.CountryCode.ToLower();
+ // visit interval init
+ if (Company.Interval == 0)
+ Company.Interval = 8;
+ // visit date init
+ LastVisit = DateTime.Parse(Company.LastVisit);
+ NextVisit = DateTime.Parse(Company.NextVisit);
+ // if no previous visit is registered - force last visit date to 2020
+ if (LastVisit.Year < 2020)
+ LastVisit = DateTime.Parse("2020-01-01");
+ // set next visit according to last visit and interval
+ if (!Company.ValidDateSpan())
+ NextVisit = LastVisit.AddDays(Company.Interval * 7);
+ // display urgency of next visit
+ VisitState = Utils.GetVisitState($"{NextVisit:yyyy-MM-dd}");
+ // handle company out of business case
+ if (Company.HasFolded == 1)
+ {
+ // this is only used if user has selected to show closed companies
+ HasFolded = true;
+ VatState = "the-dead";
+ VisitState = "the-dead";
+ }
+ else
+ {
+ // valid vat enum
+ Company.ValidVat = VatUtils.ValidateFormat(Company.CountryCode, Company.VatNumber) ? 1 : 0;
+ // valid vat flag
+ ValidVat = Company.ValidVat == 1; // true/false flag set if company has a valid vatNumber
+ // vat state css class
+ VatState = Company.ValidVat == 1 ? "the-good" : "no-vat"; // assign css class
+ }
+
+ // create search address from address
+ if (CountryIsDk)
+ CompanyVatAddress = PrepareVatAddress(Company);
+
+ await FetchContacts(CompanyId);
+ await Task.Delay(100);
+ await RequestErpUpdate();
}
- else
- {
- // valid vat enum
- Company.ValidVat = VatUtils.ValidateFormat(Company.CountryCode, Company.VatNumber) ? 1 : 0;
- // valid vat flag
- ValidVat = Company.ValidVat == 1; // true/false flag set if company has a valid vatNumber
- // vat state css class
- VatState = Company.ValidVat == 1 ? "the-good" : "no-vat"; // assign css class
- }
-
- // create search address from address
- if (CountryIsDk)
- CompanyVatAddress = PrepareVatAddress(Company);
-
- await FetchContacts(CompanyId);
-
+
// remove loading image
Working = false;
- await Task.Delay(100);
- await RequestErpUpdate();
}
private void ToggleErpEdit()
@@ -414,6 +422,7 @@ public partial class AdvisorCustomerViewEditPage : IDisposable
///
private void HandleFieldChanged(object? sender, FieldChangedEventArgs? e)
{
+
NextVisit = LastVisit.AddDays(Company.Interval * 7);
// avoid nesting if by assuming ValidVat is false
ValidVat = false;
diff --git a/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs b/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs
index c4c9f5b1..4b3207c7 100644
--- a/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs
+++ b/Wonky.Client/Pages/OfficeOrderCreatePage.razor.cs
@@ -153,7 +153,7 @@ public partial class OfficeOrderCreatePage : IDisposable
// setting up activity properties
Activity.ActivityStatusEnum = "noSale";
- Activity.VisitTypeEnum = "recall";
+ Activity.ActivityVisitEnum = "recall";
Activity.ActivityTypeEnum = "phone";
Activity.ActivityStatusEnum = "order";
Activity.OurRef = $"T:{UserInfo.FirstName}";
diff --git a/Wonky.Client/wwwroot/appsettings.json b/Wonky.Client/wwwroot/appsettings.json
index 8642f165..b4cdc992 100644
--- a/Wonky.Client/wwwroot/appsettings.json
+++ b/Wonky.Client/wwwroot/appsettings.json
@@ -1,15 +1,15 @@
{
"appInfo": {
"name": "Wonky Online",
- "version": "0.131.0",
+ "version": "0.132.1",
"rc": true,
"sandBox": false,
"image": "grumpy-coder.png"
},
"Logging": {
"LogLevel": {
- "Default": "Debug",
- "System": "Debug",
+ "Default": "Information",
+ "System": "Information",
"Microsoft": "Information"
},
"Debug": {
@@ -19,7 +19,7 @@
}
},
"apiConfig": {
- "baseUrl": "https://dev.innotec.dk",
+ "baseUrl": "https://zeta.innotec.dk",
"catalog": "api/v2/catalog/country",
"crmCustomers": "api/v2/crm/companies",
"crmInventoryExt": "history/inventory",
diff --git a/Wonky.Entity/DTO/ActivityDto.cs b/Wonky.Entity/DTO/ActivityDto.cs
index 3c938a19..f8a18ec6 100644
--- a/Wonky.Entity/DTO/ActivityDto.cs
+++ b/Wonky.Entity/DTO/ActivityDto.cs
@@ -24,164 +24,200 @@ public class ActivityDto
/// Activity entity id
///
public string SalesHeadId { get; set; } = "";
-
+
///
/// Sales representative identification
///
- [Required] public string SalesRep { get; set; } = "";
+ [Required]
+ public string SalesRep { get; set; } = "";
+
///
/// Sales representative entity Id
///
- [Required] public string SalesRepId { get; set; } = "";
+ [Required]
+ public string SalesRepId { get; set; } = "";
+
///
/// Company countryCode (ensure correct code when office create ordre)
///
- [Required] public string CountryCode { get; set; } = "";
+ [Required]
+ public string CountryCode { get; set; } = "";
+
///
/// Company entity Id
///
- [Required] public string CompanyId { get; set; } = "";
+ [Required]
+ public string CompanyId { get; set; } = "";
+
///
/// Business Central entity Id
///
public string BcId { get; set; } = "";
+
///
/// Customer account
///
public string Account { get; set; } = "";
+
///
/// VAT number
///
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string VatNumber { get; set; } = "";
+
///
/// Customer name
///
[Required(ErrorMessage = "Navn skal udfyldes")]
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Name { get; set; } = "";
+
///
/// Customer address city name
///
[Required(ErrorMessage = "Byanvn skal udfyldes")]
- [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
- public string City { get; set; }= "";
+ [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
+ public string City { get; set; } = "";
+
///
/// Customer address postal code
///
[Required(ErrorMessage = "Postnr. skal udfyldes")]
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ZipCode { get; set; } = "";
+
///
/// Customer address line 1
///
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Address1 { get; set; } = "";
+
///
/// Customer address line 2
///
- [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
+ [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string Address2 { get; set; } = "";
+
///
/// Customer office phone
///
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Phone { get; set; } = "";
+
///
/// Customer mobile phone
///
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string Mobile { get; set; } = "";
+
///
/// Customer office email
///
- [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")]
+ [MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn")]
public string Email { get; set; } = "";
+
///
/// Customer attention description
///
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string Attention { get; set; } = "";
- // Form entries
- ///
- /// Activity type enum as string
- ///
- [Required(ErrorMessage = "Vælg aktivitetstype")]
- public string ActivityTypeEnum { get; set; } = "";
+
///
/// Flag express order
///
public bool Express { get; set; }
+
+ // Form entries
///
/// Activity status enum as string
///
- [Required(ErrorMessage = "Vælg status for besøg ")]
+ [Required(ErrorMessage = "Vælg status for besøg ")]
public string ActivityStatusEnum { get; set; } = "";
+
+ ///
+ /// Activity type enum as string
+ ///
+ [Required(ErrorMessage = "Vælg aktivitetstype")]
+ public string ActivityTypeEnum { get; set; } = "";
+
///
/// Visit type enum as string
///
- public string VisitTypeEnum { get; set; } = "recall";
+ public string ActivityVisitEnum { get; set; } = "recall";
+
///
/// Activity date
///
- [Required(ErrorMessage = "Dato skal angives")]
+ [Required(ErrorMessage = "Dato skal angives")]
public string ActivityDate { get; set; } = "";
+
///
/// Product demonstration
///
- [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
+ [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string Demo { get; set; } = "";
+
///
/// Our reference - system generated
///
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string OurRef { get; set; } = "";
+
///
/// Customer reference number
///
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string ReferenceNumber { get; set; } = "";
+
///
/// Customer reference description
///
- [MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")]
+ [MaxLength(35, ErrorMessage = "Du kan højst bruge 35 tegn")]
public string YourRef { get; set; } = "";
+
///
/// Processing note to office
///
- [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
+ [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
public string OrderMessage { get; set; } = "";
+
///
/// CRM note for future reference
///
- [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
+ [MaxLength(255, ErrorMessage = "Du kan højst bruge 255 tegn")]
public string CrmNote { get; set; } = "";
+
// Delivery address form entries
///
/// Customer delivery name
///
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string DlvName { get; set; } = "";
+
///
/// Customer delivery address line 1
///
- [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
+ [MaxLength(100, ErrorMessage = "Du kan højst bruge 100 tegn")]
public string DlvAddress1 { get; set; } = "";
+
///
/// Customer delivery address line 2
///
- [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
+ [MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn")]
public string DlvAddress2 { get; set; } = "";
+
///
/// Customer delivery postal code
///
- [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
+ [MaxLength(20, ErrorMessage = "Du kan højst bruge 20 tegn")]
public string DlvZipCode { get; set; } = "";
+
///
/// Customer delivery city name
///
- [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
+ [MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
public string DlvCity { get; set; } = "";
+
// Lines
///
/// Order lines