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'); - }); - } + }); } } 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' }; } } 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() => { 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"> -