From da13f0811cf793b115bdd7bc3180162592391f79 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 11 Jul 2023 09:59:11 +0200 Subject: [PATCH] refs 5887 cambiado drop y create por create or replace --- modules/client/front/credit-management/index.html | 2 +- modules/client/front/summary/index.html | 4 ++-- modules/ticket/back/methods/ticket/invoiceTickets.js | 3 +-- .../back/methods/ticket/specs/canBeInvoiced.spec.js | 12 ++++-------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/modules/client/front/credit-management/index.html b/modules/client/front/credit-management/index.html index b9064ff69d..f66b988f5d 100644 --- a/modules/client/front/credit-management/index.html +++ b/modules/client/front/credit-management/index.html @@ -68,7 +68,7 @@ {{::clientInforma.rating}} - {{::clientInforma.recommendedCredit | currency: 'EUR': 2}} + {{::clientInforma.recommendedCredit | currency: 'EUR'}} diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 0a15efcd1c..15a55ec8c9 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -270,7 +270,7 @@ info="Invoices minus payments plus orders not yet invoiced"> @@ -297,7 +297,7 @@ info="Value from 1 to 20. The higher the better value"> + value="{{$ctrl.summary.recommendedCredit | currency: 'EUR'}}"> diff --git a/modules/ticket/back/methods/ticket/invoiceTickets.js b/modules/ticket/back/methods/ticket/invoiceTickets.js index 780e9eb578..ca1bf15fb6 100644 --- a/modules/ticket/back/methods/ticket/invoiceTickets.js +++ b/modules/ticket/back/methods/ticket/invoiceTickets.js @@ -88,8 +88,7 @@ module.exports = function(Self) { const models = Self.app.models; await models.Ticket.rawSql(` - DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice; - CREATE TEMPORARY TABLE tmp.ticketToInvoice + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketToInvoice (PRIMARY KEY (id)) ENGINE = MEMORY SELECT id diff --git a/modules/ticket/back/methods/ticket/specs/canBeInvoiced.spec.js b/modules/ticket/back/methods/ticket/specs/canBeInvoiced.spec.js index 42f9b5a9e7..538dbc49f6 100644 --- a/modules/ticket/back/methods/ticket/specs/canBeInvoiced.spec.js +++ b/modules/ticket/back/methods/ticket/specs/canBeInvoiced.spec.js @@ -19,8 +19,7 @@ describe('ticket canBeInvoiced()', () => { await ticket.updateAttribute('refFk', 'T1111111', options); await models.Ticket.rawSql(` - DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice; - CREATE TEMPORARY TABLE tmp.ticketToInvoice + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketToInvoice (PRIMARY KEY (id)) ENGINE = MEMORY SELECT id @@ -52,8 +51,7 @@ describe('ticket canBeInvoiced()', () => { await ticket.updateAttribute('totalWithVat', 0, options); await models.Ticket.rawSql(` - DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice; - CREATE TEMPORARY TABLE tmp.ticketToInvoice + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketToInvoice (PRIMARY KEY (id)) ENGINE = MEMORY SELECT id @@ -89,8 +87,7 @@ describe('ticket canBeInvoiced()', () => { await ticket.updateAttribute('shipped', shipped, options); await models.Ticket.rawSql(` - DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice; - CREATE TEMPORARY TABLE tmp.ticketToInvoice + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketToInvoice (PRIMARY KEY (id)) ENGINE = MEMORY SELECT id @@ -118,8 +115,7 @@ describe('ticket canBeInvoiced()', () => { const options = {transaction: tx}; await models.Ticket.rawSql(` - DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice; - CREATE TEMPORARY TABLE tmp.ticketToInvoice + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketToInvoice (PRIMARY KEY (id)) ENGINE = MEMORY SELECT id