From 1ae2512169c3ae36590e9a7d1a17607b19def214 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 16 May 2019 09:24:13 +0200 Subject: [PATCH 1/4] client greuge order by shipped and amount #1431 --- modules/client/front/greuge/index/index.html | 6 +++--- modules/client/front/greuge/index/index.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html index a9d06cfa3..537e67602 100644 --- a/modules/client/front/greuge/index/index.html +++ b/modules/client/front/greuge/index/index.html @@ -4,7 +4,7 @@ filter="::$ctrl.filter" link="{clientFk: $ctrl.$stateParams.id}" limit="20" - data="greuges" auto-load="false"> + data="greuges" auto-load="true"> - + Date Comment - Amount + Amount Type diff --git a/modules/client/front/greuge/index/index.js b/modules/client/front/greuge/index/index.js index 3dd5c9eaf..b89b01d7e 100644 --- a/modules/client/front/greuge/index/index.js +++ b/modules/client/front/greuge/index/index.js @@ -6,12 +6,13 @@ class Controller { this.filter = { include: [ { - relation: "greugeType", + relation: 'greugeType', scope: { - fields: ["id", "name"] + fields: ['id', 'name'] } } - ] + ], + order: 'shipped DESC, amount' }; } } From b70316551b0b41f767cdadb5a0451c9d05eca724 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 16 May 2019 09:33:56 +0200 Subject: [PATCH 2/4] edit claim basic data for salesPerson #1433 --- modules/claim/front/basic-data/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/claim/front/basic-data/index.js b/modules/claim/front/basic-data/index.js index fa3306429..bc616dd5c 100644 --- a/modules/claim/front/basic-data/index.js +++ b/modules/claim/front/basic-data/index.js @@ -10,11 +10,10 @@ class Controller { } onSubmit() { - if (this.aclService.hasAny(['salesAssistant'])) { - this.$scope.watcher.submit().then(() => { + this.$scope.watcher.submit().then(() => { + if (this.aclService.hasAny(['salesAssistant'])) this.$state.go('claim.card.detail'); - }); - } + }); } } From 599084a8beb1016c9d4c84caa77003e38e80ff02 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 16 May 2019 12:33:41 +0200 Subject: [PATCH 3/4] parse scopeDays integer on ticket.index #1439 --- modules/ticket/front/index/index.js | 3 ++- modules/ticket/front/search-panel/index.html | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ticket/front/index/index.js b/modules/ticket/front/index/index.js index c616120df..4b58d9bd8 100644 --- a/modules/ticket/front/index/index.js +++ b/modules/ticket/front/index/index.js @@ -27,7 +27,7 @@ export default class Controller { this.$http.get(`/api/TicketConfigs/findOne`).then(res => { if (res.data) { this.filter = { - scopeDays: res.data.scopeDays + scopeDays: parseInt(res.data.scopeDays) }; } }); @@ -64,6 +64,7 @@ export default class Controller { onSearch(params) { if (params) { if (params.scopeDays) { + params.scopeDays = parseInt(params.scopeDays); this.scopeDays = params.scopeDays; this.buildFilterDates(); params = Object.assign(params, {from: this.today, to: this.daysOnward}); diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 7e3267f45..70fa24e63 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -37,8 +37,7 @@ label="To" model="filter.to"> - Date: Thu, 16 May 2019 12:51:16 +0200 Subject: [PATCH 4/4] remove description properties from item clone --- modules/item/back/methods/item/clone.js | 6 ++++++ modules/item/back/methods/item/specs/clone.spec.js | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/item/back/methods/item/clone.js b/modules/item/back/methods/item/clone.js index fc1682912..14fc1e365 100644 --- a/modules/item/back/methods/item/clone.js +++ b/modules/item/back/methods/item/clone.js @@ -31,7 +31,13 @@ module.exports = Self => { if (!origin) throw new UserError(`That item doesn't exists`); + origin.itemTag = undefined; + origin.description = undefined; + origin.image = undefined; + origin.comment = undefined; + const newItem = await Self.create(origin, options); + let promises = []; await cloneTaxes(origin.id, newItem.id, promises, options); diff --git a/modules/item/back/methods/item/specs/clone.spec.js b/modules/item/back/methods/item/specs/clone.spec.js index 859a3167f..a1bd0f6c8 100644 --- a/modules/item/back/methods/item/specs/clone.spec.js +++ b/modules/item/back/methods/item/specs/clone.spec.js @@ -1,6 +1,6 @@ const app = require('vn-loopback/server/server'); -describe('item clone()', () => { +fdescribe('item clone()', () => { let nextItemId; beforeEach(async() => { @@ -17,6 +17,10 @@ describe('item clone()', () => { let result = await app.models.Item.clone(itemFk); expect(result.id).toEqual(nextItemId); + expect(result.image).toBeUndefined(); + expect(result.itemTag).toBeUndefined(); + expect(result.comment).toBeUndefined(); + expect(result.description).toBeUndefined(); }); it('should attempt to clone the given item but give an error as it doesnt exist', async() => {