diff --git a/modules/client/back/methods/client/createReceipt.js b/modules/client/back/methods/client/createReceipt.js index 976ff7cf2..a96575c5e 100644 --- a/modules/client/back/methods/client/createReceipt.js +++ b/modules/client/back/methods/client/createReceipt.js @@ -83,9 +83,8 @@ module.exports = function(Self) { throw new UserError('Invalid account'); await Self.rawSql( - `CALL vn.ledger_doCompensation(?, ?, ?, ?, ?, ?, ?)`, + `CALL vn.ledger_doCompensation(CURDATE(), ?, ?, ?, ?, ?, ?)`, [ - Date(), args.compensationAccount, args.bankFk, accountingType.receiptDescription + args.compensationAccount, diff --git a/modules/route/back/methods/route/getSuggestedTickets.js b/modules/route/back/methods/route/getSuggestedTickets.js index 12bde1684..5699cf654 100644 --- a/modules/route/back/methods/route/getSuggestedTickets.js +++ b/modules/route/back/methods/route/getSuggestedTickets.js @@ -20,12 +20,6 @@ module.exports = Self => { }); Self.getSuggestedTickets = async id => { - const ticketsInRoute = await Self.app.models.Ticket.find({ - where: {routeFk: id}, - fields: ['id'] - }); - const idsToExclude = ticketsInRoute.map(ticket => ticket.id); - const route = await Self.app.models.Route.findById(id); const zoneAgencyModes = await Self.app.models.ZoneAgencyMode.find({ @@ -48,8 +42,8 @@ module.exports = Self => { where: { agencyModeFk: route.agencyModeFk, zoneFk: {inq: zoneIds}, - id: {nin: idsToExclude}, - created: {between: [minDate, maxDate]} + routeFk: null, + landed: {between: [minDate, maxDate]} }, include: [ {