This commit is contained in:
@@ -22,7 +22,7 @@ namespace AyaNovaQBI
|
||||
/// <remarks>
|
||||
/// Do not modify the definition of BuildAt as your changes will be discarded.
|
||||
/// </remarks>
|
||||
public static DateTime BuildAt { get { return new DateTime(637914972292295086); } } //--**
|
||||
public static DateTime BuildAt { get { return new DateTime(637914996753521669); } } //--**
|
||||
/// <summary>
|
||||
/// The program that time stamped it.
|
||||
/// </summary>
|
||||
|
||||
@@ -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<AyaNovaLicense>();
|
||||
@@ -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<bool> 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
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user