cambio landed por created #620

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

View File

@ -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,

View File

@ -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: [
{