This commit is contained in:
2021-09-09 15:29:19 +00:00
parent 23ffa04ce1
commit a13ed7c096
2 changed files with 11 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ namespace AyaNova.PickList
{ {
DefaultListAType = AyaType.Customer; DefaultListAType = AyaType.Customer;
SQLFrom = "from acustomer"; SQLFrom = "from acustomer ";
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select; AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray(); dynamic dTemplate = new JArray();
@@ -58,8 +58,6 @@ namespace AyaNova.PickList
{ {
//Currently the only variant is a object type and id to indicate headoffice //Currently the only variant is a object type and id to indicate headoffice
//ClientCriteria format for this list is "OBJECTID,AYATYPE" //ClientCriteria format for this list is "OBJECTID,AYATYPE"
var crit = (variant ?? "").Split(',').Select(z => z.Trim()).ToArray(); var crit = (variant ?? "").Split(',').Select(z => z.Trim()).ToArray();
if (crit.Length > 1) if (crit.Length > 1)
@@ -78,7 +76,7 @@ namespace AyaNova.PickList
{ {
case AyaType.HeadOffice: case AyaType.HeadOffice:
{ {
return $"aunit.customerid = {lId}"; return $"acustomer.headofficeid = {lId}";
} }
} }
} }

View File

@@ -283,12 +283,15 @@ namespace AyaNova.PickList
else else
{ {
//we might have a trailing and to remove //we might have a trailing and to remove
//jesus this stuff sucks, there must be a better way, it seems so fragile //{select acustomer.id as plId, acustomer.active as plActive, concat_ws(' ', acustomer.name) as plname from acustomer where (acustomer.headofficeid = 2) and }
if (!IncludeInactive || HasTagSpecificQuery || preIds.Length > 0) if(sb.ToString().EndsWith(" and "))
{ sb.Length-=5;
//trailing " and " to remove //
sb.Length -= 5; // if (!IncludeInactive || HasTagSpecificQuery || preIds.Length > 0)
} // {
// //trailing " and " to remove
// sb.Length -= 5;
// }
} }
} }