cambio landed por created #620

Merged
joan merged 4 commits from 2902-error-getSuggestedTickets into dev 2021-05-11 09:57:43 +00:00
1 changed files with 1 additions and 3 deletions
Showing only changes of commit 19b35f5f6c - Show all commits

View File

@ -31,19 +31,17 @@ module.exports = Self => {
const zoneIds = []; const zoneIds = [];
for (let zoneAgencyMode of zoneAgencyModes) for (let zoneAgencyMode of zoneAgencyModes)
zoneIds.push(zoneAgencyMode.zoneFk); zoneIds.push(zoneAgencyMode.zoneFk);
const minDate = new Date(route.created); const minDate = new Date(route.created);
minDate.setHours(0, 0, 0, 0); minDate.setHours(0, 0, 0, 0);
const maxDate = new Date(route.created); const maxDate = new Date(route.created);
maxDate.setHours(23, 59, 59, 59); maxDate.setHours(23, 59, 59, 59);
let tickets = await Self.app.models.Ticket.find({ let tickets = await Self.app.models.Ticket.find({
where: { where: {
agencyModeFk: route.agencyModeFk, agencyModeFk: route.agencyModeFk,
zoneFk: {inq: zoneIds}, zoneFk: {inq: zoneIds},
routeFk: null, routeFk: null,
landed: {between: [minDate, maxDate]} shipped: {between: [minDate, maxDate]}
}, },
include: [ include: [
{ {