This commit is contained in:
2022-06-19 23:34:48 +00:00
parent 104cddc35d
commit 4d524efb4b
12 changed files with 4266 additions and 28 deletions

View File

@@ -1,14 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net.Http.Headers;
namespace AyaNovaQBI
{
internal class util
{
public const string TEST_ROUTE = "notify/hello";
public const string API_BASE_ROUTE = "api/v8/";
private const int MAX_TRIES = 3;//max times to retry an api call before giving up
private const int API_RETRY_DELAY = 3000;//pause in ms before retrying api call
public static int HTTPCLIENT_TIMEOUT_SECONDS = 100;//changed by the setting in ops anyway, just a in-case sensible default here
public static HttpClient client = null;
internal static string SERVER_URL { get; set; } = Properties.Settings.Default.serverurl;
public static List<InvoiceableItem> GetInvoiceableItems()
{
var random = new Random();
@@ -18,7 +28,7 @@ namespace AyaNovaQBI
return l.OrderBy(x => x.Customer)
.ThenBy(x => x.ServiceNumber)
.ThenBy(x=>x.ServiceDate)
.ThenBy(x => x.ServiceDate)
.ToList();
}
@@ -27,11 +37,13 @@ namespace AyaNovaQBI
public static bool InitializeQBI()
{
//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
//This is pre-pfc block of stuff that doesn't map well from v7 qbi plugin to here so replicate it in spirit here but not much is copyable just the concepts
//LOGIN to v8 first
//Fetch AyaNova license
//Check if licensed
//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 (
//PFC - Util.QBValidate stuff:
@@ -45,10 +57,13 @@ namespace AyaNovaQBI
//PFC - Validate settings, create if necessary (Util.ValidateSettings()) and save
//PFC - verify integration mapped objects still exist at each end (Util.PreFlightCheck() line 199)
//DONE
return true;
}
}
}