diff --git a/front/core/components/field/style.scss b/front/core/components/field/style.scss index ceaeda40a..9012b8c4c 100644 --- a/front/core/components/field/style.scss +++ b/front/core/components/field/style.scss @@ -71,7 +71,7 @@ color: $color-font; &::placeholder { - color: $color-font-bg; + color: $color-font-bg-marginal; } &[type=time], &[type=date], diff --git a/front/core/components/input-number/index.html b/front/core/components/input-number/index.html index 4d0227333..3bf1e7ebd 100644 --- a/front/core/components/input-number/index.html +++ b/front/core/components/input-number/index.html @@ -15,6 +15,7 @@
diff --git a/front/core/components/input-number/index.js b/front/core/components/input-number/index.js index 6f9fefcd8..8b1341e44 100644 --- a/front/core/components/input-number/index.js +++ b/front/core/components/input-number/index.js @@ -85,6 +85,7 @@ ngModule.vnComponent('vnInputNumber', { min: ' + order="itemTypeFk, itemName, itemSize, description"> Item Ticket Fecha - Description + Description Quantity diff --git a/modules/entry/front/latest-buys-search-panel/index.html b/modules/entry/front/latest-buys-search-panel/index.html index 3ef688f58..8cfab622a 100644 --- a/modules/entry/front/latest-buys-search-panel/index.html +++ b/modules/entry/front/latest-buys-search-panel/index.html @@ -109,18 +109,21 @@ on-change="itemTag.value = null"> - + show-field="value" + value-field="value" + rule> { controller = $componentController('vnLatestBuysSearchPanel', {$element}); })); - describe('getSourceTable()', () => { - it(`should return null if there's no selection`, () => { - let selection = null; - let result = controller.getSourceTable(selection); + describe('filter() setter', () => { + it(`should set the tags property to the scope filter with an empty array`, () => { + const expectedFilter = { + tags: [{}] + }; + controller.filter = null; - expect(result).toBeNull(); + expect(controller.filter).toEqual(expectedFilter); }); - it(`should return null if there's a selection but its isFree property is truthy`, () => { - let selection = {isFree: true}; - let result = controller.getSourceTable(selection); + it(`should set the tags property to the scope filter with an array of tags`, () => { + const expectedFilter = { + description: 'My item', + tags: [{}] + }; + const expectedFieldFilter = [{ + info: { + label: 'description', + name: 'description', + type: null + }, + name: 'description', + value: 'My item' + }]; + controller.filter = { + description: 'My item' + }; - expect(result).toBeNull(); + expect(controller.filter).toEqual(expectedFilter); + expect(controller.fieldFilters).toEqual(expectedFieldFilter); }); + }); - it(`should return the formated sourceTable concatenated to a path`, () => { - let selection = {sourceTable: 'hello guy'}; - let result = controller.getSourceTable(selection); + describe('removeField()', () => { + it(`should remove the description property from the fieldFilters and from the scope filter`, () => { + const expectedFilter = {tags: [{}]}; + controller.filter = {description: 'My item'}; - expect(result).toEqual('Hello guys'); - }); + controller.removeField(0, 'description'); - it(`should return a path if there's no sourceTable and the selection has an id`, () => { - let selection = {id: 99}; - let result = controller.getSourceTable(selection); - - expect(result).toEqual(`ItemTags/filterItemTags/${selection.id}`); + expect(controller.filter).toEqual(expectedFilter); + expect(controller.fieldFilters).toEqual([]); }); }); }); diff --git a/modules/item/back/methods/tag/filterValue.js b/modules/item/back/methods/tag/filterValue.js index 062127a74..3f39519fc 100644 --- a/modules/item/back/methods/tag/filterValue.js +++ b/modules/item/back/methods/tag/filterValue.js @@ -47,9 +47,14 @@ module.exports = Self => { const where = filter.where; if (where && where.value) { stmt.merge(conn.makeWhere({value: {like: `%${where.value}%`}})); - stmt.merge(` - ORDER BY value LIKE '${where.value}' DESC, - value LIKE '${where.value}%' DESC`); + + const orderStmt = new ParameterizedSQL( + `ORDER BY value LIKE ? DESC, + value LIKE ? DESC`, [ + where.value, + `${where.value}%` + ]); + ParameterizedSQL.append(stmt, orderStmt); } stmt.merge(conn.makeLimit(filter)); diff --git a/modules/item/front/search-panel/index.html b/modules/item/front/search-panel/index.html index 7cbe9c56d..7fc2a0210 100644 --- a/modules/item/front/search-panel/index.html +++ b/modules/item/front/search-panel/index.html @@ -83,19 +83,21 @@ - + show-field="value" + value-field="value" + rule> { controller = $componentController('vnItemSearchPanel', {$element}); })); - describe('getSourceTable()', () => { - it(`should return null if there's no selection`, () => { - let selection = null; - let result = controller.getSourceTable(selection); + describe('filter() setter', () => { + it(`should set the tags property to the scope filter with an empty array`, () => { + const expectedFilter = { + tags: [{}] + }; + controller.filter = null; - expect(result).toBeNull(); + expect(controller.filter).toEqual(expectedFilter); }); - it(`should return null if there's a selection but its isFree property is truthy`, () => { - let selection = {isFree: true}; - let result = controller.getSourceTable(selection); + it(`should set the tags property to the scope filter with an array of tags`, () => { + const expectedFilter = { + description: 'My item', + tags: [{}] + }; + const expectedFieldFilter = [{ + info: { + label: 'description', + name: 'description', + type: null + }, + name: 'description', + value: 'My item' + }]; + controller.filter = { + description: 'My item' + }; - expect(result).toBeNull(); + expect(controller.filter).toEqual(expectedFilter); + expect(controller.fieldFilters).toEqual(expectedFieldFilter); }); + }); - it(`should return the formated sourceTable concatenated to a path`, () => { - let selection = {sourceTable: 'hello guy'}; - let result = controller.getSourceTable(selection); + describe('removeField()', () => { + it(`should remove the description property from the fieldFilters and from the scope filter`, () => { + const expectedFilter = {tags: [{}]}; + controller.filter = {description: 'My item'}; - expect(result).toEqual('Hello guys'); - }); + controller.removeField(0, 'description'); - it(`should return a path if there's no sourceTable and the selection has an id`, () => { - let selection = {id: 99}; - let result = controller.getSourceTable(selection); - - expect(result).toEqual(`ItemTags/filterItemTags/${selection.id}`); + expect(controller.filter).toEqual(expectedFilter); + expect(controller.fieldFilters).toEqual([]); }); }); }); diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 0aa41226b..996135c1e 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -153,7 +153,8 @@ + on-change="$ctrl.changeQuantity(sale)" + clear-disabled="true"> @@ -177,7 +178,8 @@ + on-change="$ctrl.updateConcept(sale)" + clear-disabled="true"> @@ -251,6 +253,7 @@ ng-model="$ctrl.edit.price" step="0.01" on-change="$ctrl.updatePrice()" + clear-disabled="true" suffix="€">
@@ -283,6 +286,7 @@ label="Discount" ng-model="$ctrl.edit.discount" on-change="$ctrl.changeDiscount()" + clear-disabled="true" suffix="%">
@@ -311,6 +315,7 @@ label="Discount" ng-model="$ctrl.edit.discount" on-change="$ctrl.changeMultipleDiscount()" + clear-disabled="true" suffix="%">