case 4522

This commit is contained in:
2023-05-04 00:49:19 +00:00
parent 7efdf58bcf
commit 2116534503
4 changed files with 41 additions and 5 deletions

2
.vscode/launch.json vendored
View File

@@ -63,7 +63,7 @@
"AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=300;",
"AYANOVA_DATA_PATH": "c:\\temp\\ravendata",
"AYANOVA_USE_URLS": "http://*:7575;",
"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
//"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
//"AYANOVA_REMOVE_LICENSE_FROM_DB":"true",
//"AYANOVA_REPORT_RENDERING_TIMEOUT":"1",
//"AYANOVA_REPORT_RENDER_API_URL_OVERRIDE": "http://localhost:7575",

View File

@@ -142,7 +142,8 @@ namespace AyaNova.Api.Controllers
//used to drive UI in case of out of date release message to be shown to staff users non subscription only
ShowUpdateAvailable = (Util.AyaNovaVersion.VersionString != AyaNova.Util.ServerGlobalOpsSettingsCache.LATEST_VERSION && !IsSubscriptionBuild),
LatestVersion = AyaNova.Util.ServerGlobalOpsSettingsCache.LATEST_VERSION,
ChangeLogUrl = AyaNova.Util.ServerGlobalOpsSettingsCache.CHANGE_LOG_URL
ChangeLogUrl = AyaNova.Util.ServerGlobalOpsSettingsCache.CHANGE_LOG_URL,
LicenseExpirationDays = AyaNova.Core.License.ActiveKey.LicenseExpirationDays
// ,
// TestTSDaysWMS=new TimeSpan(22,10,15,22,33),

View File

@@ -20,7 +20,7 @@ namespace AyaNova.Util
/////////// CHANGE THIS ON NEW SCHEMA UPDATE ////////////////////
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 17;
private const int DESIRED_SCHEMA_LEVEL = 18;
internal const long EXPECTED_COLUMN_COUNT = 1389;
internal const long EXPECTED_INDEX_COUNT = 160;
@@ -1825,6 +1825,31 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist
}
//////////////////////////////////////////////////
//
// case 4522
//
if (currentSchema < 18)
{
LogUpdateMessage(log);
//english translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Days before license expires' FROM atranslation t where t.baselanguage = 'en'");
//spanish translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Días antes de que caduque la licencia' FROM atranslation t where t.baselanguage = 'es'");
//french translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Jours avant l''expiration de la licence' FROM atranslation t where t.baselanguage = 'fr'");
//german translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'LicenseExpirationDays', 'Tage vor Ablauf der Lizenz' FROM atranslation t where t.baselanguage = 'de'");
await SetSchemaLevelAsync(++currentSchema);
}
//#########################################

View File

@@ -271,6 +271,16 @@ namespace AyaNova.Core
}
public int LicenseExpirationDays
{
get
{
if (WillExpire)
return (int)(LicenseExpiration.ToUniversalTime() - DateTime.UtcNow).TotalDays;
else
return -1;//not expiring
}
}
public string LicenseFormat { get; set; }
public string Id { get; set; }