cambio landed por created
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Javi Gallego 2021-05-06 08:13:17 +02:00
parent e37b3d8277
commit f1c30ca6d1
2 changed files with 3 additions and 10 deletions

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