diff --git a/client/client/src/credit-insurance/index/credit-insurance-index.spec.js b/client/client/src/credit-insurance/index/credit-insurance-index.spec.js index 2a87132be..052c88c19 100644 --- a/client/client/src/credit-insurance/index/credit-insurance-index.spec.js +++ b/client/client/src/credit-insurance/index/credit-insurance-index.spec.js @@ -64,12 +64,13 @@ describe('Client', () => { it('should define the classificationId property of the controller and then call the show method()', () => { controller.$scope.closeContract = {show: () => {}}; spyOn(controller.$scope.closeContract, 'show'); + expect(controller.classificationId).toBeFalsy(); controller.closeContract({id: 1}); expect(controller.classificationId).toEqual(1); expect(controller.$scope.closeContract.show).toHaveBeenCalledWith(); - }); + }); }); }); }); diff --git a/client/ticket/src/card/index.js b/client/ticket/src/card/index.js index 643156965..5bfb31b7b 100644 --- a/client/ticket/src/card/index.js +++ b/client/ticket/src/card/index.js @@ -33,20 +33,19 @@ class Controller { } ] }; - + let json = encodeURIComponent(JSON.stringify(filter)); let query = `/ticket/api/Tickets/${this.$state.params.id}?filter=${json}`; this.$http.get(query).then(res => { - if (res.data) - this.ticket = res.data; - } - ); + if (res.data) + this.ticket = res.data; + }); } $onInit() { this.getTicket(); } - + reload() { this.getTicket(); } diff --git a/client/ticket/src/data/step-one/index.js b/client/ticket/src/data/step-one/index.js index 957ce99a8..7e96eb40a 100644 --- a/client/ticket/src/data/step-one/index.js +++ b/client/ticket/src/data/step-one/index.js @@ -36,7 +36,7 @@ class Controller { agencyModeFk: this.ticket.agencyModeFk, warehouseFk: this.ticket.warehouseFk }; - + return this.$http.post(query, data).then(res => { if (res.data) this.ticket.sale = res.data; diff --git a/services/loopback/common/methods/message/send.js b/services/loopback/common/methods/message/send.js index 0a918a1d2..b7bf00965 100644 --- a/services/loopback/common/methods/message/send.js +++ b/services/loopback/common/methods/message/send.js @@ -31,7 +31,7 @@ module.exports = Self => { } }); - Self.send = async (recipient, data, ctx) => { + Self.send = async(recipient, data, ctx) => { let query = `SELECT vn.messageSendWithUser(?, ?, ?) AS sent`; let [result] = await Self.rawSql(query, [ctx.req.accessToken.userId, recipient, data.message]); diff --git a/services/loopback/common/methods/sale/priceDifference.js b/services/loopback/common/methods/sale/priceDifference.js index ac6d9d639..b6f4855dd 100644 --- a/services/loopback/common/methods/sale/priceDifference.js +++ b/services/loopback/common/methods/sale/priceDifference.js @@ -25,7 +25,7 @@ module.exports = Self => { } }); - Self.priceDifference = async (ticketFk, data) => { + Self.priceDifference = async(ticketFk, data) => { let filter = { where: { ticketFk: ticketFk diff --git a/services/loopback/common/methods/ticket/componentUpdate.js b/services/loopback/common/methods/ticket/componentUpdate.js index 65908139a..34ff2210c 100644 --- a/services/loopback/common/methods/ticket/componentUpdate.js +++ b/services/loopback/common/methods/ticket/componentUpdate.js @@ -33,21 +33,21 @@ module.exports = Self => { } }); - Self.componentUpdate = async (ticketFk, data, ctx) => { + Self.componentUpdate = async(ticketFk, data, ctx) => { let userId = ctx.req.accessToken.userId; let hasDeliveryRole = await Self.app.models.Account.hasRole(userId, 'delivery'); - + if (!hasDeliveryRole) data.hasToBeUnrouted = true; let query = 'CALL vn.ticketComponentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; let res = await Self.rawSql(query, [ - ticketFk, + ticketFk, data.clientFk, - data.agencyModeFk, - data.addressFk, - data.warehouseFk, - data.shipped, + data.agencyModeFk, + data.addressFk, + data.warehouseFk, + data.shipped, data.landed, data.isDeleted, data.hasToBeUnrouted, diff --git a/services/loopback/common/methods/ticket/getTaxes.js b/services/loopback/common/methods/ticket/getTaxes.js index 4ca66f72d..151866eff 100644 --- a/services/loopback/common/methods/ticket/getTaxes.js +++ b/services/loopback/common/methods/ticket/getTaxes.js @@ -25,4 +25,4 @@ module.exports = Self => { return taxes; }; -}; \ No newline at end of file +}; diff --git a/services/loopback/common/methods/ticket/getTotal.js b/services/loopback/common/methods/ticket/getTotal.js index b743de090..8e342cf5d 100644 --- a/services/loopback/common/methods/ticket/getTotal.js +++ b/services/loopback/common/methods/ticket/getTotal.js @@ -25,4 +25,4 @@ module.exports = Self => { return total.amount ? total.amount : 0.00; }; -}; \ No newline at end of file +};