diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 9220da4ef..dd21ca847 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -806,7 +806,7 @@ INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `d (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0), (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0), (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0), - (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 0), + (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1), (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0), (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0), (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0), diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index 0c8ce3f99..8bae27ab2 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -54,6 +54,11 @@ module.exports = Self => { type: 'boolean', description: 'Whether the item is or not visible', }, + { + arg: 'floramondo', + type: 'boolean', + description: 'Whether the item is or not floramondo', + }, { arg: 'typeFk', type: 'integer', @@ -110,6 +115,8 @@ module.exports = Self => { return {'it.code': value}; case 'active': return {'i.isActive': value}; + case 'floramondo': + return {'i.isFloramondo': value}; case 'visible': if (value) return {'v.visible': {gt: 0}}; diff --git a/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js b/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js index bdd302adb..f4a404fa4 100644 --- a/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js +++ b/modules/entry/back/methods/entry/specs/latestBuysFilter.spec.js @@ -113,6 +113,30 @@ describe('Buy latests buys filter()', () => { expect(results.length).toBe(0); }); + it('should return results matching "floramondo"', async() => { + let ctx = { + args: { + floramondo: true + } + }; + + let results = await app.models.Buy.latestBuysFilter(ctx); + + expect(results.length).toBe(1); + }); + + it('should return results matching "not floramondo"', async() => { + let ctx = { + args: { + floramondo: false + } + }; + + let results = await app.models.Buy.latestBuysFilter(ctx); + + expect(results.length).toBe(5); + }); + it('should return results matching "salesPersonFk"', async() => { let ctx = { args: { diff --git a/modules/entry/front/latest-buys-search-panel/index.html b/modules/entry/front/latest-buys-search-panel/index.html index 7d570f798..c829a25ba 100644 --- a/modules/entry/front/latest-buys-search-panel/index.html +++ b/modules/entry/front/latest-buys-search-panel/index.html @@ -69,6 +69,11 @@ ng-model="filter.visible" triple-state="true"> + + diff --git a/modules/entry/front/latest-buys/locale/es.yml b/modules/entry/front/latest-buys/locale/es.yml index 21eae0307..8d70844fa 100644 --- a/modules/entry/front/latest-buys/locale/es.yml +++ b/modules/entry/front/latest-buys/locale/es.yml @@ -4,6 +4,8 @@ Freight value: Porte Commission value: ComisiĆ³n Package value: Embalaje Is ignored: Ignorado +Is visible: Visible +Is floramondo: Floramondo Grouping price: Precio grouping Packing price: Precio packing Min price: Precio min diff --git a/modules/item/back/methods/item/specs/filter.spec.js b/modules/item/back/methods/item/specs/filter.spec.js index 30bdcec32..6a173576d 100644 --- a/modules/item/back/methods/item/specs/filter.spec.js +++ b/modules/item/back/methods/item/specs/filter.spec.js @@ -70,8 +70,8 @@ describe('item filter()', () => { const ctx = {args: {filter: filter, isFloramondo: true}}; const result = await models.Item.filter(ctx, filter, options); - expect(result.length).toEqual(2); - expect(result[0].id).toEqual(13); + expect(result.length).toEqual(3); + expect(result[0].id).toEqual(9); await tx.rollback(); } catch (e) {