diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html
index 1d646a0db..aed4b38f3 100644
--- a/print/templates/reports/invoice/invoice.html
+++ b/print/templates/reports/invoice/invoice.html
@@ -264,7 +264,7 @@
{{row.code}} |
- {{row.description}} |
+ {{row.description || $t('services') }} |
{{row.stems | number($i18n.locale)}} |
{{row.netKg | number($i18n.locale)}} |
{{row.subtotal | currency('EUR', $i18n.locale)}} |
diff --git a/print/templates/reports/invoice/invoice.js b/print/templates/reports/invoice/invoice.js
index db94a7a12..31df7f7f5 100755
--- a/print/templates/reports/invoice/invoice.js
+++ b/print/templates/reports/invoice/invoice.js
@@ -81,7 +81,7 @@ module.exports = {
return this.rawSqlFromDef(`taxes`, [reference]);
},
fetchIntrastat(reference) {
- return this.rawSqlFromDef(`intrastat`, [reference, reference, reference]);
+ return this.rawSqlFromDef(`intrastat`, [reference, reference, reference, reference]);
},
fetchRectified(reference) {
return this.rawSqlFromDef(`rectified`, [reference]);
diff --git a/print/templates/reports/invoice/locale/en.yml b/print/templates/reports/invoice/locale/en.yml
index 4e4688b55..336592f0c 100644
--- a/print/templates/reports/invoice/locale/en.yml
+++ b/print/templates/reports/invoice/locale/en.yml
@@ -33,4 +33,5 @@ issued: Issued
plantPassport: Plant passport
observations: Observations
wireTransfer: "Pay method: Transferencia"
-accountNumber: "Account number: {0}"
\ No newline at end of file
+accountNumber: "Account number: {0}"
+services: Services
\ No newline at end of file
diff --git a/print/templates/reports/invoice/locale/es.yml b/print/templates/reports/invoice/locale/es.yml
index d37e77943..32f6fc708 100644
--- a/print/templates/reports/invoice/locale/es.yml
+++ b/print/templates/reports/invoice/locale/es.yml
@@ -33,4 +33,5 @@ issued: F. emisión
plantPassport: Pasaporte fitosanitario
observations: Observaciones
wireTransfer: "Forma de pago: Transferencia"
-accountNumber: "Número de cuenta: {0}"
\ No newline at end of file
+accountNumber: "Número de cuenta: {0}"
+services: Servicios
\ No newline at end of file
diff --git a/print/templates/reports/invoice/sql/intrastat.sql b/print/templates/reports/invoice/sql/intrastat.sql
index e2ee47667..5cc3ebd7f 100644
--- a/print/templates/reports/invoice/sql/intrastat.sql
+++ b/print/templates/reports/invoice/sql/intrastat.sql
@@ -1,4 +1,4 @@
-SELECT
+(SELECT
ir.id code,
ir.description description,
CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems,
@@ -19,4 +19,14 @@ SELECT
WHERE t.refFk = ?
AND i.intrastatFk
GROUP BY i.intrastatFk
- ORDER BY i.intrastatFk;
\ No newline at end of file
+ ORDER BY i.intrastatFk)
+UNION ALL
+(SELECT
+ NULL AS code,
+ NULL AS description,
+ 0 AS stems,
+ 0 AS netKg,
+ CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)) AS subtotal
+ FROM vn.ticketService ts
+ JOIN vn.ticket t ON ts.ticketFk = t.id
+ WHERE t.refFk = ?);
\ No newline at end of file