From b6761d3dc00057a4ab829fe2fd8407beea7b9c94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20Andr=C3=A9s?=
Date: Wed, 17 Jul 2024 19:08:01 +0200
Subject: [PATCH 1/5] =?UTF-8?q?fix:=20refs#7748=20solicitud=20de=20domicil?=
=?UTF-8?q?iaci=C3=B3n=20bancaria?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
print/templates/email/sepa-core/locale/es.yml | 4 +---
print/templates/email/sepa-core/locale/fr.yml | 6 +-----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/print/templates/email/sepa-core/locale/es.yml b/print/templates/email/sepa-core/locale/es.yml
index 10a1d32fe..a8dd9032e 100644
--- a/print/templates/email/sepa-core/locale/es.yml
+++ b/print/templates/email/sepa-core/locale/es.yml
@@ -9,9 +9,7 @@ description:
forma automatizada y electrónicamente, lo que supone para usted una reducción
sustancial de costos en términos de honorarios y gastos bancarios.
En caso de que acepte nuestra propuesta, a la fecha de vencimiento de cada efecto,
- se debitará a su cuenta automáticamente a través de su entidad bancaria.
- Por tanto, le pedimos que firme y envíe a su banco la autorización original adjunta,
- debidamente cumplimentada, y nos devuelva una fotocopia de dicha autorización.
+ se debitará a su cuenta automáticamente a través de su entidad bancaria.
Este sistema se basa en la transmisión electrónica de datos;
el manejo de documentos físicos ha sido eliminado.
Le agradecemos su cooperación,
diff --git a/print/templates/email/sepa-core/locale/fr.yml b/print/templates/email/sepa-core/locale/fr.yml
index 98bd7593a..6d76ef24f 100644
--- a/print/templates/email/sepa-core/locale/fr.yml
+++ b/print/templates/email/sepa-core/locale/fr.yml
@@ -14,11 +14,7 @@ description:
et commissions bancaires.
Dans le cas où vous accepteriez notre proposition, à
l’échéance de chaque effet, votre compte sera débité
- automatiquement par votre Banque.
- Ainsi, nous vous demandons de signer et envoyer à votre
- Banque l'original de l'autorisation pour débit en annexe,
- dûment remplie, et de nous retourner une photocopie de la
- dite autorisation.
+ automatiquement par votre Banque.
Ce système étant basé sur la transmission de données de
manière électronique, le maniement de documents
physiques á été éliminé
--
2.40.1
From 29e7d9787867f5f46ee2cba687b7f07d1c077b27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20Andr=C3=A9s?=
Date: Thu, 18 Jul 2024 16:58:20 +0200
Subject: [PATCH 2/5] =?UTF-8?q?fix:=20refs#7748=20solicitud=20de=20domicil?=
=?UTF-8?q?iaci=C3=B3n=20bancaria?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
print/templates/email/sepa-core/locale/en.yml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 print/templates/email/sepa-core/locale/en.yml
diff --git a/print/templates/email/sepa-core/locale/en.yml b/print/templates/email/sepa-core/locale/en.yml
new file mode 100644
index 000000000..c6cc4dab4
--- /dev/null
+++ b/print/templates/email/sepa-core/locale/en.yml
@@ -0,0 +1,16 @@
+subject: Bank Direct Debit Request
+title: SEPA CORE Direct Debit
+description:
+ dear: Dear Customer
+ instructions: Given the excellent relationship between our two companies
+ and to facilitate the payment processes of our invoices, we suggest the use
+ of the SEPA CORE direct debit system.
+ This service involves issuing our receipts to your company in an automated
+ and electronic manner, which represents a substantial reduction in costs for you
+ in terms of fees and bank charges.
+ If you accept our proposal, on the due date of each payment, it will be automatically
+ debited from your account through your bank.
+ This system is based on the electronic transmission of data; the handling of
+ physical documents has been eliminated.
+ We appreciate your cooperation,
+ conclusion: Thank you for your attention!
--
2.40.1
From 9003f2db9119a7ad47ada29b8d8b8ef63e431b59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20Andr=C3=A9s?=
Date: Thu, 18 Jul 2024 19:37:03 +0200
Subject: [PATCH 3/5] =?UTF-8?q?fix:=20refs=20#7748=20solicitud=20de=20domi?=
=?UTF-8?q?ciliaci=C3=B3n=20bancaria?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../templates/reports/sepa-core/sepa-core.js | 11 ----
.../reports/sepa-core/sql/client.sql | 26 ++++-----
.../reports/sepa-core/sql/supplier.sql | 54 +++++++++----------
3 files changed, 39 insertions(+), 52 deletions(-)
diff --git a/print/templates/reports/sepa-core/sepa-core.js b/print/templates/reports/sepa-core/sepa-core.js
index 6b941556e..2600b596e 100755
--- a/print/templates/reports/sepa-core/sepa-core.js
+++ b/print/templates/reports/sepa-core/sepa-core.js
@@ -23,16 +23,5 @@ module.exports = {
type: Number,
required: true
}
- },
- methods: {
- getSupplierCif() {
- return db.findOne(`
- SELECT DISTINCT ad.value
- FROM supplierAccount sa
- JOIN accountDetail ad ON ad.supplierAccountFk = sa.id
- JOIN accountDetailType adt ON adt.id = ad.accountDetailTypeFk AND adt.id = 3
- WHERE sa.supplierFk = ?`) [this.companyId];
- }
}
-
};
diff --git a/print/templates/reports/sepa-core/sql/client.sql b/print/templates/reports/sepa-core/sql/client.sql
index b3ba180b3..6cdd7403f 100644
--- a/print/templates/reports/sepa-core/sql/client.sql
+++ b/print/templates/reports/sepa-core/sql/client.sql
@@ -1,19 +1,21 @@
-SELECT
- c.id,
+SELECT c.id,
m.code mandateCode,
c.socialName,
c.street,
c.postcode,
c.city,
c.fi,
- p.name AS province,
+ p.name province,
ct.name country,
- ct.code AS countryCode,
- ct.ibanLength AS ibanLength
-FROM client c
- JOIN country ct ON ct.id = c.countryFk
- LEFT JOIN mandate m ON m.clientFk = c.id
- AND m.companyFk = ? AND m.finished IS NULL
- LEFT JOIN province p ON p.id = c.provinceFk
-WHERE (m.companyFk = ? OR m.companyFk IS NULL) AND c.id = ?
-ORDER BY m.created DESC LIMIT 1
\ No newline at end of file
+ ct.code countryCode,
+ ct.ibanLength ibanLength
+ FROM client c
+ JOIN country ct ON ct.id = c.countryFk
+ LEFT JOIN province p ON p.id = c.provinceFk
+ LEFT JOIN mandate m ON m.clientFk = c.id
+ AND m.companyFk = ?
+ AND m.finished IS NULL
+ WHERE (m.companyFk = ? OR m.companyFk IS NULL)
+ AND c.id = ?
+ ORDER BY m.created DESC
+ LIMIT 1
\ No newline at end of file
diff --git a/print/templates/reports/sepa-core/sql/supplier.sql b/print/templates/reports/sepa-core/sql/supplier.sql
index 1276f2437..749f2c430 100644
--- a/print/templates/reports/sepa-core/sql/supplier.sql
+++ b/print/templates/reports/sepa-core/sql/supplier.sql
@@ -1,29 +1,25 @@
-SELECT
- m.code mandateCode,
- s.name,
- s.street,
- sc.name country,
- s.postCode,
- s.city,
- sp.name province,
- s.nif,
- sa.supplierFk,
- be.name bankName,
- ad.value accountDetailValue
-FROM
- client c
- LEFT JOIN mandate m ON m.clientFk = c.id AND m.companyFk = ? AND m.finished IS NULL
- LEFT JOIN supplier s ON s.id = m.companyFk
- LEFT JOIN country sc ON sc.id = s.countryFk
- LEFT JOIN province sp ON sp.id = s.provinceFk
- LEFT JOIN province p ON p.id = c.provinceFk
- LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id
- LEFT JOIN bankEntity be ON sa.bankEntityFk = be.id
- LEFT JOIN accountDetail ad ON ad.supplierAccountFk = sa.id
- JOIN accountDetailType adt ON adt.id = ad.accountDetailTypeFk AND adt.id = 3
-WHERE
- (m.companyFk = ? OR m.companyFk IS NULL)
- AND (c.id = ? OR (c.id IS NULL AND c.countryFk = sa.countryFk))
-GROUP BY ad.value
-ORDER BY
-m.created DESC;
+SELECT m.code mandateCode,
+ s.name,
+ s.street,
+ sc.name country,
+ s.postCode,
+ s.city,
+ sp.name province,
+ ad.value accountDetailValue
+ FROM client c
+ JOIN mandate m ON m.clientFk = c.id
+ JOIN mandateType mt ON mt.id = m.mandateTypeFk
+ JOIN supplier s ON s.id = m.companyFk
+ LEFT JOIN country sc ON sc.id = s.countryFk
+ LEFT JOIN province sp ON sp.id = s.provinceFk
+ JOIN supplierAccount sa ON sa.supplierFk = s.id
+ JOIN accountDetail ad ON ad.supplierAccountFk = sa.id
+ JOIN accountDetailType adt ON adt.id = ad.accountDetailTypeFk
+ WHERE m.companyFk = ?
+ AND m.finished IS NULL
+ AND c.id = ?
+ AND mt.name = 'CORE'
+ AND adt.description = 'Referencia Remesas'
+ GROUP BY m.id
+ ORDER BY m.created DESC
+ LIMIT 1;
--
2.40.1
From 9d17a9e82720adee25d03003ca3551a43a5ea8f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20Andr=C3=A9s?=
Date: Thu, 18 Jul 2024 19:48:35 +0200
Subject: [PATCH 4/5] =?UTF-8?q?fix:=20refs=20#7748=20solicitud=20de=20domi?=
=?UTF-8?q?ciliaci=C3=B3n=20bancaria?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
print/templates/reports/sepa-core/sepa-core.js | 5 ++---
print/templates/reports/sepa-core/sql/client.sql | 11 ++---------
print/templates/reports/sepa-core/sql/supplier.sql | 5 ++---
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/print/templates/reports/sepa-core/sepa-core.js b/print/templates/reports/sepa-core/sepa-core.js
index 2600b596e..8c4e4911c 100755
--- a/print/templates/reports/sepa-core/sepa-core.js
+++ b/print/templates/reports/sepa-core/sepa-core.js
@@ -1,13 +1,12 @@
const vnReport = require('../../../core/mixins/vn-report.js');
-const db = require('../../../core/database');
module.exports = {
name: 'sepa-core',
mixins: [vnReport],
async serverPrefetch() {
- this.client = await this.findOneFromDef('client', [this.companyId, this.companyId, this.id]);
+ this.client = await this.findOneFromDef('client', [this.id]);
this.checkMainEntity(this.client);
- const suppliers = await this.rawSqlFromDef('supplier', [this.companyId, this.companyId, this.id]);
+ const suppliers = await this.rawSqlFromDef('supplier', [this.companyId, this.id]);
this.supplier = {
...suppliers[0],
accountDetailValue: suppliers.map(val => val?.accountDetailValue)
diff --git a/print/templates/reports/sepa-core/sql/client.sql b/print/templates/reports/sepa-core/sql/client.sql
index 6cdd7403f..6e0ec89eb 100644
--- a/print/templates/reports/sepa-core/sql/client.sql
+++ b/print/templates/reports/sepa-core/sql/client.sql
@@ -1,5 +1,4 @@
SELECT c.id,
- m.code mandateCode,
c.socialName,
c.street,
c.postcode,
@@ -11,11 +10,5 @@ SELECT c.id,
ct.ibanLength ibanLength
FROM client c
JOIN country ct ON ct.id = c.countryFk
- LEFT JOIN province p ON p.id = c.provinceFk
- LEFT JOIN mandate m ON m.clientFk = c.id
- AND m.companyFk = ?
- AND m.finished IS NULL
- WHERE (m.companyFk = ? OR m.companyFk IS NULL)
- AND c.id = ?
- ORDER BY m.created DESC
- LIMIT 1
\ No newline at end of file
+ JOIN province p ON p.id = c.provinceFk
+ WHERE c.id = ?
\ No newline at end of file
diff --git a/print/templates/reports/sepa-core/sql/supplier.sql b/print/templates/reports/sepa-core/sql/supplier.sql
index 749f2c430..da543147a 100644
--- a/print/templates/reports/sepa-core/sql/supplier.sql
+++ b/print/templates/reports/sepa-core/sql/supplier.sql
@@ -20,6 +20,5 @@ SELECT m.code mandateCode,
AND c.id = ?
AND mt.name = 'CORE'
AND adt.description = 'Referencia Remesas'
- GROUP BY m.id
- ORDER BY m.created DESC
- LIMIT 1;
+ GROUP BY m.id, ad.value
+ ORDER BY m.created DESC
\ No newline at end of file
--
2.40.1
From 64b127d73c29e847f2b2ea80e5d0dd4873fef0ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20Andr=C3=A9s?=
Date: Fri, 19 Jul 2024 11:27:14 +0200
Subject: [PATCH 5/5] =?UTF-8?q?fix:=20refs=20#7748=20solicitud=20de=20domi?=
=?UTF-8?q?ciliaci=C3=B3n=20bancaria?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../templates/reports/sepa-core/locale/en.yml | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 print/templates/reports/sepa-core/locale/en.yml
diff --git a/print/templates/reports/sepa-core/locale/en.yml b/print/templates/reports/sepa-core/locale/en.yml
new file mode 100644
index 000000000..6d7e23501
--- /dev/null
+++ b/print/templates/reports/sepa-core/locale/en.yml
@@ -0,0 +1,46 @@
+reportName: direct-debit-order
+title: SEPA CORE Direct Debit Order
+description: By signing this direct debit order, the debtor authorizes (A) the creditor
+ to send instructions to the debtor's bank to debit their account and (B) the bank to debit
+ their account according to the creditor's instructions. As part of their rights,
+ the debtor is entitled to a refund by their bank under the terms and conditions
+ of the contract signed with the bank. The refund request must be made within
+ eight weeks of the debit. You can obtain additional information about your rights
+ from your financial institution.
+documentCopy: You must take a signed copy of this document to your Bank for registration to avoid returns.
+mandatoryFields: ALL FIELDS MUST BE COMPLETED.
+sendOrder: ONCE THIS DIRECT DEBIT ORDER IS SIGNED, IT MUST BE SENT TO THE CREDITOR
+ FOR SAFEGUARDING AND IT IS RECOMMENDED TO PROVIDE A COPY TO YOUR BANK.
+supplier:
+ toCompleteBySupplier: To be completed by the creditor
+ orderReference: Direct debit order reference
+ identifier: Creditor identifier
+ name: Creditor's name
+ street: Address
+ location: Postal Code - City - Province
+ country: Country
+client:
+ toCompleteByClient: To be completed by the debtor
+ name: Debtor's name(s)
+ fiscalId: NIF
+ street: Debtor's address
+ location: Postal Code - City - Province
+ country: Debtor's country
+ swift: Swift BIC
+ accountNumber: IBAN
+ accountHolder: "(Account holder(s))"
+ accountNumberFormat: In {0}, the IBAN consists of {1} characters always starting with {2}
+ paymentType: Payment type
+ recurrent: Recurrent
+ unique: Unique
+ signLocation: Date - City
+ sign: Debtor's signature and stamp
+order: Direct Debit Order {0}
+Francia: France
+España: Spain
+Portugal: Portugal
+instructions:
+ title: Instructions
+ accountFields: Fill in the fields related to the bank account
+ signDocument: Sign and stamp the document. For it to be valid, the stamp must show the CIF/NIF. If not, the request must be accompanied by an account ownership certificate.
+ thanks: Thank you for your cooperation!
\ No newline at end of file
--
2.40.1