From f2e9dbd597d43686fee9775e2a7fbe049f43b9ee Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 26 Dec 2019 11:27:44 +0100 Subject: [PATCH] added category name to item type autocompletes --- modules/item/front/basic-data/index.html | 10 +++++++++- modules/item/front/create/index.html | 16 +++++++++++----- modules/item/front/search-panel/index.html | 13 ++++++++++--- .../back/methods/order/getItemTypeAvailable.js | 3 ++- modules/order/front/filter/index.html | 10 +++++++++- 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 4fe9bfe21..bd0cec86d 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -31,7 +31,15 @@ show-field="name" value-field="id" ng-model="$ctrl.item.typeFk" - initial-data="$ctrl.item.itemType"> + initial-data="$ctrl.item.itemType" + fields="['categoryFk']" + include="'category'"> + +
{{name}}
+
+ {{category.name}} +
+
diff --git a/modules/item/front/create/index.html b/modules/item/front/create/index.html index 0c00aa8e9..e57da198c 100644 --- a/modules/item/front/create/index.html +++ b/modules/item/front/create/index.html @@ -19,13 +19,19 @@ - -
{{::code}}
-
{{::name}}
+ search-function="{or: [{code: {like: $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}" + include="'category'"> + +
+
{{::code}}
+
{{::name}}
+
+
+ {{category.name}} +
- + ng-model="filter.typeFk" + fields="['categoryFk']" + include="'category'"> + +
{{name}}
+
+ {{category.name}} +
+
>
diff --git a/modules/order/back/methods/order/getItemTypeAvailable.js b/modules/order/back/methods/order/getItemTypeAvailable.js index 977a2cf85..de0a5511c 100644 --- a/modules/order/back/methods/order/getItemTypeAvailable.js +++ b/modules/order/back/methods/order/getItemTypeAvailable.js @@ -38,11 +38,12 @@ module.exports = Self => { order.agencyModeFk ]); stmts.push(stmt); - stmt = new ParameterizedSQL(`SELECT it.id, it.name + stmt = new ParameterizedSQL(`SELECT it.id, it.name, ic.name categoryName FROM tmp.availableCalc ac JOIN cache.available a ON a.calc_id = ac.calcFk JOIN item i ON i.id = a.item_id JOIN itemType it ON it.id = i.typeFk + JOIN itemCategory ic ON ic.id = it.categoryFk WHERE it.categoryFk = ? GROUP BY it.id`, [ itemCategoryId diff --git a/modules/order/front/filter/index.html b/modules/order/front/filter/index.html index 68691e0a7..2b92b5f4a 100644 --- a/modules/order/front/filter/index.html +++ b/modules/order/front/filter/index.html @@ -29,7 +29,15 @@ ng-model="$ctrl.type.id" show-field="name" value-field="id" - label="Type"> + label="Type" + fields="['categoryFk']" + include="'category'"> + +
{{name}}
+
+ {{categoryName}} +
+