From 238099311b1248e40966ed3bb430a2a897279bf1 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 8 Mar 2024 10:39:34 +0100 Subject: [PATCH 1/6] refs #7004 fix: bug --- modules/supplier/back/methods/supplier/newSupplier.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/supplier/back/methods/supplier/newSupplier.js b/modules/supplier/back/methods/supplier/newSupplier.js index c40e7214f..3cca4195f 100644 --- a/modules/supplier/back/methods/supplier/newSupplier.js +++ b/modules/supplier/back/methods/supplier/newSupplier.js @@ -1,3 +1,5 @@ +const UserError = require('vn-loopback/util/user-error'); + module.exports = Self => { Self.remoteMethodCtx('newSupplier', { description: 'Creates a new supplier and returns it', @@ -19,12 +21,13 @@ module.exports = Self => { Self.newSupplier = async(ctx, options) => { const models = Self.app.models; const args = ctx.args; - const myOptions = {}; + const myOptions = {validate: false}; if (typeof options == 'object') Object.assign(myOptions, options); delete args.ctx; + if (!args.name) throw new UserError('The social name cannot be empty'); const data = {...args, ...{nickname: args.name}}; const supplier = await models.Supplier.create(data, myOptions); From a8420cd6504020eb0081ada5141708d19dd56958 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 8 Mar 2024 10:39:54 +0100 Subject: [PATCH 2/6] refs #7004 feat: translate label newSupplier --- modules/supplier/front/descriptor/locale/es.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/supplier/front/descriptor/locale/es.yml b/modules/supplier/front/descriptor/locale/es.yml index d889a9eee..cf4a52393 100644 --- a/modules/supplier/front/descriptor/locale/es.yml +++ b/modules/supplier/front/descriptor/locale/es.yml @@ -4,4 +4,5 @@ Go to client: Ir al cliente Verified supplier: Proveedor verificado Unverified supplier: Proveedor no verificado Inactive supplier: Proveedor inactivo -Create invoiceIn: Crear factura recibida \ No newline at end of file +Create invoiceIn: Crear factura recibida +Supplier name: Razón social From 74c199384c5a197a4af92e09dfec2b5d6af4c8f0 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 8 Mar 2024 10:42:07 +0100 Subject: [PATCH 3/6] fix: refs #6372 vn2008.clean --- db/routines/vn2008/procedures/clean.sql | 5 ----- 1 file changed, 5 deletions(-) diff --git a/db/routines/vn2008/procedures/clean.sql b/db/routines/vn2008/procedures/clean.sql index 946157fa0..5a62b133e 100644 --- a/db/routines/vn2008/procedures/clean.sql +++ b/db/routines/vn2008/procedures/clean.sql @@ -25,11 +25,6 @@ proc: BEGIN DELETE FROM Movimientos_mark WHERE odbc_date < vDate; DELETE FROM Splits WHERE Fecha < vDate18; - DELETE tobs - FROM movement_label tobs - JOIN Movimientos m ON tobs.Id_Movimiento = m.Id_Movimiento - JOIN Tickets t ON m.Id_Ticket = t.Id_Ticket WHERE t.Fecha < vDate; - DELETE FROM Remesas WHERE `Fecha Remesa` < vDate18; DELETE tt.* From cdb9f372cf350712aae9f15e8c4bc5d411e48cb4 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 8 Mar 2024 12:19:57 +0100 Subject: [PATCH 4/6] feat: refs #6610 fixDeleteTickets --- db/routines/vn/procedures/clean.sql | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/db/routines/vn/procedures/clean.sql b/db/routines/vn/procedures/clean.sql index 06f36afce..e31d73c14 100644 --- a/db/routines/vn/procedures/clean.sql +++ b/db/routines/vn/procedures/clean.sql @@ -182,6 +182,27 @@ BEGIN DELETE FROM travelLog WHERE creationDate < v3Month; + CREATE OR REPLACE TEMPORARY TABLE tTicketDelete + SELECT DISTINCT tl.originFk ticketFk, sub.ticketFk aa + FROM ticketLog tl + JOIN ( + SELECT MAX(tl.id)ids,tw.ticketFk + FROM ticket t + JOIN ticketLog tl ON tl.originFk = t.id + LEFT JOIN ticketWeekly tw ON tw.ticketFk =t.id + WHERE t.shipped BETWEEN '2000-01-01' AND '2000-12-31' + AND t.isDeleted + AND tw.ticketFk IS NULL + GROUP BY t.id + ) sub ON sub.ids = tl.id + WHERE tl.creationDate <= util.VN_CURDATE() - INTERVAL 60 DAY; + + DELETE t + FROM ticket t + JOIN tTicketDelete tmp ON tmp.ticketFk = t.id; + + DROP TEMPORARY TABLE tTicketDelete; + CALL shelving_clean; DELETE FROM chat WHERE dated < v5Years; From b1e90fabb2346933518134efd8745a043fa911d1 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 8 Mar 2024 12:32:22 +0100 Subject: [PATCH 5/6] refs #6610 --- db/routines/vn/procedures/clean.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/db/routines/vn/procedures/clean.sql b/db/routines/vn/procedures/clean.sql index e31d73c14..66164d894 100644 --- a/db/routines/vn/procedures/clean.sql +++ b/db/routines/vn/procedures/clean.sql @@ -183,19 +183,19 @@ BEGIN DELETE FROM travelLog WHERE creationDate < v3Month; CREATE OR REPLACE TEMPORARY TABLE tTicketDelete - SELECT DISTINCT tl.originFk ticketFk, sub.ticketFk aa + SELECT DISTINCT tl.originFk ticketFk FROM ticketLog tl JOIN ( - SELECT MAX(tl.id)ids,tw.ticketFk + SELECT MAX(tl.id)ids, tw.ticketFk FROM ticket t JOIN ticketLog tl ON tl.originFk = t.id LEFT JOIN ticketWeekly tw ON tw.ticketFk =t.id - WHERE t.shipped BETWEEN '2000-01-01' AND '2000-12-31' + WHERE t.shipped BETWEEN '2000-01-01' AND '2000-12-31' AND t.isDeleted AND tw.ticketFk IS NULL GROUP BY t.id - ) sub ON sub.ids = tl.id - WHERE tl.creationDate <= util.VN_CURDATE() - INTERVAL 60 DAY; + ) sub ON sub.ids = tl.id + WHERE tl.creationDate <= vDateShort; DELETE t FROM ticket t From 9910ae5c643b51369d5e7b0036046f4f2c3fca6d Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 11 Mar 2024 12:12:02 +0100 Subject: [PATCH 6/6] fix: refs #6610 quitar variable --- db/routines/vn/procedures/clean.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/clean.sql b/db/routines/vn/procedures/clean.sql index 66164d894..cee64d772 100644 --- a/db/routines/vn/procedures/clean.sql +++ b/db/routines/vn/procedures/clean.sql @@ -186,7 +186,7 @@ BEGIN SELECT DISTINCT tl.originFk ticketFk FROM ticketLog tl JOIN ( - SELECT MAX(tl.id)ids, tw.ticketFk + SELECT MAX(tl.id)ids FROM ticket t JOIN ticketLog tl ON tl.originFk = t.id LEFT JOIN ticketWeekly tw ON tw.ticketFk =t.id