From 0bb142a5d99e46426327d0e0c9fe26f6f2f78cfe Mon Sep 17 00:00:00 2001 From: joan Date: Sat, 4 Jun 2022 12:25:05 +0200 Subject: [PATCH 1/7] Removed rmdir --- back/methods/edi/updateData.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index 33ad76e6db..d280710827 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -95,8 +95,6 @@ module.exports = Self => { zip.extractAllTo(paths.tempDir, false); await dumpData({file, entries, paths}); - - await fs.rmdir(paths.tempDir, {recursive: true}); }); } From 5918ddce3c825c7332776e4960597c0bbba2a4cc Mon Sep 17 00:00:00 2001 From: joan Date: Sat, 4 Jun 2022 12:45:02 +0200 Subject: [PATCH 2/7] Fix table cleaning --- back/methods/edi/updateData.js | 51 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index d280710827..c4f7ef869c 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -102,6 +102,31 @@ module.exports = Self => { const toTable = file.toTable; const baseName = file.fileName; + const firstEntry = entries[0]; + const entryName = firstEntry.entryName; + const startIndex = (entryName.length - 10); + const endIndex = (entryName.length - 4); + const dateString = entryName.substring(startIndex, endIndex); + + const lastUpdated = new Date(); + + let updated = null; + if (file.updated) { + updated = new Date(file.updated); + updated.setHours(0, 0, 0, 0); + } + + // Format string date to a date object + lastUpdated.setFullYear(`20${dateString.substring(4, 6)}`); + lastUpdated.setMonth(parseInt(dateString.substring(2, 4)) - 1); + lastUpdated.setDate(dateString.substring(0, 2)); + lastUpdated.setHours(0, 0, 0, 0); + + if (updated && lastUpdated <= updated) { + console.debug(`Table ${toTable} already updated, skipping...`); + return; + } + const tx = await Self.beginTransaction({}); try { @@ -112,31 +137,7 @@ module.exports = Self => { for (const zipEntry of entries) { const entryName = zipEntry.entryName; - console.log(`Reading file ${entryName}...`); - - const startIndex = (entryName.length - 10); - const endIndex = (entryName.length - 4); - const dateString = entryName.substring(startIndex, endIndex); - const lastUpdated = new Date(); - - // Format string date to a date object - let updated = null; - if (file.updated) { - updated = new Date(file.updated); - updated.setHours(0, 0, 0, 0); - } - - lastUpdated.setFullYear(`20${dateString.substring(4, 6)}`); - lastUpdated.setMonth(parseInt(dateString.substring(2, 4)) - 1); - lastUpdated.setDate(dateString.substring(0, 2)); - lastUpdated.setHours(0, 0, 0, 0); - - if (updated && lastUpdated <= updated) { - console.debug(`Table ${toTable} already updated, skipping...`); - continue; - } - - console.log('Dumping data...'); + console.log(`Dumping data from file ${entryName}...`); const templatePath = path.join(__dirname, `./sql/${toTable}.sql`); const sqlTemplate = fs.readFileSync(templatePath, 'utf8'); From 70632ddc7c9947739f87059d438b71d83725b4e1 Mon Sep 17 00:00:00 2001 From: joan Date: Sat, 4 Jun 2022 12:58:58 +0200 Subject: [PATCH 3/7] Clean --- back/methods/edi/updateData.js | 1 + 1 file changed, 1 insertion(+) diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index c4f7ef869c..abd1c7a778 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -24,6 +24,7 @@ module.exports = Self => { // Temporary file clean await fs.rmdir(`${tempPath}/*`, {recursive: true}); + fs.emptyDirSync(`${tempPath}`); const [ftpConfig] = await Self.rawSql('SELECT host, user, password FROM edi.ftpConfig'); console.debug(`Openning FTP connection to ${ftpConfig.host}...\n`); From 504fb9acea4f0a0e76449bdc77ddbb89b14286ee Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sun, 19 Jun 2022 13:17:48 +0200 Subject: [PATCH 4/7] docker-compose fixes --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 1d80a4b62d..4fc5dc8117 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,6 +32,7 @@ services: - /mnt/appdata/pdfs:/var/lib/salix/pdfs - /mnt/appdata/dms:/var/lib/salix/dms - /mnt/appdata/image:/var/lib/salix/image + - /mnt/appdata/vn-access:/var/lib/salix/vn-access deploy: replicas: ${BACK_REPLICAS:?} placement: From 4118f52a2feb4e7df9a14fadc194aa0ffb7916c6 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 20 Jun 2022 10:04:00 +0200 Subject: [PATCH 5/7] Force master update --- print/methods/closure/closure.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/print/methods/closure/closure.js b/print/methods/closure/closure.js index 2b58205e38..10d707b10e 100644 --- a/print/methods/closure/closure.js +++ b/print/methods/closure/closure.js @@ -136,7 +136,8 @@ module.exports = { const body = `No se ha podido enviar el albarán ${ticket.id} al cliente ${ticket.clientFk} - ${ticket.clientName} - porque la dirección de email "${ticket.recipient}" no es correcta o no está disponible.

+ porque la dirección de email "${ticket.recipient}" no es correcta + o no está disponible.

Para evitar que se repita este error, se ha eliminado la dirección de email de la ficha del cliente. Actualiza la dirección de email con una correcta.`; From 16d677528a52b1b03513146def65c5328b58dc00 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 21 Jun 2022 12:18:33 +0200 Subject: [PATCH 6/7] FIX: Sort by id as last field --- modules/invoiceOut/front/main/index.html | 2 +- modules/ticket/front/weekly/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/invoiceOut/front/main/index.html b/modules/invoiceOut/front/main/index.html index 7f3e67f35b..ab3fce9ea7 100644 --- a/modules/invoiceOut/front/main/index.html +++ b/modules/invoiceOut/front/main/index.html @@ -2,7 +2,7 @@ vn-id="model" url="InvoiceOuts/filter" limit="20" - order="issued DESC"> + order="issued DESC, id DESC"> From e7bf88c7039ce759d6c66d3cc9bb502ae1a03f77 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 21 Jun 2022 14:26:34 +0200 Subject: [PATCH 7/7] Fix order --- modules/ticket/front/weekly/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/weekly/index.html b/modules/ticket/front/weekly/index.html index be7ac6b74c..3c739d5f97 100644 --- a/modules/ticket/front/weekly/index.html +++ b/modules/ticket/front/weekly/index.html @@ -4,7 +4,7 @@ filter="::$ctrl.filter" limit="20" data="weeklies" - order="ticketFk, id DESC" + order="weekDay, ticketFk" primary-key="ticketFk" auto-load="true">