diff --git a/AyaNovaQBI/Timestamp.cs b/AyaNovaQBI/Timestamp.cs index 0b839af..553e9d9 100644 --- a/AyaNovaQBI/Timestamp.cs +++ b/AyaNovaQBI/Timestamp.cs @@ -22,7 +22,7 @@ namespace AyaNovaQBI /// /// Do not modify the definition of BuildAt as your changes will be discarded. /// - public static DateTime BuildAt { get { return new DateTime(637914972292295086); } } //--** + public static DateTime BuildAt { get { return new DateTime(637914996753521669); } } //--** /// /// The program that time stamped it. /// diff --git a/AyaNovaQBI/util.cs b/AyaNovaQBI/util.cs index edd6662..5dc992c 100644 --- a/AyaNovaQBI/util.cs +++ b/AyaNovaQBI/util.cs @@ -474,6 +474,14 @@ namespace AyaNovaQBI if (d.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) return false; + //CHECK ROLE + //must have Accounting full role to use QBI + if (!AyaNovaUserRoles.HasFlag(AuthorizationRoles.Accounting)) + { + initErrors.AppendLine($"User must have the \"Accounting\" Role to use QBI\r\n"); + return false; + } + //Get license var r = await GetAsync("license"); ALicense = r.ObjectResponse["data"]["license"].ToObject(); @@ -493,7 +501,7 @@ namespace AyaNovaQBI } - //check if build date is within maintenance and updates expiry date + //BUILD DATE VERSION ALLOWED? if(ALicense.maintenanceExpiration < Timestamp.BuildAt) { initErrors.AppendLine("NOT LICENSED!\r\n\r\nThis QBI plugin was built " + @@ -504,8 +512,6 @@ namespace AyaNovaQBI return false; } - // copy timestamp.cs and the createtimestamp.exe utility from v7 qbi and create build event to run it here and do same thing - //check that AyaNova version matches required minimum for this QBI ( //PFC - Util.QBValidate stuff: //Validate QB connection can be made and open connection and start session with QB (see Util.QBValidate in v7 @@ -515,6 +521,9 @@ namespace AyaNovaQBI //PFC - PopulateQBListCache() //PFC - PopulateAyaListCache() //PFC - integration object check (fetch or create if not present) (Util.integrationObjectCheck()) + if (!await IntegrationCheck(initErrors)) + return false; + //NOTE: probably can make a class for this and use newtonsoft to convert dynamic returned from api call to class object? //PFC - Validate settings, create if necessary (Util.ValidateSettings()) and save //PFC - verify integration mapped objects still exist at each end (Util.PreFlightCheck() line 199) @@ -526,8 +535,17 @@ namespace AyaNovaQBI } - #endregion + + public static async Task IntegrationCheck(StringBuilder initErrors) + { + //Check for integration object at server, if not there then create one if have sufficient rights + //check if inactive + await Task.CompletedTask; + return true; + + } + #endregion - } + } }