From 39810ebb9e07bdca0cd209551bbc064d48b9bd5f Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 15 Aug 2022 23:28:08 +0000 Subject: [PATCH] removed license check for QBI since it's now included business decision and also added trial version excemption from expired maintenance plan check (and reworded error to say maaintenance plan instead of the deperecated supporta nd updates subscription) --- AyaNovaQBI/Properties/AssemblyInfo.cs | 4 ++-- AyaNovaQBI/util.cs | 23 +++++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/AyaNovaQBI/Properties/AssemblyInfo.cs b/AyaNovaQBI/Properties/AssemblyInfo.cs index a1b144d..27befd9 100644 --- a/AyaNovaQBI/Properties/AssemblyInfo.cs +++ b/AyaNovaQBI/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.0.0.0")] -[assembly: AssemblyFileVersion("8.0.0.0")] +[assembly: AssemblyVersion("8.0.1.0")] +[assembly: AssemblyFileVersion("8.0.1.0")] diff --git a/AyaNovaQBI/util.cs b/AyaNovaQBI/util.cs index 305d595..d180729 100644 --- a/AyaNovaQBI/util.cs +++ b/AyaNovaQBI/util.cs @@ -22,6 +22,8 @@ namespace AyaNovaQBI get { return new Guid("{82CD3609-4601-4C1A-9633-7836F92D2D06}"); } } + private const string TRIAL_FEATURE_NAME = "TrialMode"; + private const string ACCOUNTING_INTEGRATION_WORK_ORDER_STATUS_NAME = "z_Accounting integration edit"; public const string TEST_ROUTE = "notify/hello"; @@ -548,17 +550,22 @@ namespace AyaNovaQBI return false; } - //QBI LICENSED? - if (ALicense.features.FirstOrDefault(z => z.Feature == "QBI") == null) - { - initErrors.AppendLine("QBI not licensed"); - return false; - } + //2022-08-15DECISON MADE TO INCLUDE ALL ACCOUNTING ADD-ON's with AyaNova + //so no check required but keeping license code otherwise just in case and for maintenance build date check + ////QBI LICENSED? + //if (ALicense.features.FirstOrDefault(z => z.Feature == "QBI") == null) + //{ + // initErrors.AppendLine("QBI not licensed"); + // return false; + //} + + //Is a trial license? we don't check build date if a trial + bool isTrial = ALicense.features.Exists(z => z.Feature == TRIAL_FEATURE_NAME); //BUILD DATE VERSION ALLOWED? - if (ALicense.maintenanceExpiration < Timestamp.BuildAt) + if (!isTrial && ALicense.maintenanceExpiration < Timestamp.BuildAt) { - initErrors.AppendLine($"NOT LICENSED!\r\n\r\nThis QBI plugin was built {Timestamp.BuildAt.ToString("g")}\r\nbut the licensed support and updates subscription has ended on {ALicense.maintenanceExpiration.ToLocalTime().ToString("g")}\r\n\r\nDowngrade back to your previous licensed QBI version or\r\npurchase a support and updates subscription to continue using this version of QBI."); + initErrors.AppendLine($"NOT LICENSED!\r\n\r\nThis QBI build was released {Timestamp.BuildAt.ToString("g")}\r\nbut the licensed Maintenance plan has ended on {ALicense.maintenanceExpiration.ToLocalTime().ToString("g")}\r\n\r\nDowngrade back to your previous licensed QBI version or\r\npurchase an AyaNova Maintenance plan subscription to continue using this version of QBI."); return false; }