This commit is contained in:
@@ -112,13 +112,13 @@ namespace AyaNova.Api.Controllers
|
|||||||
var ret = new
|
var ret = new
|
||||||
{
|
{
|
||||||
//Actual global settings:
|
//Actual global settings:
|
||||||
SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.SearchCaseSensitiveOnly,
|
SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly,
|
||||||
UseInventory = AyaNova.Util.ServerGlobalBizSettings.UseInventory,
|
UseInventory = AyaNova.Util.ServerGlobalBizSettings.Cache.UseInventory,
|
||||||
DefaultTaxPartSaleId = AyaNova.Util.ServerGlobalBizSettings.TaxPartSaleId,
|
DefaultTaxPartSaleId = AyaNova.Util.ServerGlobalBizSettings.Cache.TaxPartSaleId,
|
||||||
DefaultTaxPartPurchaseId = AyaNova.Util.ServerGlobalBizSettings.TaxPartPurchaseId,
|
DefaultTaxPartPurchaseId = AyaNova.Util.ServerGlobalBizSettings.Cache.TaxPartPurchaseId,
|
||||||
DefaultTaxRateSaleId = AyaNova.Util.ServerGlobalBizSettings.TaxRateSaleId,
|
DefaultTaxRateSaleId = AyaNova.Util.ServerGlobalBizSettings.Cache.TaxRateSaleId,
|
||||||
WorkOrderTravelDefaultMinutes = AyaNova.Util.ServerGlobalBizSettings.WorkOrderTravelDefaultMinutes,
|
WorkOrderTravelDefaultMinutes = AyaNova.Util.ServerGlobalBizSettings.Cache.WorkOrderTravelDefaultMinutes,
|
||||||
WorkLaborScheduleDefaultMinutes = AyaNova.Util.ServerGlobalBizSettings.WorkLaborScheduleDefaultMinutes,
|
WorkLaborScheduleDefaultMinutes = AyaNova.Util.ServerGlobalBizSettings.Cache.WorkLaborScheduleDefaultMinutes,
|
||||||
|
|
||||||
//used to drive UI in case of unlicensed or attention required
|
//used to drive UI in case of unlicensed or attention required
|
||||||
LicenseStatus = AyaNova.Core.License.ActiveKey.Status,
|
LicenseStatus = AyaNova.Core.License.ActiveKey.Status,
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ namespace AyaNova.PickList
|
|||||||
//all the other templated fields
|
//all the other templated fields
|
||||||
if (HasAutoCompleteQuery && !HasTagSpecificQuery)
|
if (HasAutoCompleteQuery && !HasTagSpecificQuery)
|
||||||
{
|
{
|
||||||
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
|
if (ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly)
|
||||||
sWhere = $"(array_to_string({valueColumnName},',') like '%{autoCompleteQuery}%')";
|
sWhere = $"(array_to_string({valueColumnName},',') like '%{autoCompleteQuery}%')";
|
||||||
else
|
else
|
||||||
sWhere = $"(lower(array_to_string({valueColumnName},',')) like lower('%{autoCompleteQuery}%'))";
|
sWhere = $"(lower(array_to_string({valueColumnName},',')) like lower('%{autoCompleteQuery}%'))";
|
||||||
@@ -171,7 +171,7 @@ namespace AyaNova.PickList
|
|||||||
lSelect.Add(valueColumnName);
|
lSelect.Add(valueColumnName);
|
||||||
lOrderBy.Add(valueColumnName);
|
lOrderBy.Add(valueColumnName);
|
||||||
if (HasAutoCompleteQuery)
|
if (HasAutoCompleteQuery)
|
||||||
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
|
if (ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly)
|
||||||
sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')";
|
sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')";
|
||||||
else
|
else
|
||||||
sWhere = $"(lower({valueColumnName}) like lower('%{autoCompleteQuery}%'))";
|
sWhere = $"(lower({valueColumnName}) like lower('%{autoCompleteQuery}%'))";
|
||||||
@@ -193,7 +193,7 @@ namespace AyaNova.PickList
|
|||||||
//Where fragment is different for non text fields: it needs to be cast to text to like query on it
|
//Where fragment is different for non text fields: it needs to be cast to text to like query on it
|
||||||
//(cast (awidget.serial as text) like '%some%')
|
//(cast (awidget.serial as text) like '%some%')
|
||||||
if (HasAutoCompleteQuery)
|
if (HasAutoCompleteQuery)
|
||||||
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
|
if (ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly)
|
||||||
sWhere = $"(cast ({valueColumnName} as text) like '%{autoCompleteQuery}%')";
|
sWhere = $"(cast ({valueColumnName} as text) like '%{autoCompleteQuery}%')";
|
||||||
else
|
else
|
||||||
sWhere = $"(lower(cast ({valueColumnName} as text)) like lower('%{autoCompleteQuery}%'))";
|
sWhere = $"(lower(cast ({valueColumnName} as text)) like lower('%{autoCompleteQuery}%'))";
|
||||||
|
|||||||
@@ -328,6 +328,9 @@ namespace AyaNova.Biz
|
|||||||
//the translation key is to indicate what the linked object is that is causing the error
|
//the translation key is to indicate what the linked object is that is causing the error
|
||||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("NotifySubscription"));
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("NotifySubscription"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (await ct.GlobalBizSettings.AnyAsync(z => z.CustomerDefaultWorkOrderReportId == inObj.Id) == true)
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("GlobalSettings"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -383,8 +386,9 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
//If we get here via the /viewreport url in the client then there is no object type set so we need to set it here from the report
|
//If we get here via the /viewreport url in the client then there is no object type set so we need to set it here from the report
|
||||||
if(reportRequest.AType==AyaType.NoType){
|
if (reportRequest.AType == AyaType.NoType)
|
||||||
reportRequest.AType=report.AType;
|
{
|
||||||
|
reportRequest.AType = report.AType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -410,9 +414,10 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
|
|
||||||
//Get data
|
//Get data
|
||||||
var ReportData = await GetReportData(reportRequest);
|
var ReportData = await GetReportData(reportRequest);
|
||||||
//if GetReportData errored then will return null so need to return that as well here
|
//if GetReportData errored then will return null so need to return that as well here
|
||||||
if(ReportData==null){
|
if (ReportData == null)
|
||||||
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,9 +458,9 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//WINDOWS ONLY
|
//WINDOWS ONLY
|
||||||
log.LogDebug($"Windows: Calling browserFetcher download async now:");
|
log.LogDebug($"Windows: Calling browserFetcher download async now:");
|
||||||
|
|
||||||
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
|
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.Text.StringBuilder PageLog = new System.Text.StringBuilder();
|
System.Text.StringBuilder PageLog = new System.Text.StringBuilder();
|
||||||
|
|||||||
@@ -230,9 +230,9 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
bool isNew = currentObj == null;
|
bool isNew = currentObj == null;
|
||||||
bool isGlobalDefault = (!isNew
|
bool isGlobalDefault = (!isNew
|
||||||
&& ServerGlobalBizSettings.TaxPartPurchaseId == proposedObj.Id
|
&& ServerGlobalBizSettings.Cache.TaxPartPurchaseId == proposedObj.Id
|
||||||
|| ServerGlobalBizSettings.TaxPartSaleId == proposedObj.Id
|
|| ServerGlobalBizSettings.Cache.TaxPartSaleId == proposedObj.Id
|
||||||
|| ServerGlobalBizSettings.TaxRateSaleId == proposedObj.Id);
|
|| ServerGlobalBizSettings.Cache.TaxRateSaleId == proposedObj.Id);
|
||||||
|
|
||||||
if (!isNew && (proposedObj.TaxAPct != currentObj.TaxAPct
|
if (!isNew && (proposedObj.TaxAPct != currentObj.TaxAPct
|
||||||
|| proposedObj.TaxBPct != currentObj.TaxBPct
|
|| proposedObj.TaxBPct != currentObj.TaxBPct
|
||||||
@@ -302,9 +302,9 @@ namespace AyaNova.Biz
|
|||||||
//Referential integrity
|
//Referential integrity
|
||||||
//FOREIGN KEY CHECKS
|
//FOREIGN KEY CHECKS
|
||||||
|
|
||||||
if (ServerGlobalBizSettings.TaxPartPurchaseId == inObj.Id
|
if (ServerGlobalBizSettings.Cache.TaxPartPurchaseId == inObj.Id
|
||||||
|| ServerGlobalBizSettings.TaxPartSaleId == inObj.Id
|
|| ServerGlobalBizSettings.Cache.TaxPartSaleId == inObj.Id
|
||||||
|| ServerGlobalBizSettings.TaxRateSaleId == inObj.Id)
|
|| ServerGlobalBizSettings.Cache.TaxRateSaleId == inObj.Id)
|
||||||
AddError(ApiErrorCode.INVALID_OPERATION, "generalerror", await Translate("TaxCodeDefault"));
|
AddError(ApiErrorCode.INVALID_OPERATION, "generalerror", await Translate("TaxCodeDefault"));
|
||||||
|
|
||||||
if (await ct.PurchaseOrderItem.AnyAsync(x => x.PurchaseTaxCodeId == inObj.Id))
|
if (await ct.PurchaseOrderItem.AnyAsync(x => x.PurchaseTaxCodeId == inObj.Id))
|
||||||
|
|||||||
@@ -457,8 +457,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
//not set yet, maybe the global default is the way...
|
//not set yet, maybe the global default is the way...
|
||||||
if (AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge != TimeSpan.Zero)
|
if (AyaNova.Util.ServerGlobalBizSettings.Cache.WorkOrderCompleteByAge != TimeSpan.Zero)
|
||||||
newObj.CompleteByDate = DateTime.UtcNow.Add(AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge);
|
newObj.CompleteByDate = DateTime.UtcNow.Add(AyaNova.Util.ServerGlobalBizSettings.Cache.WorkOrderCompleteByAge);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3895,7 +3895,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (AyaNova.Util.ServerGlobalBizSettings.UseInventory)
|
if (AyaNova.Util.ServerGlobalBizSettings.Cache.UseInventory)
|
||||||
{
|
{
|
||||||
PartInventoryBiz pib = new PartInventoryBiz(ct, UserId, UserTranslationId, CurrentUserRoles);
|
PartInventoryBiz pib = new PartInventoryBiz(ct, UserId, UserTranslationId, CurrentUserRoles);
|
||||||
|
|
||||||
|
|||||||
@@ -22,17 +22,16 @@ namespace AyaNova.Util
|
|||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
private const int DESIRED_SCHEMA_LEVEL = 1;
|
private const int DESIRED_SCHEMA_LEVEL = 1;
|
||||||
|
|
||||||
internal const long EXPECTED_COLUMN_COUNT = 928;
|
internal const long EXPECTED_COLUMN_COUNT = 954;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 137;
|
internal const long EXPECTED_INDEX_COUNT = 137;
|
||||||
internal const long EXPECTED_CHECK_CONSTRAINTS = 415;
|
internal const long EXPECTED_CHECK_CONSTRAINTS = 415;
|
||||||
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 116;
|
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 117;
|
||||||
internal const long EXPECTED_VIEWS = 6;
|
internal const long EXPECTED_VIEWS = 6;
|
||||||
internal const long EXPECTED_ROUTINES = 2;
|
internal const long EXPECTED_ROUTINES = 2;
|
||||||
|
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////// (C927:I137:CC415:FC116:V6:R2)
|
///////////////////////////////////////////////////////////////// (C954:I137:CC415:FC117:V6:R2)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using AyaNova.Models;
|
using AyaNova.Models;
|
||||||
|
|
||||||
@@ -13,22 +12,12 @@ namespace AyaNova.Util
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class ServerGlobalBizSettings
|
internal static class ServerGlobalBizSettings
|
||||||
{
|
{
|
||||||
|
internal static GlobalBizSettings Cache {get;set;}
|
||||||
internal static bool SearchCaseSensitiveOnly { get; set; }
|
|
||||||
internal static bool UseInventory { get; set; }
|
|
||||||
internal static long? TaxPartPurchaseId { get; set; }
|
|
||||||
internal static long? TaxPartSaleId { get; set; }
|
|
||||||
internal static long? TaxRateSaleId { get; set; }
|
|
||||||
internal static TimeSpan WorkOrderCompleteByAge { get; set; }
|
|
||||||
internal static int WorkLaborScheduleDefaultMinutes { get; set; }
|
|
||||||
internal static int WorkOrderTravelDefaultMinutes { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populate and / or create the settings
|
/// Populate and / or create the settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static void Initialize(GlobalBizSettings global, AyContext ct = null)
|
internal static void Initialize(GlobalBizSettings global, AyContext ct = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (global == null)
|
if (global == null)
|
||||||
{
|
{
|
||||||
//fetch or create as not provided (meaning this was called from Startup.cs)
|
//fetch or create as not provided (meaning this was called from Startup.cs)
|
||||||
@@ -40,20 +29,7 @@ namespace AyaNova.Util
|
|||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Cache = global;
|
||||||
//We have the object, now copy the static values here
|
|
||||||
SearchCaseSensitiveOnly = global.SearchCaseSensitiveOnly;
|
|
||||||
UseInventory = global.UseInventory;
|
|
||||||
TaxPartPurchaseId = global.TaxPartPurchaseId;
|
|
||||||
TaxPartSaleId = global.TaxPartSaleId;
|
|
||||||
TaxRateSaleId = global.TaxRateSaleId;
|
|
||||||
WorkOrderCompleteByAge = global.WorkOrderCompleteByAge;
|
|
||||||
WorkLaborScheduleDefaultMinutes = global.WorkLaborScheduleDefaultMinutes;
|
|
||||||
WorkOrderTravelDefaultMinutes = global.WorkOrderTravelDefaultMinutes;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
Reference in New Issue
Block a user