From f1c30ca6d1f6ced7785ae4186435285f96b4fedc Mon Sep 17 00:00:00 2001 From: jgallego Date: Thu, 6 May 2021 08:13:17 +0200 Subject: [PATCH 1/3] cambio landed por created --- modules/client/back/methods/client/createReceipt.js | 3 +-- .../route/back/methods/route/getSuggestedTickets.js | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) 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: [ { From 19b35f5f6c3cabdc1538ab559af46bb88f8502a9 Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 7 May 2021 07:52:03 +0200 Subject: [PATCH 2/3] landed en lugar de shipped --- modules/route/back/methods/route/getSuggestedTickets.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/route/back/methods/route/getSuggestedTickets.js b/modules/route/back/methods/route/getSuggestedTickets.js index 5699cf654..c2afd60b4 100644 --- a/modules/route/back/methods/route/getSuggestedTickets.js +++ b/modules/route/back/methods/route/getSuggestedTickets.js @@ -31,19 +31,17 @@ module.exports = Self => { const zoneIds = []; for (let zoneAgencyMode of zoneAgencyModes) zoneIds.push(zoneAgencyMode.zoneFk); - const minDate = new Date(route.created); minDate.setHours(0, 0, 0, 0); const maxDate = new Date(route.created); maxDate.setHours(23, 59, 59, 59); - let tickets = await Self.app.models.Ticket.find({ where: { agencyModeFk: route.agencyModeFk, zoneFk: {inq: zoneIds}, routeFk: null, - landed: {between: [minDate, maxDate]} + shipped: {between: [minDate, maxDate]} }, include: [ { From 84cd89d7f769fbdaa2437a5f389bc181c93ea534 Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 7 May 2021 08:45:20 +0200 Subject: [PATCH 3/3] modifica la descripcion de la compensacion --- loopback/locale/en.json | 3 ++- modules/client/back/methods/client/createReceipt.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 1e0607813..6bdaddd9b 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -96,5 +96,6 @@ "Swift / BIC cannot be empty": "Swift / BIC cannot be empty", "Role name must be written in camelCase": "Role name must be written in camelCase", "Client assignment has changed": "I did change the salesperson ~*\"<{{previousWorkerName}}>\"*~ by *\"<{{currentWorkerName}}>\"* from the client [{{clientName}} ({{clientId}})]({{{url}}})", - "None": "None" + "None": "None", + "error densidad = 0": "error densidad = 0" } \ No newline at end of file diff --git a/modules/client/back/methods/client/createReceipt.js b/modules/client/back/methods/client/createReceipt.js index a96575c5e..cb7d7aaba 100644 --- a/modules/client/back/methods/client/createReceipt.js +++ b/modules/client/back/methods/client/createReceipt.js @@ -87,7 +87,7 @@ module.exports = function(Self) { [ args.compensationAccount, args.bankFk, - accountingType.receiptDescription + args.compensationAccount, + accountingType.receiptDescription + clientOriginal.accountingAccount, args.amountPaid, args.companyFk, clientOriginal.accountingAccount