From bca22e8ad3ce93392f5701cb347bdf9a772fed90 Mon Sep 17 00:00:00 2001 From: carlossa Date: Sun, 20 Oct 2024 15:17:17 +0200 Subject: [PATCH 01/12] fix: refs #6389 saleMonitor filter --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 927f49999..0fa2e60e5 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -194,6 +194,7 @@ module.exports = Self => { u.name userName, c.salesPersonFk, c.credit, + pm.name payMethod, z.hour zoneLanding, z.name zoneName, z.id zoneFk, @@ -211,6 +212,7 @@ module.exports = Self => { LEFT JOIN ticketState ts ON ts.ticketFk = t.id LEFT JOIN state st ON st.id = ts.stateFk LEFT JOIN client c ON c.id = t.clientFk + LEFT JOIN payMethod pm ON pm.id = c.payMethodFk LEFT JOIN worker wk ON wk.id = c.salesPersonFk LEFT JOIN account.user u ON u.id = wk.id LEFT JOIN ( From dfdd8f28d41783e399123c60c6a1e9cbf8d268bd Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 23 Oct 2024 12:23:31 +0200 Subject: [PATCH 02/12] fix: refs #6389 filter --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 0fa2e60e5..9bfb69b65 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -199,6 +199,8 @@ module.exports = Self => { z.name zoneName, z.id zoneFk, st.classColor, + d.id departmentFk, + d.name department, TIME_FORMAT(t.shipped, '%H:%i') preparationHour, TIME_FORMAT(z.hour, '%H:%i') theoreticalhour, TIME_FORMAT(zed.etc, '%H:%i') practicalHour @@ -214,6 +216,8 @@ module.exports = Self => { LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN payMethod pm ON pm.id = c.payMethodFk LEFT JOIN worker wk ON wk.id = c.salesPersonFk + LEFT JOIN workerDepartment wd ON wd.workerFk = wk.id + LEFT JOIN department d ON d.id = wd.departmentFk LEFT JOIN account.user u ON u.id = wk.id LEFT JOIN ( SELECT zoneFk, From 99bec3e7fe8d5179d5f8ba8ca8d61c2b0f9435cb Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 23 Oct 2024 14:58:20 +0200 Subject: [PATCH 03/12] fix: refs #6389 salesFilter --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 9bfb69b65..5a0ea8d9d 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -169,7 +169,7 @@ module.exports = Self => { stmt = new ParameterizedSQL(` CREATE OR REPLACE TEMPORARY TABLE tmp.filter (PRIMARY KEY (id)) - ENGINE = MEMORY + ENGINE = InnoDB SELECT t.id, t.shipped, CAST(DATE(t.shipped) AS CHAR) shippedDate, @@ -201,6 +201,11 @@ module.exports = Self => { st.classColor, d.id departmentFk, d.name department, + (SELECT GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk SEPARATOR ',') + FROM sale s + JOIN item i ON i.id = s.itemFk + WHERE s.ticketFk = t.id + ) AS packing, TIME_FORMAT(t.shipped, '%H:%i') preparationHour, TIME_FORMAT(z.hour, '%H:%i') theoreticalhour, TIME_FORMAT(zed.etc, '%H:%i') practicalHour From 55483f8e6ba8ef2293ecd59ab3ae370a0243c5ba Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 28 Oct 2024 09:01:10 +0100 Subject: [PATCH 04/12] fix: refs #6389 packing --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 5a0ea8d9d..30df9c0cc 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -88,6 +88,11 @@ module.exports = Self => { arg: 'alertLevel', type: 'number', description: `The alert level of the tickets` + }, + { + arg: 'packing', + type: 'string', + description: `The packing of the items` } ], returns: { @@ -155,6 +160,9 @@ module.exports = Self => { case 'clientFk': param = `t.${param}`; return {[param]: value}; + case 'packing': + param = `i.${param}`; + return {[param]: value}; } }); From 424a0c80794f622cf6e481116a3db2688582dd58 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 3 Dec 2024 12:25:39 +0100 Subject: [PATCH 05/12] fix: refs #6389 packing --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 5eba78887..acd5635f6 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -161,8 +161,7 @@ module.exports = Self => { param = `t.${param}`; return {[param]: value}; case 'packing': - param = `i.${param}`; - return {[param]: value}; + return {'packing': value}; } }); From 123c0db1267763302c808aa9f44f60593d69c7b6 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 4 Dec 2024 11:58:17 +0100 Subject: [PATCH 06/12] feat: modified data to be equal as the updated back --- db/dump/.dump/data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/dump/.dump/data.sql b/db/dump/.dump/data.sql index 4700d0066..a1d9a44a7 100644 --- a/db/dump/.dump/data.sql +++ b/db/dump/.dump/data.sql @@ -2110,7 +2110,7 @@ INSERT INTO `ACL` VALUES (746,'Claim','getSummary','READ','ALLOW','ROLE','claimV INSERT INTO `ACL` VALUES (747,'CplusRectificationType','*','READ','ALLOW','ROLE','administrative',NULL); INSERT INTO `ACL` VALUES (748,'SiiTypeInvoiceOut','*','READ','ALLOW','ROLE','salesPerson',NULL); INSERT INTO `ACL` VALUES (749,'InvoiceCorrectionType','*','READ','ALLOW','ROLE','salesPerson',NULL); -INSERT INTO `ACL` VALUES (750,'InvoiceOut','transferInvoice','WRITE','ALLOW','ROLE','administrative',NULL); +INSERT INTO `ACL` VALUES (750,'InvoiceOut','transfer','WRITE','ALLOW','ROLE','administrative',NULL); INSERT INTO `ACL` VALUES (751,'Application','executeProc','*','ALLOW','ROLE','employee',NULL); INSERT INTO `ACL` VALUES (752,'Application','executeFunc','*','ALLOW','ROLE','employee',NULL); INSERT INTO `ACL` VALUES (753,'NotificationSubscription','getList','READ','ALLOW','ROLE','employee',NULL); From fad6f33b7c981536f23ce4d85cd397ee6c61e8c2 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 4 Dec 2024 12:33:17 +0100 Subject: [PATCH 07/12] fix: refs #7031 remove check --- db/versions/11376-pinkBamboo/00-firstScript.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 db/versions/11376-pinkBamboo/00-firstScript.sql diff --git a/db/versions/11376-pinkBamboo/00-firstScript.sql b/db/versions/11376-pinkBamboo/00-firstScript.sql new file mode 100644 index 000000000..607a22b4d --- /dev/null +++ b/db/versions/11376-pinkBamboo/00-firstScript.sql @@ -0,0 +1,2 @@ +ALTER TABLE `zone` MODIFY COLUMN `price` DECIMAL(10,2) NOT NULL DEFAULT 0.00 CHECK (`price` > 0); + From 483966501a2b6e46ade7e13d79c334df1fa9d565 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 5 Dec 2024 08:31:09 +0100 Subject: [PATCH 08/12] fix: refs #7031 fix vnPrice --- db/versions/11376-pinkBamboo/00-firstScript.sql | 2 +- loopback/locale/en.json | 7 ++++--- loopback/locale/es.json | 10 +++++----- modules/zone/back/models/zone.js | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/db/versions/11376-pinkBamboo/00-firstScript.sql b/db/versions/11376-pinkBamboo/00-firstScript.sql index 607a22b4d..0c1e71a2f 100644 --- a/db/versions/11376-pinkBamboo/00-firstScript.sql +++ b/db/versions/11376-pinkBamboo/00-firstScript.sql @@ -1,2 +1,2 @@ -ALTER TABLE `zone` MODIFY COLUMN `price` DECIMAL(10,2) NOT NULL DEFAULT 0.00 CHECK (`price` > 0); +ALTER TABLE vn.`zone` MODIFY COLUMN `price` DECIMAL(10,2); diff --git a/loopback/locale/en.json b/loopback/locale/en.json index ff0281d4a..af07b29fa 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -246,6 +246,7 @@ "ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}", "The raid information is not correct": "The raid information is not correct", "Payment method is required": "Payment method is required", - "Sales already moved": "Sales already moved", - "There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first" -} + "Sales already moved": "Sales already moved", + "There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first", + "Price cannot be blank": "Price cannot be blank" +} \ No newline at end of file diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 1eb953d89..37572de03 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -388,8 +388,8 @@ "You do not have permission to modify the booked field": "No tienes permisos para modificar el campo contabilizada", "ticketLostExpedition": "El ticket [{{ticketId}}]({{{ticketUrl}}}) tiene la siguiente expedición perdida:{{ expeditionId }}", "The web user's email already exists": "El correo del usuario web ya existe", - "Sales already moved": "Ya han sido transferidas", - "The raid information is not correct": "La información de la redada no es correcta", - "There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero" -} - + "Sales already moved": "Ya han sido transferidas", + "The raid information is not correct": "La información de la redada no es correcta", + "There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero", + "Price cannot be blank": "Price cannot be blank" +} \ No newline at end of file diff --git a/modules/zone/back/models/zone.js b/modules/zone/back/models/zone.js index 6d5a6cdca..7b5cb4301 100644 --- a/modules/zone/back/models/zone.js +++ b/modules/zone/back/models/zone.js @@ -14,4 +14,18 @@ module.exports = Self => { Self.validatesPresenceOf('agencyModeFk', { message: `Agency cannot be blank` }); + + Self.validatesPresenceOf('price', { + message: 'Price cannot be blank' + }); + Self.validateAsync('price', priceIsValid, { + message: 'Price must be greater than 0' + }); + + async function priceIsValid(err, done) { + if (this.price <= 0) + err(); + + done(); + } }; From 34da78e1ba11e89dc613952519b55b10f4d7cd7f Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 11 Dec 2024 09:58:51 +0100 Subject: [PATCH 09/12] fix: refs #6389 back --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 44eafc8c8..6c98f6cd7 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -166,7 +166,7 @@ module.exports = Self => { param = `t.${param}`; return {[param]: value}; case 'packing': - return {'packing': value}; + return {'i.itemPackingTypeFk': value}; } }); From 093fdb6cb328aadaf1e3b6d20d4392f64f0db483 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 11 Dec 2024 11:50:16 +0100 Subject: [PATCH 10/12] fix: refs #6389 back --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 6c98f6cd7..95713f9fb 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -165,8 +165,6 @@ module.exports = Self => { case 'clientFk': param = `t.${param}`; return {[param]: value}; - case 'packing': - return {'i.itemPackingTypeFk': value}; } }); @@ -380,6 +378,7 @@ module.exports = Self => { } case 'agencyModeFk': case 'warehouseFk': + case 'packing': case 'countryFk': param = `f.${param}`; return {[param]: value}; From aba2bf60828eec96019c90d728c259b687677fb3 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 12 Dec 2024 08:12:16 +0100 Subject: [PATCH 11/12] fix: refs #8251 add eng template --- .../incoterms-authorization/locale/en.yml | 6 +++ .../balance-compensation/locale/en.yml | 16 ++++++++ .../incoterms-authorization/locale/en.yml | 39 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 print/templates/email/incoterms-authorization/locale/en.yml create mode 100644 print/templates/reports/balance-compensation/locale/en.yml create mode 100644 print/templates/reports/incoterms-authorization/locale/en.yml diff --git a/print/templates/email/incoterms-authorization/locale/en.yml b/print/templates/email/incoterms-authorization/locale/en.yml new file mode 100644 index 000000000..7e1402575 --- /dev/null +++ b/print/templates/email/incoterms-authorization/locale/en.yml @@ -0,0 +1,6 @@ +subject: Incoterms Authorization +title: Incoterms Authorization +description: + dear: Dear customer + instructions: Please find attached the Incoterms authorization form, which you must complete and sign. + conclusion: Thank you for your attention! diff --git a/print/templates/reports/balance-compensation/locale/en.yml b/print/templates/reports/balance-compensation/locale/en.yml new file mode 100644 index 000000000..824127482 --- /dev/null +++ b/print/templates/reports/balance-compensation/locale/en.yml @@ -0,0 +1,16 @@ +reportName: balance-compensation +Place: Algemesí, on +Compensation: Compensation of debtor and creditor balances +In one hand: On one hand +CIF: with CIF +NIF: with NIF +Home: and address located at +In other hand: On the other hand +Sr: Mr./Ms. +Agree: Agree +Date: On the date of +Compensate: the balance of has been compensated +From client: from the client/supplier +Against the balance of: against the balance of +Reception: Please confirm receipt of this compensation at the email +Greetings: Best regards, diff --git a/print/templates/reports/incoterms-authorization/locale/en.yml b/print/templates/reports/incoterms-authorization/locale/en.yml new file mode 100644 index 000000000..eb6a8a513 --- /dev/null +++ b/print/templates/reports/incoterms-authorization/locale/en.yml @@ -0,0 +1,39 @@ +reportName: autorization-incoterms +description: '{socialName} a duly constituted and responsible company limited +and registered under corporate law {country} and here represented by {socialName}, with address in {address}, +CIF {fiscalID}. Hereinafter referred to as {name}.' +issued: 'In {0}, on {1} of {2} of {3}' +client: 'Customer {0}' +declaration: '{socialName} hereby declares that:' +declarations: + - 'All purchases made by {socialName} with {companyName} They are delivered according to the conditions defined in the Incoterm.' + - '{socialName} recognizes that it is important for {companyName} have +proof of intra-community delivery of the goods to {destinationCountry} to +be able to invoice with 0% VAT.' + - 'Therefore, by signing this agreement, {socialName} declares that all goods +purchased from {companyName} will be delivered to {destinationCountry}.' + - 'Besides, {socialName} shall, at the first request of {companyName}, +provide proof that all products purchased from {companyName} have +been delivered in {destinationCountry}.' + - 'In addition to the above, {companyName} will provide to {socialName} +a monthly summary that includes all bills (and corresponding deliveries). +{socialName} will sign and return the monthly summary to {companyName}, +S.L. within 5 days of receiving the summary.' +signer: + representative: Representative + representativeRole: Position of the representative + signed: Date of signature +manager: Manager +months: + - 'January' + - 'February' + - 'March' + - 'April' + - 'May' + - 'June' + - 'July' + - 'August' + - 'September' + - 'October' + - 'November' + - 'December' From c8f26bbbab67cc82117baa7846a4bf5c2ef1417d Mon Sep 17 00:00:00 2001 From: Jtubau Date: Thu, 12 Dec 2024 08:42:10 +0100 Subject: [PATCH 12/12] refactor: refs #8266 changed expedition item name --- modules/ticket/back/methods/expedition/filter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/expedition/filter.js b/modules/ticket/back/methods/expedition/filter.js index 43be14349..bd2012668 100644 --- a/modules/ticket/back/methods/expedition/filter.js +++ b/modules/ticket/back/methods/expedition/filter.js @@ -49,7 +49,8 @@ module.exports = Self => { es.workerFk expeditionScanWorkerFk, su.name scannerUserName, es.scanned, - est.description state + est.description state, + de.longName FROM vn.expedition e LEFT JOIN vn.expeditionStateType est ON est.id = e.stateTypeFk INNER JOIN vn.item i1 ON i1.id = e.freightItemFk @@ -59,6 +60,7 @@ module.exports = Self => { LEFT JOIN account.user u ON u.id = e.workerFk LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id LEFT JOIN account.user su ON su.id = es.workerFk + LEFT JOIN dipole.expedition_PrintOut de ON de.expeditionFk = e.id ) e `); stmt.merge(conn.makeWhere(filter.where));