This commit is contained in:
2021-09-10 17:35:26 +00:00
parent caf0f3071d
commit adda80c05b
11 changed files with 32 additions and 43 deletions

View File

@@ -112,7 +112,7 @@ namespace AyaNova.Api.Controllers
var ret = new var ret = new
{ {
//Actual global settings: //Actual global settings:
SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly, FilterCaseSensitive = AyaNova.Util.ServerGlobalBizSettings.Cache.FilterCaseSensitive,
UseInventory = AyaNova.Util.ServerGlobalBizSettings.Cache.UseInventory, UseInventory = AyaNova.Util.ServerGlobalBizSettings.Cache.UseInventory,
DefaultTaxPartSaleId = AyaNova.Util.ServerGlobalBizSettings.Cache.TaxPartSaleId, DefaultTaxPartSaleId = AyaNova.Util.ServerGlobalBizSettings.Cache.TaxPartSaleId,
DefaultTaxPartPurchaseId = AyaNova.Util.ServerGlobalBizSettings.Cache.TaxPartPurchaseId, DefaultTaxPartPurchaseId = AyaNova.Util.ServerGlobalBizSettings.Cache.TaxPartPurchaseId,

View File

@@ -5,6 +5,7 @@ using System.Text;
using System.Linq; using System.Linq;
using AyaNova.Models; using AyaNova.Models;
using AyaNova.Biz; using AyaNova.Biz;
using AyaNova.Util;
namespace AyaNova.DataList namespace AyaNova.DataList
{ {
@@ -238,45 +239,33 @@ namespace AyaNova.DataList
sb.Append(sValue); sb.Append(sValue);
sb.Append("'"); sb.Append("'");
break; break;
/* NOTE: CASE - I decided to NOT do case insensitive for now for datalists like I did for picklists because it's a bit of a different situation
I would need to make big changes to the select builder and this criteria builder so it's TTM at the moment because it's all tested and working
however also the use is a bit different in that it's much more necessary to be hyper accurate here since this drives reporting and potentially a lot
of important business data. Matching two different clients inadvertantly because of a case issue would be a bit of a kerfuffle potentially so I'd rather err on the side of accuracy
and also I'm not certain how the case code will work with other languages so it's a bit more risky here, if a picklist doesn't work I get a support call but if a report is missing data then maybe
the user doesn't realize it and has bad reports.
code from picklist in case I decide to do it later
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')";
else
sWhere = $"(lower({valueColumnName}) like lower('%{autoCompleteQuery}%'))";
*/
//Following 7 operators added 14-June-2006
case DataListFilterComparisonOperator.NotContains: case DataListFilterComparisonOperator.NotContains:
sb.Append("Not Like '%"); if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
sb.Append(sValue); sb.Append($"NOT LIKE '%{sValue}%'");
sb.Append("%'"); else
sb.Append($"NOT LIKE lower('%{sValue}%')");
break; break;
case DataListFilterComparisonOperator.Contains: case DataListFilterComparisonOperator.Contains:
sb.Append("Like '%"); if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
sb.Append(sValue); sb.Append($"LIKE '%{sValue}%'");
sb.Append("%'"); else
sb.Append($"LIKE lower('%{sValue}%')");
break; break;
case DataListFilterComparisonOperator.StartsWith: case DataListFilterComparisonOperator.StartsWith:
sb.Append("Like '"); if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
sb.Append(sValue); sb.Append($"LIKE '{sValue}%'");
sb.Append("%'"); else
sb.Append($"LIKE lower('{sValue}%')");
break; break;
case DataListFilterComparisonOperator.EndsWith: case DataListFilterComparisonOperator.EndsWith:
sb.Append("Like '%"); if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
sb.Append(sValue); sb.Append($"LIKE '%{sValue}'");
sb.Append("'"); else
sb.Append($"LIKE lower('%{sValue}')");
break; break;
default: default:

View File

@@ -149,7 +149,7 @@ namespace AyaNova.PickList
//all the other templated fields //all the other templated fields
if (HasAutoCompleteQuery && !HasTagSpecificQuery) if (HasAutoCompleteQuery && !HasTagSpecificQuery)
{ {
if (ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly) if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
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}%'))";
@@ -164,7 +164,7 @@ namespace AyaNova.PickList
lSelect.Add(valueColumnName); lSelect.Add(valueColumnName);
lOrderBy.Add(valueColumnName); lOrderBy.Add(valueColumnName);
if (HasAutoCompleteQuery) if (HasAutoCompleteQuery)
if (ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly) if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')"; sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')";
else else
sWhere = $"(lower({valueColumnName}) like lower('%{autoCompleteQuery}%'))"; sWhere = $"(lower({valueColumnName}) like lower('%{autoCompleteQuery}%'))";
@@ -186,7 +186,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 (aworkorder.serial as text) like '%some%') //(cast (aworkorder.serial as text) like '%some%')
if (HasAutoCompleteQuery) if (HasAutoCompleteQuery)
if (ServerGlobalBizSettings.Cache.SearchCaseSensitiveOnly) if (ServerGlobalBizSettings.Cache.FilterCaseSensitive)
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}%'))";

View File

@@ -784,7 +784,7 @@ namespace AyaNova.Biz
{ {
#region Include token #region Include token
//All latin text is converted to lower case //All latin text is converted to lower case
c = char.ToLower(c); c = char.ToLower(c,System.Globalization.CultureInfo.CurrentCulture);
//Do we already have a word? //Do we already have a word?
if (sbWord.Length > 0) if (sbWord.Length > 0)
@@ -851,7 +851,7 @@ namespace AyaNova.Biz
{ {
#region Latin Include token #region Latin Include token
//All latin text is converted to lower case //All latin text is converted to lower case
c = char.ToLower(c); c = char.ToLower(c,System.Globalization.CultureInfo.CurrentCulture);
//Do we already have a word? //Do we already have a word?
if (sbWord.Length > 0) if (sbWord.Length > 0)

View File

@@ -56,7 +56,7 @@ namespace AyaNova.Biz
if (string.IsNullOrWhiteSpace(inObj)) return null; if (string.IsNullOrWhiteSpace(inObj)) return null;
//Must be lowercase per rules //Must be lowercase per rules
//This may be naive when we get international cust omers but for now supporting utf-8 and it appears it's safe to do this with unicode //This may be naive when we get international cust omers but for now supporting utf-8 and it appears it's safe to do this with unicode
inObj = inObj.ToLowerInvariant(); inObj = inObj.ToLower(System.Globalization.CultureInfo.CurrentCulture);
//No spaces in tags, replace with dashes //No spaces in tags, replace with dashes
inObj = inObj.Replace(" ", "-"); inObj = inObj.Replace(" ", "-");
//Remove multiple dash sequences //Remove multiple dash sequences

View File

@@ -22,7 +22,7 @@ namespace AyaNova.Models
//Picklist and other searches override the normal case insensitive value //Picklist and other searches override the normal case insensitive value
//this is precautionarily added for non latinate languages where it could be an issue //this is precautionarily added for non latinate languages where it could be an issue
public bool SearchCaseSensitiveOnly { get; set; } public bool FilterCaseSensitive { get; set; }
public bool UseInventory { get; set; } public bool UseInventory { get; set; }
//TAX CODE DEFAULTS //TAX CODE DEFAULTS
@@ -92,7 +92,7 @@ namespace AyaNova.Models
public GlobalBizSettings() public GlobalBizSettings()
{ {
Id = 1;//always 1 Id = 1;//always 1
SearchCaseSensitiveOnly = false; FilterCaseSensitive = false;
UseInventory = true; UseInventory = true;
} }
} }

View File

@@ -321,7 +321,7 @@
"GlobalUnitNameDisplayFormatsDescription": "Bestimmt das Format, in dem Einheiten in den Dropdown-Auswahlfeldern auf Servicearbeitsaufträgen, Angeboten und Wartung/Inspektion-Aufträgen angezeigt werden.", "GlobalUnitNameDisplayFormatsDescription": "Bestimmt das Format, in dem Einheiten in den Dropdown-Auswahlfeldern auf Servicearbeitsaufträgen, Angeboten und Wartung/Inspektion-Aufträgen angezeigt werden.",
"GlobalUseInventory": "Bestand verwenden", "GlobalUseInventory": "Bestand verwenden",
"GlobalUseInventoryDescription": "Wenn FALSCH festgelegt ist, wird der Zugriff auf die Teileeingabe und die Auswahl von auf Arbeitsaufträgen verwendeten Teilen eingeschränkt. Wenn WAHR festgelegt ist, kann auf alle Bestandsfunktionen zugegriffen werden.", "GlobalUseInventoryDescription": "Wenn FALSCH festgelegt ist, wird der Zugriff auf die Teileeingabe und die Auswahl von auf Arbeitsaufträgen verwendeten Teilen eingeschränkt. Wenn WAHR festgelegt ist, kann auf alle Bestandsfunktionen zugegriffen werden.",
"GlobalSearchCaseSensitiveOnly": "Suche zwischen Groß- und Kleinschreibung unterscheiden", "GlobalFilterCaseSensitive": "Bei Filtervorgängen muss die Groß-/Kleinschreibung beachtet werden",
"GlobalUseNotification": "Benachrichtigung verwenden", "GlobalUseNotification": "Benachrichtigung verwenden",
"GlobalUseNotificationDescription": "Wird WAHR festgelegt, wird das Benachrichtigungssystem eingeschaltet. Wird FALSCH festgelegt, wird die gesamte Benachrichtigungsverarbeitung ausgeschaltet.", "GlobalUseNotificationDescription": "Wird WAHR festgelegt, wird das Benachrichtigungssystem eingeschaltet. Wird FALSCH festgelegt, wird die gesamte Benachrichtigungsverarbeitung ausgeschaltet.",
"GlobalUseRegions": "Regionen verwenden", "GlobalUseRegions": "Regionen verwenden",

View File

@@ -321,7 +321,7 @@
"GlobalUnitNameDisplayFormatsDescription": "Determines the format of how Units display within drop down selection boxes within workorders, quotes, and pm's.", "GlobalUnitNameDisplayFormatsDescription": "Determines the format of how Units display within drop down selection boxes within workorders, quotes, and pm's.",
"GlobalUseInventory": "Use Inventory", "GlobalUseInventory": "Use Inventory",
"GlobalUseInventoryDescription": "FALSE restricts access to part entry and selection of parts used within workorders. TRUE allows access to all inventory functions.", "GlobalUseInventoryDescription": "FALSE restricts access to part entry and selection of parts used within workorders. TRUE allows access to all inventory functions.",
"GlobalSearchCaseSensitiveOnly": "Search is case sensitive", "GlobalFilterCaseSensitive": "Filtering is case sensitive",
"GlobalUseNotification": "Use Notification", "GlobalUseNotification": "Use Notification",
"GlobalUseNotificationDescription": "If set to TRUE turns on notification system\r\nIf set to FALSE turns off all notification processing.", "GlobalUseNotificationDescription": "If set to TRUE turns on notification system\r\nIf set to FALSE turns off all notification processing.",
"GlobalUseRegions": "Use Regions", "GlobalUseRegions": "Use Regions",

View File

@@ -321,7 +321,7 @@
"GlobalUnitNameDisplayFormatsDescription": "Determina el formato en el que se muestran las unidades en los cuadros de selección desplegables de los pedidos de servicio, presupuestos y mantenimientos preventivos", "GlobalUnitNameDisplayFormatsDescription": "Determina el formato en el que se muestran las unidades en los cuadros de selección desplegables de los pedidos de servicio, presupuestos y mantenimientos preventivos",
"GlobalUseInventory": "Usar inventario", "GlobalUseInventory": "Usar inventario",
"GlobalUseInventoryDescription": "Si se ajusta a falso, el acceso queda limitado a la entrada de piezas y a la selección de las utilizadas en los pedidos de servicio. Si se ajusta a verdadero, se permite el acceso a todas las funciones del inventario.", "GlobalUseInventoryDescription": "Si se ajusta a falso, el acceso queda limitado a la entrada de piezas y a la selección de las utilizadas en los pedidos de servicio. Si se ajusta a verdadero, se permite el acceso a todas las funciones del inventario.",
"GlobalSearchCaseSensitiveOnly": "Búsqueda sensible a mayúsculas y minúsculas", "GlobalFilterCaseSensitive": "El filtrado distingue entre mayúsculas y minúsculas",
"GlobalUseNotification": "Usar notificaciones", "GlobalUseNotification": "Usar notificaciones",
"GlobalUseNotificationDescription": "Si se ajusta a verdadero, se activa el sistema de notificaciones. Si se ajusta a falso, todo el procesamiento de las notificaciones se desactiva.", "GlobalUseNotificationDescription": "Si se ajusta a verdadero, se activa el sistema de notificaciones. Si se ajusta a falso, todo el procesamiento de las notificaciones se desactiva.",
"GlobalUseRegions": "Usar regiones", "GlobalUseRegions": "Usar regiones",

View File

@@ -321,7 +321,7 @@
"GlobalUnitNameDisplayFormatsDescription": "Détermine le format d'affichage des unités dans les champs déroulants pour les bons de travail de service, les devis et les entretiens préventifs.", "GlobalUnitNameDisplayFormatsDescription": "Détermine le format d'affichage des unités dans les champs déroulants pour les bons de travail de service, les devis et les entretiens préventifs.",
"GlobalUseInventory": "Utiliser le stock", "GlobalUseInventory": "Utiliser le stock",
"GlobalUseInventoryDescription": "FAUX limite laccès à la saisie de pièces et à la sélection des pièces utilisées dans les bons de travail de service. VRAI autorise laccès à toutes les fonctions liées aux stocks.", "GlobalUseInventoryDescription": "FAUX limite laccès à la saisie de pièces et à la sélection des pièces utilisées dans les bons de travail de service. VRAI autorise laccès à toutes les fonctions liées aux stocks.",
"GlobalSearchCaseSensitiveOnly": "Recherche sensible à la casse", "GlobalFilterCaseSensitive": "Le filtrage est sensible à la casse",
"GlobalUseNotification": "Utiliser notification", "GlobalUseNotification": "Utiliser notification",
"GlobalUseNotificationDescription": "Si VRAI, active le système de notification. Si FAUX, désactive toutes les procédures de notification.", "GlobalUseNotificationDescription": "Si VRAI, active le système de notification. Si FAUX, désactive toutes les procédures de notification.",
"GlobalUseRegions": "Utiliser les régions", "GlobalUseRegions": "Utiliser les régions",

View File

@@ -251,7 +251,7 @@ namespace AyaNova.Util
//create global biz settings table //create global biz settings table
await ExecQueryAsync("CREATE TABLE aglobalbizsettings (id INTEGER NOT NULL PRIMARY KEY, " await ExecQueryAsync("CREATE TABLE aglobalbizsettings (id INTEGER NOT NULL PRIMARY KEY, "
+ "searchcasesensitiveonly BOOL DEFAULT FALSE, " + "filtercasesensitive BOOL DEFAULT FALSE, "
+ "useinventory BOOL DEFAULT TRUE, " + "useinventory BOOL DEFAULT TRUE, "
+ "allowscheduleconflicts BOOL DEFAULT TRUE, " + "allowscheduleconflicts BOOL DEFAULT TRUE, "
+ "workordercompletebyage INTERVAL NOT NULL DEFAULT '00:00:00', " + "workordercompletebyage INTERVAL NOT NULL DEFAULT '00:00:00', "