diff --git a/client/ticket/src/data/step-one/index.js b/client/ticket/src/data/step-one/index.js index ff986b426..d7d81747b 100644 --- a/client/ticket/src/data/step-one/index.js +++ b/client/ticket/src/data/step-one/index.js @@ -1,4 +1,5 @@ import ngModule from '../../module'; +import {toJsonDate} from 'core/src/lib/date'; class Controller { constructor($scope, $http, $translate, vnApp) { @@ -35,7 +36,7 @@ class Controller { let query = `/ticket/api/sales/${this.ticket.id}/priceDifference`; let data = { - landed: this.ticket.landed, + landed: toJsonDate(this.ticket.landed), addressFk: this.ticket.addressFk, agencyModeFk: this.ticket.agencyModeFk, warehouseFk: this.ticket.warehouseFk diff --git a/services/loopback/common/methods/sale/moveToNewTicket.js b/services/loopback/common/methods/sale/moveToNewTicket.js index 348e1e51e..411b05c75 100644 --- a/services/loopback/common/methods/sale/moveToNewTicket.js +++ b/services/loopback/common/methods/sale/moveToNewTicket.js @@ -32,14 +32,21 @@ module.exports = Self => { throw new Error(`The sales of this ticket can't be modified`); let travelDates = await model.Agency.getFirstShipped(params.ticket); + let shipped = new Date(travelDates.vShipped); + shipped.setMinutes(shipped.getMinutes() + shipped.getTimezoneOffset()); + console.log(shipped); + + let landed = new Date(travelDates.vLanded); + landed.setMinutes(landed.getMinutes() + landed.getTimezoneOffset()); + console.log(shipped); let newTicketParams = { clientFk: params.ticket.clientFk, addressFk: params.ticket.addressFk, agencyModeFk: params.ticket.agencyModeFk, warehouseFk: params.ticket.warehouseFk, - shipped: travelDates.vShipped, - landed: travelDates.vLanded + shipped: shipped, + landed: landed }; let newTicket = await model.Ticket.create(newTicketParams); diff --git a/services/loopback/server/datasources.json b/services/loopback/server/datasources.json index 25d7d0739..1bc491c64 100644 --- a/services/loopback/server/datasources.json +++ b/services/loopback/server/datasources.json @@ -16,6 +16,7 @@ }, "salix": { "connector": "vn-mysql", + "timezone": "CET", "database": "salix", "debug": false, "host": "${salixHost}", @@ -27,6 +28,7 @@ }, "account": { "connector": "vn-mysql", + "timezone": "CET", "database": "account", "debug": false, "host": "${salixHost}", @@ -38,6 +40,7 @@ }, "edi": { "connector": "vn-mysql", + "timezone": "CET", "database": "edi", "debug": false, "host": "${salixHost}", @@ -49,6 +52,7 @@ }, "bs": { "connector": "vn-mysql", + "timezone": "CET", "database": "bs", "debug": false, "host": "${salixHost}", @@ -60,6 +64,7 @@ }, "hedera": { "connector": "vn-mysql", + "timezone": "CET", "database": "hedera", "debug": false, "host": "${salixHost}",