Merge pull request 'refs #4497 servicios añadidos' (!1117) from 4497-services-intrastat into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1117
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Alexandre Riera 2022-11-03 07:27:13 +00:00
commit 868218096b
5 changed files with 18 additions and 6 deletions

View File

@ -264,7 +264,7 @@
<tbody> <tbody>
<tr v-for="row in intrastat"> <tr v-for="row in intrastat">
<td>{{row.code}}</td> <td>{{row.code}}</td>
<td width="50%">{{row.description}}</td> <td width="50%">{{row.description || $t('services') }}</td>
<td class="number">{{row.stems | number($i18n.locale)}}</td> <td class="number">{{row.stems | number($i18n.locale)}}</td>
<td class="number">{{row.netKg | number($i18n.locale)}}</td> <td class="number">{{row.netKg | number($i18n.locale)}}</td>
<td class="number">{{row.subtotal | currency('EUR', $i18n.locale)}}</td> <td class="number">{{row.subtotal | currency('EUR', $i18n.locale)}}</td>

View File

@ -81,7 +81,7 @@ module.exports = {
return this.rawSqlFromDef(`taxes`, [reference]); return this.rawSqlFromDef(`taxes`, [reference]);
}, },
fetchIntrastat(reference) { fetchIntrastat(reference) {
return this.rawSqlFromDef(`intrastat`, [reference, reference, reference]); return this.rawSqlFromDef(`intrastat`, [reference, reference, reference, reference]);
}, },
fetchRectified(reference) { fetchRectified(reference) {
return this.rawSqlFromDef(`rectified`, [reference]); return this.rawSqlFromDef(`rectified`, [reference]);

View File

@ -33,4 +33,5 @@ issued: Issued
plantPassport: Plant passport plantPassport: Plant passport
observations: Observations observations: Observations
wireTransfer: "Pay method: Transferencia" wireTransfer: "Pay method: Transferencia"
accountNumber: "Account number: {0}" accountNumber: "Account number: {0}"
services: Services

View File

@ -33,4 +33,5 @@ issued: F. emisión
plantPassport: Pasaporte fitosanitario plantPassport: Pasaporte fitosanitario
observations: Observaciones observations: Observaciones
wireTransfer: "Forma de pago: Transferencia" wireTransfer: "Forma de pago: Transferencia"
accountNumber: "Número de cuenta: {0}" accountNumber: "Número de cuenta: {0}"
services: Servicios

View File

@ -1,4 +1,4 @@
SELECT (SELECT
ir.id code, ir.id code,
ir.description description, ir.description description,
CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems, CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems,
@ -19,4 +19,14 @@ SELECT
WHERE t.refFk = ? WHERE t.refFk = ?
AND i.intrastatFk AND i.intrastatFk
GROUP BY i.intrastatFk GROUP BY i.intrastatFk
ORDER BY i.intrastatFk; 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 = ?);