diff --git a/print/templates/reports/sepa-core/sepa-core.html b/print/templates/reports/sepa-core/sepa-core.html
index defbdb110..1b2ad13d9 100644
--- a/print/templates/reports/sepa-core/sepa-core.html
+++ b/print/templates/reports/sepa-core/sepa-core.html
@@ -28,7 +28,7 @@
{{$t('supplier.identifier')}} |
{{$t('supplier.iban')}}
- {{$t('supplier.cif')}}
+ {{supplier.nif}}
|
diff --git a/print/templates/reports/sepa-core/sepa-core.js b/print/templates/reports/sepa-core/sepa-core.js
index 2198984f3..efc9ed7ed 100755
--- a/print/templates/reports/sepa-core/sepa-core.js
+++ b/print/templates/reports/sepa-core/sepa-core.js
@@ -1,10 +1,6 @@
const vnReport = require('../../../core/mixins/vn-report.js');
+const db = require('../../../core/database');
-// class Controller {
-// constructor(country, supplier, iban, cif) {
-// this.country = countryFk;
-// }
-// }
module.exports = {
name: 'sepa-core',
mixins: [vnReport],
@@ -12,6 +8,7 @@ module.exports = {
this.client = await this.findOneFromDef('client', [this.companyId, this.companyId, this.id]);
this.checkMainEntity(this.client);
this.supplier = await this.findOneFromDef('supplier', [this.companyId, this.companyId, this.id]);
+ console.log(this.supplier);
},
props: {
id: {
@@ -23,5 +20,16 @@ module.exports = {
type: Number,
required: true
}
+ },
+ methods: {
+ getSupplierCif() {
+ return db.findOne(`
+ SELECT sa.iban, s.nif
+ FROM supplierAccount sa
+ INNER JOIN supplier s ON sa.supplierFk = s.id
+ WHERE s.countryFk = ?
+ LIMIT 1`), [this.countryFk];
+ }
}
+
};