This commit is contained in:
2022-02-26 01:00:45 +00:00
parent 919dab2dfb
commit 25188519d9
6 changed files with 17 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
#define AYSHOWKPIQUERYINFO
//#define AYSHOWKPIQUERYINFO
using System.Collections.Generic;
using System.Linq;

View File

@@ -21,26 +21,26 @@ namespace AyaNova.KPI
//build data and meta queries
//validate criteria exists
if (!options.Criteria.ContainsKey("dateRange"))
if (!options.Criteria.ContainsKey("timeSpan"))
{
_errorMessage = "Missing 'dateRange' criteria";
_errorMessage = "Missing 'timeSpan' criteria";
return;
}
if (!options.Criteria.ContainsKey("unit"))
if (!options.Criteria.ContainsKey("interval"))
{
_errorMessage = "Missing 'unit' criteria";
_errorMessage = "Missing 'interval' criteria";
return;
}
var dateRange = (string)options.Criteria["dateRange"];
var unit = (string)options.Criteria["unit"];
var timeSpan = (string)options.Criteria["timeSpan"];
var interval = (string)options.Criteria["interval"];
var dateWhere = DataListSqlFilterCriteriaBuilder.DataFilterToColumnCriteria("aworkorderitemlabor.servicestopdate", UiFieldDataType.DateTime, "no-operator", dateRange, options.ClientTimeStamp);
var dateWhere = DataListSqlFilterCriteriaBuilder.DataFilterToColumnCriteria("aworkorderitemlabor.servicestopdate", UiFieldDataType.DateTime, "no-operator", timeSpan, options.ClientTimeStamp);
_dataQuery = @$"SELECT row_to_json(t) as res from (
select SUM(AWORKORDERITEMLABOR.serviceratequantity) y, date_trunc('{unit}',AWORKORDERITEMLABOR.servicestopdate) x
select SUM(AWORKORDERITEMLABOR.serviceratequantity) y, date_trunc('{interval}',AWORKORDERITEMLABOR.servicestopdate) x
FROM AWORKORDER
LEFT JOIN AWORKORDERITEM ON AWORKORDER.ID = AWORKORDERITEM.WORKORDERID
LEFT JOIN AWORKORDERITEMLABOR ON AWORKORDERITEM.ID = AWORKORDERITEMLABOR.WORKORDERITEMID

View File

@@ -452,6 +452,7 @@
"Include": "Umfassen",
"InsertImage": "Bild einfügen",
"InsertLink": "Link einfügen",
"Interval": "Intervall",
"Inventory": "Bestand",
"InventoryPurchaseOrders": "Einkaufsaufträge",
"InventoryRoleRequired": "Der Benutzer muss für diesen Vorgang eine Inventarrolle haben",
@@ -1091,6 +1092,7 @@
"TestToAddress": "Test senden an",
"ThankYouForEvaluating": "Vielen Dank, dass Sie AyaNova ausprobiert haben. Verwenden Sie die folgenden Links, um AyaNova zu erkunden und festzustellen, ob es zu Ihrer Organisation passt.",
"TimedOut": "Zeitüberschreitung",
"TimeSpan":"Zeitspanne",
"TimeSpanDays": "Tage",
"TimeSpanHours": "Stunden",
"TimeSpanMinutes": "Minuten",

View File

@@ -452,6 +452,7 @@
"Include": "Include",
"InsertImage": "Insert image",
"InsertLink": "Insert link",
"Interval": "Interval",
"Inventory": "Inventory",
"InventoryPurchaseOrders": "Purchase Orders",
"InventoryRoleRequired": "User must have Inventory Role for this operation",
@@ -1091,6 +1092,7 @@
"TestToAddress": "Send test to",
"ThankYouForEvaluating": "Use the following links to get started exploring AyaNova",
"TimedOut": "Timed out",
"TimeSpan":"Time span",
"TimeSpanDays": "days",
"TimeSpanHours": "hours",
"TimeSpanMinutes": "minutes",

View File

@@ -452,6 +452,7 @@
"Include": "Incluir",
"InsertImage": "Insertar imagen",
"InsertLink": "Insertar vínculo",
"Interval": "Intervalo",
"Inventory": "Inventario",
"InventoryPurchaseOrders": "Órdenes de compra",
"InventoryRoleRequired": "El usuario debe tener un rol de inventario para esta operación",
@@ -1091,6 +1092,7 @@
"TestToAddress": "Enviar prueba a",
"ThankYouForEvaluating": "Gracias por probar AyaNova. Utilice los siguientes enlaces para ayudar a explorar AyaNova y ver si es una buena opción para su organización.",
"TimedOut": "Tiempo de espera agotado",
"TimeSpan":"Espacio de tiempo",
"TimeSpanDays": "días",
"TimeSpanHours": "horas",
"TimeSpanMinutes": "minutos",

View File

@@ -452,6 +452,7 @@
"Include": "Inclure",
"InsertImage": "Insérer une image",
"InsertLink": "Insérer un lien",
"Interval": "Intervalle",
"Inventory": "Stock",
"InventoryPurchaseOrders": "Bons de commande",
"InventoryRoleRequired": "L'utilisateur doit avoir un rôle d'inventaire pour cette opération",
@@ -1091,6 +1092,7 @@
"TestToAddress": "Envoyer à l'adresse",
"ThankYouForEvaluating": "Merci d'essayer AyaNova. Veuillez utiliser les liens suivants pour vous aider à explorer AyaNova et voir s'il correspond bien à votre organisation.",
"TimedOut": "Délai dépassé",
"TimeSpan":"Laps de temps",
"TimeSpanDays": "jours",
"TimeSpanHours": "heures",
"TimeSpanMinutes": "minutes",