From 6586595976092b94a9190cb4435d06c1e4f141f5 Mon Sep 17 00:00:00 2001
From: joan
Date: Thu, 19 May 2022 07:31:00 +0200
Subject: [PATCH 1/8] feat(closure): send incoterms authorization
---
db/changes/10470-family/00-sample.sql | 7 +++
loopback/locale/es.json | 4 +-
print/methods/closure/closure.js | 20 +++++++
.../assets/css/import.js | 8 +++
.../incoterms-authorization/attachments.json | 6 ++
.../incoterms-authorization.html | 56 ++++++++++++++++++
.../incoterms-authorization.js | 23 +++++++
.../incoterms-authorization/locale/es.yml | 5 ++
.../assets/css/import.js | 0
.../assets/css/style.css | 0
.../assets/images/signature.png | Bin
.../incoterms-authorization.html} | 0
.../incoterms-authorization.js} | 0
.../locale/es.yml | 0
.../sql/client.sql | 0
.../sql/ticket.sql | 0
16 files changed, 128 insertions(+), 1 deletion(-)
create mode 100644 db/changes/10470-family/00-sample.sql
create mode 100644 print/templates/email/incoterms-authorization/assets/css/import.js
create mode 100644 print/templates/email/incoterms-authorization/attachments.json
create mode 100644 print/templates/email/incoterms-authorization/incoterms-authorization.html
create mode 100755 print/templates/email/incoterms-authorization/incoterms-authorization.js
create mode 100644 print/templates/email/incoterms-authorization/locale/es.yml
rename print/templates/reports/{cmr-authorization => incoterms-authorization}/assets/css/import.js (100%)
rename print/templates/reports/{cmr-authorization => incoterms-authorization}/assets/css/style.css (100%)
rename print/templates/reports/{cmr-authorization => incoterms-authorization}/assets/images/signature.png (100%)
rename print/templates/reports/{cmr-authorization/cmr-authorization.html => incoterms-authorization/incoterms-authorization.html} (100%)
rename print/templates/reports/{cmr-authorization/cmr-authorization.js => incoterms-authorization/incoterms-authorization.js} (100%)
rename print/templates/reports/{cmr-authorization => incoterms-authorization}/locale/es.yml (100%)
rename print/templates/reports/{cmr-authorization => incoterms-authorization}/sql/client.sql (100%)
rename print/templates/reports/{cmr-authorization => incoterms-authorization}/sql/ticket.sql (100%)
diff --git a/db/changes/10470-family/00-sample.sql b/db/changes/10470-family/00-sample.sql
new file mode 100644
index 000000000..e0fa7ceac
--- /dev/null
+++ b/db/changes/10470-family/00-sample.sql
@@ -0,0 +1,7 @@
+INSERT INTO `vn`.`sample` (code, description, isVisible, hasCompany, hasPreview, datepickerEnabled)
+VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 0, 1, 0);
+
+
+INSERT INTO vn.expedition (agencyModeFk, ticketFk, isBox, created, isRefund, isPickUp, itemFk, counter, checked,
+ workerFk, externalId, packagingFk, itemPackingTypeFk, hostFk, stateTypeFk)
+VALUES (7, 11, 71, '2022-05-18 11:40:56', false, false, null, 1, 1, 18, null, '94', null, '', 3);
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index a44ba2da8..9e2b8989b 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -224,5 +224,7 @@
"The agency is already assigned to another autonomous": "La agencia ya está asignada a otro autónomo",
"date in the future": "Fecha en el futuro",
"reference duplicated": "Referencia duplicada",
- "This ticket is already a refund": "Este ticket ya es un abono"
+ "This ticket is already a refund": "Este ticket ya es un abono",
+ "isWithoutNegatives": "isWithoutNegatives",
+ "routeFk": "routeFk"
}
\ No newline at end of file
diff --git a/print/methods/closure/closure.js b/print/methods/closure/closure.js
index 2b58205e3..925eb6f67 100644
--- a/print/methods/closure/closure.js
+++ b/print/methods/closure/closure.js
@@ -89,6 +89,26 @@ module.exports = {
const email = new Email('delivery-note-link', args);
await email.send();
}
+
+ // Incoterms authorization
+ const {firstOrder} = await db.findOne(`
+ SELECT COUNT(*) as firstOrder
+ FROM ticket t
+ WHERE t.clientFk = ?
+ AND NOT t.isDeleted
+ `, [ticket.clientFk]);
+
+ if (firstOrder == 1) {
+ const args = Object.assign({
+ ticketId: ticket.id,
+ recipientId: ticket.clientFk,
+ recipient: ticket.recipient,
+ replyTo: ticket.salesPersonEmail
+ }, reqArgs);
+
+ const email = new Email('incoterms-authorization', args);
+ await email.send();
+ }
} catch (error) {
// Domain not found
if (error.responseCode == 450)
diff --git a/print/templates/email/incoterms-authorization/assets/css/import.js b/print/templates/email/incoterms-authorization/assets/css/import.js
new file mode 100644
index 000000000..b44d6bd37
--- /dev/null
+++ b/print/templates/email/incoterms-authorization/assets/css/import.js
@@ -0,0 +1,8 @@
+const Stylesheet = require(`${appPath}/core/stylesheet`);
+
+module.exports = new Stylesheet([
+ `${appPath}/common/css/spacing.css`,
+ `${appPath}/common/css/misc.css`,
+ `${appPath}/common/css/layout.css`,
+ `${appPath}/common/css/email.css`])
+ .mergeStyles();
diff --git a/print/templates/email/incoterms-authorization/attachments.json b/print/templates/email/incoterms-authorization/attachments.json
new file mode 100644
index 000000000..9dfd945db
--- /dev/null
+++ b/print/templates/email/incoterms-authorization/attachments.json
@@ -0,0 +1,6 @@
+[
+ {
+ "filename": "incoterms-authorization.pdf",
+ "component": "incoterms-authorization"
+ }
+]
\ No newline at end of file
diff --git a/print/templates/email/incoterms-authorization/incoterms-authorization.html b/print/templates/email/incoterms-authorization/incoterms-authorization.html
new file mode 100644
index 000000000..e50a40c6d
--- /dev/null
+++ b/print/templates/email/incoterms-authorization/incoterms-authorization.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+ {{ $t('subject') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('title') }}
+ {{$t('description.dear')}},
+ {{$t('description.instructions')}}
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
\ No newline at end of file
diff --git a/print/templates/email/incoterms-authorization/incoterms-authorization.js b/print/templates/email/incoterms-authorization/incoterms-authorization.js
new file mode 100755
index 000000000..dbf2c5bdc
--- /dev/null
+++ b/print/templates/email/incoterms-authorization/incoterms-authorization.js
@@ -0,0 +1,23 @@
+const Component = require(`${appPath}/core/component`);
+const emailHeader = new Component('email-header');
+const emailFooter = new Component('email-footer');
+const attachment = new Component('attachment');
+const attachments = require('./attachments.json');
+
+module.exports = {
+ name: 'incoterms-authorization',
+ data() {
+ return {attachments};
+ },
+ components: {
+ 'email-header': emailHeader.build(),
+ 'email-footer': emailFooter.build(),
+ 'attachment': attachment.build()
+ },
+ props: {
+ ticketId: {
+ type: [Number, String],
+ required: true
+ }
+ }
+};
diff --git a/print/templates/email/incoterms-authorization/locale/es.yml b/print/templates/email/incoterms-authorization/locale/es.yml
new file mode 100644
index 000000000..fe08fb0a8
--- /dev/null
+++ b/print/templates/email/incoterms-authorization/locale/es.yml
@@ -0,0 +1,5 @@
+subject: Orden de recogida
+title: Orden de recogida
+description:
+ dear: Estimado cliente
+ instructions: Aqui tienes tu orden de recogida.
\ No newline at end of file
diff --git a/print/templates/reports/cmr-authorization/assets/css/import.js b/print/templates/reports/incoterms-authorization/assets/css/import.js
similarity index 100%
rename from print/templates/reports/cmr-authorization/assets/css/import.js
rename to print/templates/reports/incoterms-authorization/assets/css/import.js
diff --git a/print/templates/reports/cmr-authorization/assets/css/style.css b/print/templates/reports/incoterms-authorization/assets/css/style.css
similarity index 100%
rename from print/templates/reports/cmr-authorization/assets/css/style.css
rename to print/templates/reports/incoterms-authorization/assets/css/style.css
diff --git a/print/templates/reports/cmr-authorization/assets/images/signature.png b/print/templates/reports/incoterms-authorization/assets/images/signature.png
similarity index 100%
rename from print/templates/reports/cmr-authorization/assets/images/signature.png
rename to print/templates/reports/incoterms-authorization/assets/images/signature.png
diff --git a/print/templates/reports/cmr-authorization/cmr-authorization.html b/print/templates/reports/incoterms-authorization/incoterms-authorization.html
similarity index 100%
rename from print/templates/reports/cmr-authorization/cmr-authorization.html
rename to print/templates/reports/incoterms-authorization/incoterms-authorization.html
diff --git a/print/templates/reports/cmr-authorization/cmr-authorization.js b/print/templates/reports/incoterms-authorization/incoterms-authorization.js
similarity index 100%
rename from print/templates/reports/cmr-authorization/cmr-authorization.js
rename to print/templates/reports/incoterms-authorization/incoterms-authorization.js
diff --git a/print/templates/reports/cmr-authorization/locale/es.yml b/print/templates/reports/incoterms-authorization/locale/es.yml
similarity index 100%
rename from print/templates/reports/cmr-authorization/locale/es.yml
rename to print/templates/reports/incoterms-authorization/locale/es.yml
diff --git a/print/templates/reports/cmr-authorization/sql/client.sql b/print/templates/reports/incoterms-authorization/sql/client.sql
similarity index 100%
rename from print/templates/reports/cmr-authorization/sql/client.sql
rename to print/templates/reports/incoterms-authorization/sql/client.sql
diff --git a/print/templates/reports/cmr-authorization/sql/ticket.sql b/print/templates/reports/incoterms-authorization/sql/ticket.sql
similarity index 100%
rename from print/templates/reports/cmr-authorization/sql/ticket.sql
rename to print/templates/reports/incoterms-authorization/sql/ticket.sql
From a5f3580b175fc174a79a7bd3e4a7bb9ca9f9eec4 Mon Sep 17 00:00:00 2001
From: joan
Date: Thu, 26 May 2022 16:14:10 +0200
Subject: [PATCH 2/8] derp
---
db/changes/10470-family/00-client.sql | 3 +++
.../back/methods/client/updateFiscalData.js | 4 ++++
modules/client/back/models/client-sample.json | 6 +++---
modules/client/back/models/client.json | 3 +++
modules/client/front/fiscal-data/index.html | 8 ++++++++
modules/client/front/fiscal-data/locale/es.yml | 3 ++-
modules/client/front/sample/index/index.html | 6 +++---
modules/client/front/sample/index/index.js | 10 ++--------
print/methods/closure/closeAll.js | 1 +
print/methods/closure/closeByAgency.js | 1 +
print/methods/closure/closeByRoute.js | 1 +
print/methods/closure/closeByTicket.js | 1 +
print/methods/closure/closure.js | 11 +++++++++++
.../email/incoterms-authorization/locale/es.yml | 6 +++---
.../incoterms-authorization.html | 16 ----------------
.../incoterms-authorization.js | 2 +-
16 files changed, 47 insertions(+), 35 deletions(-)
create mode 100644 db/changes/10470-family/00-client.sql
diff --git a/db/changes/10470-family/00-client.sql b/db/changes/10470-family/00-client.sql
new file mode 100644
index 000000000..4a39bbdf9
--- /dev/null
+++ b/db/changes/10470-family/00-client.sql
@@ -0,0 +1,3 @@
+alter table `vn`.`client`
+ add hasIncoterms tinyint(1) default 0 not null comment 'Received incoterms authorization from client';
+
diff --git a/modules/client/back/methods/client/updateFiscalData.js b/modules/client/back/methods/client/updateFiscalData.js
index c2de8f927..b4fbe89aa 100644
--- a/modules/client/back/methods/client/updateFiscalData.js
+++ b/modules/client/back/methods/client/updateFiscalData.js
@@ -95,6 +95,10 @@ module.exports = Self => {
{
arg: 'despiteOfClient',
type: 'number'
+ },
+ {
+ arg: 'hasIncoterms',
+ type: 'boolean'
}
],
returns: {
diff --git a/modules/client/back/models/client-sample.json b/modules/client/back/models/client-sample.json
index 920758217..fc64cd949 100644
--- a/modules/client/back/models/client-sample.json
+++ b/modules/client/back/models/client-sample.json
@@ -32,10 +32,10 @@
"model": "Sample",
"foreignKey": "typeFk"
},
- "worker": {
+ "user": {
"type": "belongsTo",
- "model": "Worker",
- "foreignKey": "workerFk"
+ "model": "Account",
+ "foreignKey": "userFk"
},
"account": {
"type": "belongsTo",
diff --git a/modules/client/back/models/client.json b/modules/client/back/models/client.json
index b9951e8bb..fb59fafec 100644
--- a/modules/client/back/models/client.json
+++ b/modules/client/back/models/client.json
@@ -98,6 +98,9 @@
"hasCoreVnh": {
"type": "boolean"
},
+ "hasIncoterms": {
+ "type": "boolean"
+ },
"isTaxDataChecked":{
"type": "boolean"
},
diff --git a/modules/client/front/fiscal-data/index.html b/modules/client/front/fiscal-data/index.html
index 2249127c5..b3eda2bc0 100644
--- a/modules/client/front/fiscal-data/index.html
+++ b/modules/client/front/fiscal-data/index.html
@@ -185,6 +185,14 @@
vn-acl="administrative">
+
+
+
+
- {{::sample.worker.user.name}}
+ ng-click="workerDescriptor.show($event, sample.user.id)"
+ ng-class="{'link': sample.user}">
+ {{::sample.user.name || 'System' | translate}}
{{::sample.company.code}}
diff --git a/modules/client/front/sample/index/index.js b/modules/client/front/sample/index/index.js
index 132704de0..7aa44c67f 100644
--- a/modules/client/front/sample/index/index.js
+++ b/modules/client/front/sample/index/index.js
@@ -12,15 +12,9 @@ class Controller extends Section {
fields: ['code', 'description']
}
}, {
- relation: 'worker',
+ relation: 'user',
scope: {
- fields: ['userFk'],
- include: {
- relation: 'user',
- scope: {
- fields: ['name']
- }
- }
+ fields: ['id', 'name']
}
}, {
relation: 'company',
diff --git a/print/methods/closure/closeAll.js b/print/methods/closure/closeAll.js
index 7af3676f2..400ca2917 100644
--- a/print/methods/closure/closeAll.js
+++ b/print/methods/closure/closeAll.js
@@ -15,6 +15,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
+ t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,
diff --git a/print/methods/closure/closeByAgency.js b/print/methods/closure/closeByAgency.js
index 7807de23a..12e6b4c53 100644
--- a/print/methods/closure/closeByAgency.js
+++ b/print/methods/closure/closeByAgency.js
@@ -23,6 +23,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
+ t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,
diff --git a/print/methods/closure/closeByRoute.js b/print/methods/closure/closeByRoute.js
index 2c0bfd1eb..32a1688d3 100644
--- a/print/methods/closure/closeByRoute.js
+++ b/print/methods/closure/closeByRoute.js
@@ -17,6 +17,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
+ t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,
diff --git a/print/methods/closure/closeByTicket.js b/print/methods/closure/closeByTicket.js
index c71b3ecd0..f6d97cba3 100644
--- a/print/methods/closure/closeByTicket.js
+++ b/print/methods/closure/closeByTicket.js
@@ -16,6 +16,7 @@ module.exports = async function(request, response, next) {
SELECT
t.id,
t.clientFk,
+ t.companyFk,
c.name clientName,
c.email recipient,
c.salesPersonFk,
diff --git a/print/methods/closure/closure.js b/print/methods/closure/closure.js
index 925eb6f67..92d0c8f24 100644
--- a/print/methods/closure/closure.js
+++ b/print/methods/closure/closure.js
@@ -94,8 +94,10 @@ module.exports = {
const {firstOrder} = await db.findOne(`
SELECT COUNT(*) as firstOrder
FROM ticket t
+ JOIN client c ON c.id = t.clientFk
WHERE t.clientFk = ?
AND NOT t.isDeleted
+ AND c.isVies
`, [ticket.clientFk]);
if (firstOrder == 1) {
@@ -108,6 +110,15 @@ module.exports = {
const email = new Email('incoterms-authorization', args);
await email.send();
+
+ const sample = await db.findOne(
+ `SELECT id
+ FROM sample
+ WHERE code = 'incoterms-authorization'`);
+
+ await db.rawSql(`
+ INSERT INTO clientSample (clientFk, typeFk, companyFk) VALUES(?, ?, ?)
+ `, [ticket.clientFk, sample.id, ticket.companyFk])
}
} catch (error) {
// Domain not found
diff --git a/print/templates/email/incoterms-authorization/locale/es.yml b/print/templates/email/incoterms-authorization/locale/es.yml
index fe08fb0a8..d0aaf9ab4 100644
--- a/print/templates/email/incoterms-authorization/locale/es.yml
+++ b/print/templates/email/incoterms-authorization/locale/es.yml
@@ -1,5 +1,5 @@
-subject: Orden de recogida
-title: Orden de recogida
+subject: Autorización incoterms
+title: Autorización incoterms
description:
dear: Estimado cliente
- instructions: Aqui tienes tu orden de recogida.
\ No newline at end of file
+ instructions: A continuación le adjuntamos la autorización incoterms que deberá entregar rellenada y firmada.
\ No newline at end of file
diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.html b/print/templates/reports/incoterms-authorization/incoterms-authorization.html
index 2d8342a47..9f45331bc 100644
--- a/print/templates/reports/incoterms-authorization/incoterms-authorization.html
+++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.html
@@ -68,22 +68,6 @@
-
diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.js b/print/templates/reports/incoterms-authorization/incoterms-authorization.js
index 1adc75fa6..5132c0442 100755
--- a/print/templates/reports/incoterms-authorization/incoterms-authorization.js
+++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.js
@@ -3,7 +3,7 @@ const reportHeader = new Component('report-header');
const reportFooter = new Component('report-footer');
module.exports = {
- name: 'cmr-authorization',
+ name: 'incoterms-authorization',
async serverPrefetch() {
this.ticket = await this.findOneFromDef('ticket', [this.ticketId]);
if (!this.ticket)
From 0e896160891f775ab73c9b84ccd09f141c8ac338 Mon Sep 17 00:00:00 2001
From: joan
Date: Mon, 13 Jun 2022 11:03:11 +0200
Subject: [PATCH 3/8] incoterms report refactor
---
db/changes/10470-family/00-sample.sql | 2 +-
db/dump/fixtures.sql | 92 +++++++++----------
.../incoterms-authorization.js | 6 +-
.../assets/css/style.css | 9 +-
.../incoterms-authorization.html | 13 +--
.../incoterms-authorization.js | 13 ++-
.../incoterms-authorization/locale/es.yml | 20 ++--
.../incoterms-authorization/locale/fr.yml | 42 +++++++++
.../incoterms-authorization/locale/pt.yml | 42 +++++++++
.../incoterms-authorization/sql/company.sql | 8 ++
.../incoterms-authorization/sql/ticket.sql | 12 ---
11 files changed, 171 insertions(+), 88 deletions(-)
create mode 100644 print/templates/reports/incoterms-authorization/locale/fr.yml
create mode 100644 print/templates/reports/incoterms-authorization/locale/pt.yml
create mode 100644 print/templates/reports/incoterms-authorization/sql/company.sql
delete mode 100644 print/templates/reports/incoterms-authorization/sql/ticket.sql
diff --git a/db/changes/10470-family/00-sample.sql b/db/changes/10470-family/00-sample.sql
index e0fa7ceac..619030013 100644
--- a/db/changes/10470-family/00-sample.sql
+++ b/db/changes/10470-family/00-sample.sql
@@ -1,5 +1,5 @@
INSERT INTO `vn`.`sample` (code, description, isVisible, hasCompany, hasPreview, datepickerEnabled)
-VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 0, 1, 0);
+VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 1, 1, 0);
INSERT INTO vn.expedition (agencyModeFk, ticketFk, isBox, created, isRefund, isPickUp, itemFk, counter, checked,
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 0a27b48b8..08ff96eef 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -309,7 +309,7 @@ INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city
(1112, 'Trash', NULL, 'Garbage man', 'Unknown name', 'New York city, Underground', 'Silla', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, NULL);
INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`)
- SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'SILLA', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, CURDATE(), 1
+ SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'ALGEMESI', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, CURDATE(), 1
FROM `account`.`role` `r`
WHERE `r`.`hasLogin` = 1;
@@ -326,51 +326,51 @@ INSERT INTO `vn`.`clientConfig`(`riskTolerance`, `maxCreditRows`)
INSERT INTO `vn`.`address`(`id`, `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `phone`, `mobile`, `isActive`, `clientFk`, `agencyModeFk`, `longitude`, `latitude`, `isEqualizated`, `isDefaultAddress`)
VALUES
- (1, 'Bruce Wayne', '1007 Mountain Drive, Gotham', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1101, 2, NULL, NULL, 0, 1),
- (2, 'Petter Parker', '20 Ingram Street', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1102, 2, NULL, NULL, 0, 1),
- (3, 'Clark Kent', '344 Clinton Street', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1103, 2, NULL, NULL, 0, 1),
- (4, 'Tony Stark', '10880 Malibu Point', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1104, 2, NULL, NULL, 0, 1),
- (5, 'Max Eisenhardt', 'Unknown Whereabouts', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 1),
- (6, 'DavidCharlesHaller', 'Evil hideout', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 1),
- (7, 'Hank Pym', 'Anthill', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 1),
- (8, 'Charles Xavier', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 1),
- (9, 'Bruce Banner', 'Somewhere in New York', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 1),
- (10, 'Jessica Jones', 'NYCC 2015 Poster', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 1),
- (11, 'Missing', 'The space', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1111, 10, NULL, NULL, 0, 1),
- (12, 'Trash', 'New York city', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1112, 10, NULL, NULL, 0, 1),
- (101, 'Somewhere in Thailand', 'address 01', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (102, 'Somewhere in Poland', 'address 02', 'Silla', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
- (103, 'Somewhere in Japan', 'address 03', 'Silla', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
- (104, 'Somewhere in Spain', 'address 04', 'Silla', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
- (105, 'Somewhere in Potugal', 'address 05', 'Silla', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
- (106, 'Somewhere in UK', 'address 06', 'Silla', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
- (107, 'Somewhere in Valencia', 'address 07', 'Silla', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
- (108, 'Somewhere in Silla', 'address 08', 'Silla', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
- (109, 'Somewhere in London', 'address 09', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (110, 'Somewhere in Algemesi', 'address 10', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (111, 'Somewhere in Carlet', 'address 11', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (112, 'Somewhere in Campanar', 'address 12', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (113, 'Somewhere in Malilla', 'address 13', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (114, 'Somewhere in France', 'address 14', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (115, 'Somewhere in Birmingham', 'address 15', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (116, 'Somewhere in Scotland', 'address 16', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (117, 'Somewhere in nowhere', 'address 17', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (118, 'Somewhere over the rainbow', 'address 18', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (119, 'Somewhere in Alberic', 'address 19', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (120, 'Somewhere in Montortal', 'address 20', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
- (121, 'the bat cave', 'address 21', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1101, 2, NULL, NULL, 0, 0),
- (122, 'NY roofs', 'address 22', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1102, 2, NULL, NULL, 0, 0),
- (123, 'The phone box', 'address 23', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1103, 2, NULL, NULL, 0, 0),
- (124, 'Stark tower Silla', 'address 24', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1104, 2, NULL, NULL, 0, 0),
- (125, 'The plastic cell', 'address 25', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 0),
- (126, 'Many places', 'address 26', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 0),
- (127, 'Your pocket', 'address 27', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 0),
- (128, 'Cerebro', 'address 28', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 0),
- (129, 'Luke Cages Bar', 'address 29', 'Silla', 46460, 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 0),
- (130, 'Non valid address', 'address 30', 'Silla', 46460, 1, 1111111111, 222222222, 0, 1101, 2, NULL, NULL, 0, 0);
+ (1, 'Bruce Wayne', '1007 Mountain Drive, Gotham', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1101, 2, NULL, NULL, 0, 1),
+ (2, 'Petter Parker', '20 Ingram Street', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1102, 2, NULL, NULL, 0, 1),
+ (3, 'Clark Kent', '344 Clinton Street', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1103, 2, NULL, NULL, 0, 1),
+ (4, 'Tony Stark', '10880 Malibu Point', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1104, 2, NULL, NULL, 0, 1),
+ (5, 'Max Eisenhardt', 'Unknown Whereabouts', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 1),
+ (6, 'DavidCharlesHaller', 'Evil hideout', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 1),
+ (7, 'Hank Pym', 'Anthill', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 1),
+ (8, 'Charles Xavier', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 1),
+ (9, 'Bruce Banner', 'Somewhere in New York', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 1),
+ (10, 'Jessica Jones', 'NYCC 2015 Poster', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 1),
+ (11, 'Missing', 'The space', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1111, 10, NULL, NULL, 0, 1),
+ (12, 'Trash', 'New York city', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1112, 10, NULL, NULL, 0, 1),
+ (101, 'Somewhere in Thailand', 'address 01', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (102, 'Somewhere in Poland', 'address 02', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
+ (103, 'Somewhere in Japan', 'address 03', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
+ (104, 'Somewhere in Spain', 'address 04', 'Gotham', 46460, 1, 3333333333, 444444444, 1, 1109, 2, NULL, NULL, 0, 0),
+ (105, 'Somewhere in Potugal', 'address 05', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
+ (106, 'Somewhere in UK', 'address 06', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
+ (107, 'Somewhere in Valencia', 'address 07', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
+ (108, 'Somewhere in Gotham', 'address 08', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0),
+ (109, 'Somewhere in London', 'address 09', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (110, 'Somewhere in Algemesi', 'address 10', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (111, 'Somewhere in Carlet', 'address 11', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (112, 'Somewhere in Campanar', 'address 12', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (113, 'Somewhere in Malilla', 'address 13', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (114, 'Somewhere in France', 'address 14', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (115, 'Somewhere in Birmingham', 'address 15', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (116, 'Somewhere in Scotland', 'address 16', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (117, 'Somewhere in nowhere', 'address 17', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (118, 'Somewhere over the rainbow', 'address 18', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (119, 'Somewhere in Alberic', 'address 19', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (120, 'Somewhere in Montortal', 'address 20', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0),
+ (121, 'the bat cave', 'address 21', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1101, 2, NULL, NULL, 0, 0),
+ (122, 'NY roofs', 'address 22', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1102, 2, NULL, NULL, 0, 0),
+ (123, 'The phone box', 'address 23', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1103, 2, NULL, NULL, 0, 0),
+ (124, 'Stark tower Gotham', 'address 24', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1104, 2, NULL, NULL, 0, 0),
+ (125, 'The plastic cell', 'address 25', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1105, 2, NULL, NULL, 0, 0),
+ (126, 'Many places', 'address 26', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1106, 2, NULL, NULL, 0, 0),
+ (127, 'Your pocket', 'address 27', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1107, 2, NULL, NULL, 0, 0),
+ (128, 'Cerebro', 'address 28', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1108, 2, NULL, NULL, 0, 0),
+ (129, 'Luke Cages Bar', 'address 29', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1110, 2, NULL, NULL, 0, 0),
+ (130, 'Non valid address', 'address 30', 'Gotham', 46460, 1, 1111111111, 222222222, 0, 1101, 2, NULL, NULL, 0, 0);
INSERT INTO `vn`.`address`( `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `isActive`, `clientFk`, `agencyModeFk`, `isDefaultAddress`)
- SELECT name, CONCAT(name, 'Street'), 'SILLA', 46460, 1, 1, id, 2, 1
+ SELECT name, CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, 1, id, 2, 1
FROM `account`.`role` `r`
WHERE `r`.`hasLogin` = 1;
@@ -1328,8 +1328,8 @@ INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `pr
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`, `healthRegister`)
VALUES
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
- (2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, CURDATE(), 1, 'supplier address 2', 'SILLA', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
- (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, CURDATE(), 1, 'supplier address 3', 'SILLA', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
+ (2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
+ (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
VALUES
diff --git a/print/templates/email/incoterms-authorization/incoterms-authorization.js b/print/templates/email/incoterms-authorization/incoterms-authorization.js
index dbf2c5bdc..bac40d331 100755
--- a/print/templates/email/incoterms-authorization/incoterms-authorization.js
+++ b/print/templates/email/incoterms-authorization/incoterms-authorization.js
@@ -15,7 +15,11 @@ module.exports = {
'attachment': attachment.build()
},
props: {
- ticketId: {
+ recipientId: {
+ type: [Number, String],
+ required: true
+ },
+ companyId: {
type: [Number, String],
required: true
}
diff --git a/print/templates/reports/incoterms-authorization/assets/css/style.css b/print/templates/reports/incoterms-authorization/assets/css/style.css
index adfe4b4c9..34545c951 100644
--- a/print/templates/reports/incoterms-authorization/assets/css/style.css
+++ b/print/templates/reports/incoterms-authorization/assets/css/style.css
@@ -2,13 +2,8 @@
font-size: 1.2em
}
-.signature .dummy-signature {
- width: 400px;
- height: 190px;
- display: block;
- content: '';
- overflow: hidden;
- clear:both
+.signature {
+ margin-top: 100px
}
.signature img {
diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.html b/print/templates/reports/incoterms-authorization/incoterms-authorization.html
index 9f45331bc..27cad97b1 100644
--- a/print/templates/reports/incoterms-authorization/incoterms-authorization.html
+++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.html
@@ -23,9 +23,10 @@
@@ -53,13 +54,13 @@
-
{{$t('signature')}}
+
{{ company.name }}
-
Juan Vicente Ferrer Roig
-
Director
+
{{company.manager}}
+
{{$t('manager')}}
{{$t('issued', [
- 'Algemesí',
+ company.city,
issued.getDate(),
$t('months')[issued.getMonth()],
issued.getFullYear()])
diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.js b/print/templates/reports/incoterms-authorization/incoterms-authorization.js
index 5132c0442..656a9d7b0 100755
--- a/print/templates/reports/incoterms-authorization/incoterms-authorization.js
+++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.js
@@ -5,11 +5,10 @@ const reportFooter = new Component('report-footer');
module.exports = {
name: 'incoterms-authorization',
async serverPrefetch() {
- this.ticket = await this.findOneFromDef('ticket', [this.ticketId]);
- if (!this.ticket)
+ this.client = await this.findOneFromDef('client', [this.recipientId]);
+ this.company = await this.findOneFromDef('company', [this.companyId]);
+ if (!this.client)
throw new Error('Something went wrong');
-
- this.client = await this.findOneFromDef('client', [this.ticket.clientFk]);
},
computed: {
issued: function() {
@@ -21,7 +20,11 @@ module.exports = {
'report-footer': reportFooter.build()
},
props: {
- ticketId: {
+ recipientId: {
+ type: [Number, String],
+ required: true
+ },
+ companyId: {
type: [Number, String],
required: true
}
diff --git a/print/templates/reports/incoterms-authorization/locale/es.yml b/print/templates/reports/incoterms-authorization/locale/es.yml
index 37e40202d..67edd4a2a 100644
--- a/print/templates/reports/incoterms-authorization/locale/es.yml
+++ b/print/templates/reports/incoterms-authorization/locale/es.yml
@@ -1,4 +1,4 @@
-reportName: autorizacion-cmr
+reportName: autorizacion-incoterms
description: '{socialName} una sociedad debidamente constituida con responsabilidad limitada
y registrada conforme al derecho de sociedades de {country} y aquí representada por
___________________. {socialName}, con domicilio en {address},
@@ -7,26 +7,26 @@ issued: 'En {0}, a {1} de {2} de {3}'
client: 'Client {0}'
declaration: '{socialName} declara por la presente que:'
declarations:
- - 'Todas las compras realizadas por {socialName} con Verdnatura Levante, S.L. se
-entregan, Ex Works (Incoterms), en el almacén de Verdnatura Levante, S.L. situado en
-{destinationWarehouse}.'
- - '{socialName} reconoce que es importante para Verdnatura Levante, S.L. tener
+ - 'Todas las compras realizadas por {socialName} con {companyName} se
+entregan, Ex Works (Incoterms), en el almacén de {companyName} situado en
+{companyCity}.'
+ - '{socialName} reconoce que es importante para {companyName} tener
comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para
poder facturar con 0% de IVA.'
- 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que
-se compren a Verdnatura Levante, S.L. serán entregados a {destinationCountry}.'
- - 'Además, {socialName} deberá, a primera solicitud de Verdnatura Levante, S.L.,
-proporcionar una prueba de que todos los productos comprados a Verdnatura Levante, S.L. han
+se compren a {companyName} serán entregados a {destinationCountry}.'
+ - 'Además, {socialName} deberá, a primera solicitud de {companyName},
+proporcionar una prueba de que todos los productos comprados a {companyName} han
sido entregados en {destinationCountry}.'
- - 'Además de lo anterior, Verdnatura Levante, S.L. proporcionará a {socialName}
+ - 'Además de lo anterior, {companyName} proporcionará a {socialName}
un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes).
{socialName} firmará y devolverá el resumen mensual a Verdnatura Levante,
S.L. dentro de los 5 días posteriores a la recepción del resumen.'
-signature: Verdnatura Levante, S.L.
signer:
representative: Representante
representativeRole: Cargo del representante
signed: Fecha de firma
+manager: Gerente
months:
- 'Enero'
- 'Febrero'
diff --git a/print/templates/reports/incoterms-authorization/locale/fr.yml b/print/templates/reports/incoterms-authorization/locale/fr.yml
new file mode 100644
index 000000000..67edd4a2a
--- /dev/null
+++ b/print/templates/reports/incoterms-authorization/locale/fr.yml
@@ -0,0 +1,42 @@
+reportName: autorizacion-incoterms
+description: '{socialName} una sociedad debidamente constituida con responsabilidad limitada
+y registrada conforme al derecho de sociedades de {country} y aquí representada por
+___________________. {socialName}, con domicilio en {address},
+CIF {fiscalID}. En adelante denominada {name}.'
+issued: 'En {0}, a {1} de {2} de {3}'
+client: 'Client {0}'
+declaration: '{socialName} declara por la presente que:'
+declarations:
+ - 'Todas las compras realizadas por {socialName} con {companyName} se
+entregan, Ex Works (Incoterms), en el almacén de {companyName} situado en
+{companyCity}.'
+ - '{socialName} reconoce que es importante para {companyName} tener
+comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para
+poder facturar con 0% de IVA.'
+ - 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que
+se compren a {companyName} serán entregados a {destinationCountry}.'
+ - 'Además, {socialName} deberá, a primera solicitud de {companyName},
+proporcionar una prueba de que todos los productos comprados a {companyName} han
+sido entregados en {destinationCountry}.'
+ - 'Además de lo anterior, {companyName} proporcionará a {socialName}
+un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes).
+{socialName} firmará y devolverá el resumen mensual a Verdnatura Levante,
+S.L. dentro de los 5 días posteriores a la recepción del resumen.'
+signer:
+ representative: Representante
+ representativeRole: Cargo del representante
+ signed: Fecha de firma
+manager: Gerente
+months:
+ - 'Enero'
+ - 'Febrero'
+ - 'Marzo'
+ - 'Abril'
+ - 'Mayo'
+ - 'Junio'
+ - 'Julio'
+ - 'Agosto'
+ - 'Septiembre'
+ - 'Octubre'
+ - 'Noviembre'
+ - 'Diciembre'
\ No newline at end of file
diff --git a/print/templates/reports/incoterms-authorization/locale/pt.yml b/print/templates/reports/incoterms-authorization/locale/pt.yml
new file mode 100644
index 000000000..b96668b5a
--- /dev/null
+++ b/print/templates/reports/incoterms-authorization/locale/pt.yml
@@ -0,0 +1,42 @@
+reportName: autorizacion-incoterms
+description: '{socialName} uma empresa devidamente constituída com responsabilidade limitada
+e registrado sob a lei das sociedades de {country} e aqui representado por
+___________________. {socialName}, residente em {address},
+CIF {fiscalID}. Doravante referido como {name}.'
+issued: 'Em {0}, em {1} de {2} de {3}'
+client: 'Cliente {0}'
+declaration: '{socialName} declara que:'
+declarations:
+ - 'Todas as compras feitas por {socialName} com {companyName} são
+entregue, Ex Works (Incoterms), ao armazém da {companyName} localizado em
+{companyCity}.'
+ - '{socialName} reconhece que é importante para {companyName} ter
+prova de entrega intracomunitária das mercadorias para {destinationCountry} para
+poder faturar com 0% de IVA.'
+ - 'Portanto, ao assinar este acordo, {socialName} declara que todos os ativos que
+comprado de {companyName} será entregue em {destinationCountry}.'
+ - 'Além disso, {socialName} deverá, a primeira solicitação de {companyName},
+fornecer prova de que todos os produtos comprados de {companyName} têm
+foi entregue para {destinationCountry}.'
+ - 'Além do acima, {companyName} fornecerá {socialName}
+um resumo mensal incluindo todas as faturas (e entregas correspondentes).
+{socialName} assinará e devolverá o resumo mensal à {companyName},
+em até 5 dias após o recebimento do resumo.'
+signer:
+ representative: Representante
+ representativeRole: Cargo de representante
+ signed: Data de assinatura
+manager: Gerente
+months:
+ - 'Janeiro'
+ - 'Fevereiro'
+ - 'Marchar'
+ - 'abril'
+ - 'Poderia'
+ - 'Junho'
+ - 'Julho'
+ - 'Agosto'
+ - 'Setembro'
+ - 'Outubro'
+ - 'Novembro'
+ - 'Dezembro'
\ No newline at end of file
diff --git a/print/templates/reports/incoterms-authorization/sql/company.sql b/print/templates/reports/incoterms-authorization/sql/company.sql
new file mode 100644
index 000000000..39c3290d1
--- /dev/null
+++ b/print/templates/reports/incoterms-authorization/sql/company.sql
@@ -0,0 +1,8 @@
+SELECT
+ s.name,
+ s.city,
+ cl.name AS manager
+FROM company c
+ JOIN supplier s ON s.id = c.id
+ JOIN client cl ON cl.id = c.workerManagerFk
+WHERE c.id = ?
\ No newline at end of file
diff --git a/print/templates/reports/incoterms-authorization/sql/ticket.sql b/print/templates/reports/incoterms-authorization/sql/ticket.sql
deleted file mode 100644
index c6c994f7d..000000000
--- a/print/templates/reports/incoterms-authorization/sql/ticket.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-SELECT
- t.id,
- t.clientFk,
- cty.country,
- w.name AS warehouse
-FROM ticket t
- JOIN warehouse w ON w.id = t.warehouseFk
- JOIN address a ON a.id = t.addressFk
- JOIN province p ON p.id = a.provinceFk
- JOIN autonomy au ON au.id = p.autonomyFk
- JOIN country cty ON cty.id = au.countryFk
-WHERE t.id = ?
\ No newline at end of file
From b2d57f40220aa30a2bef782edbf7237814bc206a Mon Sep 17 00:00:00 2001
From: joan
Date: Wed, 22 Jun 2022 09:25:21 +0200
Subject: [PATCH 4/8] Added portuguese translation
---
.../incoterms-authorization.html | 1 +
.../incoterms-authorization/locale/es.yml | 3 +-
.../incoterms-authorization/locale/fr.yml | 6 +++
.../incoterms-authorization/locale/pt.yml | 6 +++
.../incoterms-authorization/locale/pt.yml | 38 +++++++++----------
5 files changed, 34 insertions(+), 20 deletions(-)
create mode 100644 print/templates/email/incoterms-authorization/locale/fr.yml
create mode 100644 print/templates/email/incoterms-authorization/locale/pt.yml
diff --git a/print/templates/email/incoterms-authorization/incoterms-authorization.html b/print/templates/email/incoterms-authorization/incoterms-authorization.html
index e50a40c6d..5dd0d7da6 100644
--- a/print/templates/email/incoterms-authorization/incoterms-authorization.html
+++ b/print/templates/email/incoterms-authorization/incoterms-authorization.html
@@ -26,6 +26,7 @@
{{ $t('title') }}
{{$t('description.dear')}},
{{$t('description.instructions')}}
+ {{$t('description.conclusion')}}
diff --git a/print/templates/email/incoterms-authorization/locale/es.yml b/print/templates/email/incoterms-authorization/locale/es.yml
index d0aaf9ab4..e8ce679fc 100644
--- a/print/templates/email/incoterms-authorization/locale/es.yml
+++ b/print/templates/email/incoterms-authorization/locale/es.yml
@@ -2,4 +2,5 @@ subject: Autorización incoterms
title: Autorización incoterms
description:
dear: Estimado cliente
- instructions: A continuación le adjuntamos la autorización incoterms que deberá entregar rellenada y firmada.
\ No newline at end of file
+ instructions: A continuación le adjuntamos la autorización incoterms que deberá entregar rellenada y firmada.
+ conclusion: ¡Gracias por su atención!
\ No newline at end of file
diff --git a/print/templates/email/incoterms-authorization/locale/fr.yml b/print/templates/email/incoterms-authorization/locale/fr.yml
new file mode 100644
index 000000000..115e9fbce
--- /dev/null
+++ b/print/templates/email/incoterms-authorization/locale/fr.yml
@@ -0,0 +1,6 @@
+subject: Autorisation Incoterm
+title: Autorisation Incoterm
+description:
+ dear: Messieurs
+ instructions: Ci-dessous nous joignons l'autorisation incoterms que vous devez remettre remplie et signée.
+ conclusion: Merci pour votre attention!
\ No newline at end of file
diff --git a/print/templates/email/incoterms-authorization/locale/pt.yml b/print/templates/email/incoterms-authorization/locale/pt.yml
new file mode 100644
index 000000000..bdf25ed0b
--- /dev/null
+++ b/print/templates/email/incoterms-authorization/locale/pt.yml
@@ -0,0 +1,6 @@
+subject: Autorização do Incoterm
+title: Autorização do Incoterm
+description:
+ dear: Estimado cliente
+ instructions: Abaixo anexamos a autorização dos incoterms que deves preencher e reenviar-nos.
+ conclusion: Obrigado pela atenção.
\ No newline at end of file
diff --git a/print/templates/reports/incoterms-authorization/locale/pt.yml b/print/templates/reports/incoterms-authorization/locale/pt.yml
index b96668b5a..2d33e6a1a 100644
--- a/print/templates/reports/incoterms-authorization/locale/pt.yml
+++ b/print/templates/reports/incoterms-authorization/locale/pt.yml
@@ -1,31 +1,31 @@
reportName: autorizacion-incoterms
-description: '{socialName} uma empresa devidamente constituída com responsabilidade limitada
-e registrado sob a lei das sociedades de {country} e aqui representado por
-___________________. {socialName}, residente em {address},
-CIF {fiscalID}. Doravante referido como {name}.'
+description: '{socialName} uma sociedade devidamente constituída com responsabilidade limitada e registada
+conforme ao direito de sociedades da {country} e aqui representada por
+___________________. {socialName}, com domicílio em {address},
+CIF {fiscalID}. Em adiante denominada {name}.'
issued: 'Em {0}, em {1} de {2} de {3}'
client: 'Cliente {0}'
-declaration: '{socialName} declara que:'
+declaration: '{socialName} declara através da presente que:'
declarations:
- - 'Todas as compras feitas por {socialName} com {companyName} são
-entregue, Ex Works (Incoterms), ao armazém da {companyName} localizado em
+ - 'Todas as compras realizadas por {socialName} a {companyName} se entregam,
+ Ex Works (Incoterms), no armazém da {companyName} situado em
{companyCity}.'
- - '{socialName} reconhece que é importante para {companyName} ter
-prova de entrega intracomunitária das mercadorias para {destinationCountry} para
-poder faturar com 0% de IVA.'
- - 'Portanto, ao assinar este acordo, {socialName} declara que todos os ativos que
-comprado de {companyName} será entregue em {destinationCountry}.'
- - 'Além disso, {socialName} deverá, a primeira solicitação de {companyName},
-fornecer prova de que todos os produtos comprados de {companyName} têm
-foi entregue para {destinationCountry}.'
- - 'Além do acima, {companyName} fornecerá {socialName}
-um resumo mensal incluindo todas as faturas (e entregas correspondentes).
+ - '{socialName} reconhece ser importante para {companyName}
+ ter o comprovante da entrega intracomunitária da mercadoria a {destinationCountry}
+ para poder faturar com 0% de IVA.'
+ - 'Portanto, ao assinar este acordo, {socialName} declara que todos os bens
+ que se comprem na {companyName} serão entregues na {destinationCountry}.'
+ - 'Além disto, {socialName} deverá, na primeira solicitude da {companyName},
+ proporcionar uma prova de que todos os produtos comprados na {companyName}
+ foram entregues na {destinationCountry}.'
+ - 'Além do anterio, {companyName} proporcionará a {socialName}
+um resumo mensal onde se incluem todas as faturas (e as entregas correspondentes).
{socialName} assinará e devolverá o resumo mensal à {companyName},
-em até 5 dias após o recebimento do resumo.'
+dentro dos 5 dias posteriores à receção do resumo.'
signer:
representative: Representante
representativeRole: Cargo de representante
- signed: Data de assinatura
+ signed: Data da assinatura
manager: Gerente
months:
- 'Janeiro'
From cffff93cdc70393695902ec455d8c6543de68566 Mon Sep 17 00:00:00 2001
From: joan
Date: Wed, 22 Jun 2022 10:57:28 +0200
Subject: [PATCH 5/8] Updated translations
---
.../incoterms-authorization/locale/fr.yml | 6 +-
.../incoterms-authorization/locale/es.yml | 4 +-
.../incoterms-authorization/locale/fr.yml | 70 +++++++++----------
3 files changed, 38 insertions(+), 42 deletions(-)
diff --git a/print/templates/email/incoterms-authorization/locale/fr.yml b/print/templates/email/incoterms-authorization/locale/fr.yml
index 115e9fbce..a2dc6fe3a 100644
--- a/print/templates/email/incoterms-authorization/locale/fr.yml
+++ b/print/templates/email/incoterms-authorization/locale/fr.yml
@@ -1,6 +1,6 @@
subject: Autorisation Incoterm
title: Autorisation Incoterm
description:
- dear: Messieurs
- instructions: Ci-dessous nous joignons l'autorisation incoterms que vous devez remettre remplie et signée.
- conclusion: Merci pour votre attention!
\ No newline at end of file
+ dear: Chers clients
+ instructions: Veuillez trouver ci-joint l'autorisation des INCOTERMS, une fois le document rempli doit être signé et renvoyé par e-mail.
+ conclusion: Dans l'attente de votre réponse, nous vous prions d'agréer, Madame, Monsieur, nos salutations distinguées.
\ No newline at end of file
diff --git a/print/templates/reports/incoterms-authorization/locale/es.yml b/print/templates/reports/incoterms-authorization/locale/es.yml
index 67edd4a2a..6936ebda9 100644
--- a/print/templates/reports/incoterms-authorization/locale/es.yml
+++ b/print/templates/reports/incoterms-authorization/locale/es.yml
@@ -4,7 +4,7 @@ y registrada conforme al derecho de sociedades de {country} y aquí representada
___________________. {socialName}, con domicilio en {address},
CIF {fiscalID}. En adelante denominada {name}.'
issued: 'En {0}, a {1} de {2} de {3}'
-client: 'Client {0}'
+client: 'Cliente {0}'
declaration: '{socialName} declara por la presente que:'
declarations:
- 'Todas las compras realizadas por {socialName} con {companyName} se
@@ -20,7 +20,7 @@ proporcionar una prueba de que todos los productos comprados a {companyName} han
sido entregados en {destinationCountry}.'
- 'Además de lo anterior, {companyName} proporcionará a {socialName}
un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes).
-{socialName} firmará y devolverá el resumen mensual a Verdnatura Levante,
+{socialName} firmará y devolverá el resumen mensual a {companyName},
S.L. dentro de los 5 días posteriores a la recepción del resumen.'
signer:
representative: Representante
diff --git a/print/templates/reports/incoterms-authorization/locale/fr.yml b/print/templates/reports/incoterms-authorization/locale/fr.yml
index 67edd4a2a..f1aeb0eff 100644
--- a/print/templates/reports/incoterms-authorization/locale/fr.yml
+++ b/print/templates/reports/incoterms-authorization/locale/fr.yml
@@ -1,42 +1,38 @@
reportName: autorizacion-incoterms
-description: '{socialName} una sociedad debidamente constituida con responsabilidad limitada
-y registrada conforme al derecho de sociedades de {country} y aquí representada por
-___________________. {socialName}, con domicilio en {address},
-CIF {fiscalID}. En adelante denominada {name}.'
-issued: 'En {0}, a {1} de {2} de {3}'
+description: '{socialName} une société dûment constituée à responsabilité limitée
+et enregistrée en vertu du droit des sociétés de {country} et représentée aux présentes par
+___________________. {socialName}, ayant son siège social {address},
+CIF {fiscalID}. Ci-après dénommé {name}.'
+issued: 'A {0}, le {1} {2} {3}'
client: 'Client {0}'
-declaration: '{socialName} declara por la presente que:'
+declaration: '{socialName} déclare par la présente que:'
declarations:
- - 'Todas las compras realizadas por {socialName} con {companyName} se
-entregan, Ex Works (Incoterms), en el almacén de {companyName} situado en
-{companyCity}.'
- - '{socialName} reconoce que es importante para {companyName} tener
-comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para
-poder facturar con 0% de IVA.'
- - 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que
-se compren a {companyName} serán entregados a {destinationCountry}.'
- - 'Además, {socialName} deberá, a primera solicitud de {companyName},
-proporcionar una prueba de que todos los productos comprados a {companyName} han
-sido entregados en {destinationCountry}.'
- - 'Además de lo anterior, {companyName} proporcionará a {socialName}
-un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes).
-{socialName} firmará y devolverá el resumen mensual a Verdnatura Levante,
-S.L. dentro de los 5 días posteriores a la recepción del resumen.'
+ - "Tous les achats réalisés par {socialName} avec {companyName}
+sont livrés, Ex Works (Incoterms), sur l'entrepôt de {companyName} situé à {companyCity}."
+ - "{socialName} reconnaît qu'il est important pou {companyName} d'avoir
+la preuve de la livraison intracommunautaire des biens à {destinationCountry} afin de pouvoir facturer à 0% de TVA."
+ - 'Par conséquent, en signant cet accord, {socialName} déclare que tous les biens achetés à {companyName} seront livrés à {destinationCountry}.'
+ - 'En outre, {socialName} doit, à la première demande de {companyName},
+fournir la preuve que tous les biens achetés à {companyName} ont été livrés à {destinationCountry}.'
+ - 'En plus de ce qui précède, {companyName} fournira à {socialName}
+un résumé mensuel comprenant toutes les factures (et les livraisons correspondantes).
+{socialName} signera et retournera le résumé mensuel à {companyName},
+dans les 5 jours suivant la réception du résumé.'
signer:
- representative: Representante
- representativeRole: Cargo del representante
- signed: Fecha de firma
-manager: Gerente
+ representative: Représentant
+ representativeRole: Position du représentant
+ signed: Date de la signature
+manager: Gérente
months:
- - 'Enero'
- - 'Febrero'
- - 'Marzo'
- - 'Abril'
- - 'Mayo'
- - 'Junio'
- - 'Julio'
- - 'Agosto'
- - 'Septiembre'
- - 'Octubre'
- - 'Noviembre'
- - 'Diciembre'
\ No newline at end of file
+ - 'Janvier'
+ - 'Fevrier'
+ - 'Mars'
+ - 'Avril'
+ - 'Mai'
+ - 'Juin'
+ - 'Juillet'
+ - 'Août'
+ - 'Septembre'
+ - 'Octobre'
+ - 'Novembre'
+ - 'Decembre'
\ No newline at end of file
From 2381a5d09a923d0f4ee28359f043b98d584ce87e Mon Sep 17 00:00:00 2001
From: joan
Date: Wed, 22 Jun 2022 12:40:11 +0200
Subject: [PATCH 6/8] Updated e2e tests
---
e2e/helpers/selectors.js | 3 ++-
e2e/paths/02-client/03_edit_fiscal_data.spec.js | 2 +-
e2e/paths/05-ticket/06_basic_data_steps.spec.js | 6 +++---
e2e/paths/05-ticket/09_weekly.spec.js | 6 +++---
e2e/paths/05-ticket/14_create_ticket.spec.js | 4 ++--
e2e/paths/07-order/01_summary.spec.js | 2 +-
.../client/specs/extendedListFilter.spec.js | 14 +++++++-------
.../methods/route/specs/getDeliveryPoint.spec.js | 2 +-
8 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 0972e3463..3638c26e0 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -544,7 +544,8 @@ export default {
searchResultDate: 'vn-ticket-summary [label=Landed] span',
topbarSearch: 'vn-searchbar',
moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]',
- sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6)',
+ fourthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tbody vn-tr:nth-child(4)',
+ fiveWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tbody vn-tr:nth-child(5)',
weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr',
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-tr:nth-child(1) [ng-model="weekly.agencyModeFk"]',
diff --git a/e2e/paths/02-client/03_edit_fiscal_data.spec.js b/e2e/paths/02-client/03_edit_fiscal_data.spec.js
index 4ae1d4eca..2a56cb535 100644
--- a/e2e/paths/02-client/03_edit_fiscal_data.spec.js
+++ b/e2e/paths/02-client/03_edit_fiscal_data.spec.js
@@ -276,7 +276,7 @@ describe('Client Edit fiscalData path', () => {
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2
it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async() => {
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
- await page.waitForTextInField(selectors.clientAddresses.city, 'Silla');
+ await page.waitForTextInField(selectors.clientAddresses.city, 'Gotham');
await page.waitToClick(selectors.clientAddresses.equalizationTaxCheckbox);
await page.waitToClick(selectors.clientAddresses.saveButton);
const message = await page.waitForSnackbar();
diff --git a/e2e/paths/05-ticket/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js
index fa118c25d..46cbf29b8 100644
--- a/e2e/paths/05-ticket/06_basic_data_steps.spec.js
+++ b/e2e/paths/05-ticket/06_basic_data_steps.spec.js
@@ -42,7 +42,7 @@ describe('Ticket Edit basic data path', () => {
expect(disabled).toBeFalsy();
});
- it(`should check the zone is for Silla247`, async() => {
+ it(`should check the zone is for Gotham247`, async() => {
let zone = await page
.waitToGetProperty(selectors.ticketBasicData.zone, 'value');
@@ -63,7 +63,7 @@ describe('Ticket Edit basic data path', () => {
let zone = await page
.waitToGetProperty(selectors.ticketBasicData.agency, 'value');
- expect(zone).toContain('Silla247Expensive');
+ expect(zone).toContain('Gotham247Expensive');
});
it(`should click next`, async() => {
@@ -92,7 +92,7 @@ describe('Ticket Edit basic data path', () => {
});
it(`should split ticket without negatives`, async() => {
- const newAgency = 'Silla247';
+ const newAgency = 'Gotham247';
const newDate = new Date();
newDate.setDate(newDate.getDate() - 1);
diff --git a/e2e/paths/05-ticket/09_weekly.spec.js b/e2e/paths/05-ticket/09_weekly.spec.js
index 2392de28f..d04138ee5 100644
--- a/e2e/paths/05-ticket/09_weekly.spec.js
+++ b/e2e/paths/05-ticket/09_weekly.spec.js
@@ -45,7 +45,7 @@ describe('Ticket descriptor path', () => {
it('should confirm the ticket 11 was added to thursday', async() => {
await page.accessToSection('ticket.weekly.index');
- const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
+ const result = await page.waitToGetProperty(selectors.ticketsIndex.fourthWeeklyTicket, 'value');
expect(result).toEqual('Thursday');
});
@@ -80,7 +80,7 @@ describe('Ticket descriptor path', () => {
it('should confirm the ticket 11 was added on saturday', async() => {
await page.accessToSection('ticket.weekly.index');
- const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
+ const result = await page.waitToGetProperty(selectors.ticketsIndex.fiveWeeklyTicket, 'value');
expect(result).toEqual('Saturday');
});
@@ -108,7 +108,7 @@ describe('Ticket descriptor path', () => {
});
it('should update the agency then remove it afterwards', async() => {
- await page.autocompleteSearch(selectors.ticketsIndex.firstWeeklyTicketAgency, 'Silla247');
+ await page.autocompleteSearch(selectors.ticketsIndex.firstWeeklyTicketAgency, 'Gotham247');
let message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
diff --git a/e2e/paths/05-ticket/14_create_ticket.spec.js b/e2e/paths/05-ticket/14_create_ticket.spec.js
index bfaa08775..d72557f99 100644
--- a/e2e/paths/05-ticket/14_create_ticket.spec.js
+++ b/e2e/paths/05-ticket/14_create_ticket.spec.js
@@ -27,7 +27,7 @@ describe('Ticket create path', () => {
await page.autocompleteSearch(selectors.createTicketView.client, 'Clark Kent');
await page.pickDate(selectors.createTicketView.deliveryDate, nextMonth);
await page.autocompleteSearch(selectors.createTicketView.warehouse, 'Warehouse Two');
- await page.autocompleteSearch(selectors.createTicketView.agency, 'Silla247');
+ await page.autocompleteSearch(selectors.createTicketView.agency, 'Gotham247');
await page.waitToClick(selectors.createTicketView.createButton);
const message = await page.waitForSnackbar();
@@ -50,7 +50,7 @@ describe('Ticket create path', () => {
await page.autocompleteSearch(selectors.createTicketView.client, 'Clark Kent');
await page.pickDate(selectors.createTicketView.deliveryDate, nextMonth);
await page.autocompleteSearch(selectors.createTicketView.warehouse, 'Warehouse One');
- await page.autocompleteSearch(selectors.createTicketView.agency, 'Silla247');
+ await page.autocompleteSearch(selectors.createTicketView.agency, 'Gotham247');
await page.waitToClick(selectors.createTicketView.createButton);
const message = await page.waitForSnackbar();
diff --git a/e2e/paths/07-order/01_summary.spec.js b/e2e/paths/07-order/01_summary.spec.js
index 9b9e37998..922d5eeee 100644
--- a/e2e/paths/07-order/01_summary.spec.js
+++ b/e2e/paths/07-order/01_summary.spec.js
@@ -34,7 +34,7 @@ describe('Order summary path', () => {
it('should check the summary contains the order consignee', async() => {
const result = await page.waitToGetProperty(selectors.orderSummary.consignee, 'innerText');
- expect(result).toEqual('address 26 - Silla (Province one)');
+ expect(result).toEqual('address 26 - Gotham (Province one)');
});
it('should check the summary contains the order subtotal', async() => {
diff --git a/modules/client/back/methods/client/specs/extendedListFilter.spec.js b/modules/client/back/methods/client/specs/extendedListFilter.spec.js
index 907c03ef9..9a0441656 100644
--- a/modules/client/back/methods/client/specs/extendedListFilter.spec.js
+++ b/modules/client/back/methods/client/specs/extendedListFilter.spec.js
@@ -1,4 +1,4 @@
-const { models } = require('vn-loopback/server/server');
+const {models} = require('vn-loopback/server/server');
describe('client extendedListFilter()', () => {
it('should return the clients matching the filter with a limit of 20 rows', async() => {
@@ -99,7 +99,7 @@ describe('client extendedListFilter()', () => {
const randomIndex = Math.floor(Math.random() * result.length);
const randomResultClient = result[randomIndex];
-
+
expect(result.length).toBeGreaterThanOrEqual(5);
expect(randomResultClient.salesPersonFk).toEqual(salesPersonId);
@@ -121,7 +121,7 @@ describe('client extendedListFilter()', () => {
const result = await models.Client.extendedListFilter(ctx, filter, options);
const firstClient = result[0];
-
+
expect(result.length).toEqual(1);
expect(firstClient.name).toEqual('Max Eisenhardt');
@@ -138,15 +138,15 @@ describe('client extendedListFilter()', () => {
try {
const options = {transaction: tx};
- const ctx = {req: {accessToken: {userId: 1}}, args: {city: 'Silla'}};
+ const ctx = {req: {accessToken: {userId: 1}}, args: {city: 'Gotham'}};
const filter = {};
const result = await models.Client.extendedListFilter(ctx, filter, options);
const randomIndex = Math.floor(Math.random() * result.length);
const randomResultClient = result[randomIndex];
-
+
expect(result.length).toBeGreaterThanOrEqual(20);
- expect(randomResultClient.city.toLowerCase()).toEqual('silla');
+ expect(randomResultClient.city.toLowerCase()).toEqual('gotham');
await tx.rollback();
} catch (e) {
@@ -167,7 +167,7 @@ describe('client extendedListFilter()', () => {
const randomIndex = Math.floor(Math.random() * result.length);
const randomResultClient = result[randomIndex];
-
+
expect(result.length).toBeGreaterThanOrEqual(20);
expect(randomResultClient.postcode).toEqual('46460');
diff --git a/modules/route/back/methods/route/specs/getDeliveryPoint.spec.js b/modules/route/back/methods/route/specs/getDeliveryPoint.spec.js
index 4025b04d6..b08051c0a 100644
--- a/modules/route/back/methods/route/specs/getDeliveryPoint.spec.js
+++ b/modules/route/back/methods/route/specs/getDeliveryPoint.spec.js
@@ -2,7 +2,7 @@ const app = require('vn-loopback/server/server');
describe('route getDeliveryPoint()', () => {
const routeId = 1;
- const deliveryPointAddress = '46460 Av Espioca 100-Silla';
+ const deliveryPointAddress = '1007 Mountain Drive, Gotham';
it('should get the delivery point addres of a route with assigned vehicle', async() => {
let route = await app.models.Route.findById(routeId);
From 099189fdfbf422f16befe956367f54a2d230a9e2 Mon Sep 17 00:00:00 2001
From: joan
Date: Wed, 22 Jun 2022 14:17:41 +0200
Subject: [PATCH 7/8] Added translation
---
.../email/letter-debtor-st/letter-debtor-st.html | 2 +-
.../email/letter-debtor-st/locale/pt.yml | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 print/templates/email/letter-debtor-st/locale/pt.yml
diff --git a/print/templates/email/letter-debtor-st/letter-debtor-st.html b/print/templates/email/letter-debtor-st/letter-debtor-st.html
index c78657ec7..364e79d56 100644
--- a/print/templates/email/letter-debtor-st/letter-debtor-st.html
+++ b/print/templates/email/letter-debtor-st/letter-debtor-st.html
@@ -23,7 +23,7 @@
-
{{ $t('title') }} {{$i18n.locale}}
+
{{ $t('title') }}
{{ $t('sections.introduction.title') }},
{{ $t('sections.introduction.description') }}
diff --git a/print/templates/email/letter-debtor-st/locale/pt.yml b/print/templates/email/letter-debtor-st/locale/pt.yml
new file mode 100644
index 000000000..6f6082345
--- /dev/null
+++ b/print/templates/email/letter-debtor-st/locale/pt.yml
@@ -0,0 +1,16 @@
+subject: Aviso inicial por saldo devedor
+title: Aviso inicial por saldo devedor
+sections:
+ introduction:
+ title: Estimado cliente
+ description: Através do presente escrito comunicamos-lhe que, segundo os nossos dados contáveis,
+ a sua conta tem um saldo pendente de liquidar.
+checkExtract: Solicitamos-lhe que comprove que o extrato anexado corresponde com os dados que dispõe.
+ O nosso departamento de administração aclarará qualquer dúvida que possa ter,
+ e igualmente lhe facilitará qualquer documento que solicite.
+checkValidData: Se ao comprovar os dados aportados, resultam corretos, rogamos que proceda com a regularizar a situação
+payMethod: Se não deseja acudir pessoalmente às nossas oficinas, pode realizar o pagamento mediante
+ transferência bancaria à conta que figura ao pé do comunicado, a indicar o seu número de cliente,
+ ou bem pode realizar o pagamento através do nosso sítio web.
+conclusion: De antemão agradecemos-lhe a sua amável colaboração.
+transferAccount: Dados para transferência bancária
From e3cb89b0a6cbc8c34f41838200f5c15b500876d9 Mon Sep 17 00:00:00 2001
From: joan
Date: Thu, 23 Jun 2022 15:19:02 +0200
Subject: [PATCH 8/8] Moved SQL files from version
---
db/changes/10470-family/00-sample.sql | 7 -------
db/changes/{10470-family => 10480-june}/00-client.sql | 0
db/changes/10480-june/00-sample.sql | 2 ++
3 files changed, 2 insertions(+), 7 deletions(-)
delete mode 100644 db/changes/10470-family/00-sample.sql
rename db/changes/{10470-family => 10480-june}/00-client.sql (100%)
create mode 100644 db/changes/10480-june/00-sample.sql
diff --git a/db/changes/10470-family/00-sample.sql b/db/changes/10470-family/00-sample.sql
deleted file mode 100644
index 619030013..000000000
--- a/db/changes/10470-family/00-sample.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-INSERT INTO `vn`.`sample` (code, description, isVisible, hasCompany, hasPreview, datepickerEnabled)
-VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 1, 1, 0);
-
-
-INSERT INTO vn.expedition (agencyModeFk, ticketFk, isBox, created, isRefund, isPickUp, itemFk, counter, checked,
- workerFk, externalId, packagingFk, itemPackingTypeFk, hostFk, stateTypeFk)
-VALUES (7, 11, 71, '2022-05-18 11:40:56', false, false, null, 1, 1, 18, null, '94', null, '', 3);
diff --git a/db/changes/10470-family/00-client.sql b/db/changes/10480-june/00-client.sql
similarity index 100%
rename from db/changes/10470-family/00-client.sql
rename to db/changes/10480-june/00-client.sql
diff --git a/db/changes/10480-june/00-sample.sql b/db/changes/10480-june/00-sample.sql
new file mode 100644
index 000000000..18beb736d
--- /dev/null
+++ b/db/changes/10480-june/00-sample.sql
@@ -0,0 +1,2 @@
+INSERT INTO `vn`.`sample` (code, description, isVisible, hasCompany, hasPreview, datepickerEnabled)
+VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 1, 1, 0);
\ No newline at end of file