This commit is contained in:
2022-06-22 02:31:12 +00:00
parent 0cba94f582
commit 9e51fc18f9
4 changed files with 24 additions and 17 deletions

View File

@@ -171,19 +171,19 @@
//
this.onlineManualToolStripMenuItem.Name = "onlineManualToolStripMenuItem";
this.onlineManualToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.onlineManualToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.onlineManualToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.onlineManualToolStripMenuItem.Text = "&Online manual";
//
// technicalsupportToolStripMenuItem
//
this.technicalsupportToolStripMenuItem.Name = "technicalsupportToolStripMenuItem";
this.technicalsupportToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.technicalsupportToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.technicalsupportToolStripMenuItem.Text = "Technical &support";
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
this.aboutToolStripMenuItem.Text = "&About";
//
// exitToolStripMenuItem

View File

@@ -21,8 +21,11 @@ namespace AyaNovaQBI
{
//Initialize
if(await util.InitializeQBI() == false)
StringBuilder initErrors = new StringBuilder();
if (await util.InitializeQBI(initErrors) == false)
{
if (initErrors.Length>0)
await Task.Run(() => MessageBox.Show($"AyaNova QBI was unable to start:\r\n{initErrors.ToString()}"));
Close();
}
@@ -39,7 +42,8 @@ namespace AyaNovaQBI
if (!isLinked)
{
grid.Rows[e.RowIndex].ErrorText = "Not invoiceable: use \"Invoice\" -> \"Fix problems\" to resolve";
}else
}
else
{
grid.Rows[e.RowIndex].ErrorText = null;
}

View File

@@ -72,11 +72,11 @@ namespace AyaNovaQBI
return;
}
MessageBox.Show($@"TEST - LOGIN SUCCEEDED: \r\
AyaNovaUserName: {util.AyaNovaUserName}\r\n
JWT: {util.JWT}\r\n
AyaNovaUserRoles: {util.AyaNovaUserRoles}\r\n
AyaNovaUserType: {util.AyaNovaUserType}");
// MessageBox.Show($@"TEST - LOGIN SUCCEEDED: \r\
//AyaNovaUserName: {util.AyaNovaUserName}\r\n
//JWT: {util.JWT}\r\n
//AyaNovaUserRoles: {util.AyaNovaUserRoles}\r\n
//AyaNovaUserType: {util.AyaNovaUserType}");
btnLogin.Enabled = btnTest.Enabled = true;

View File

@@ -449,7 +449,7 @@ namespace AyaNovaQBI
}
public static async Task<bool> InitializeQBI()
public static async Task<bool> InitializeQBI(StringBuilder initErrors)
{
//COPY most of this code from qbi v7 becuase it has a lot of edge cases in it and it's complex and thorough, but break it into abstracted bits so can be replicated in other accounting add-on's more easily
@@ -459,11 +459,14 @@ namespace AyaNovaQBI
if (d.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
return false;
//Fetch AyaNova license
var r=await GetAsync("license");
todo: need to be able to check via route if has licensefeature, code is already in license biz object, just need exposed to route for logged in users only under license/has-feature
//Check if licensed
var r = await GetAsync("license/has-feature/XQBI");
if (!r.ObjectResponse["data"].Value<bool>())
{
initErrors.AppendLine("This AyaNova server is not licensed to use QBI");
return false;
}
//check if build date is within licensed date (how did I do that automated build date thing?)
// 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 (