From 6b9c8300fb3509e7f7c5fd89b354488eefb3a5b6 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 3 Feb 2025 12:41:56 +0100 Subject: [PATCH] feat: refs #7412 notificationMisAllocation --- db/dump/fixtures.before.sql | 6 ++++-- db/versions/11430-salmonRaphis/00-firstScript.sql | 5 +++++ .../misallocation-warehouse/assets/css/import.js | 11 +++++++++++ .../email/misallocation-warehouse/locale/en.yml | 3 +++ .../email/misallocation-warehouse/locale/es.yml | 3 +++ .../email/misallocation-warehouse/locale/fr.yml | 3 +++ .../email/misallocation-warehouse/locale/pt.yml | 3 +++ .../misallocation-warehouse.html | 9 +++++++++ .../misallocation-warehouse.js | 15 +++++++++++++++ 9 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 db/versions/11430-salmonRaphis/00-firstScript.sql create mode 100644 print/templates/email/misallocation-warehouse/assets/css/import.js create mode 100644 print/templates/email/misallocation-warehouse/locale/en.yml create mode 100644 print/templates/email/misallocation-warehouse/locale/es.yml create mode 100644 print/templates/email/misallocation-warehouse/locale/fr.yml create mode 100644 print/templates/email/misallocation-warehouse/locale/pt.yml create mode 100644 print/templates/email/misallocation-warehouse/misallocation-warehouse.html create mode 100755 print/templates/email/misallocation-warehouse/misallocation-warehouse.js diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index c08938f043..afcacbcc4d 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -2926,7 +2926,8 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`) (7, 'zone-included','An email to notify zoneCollisions'), (8, 'backup-printer-selected','A backup printer has been selected'), (9, 'mrw-deadline','The MRW deadline has passed'), - (10,'invoice-ticket-closure','Tickets not invoiced during the nightly closure ticket process'); + (10,'invoice-ticket-closure','Tickets not invoiced during the nightly closure ticket process'), + (11,'misallocation-warehouse','Misallocation of items in the warehouse.'); TRUNCATE `util`.`notificationAcl`; INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`) @@ -2940,7 +2941,8 @@ INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`) (6, 9), (7, 9), (8, 66), - (9, 56); + (9, 56), + (11, 9); TRUNCATE `util`.`notificationQueue`; INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`) diff --git a/db/versions/11430-salmonRaphis/00-firstScript.sql b/db/versions/11430-salmonRaphis/00-firstScript.sql new file mode 100644 index 0000000000..65f8fa43b1 --- /dev/null +++ b/db/versions/11430-salmonRaphis/00-firstScript.sql @@ -0,0 +1,5 @@ + + +INSERT IGNORE INTO util.notification + SET name = 'misallocation-warehouse', + description = 'Misallocation in warehouse'; diff --git a/print/templates/email/misallocation-warehouse/assets/css/import.js b/print/templates/email/misallocation-warehouse/assets/css/import.js new file mode 100644 index 0000000000..4b4bb70869 --- /dev/null +++ b/print/templates/email/misallocation-warehouse/assets/css/import.js @@ -0,0 +1,11 @@ +const Stylesheet = require(`vn-print/core/stylesheet`); + +const path = require('path'); +const vnPrintPath = path.resolve('print'); + +module.exports = new Stylesheet([ + `${vnPrintPath}/common/css/spacing.css`, + `${vnPrintPath}/common/css/misc.css`, + `${vnPrintPath}/common/css/layout.css`, + `${vnPrintPath}/common/css/email.css`]) + .mergeStyles(); diff --git a/print/templates/email/misallocation-warehouse/locale/en.yml b/print/templates/email/misallocation-warehouse/locale/en.yml new file mode 100644 index 0000000000..b16d9bd50a --- /dev/null +++ b/print/templates/email/misallocation-warehouse/locale/en.yml @@ -0,0 +1,3 @@ +subject: Misallocation of articles +title: Misallocation of articles +body: Misallocated articles have been placed in the warehouse that do not correspond to the entry location. diff --git a/print/templates/email/misallocation-warehouse/locale/es.yml b/print/templates/email/misallocation-warehouse/locale/es.yml new file mode 100644 index 0000000000..fbb1c74f16 --- /dev/null +++ b/print/templates/email/misallocation-warehouse/locale/es.yml @@ -0,0 +1,3 @@ +subject: Artículos mal ubicados +title: Artículos mal ubicados +body: Artículos mal ubicados han sido colocados en el almacén que no corresponden a la ubicación de la entrada. diff --git a/print/templates/email/misallocation-warehouse/locale/fr.yml b/print/templates/email/misallocation-warehouse/locale/fr.yml new file mode 100644 index 0000000000..0c8f155d6b --- /dev/null +++ b/print/templates/email/misallocation-warehouse/locale/fr.yml @@ -0,0 +1,3 @@ +subject: Artículos mal placés +title: Artículos mal placés +body: Artículos mal placés ont été stockés dans l’entrepôt qui ne correspond pas à l’emplacement de l’entrée. diff --git a/print/templates/email/misallocation-warehouse/locale/pt.yml b/print/templates/email/misallocation-warehouse/locale/pt.yml new file mode 100644 index 0000000000..129960ba69 --- /dev/null +++ b/print/templates/email/misallocation-warehouse/locale/pt.yml @@ -0,0 +1,3 @@ +subject: Artículos mal colocados +title: Artículos mal colocados +body: Artículos mal colocados foram armazenados no armazém que não corresponde à localização da entrada. diff --git a/print/templates/email/misallocation-warehouse/misallocation-warehouse.html b/print/templates/email/misallocation-warehouse/misallocation-warehouse.html new file mode 100644 index 0000000000..ad68ae0b63 --- /dev/null +++ b/print/templates/email/misallocation-warehouse/misallocation-warehouse.html @@ -0,0 +1,9 @@ + +
+
+

{{ $t('title') }}

+

{{$t('body')}}

+

{{action}}

+
+
+
diff --git a/print/templates/email/misallocation-warehouse/misallocation-warehouse.js b/print/templates/email/misallocation-warehouse/misallocation-warehouse.js new file mode 100755 index 0000000000..f61cef8192 --- /dev/null +++ b/print/templates/email/misallocation-warehouse/misallocation-warehouse.js @@ -0,0 +1,15 @@ +const Component = require(`vn-print/core/component`); +const emailBody = new Component('email-body'); + +module.exports = { + name: 'misallocation-warehouse', + components: { + 'email-body': emailBody.build(), + }, + props: { + action: { + type: String, + required: true + } + } +};