This commit is contained in:
Joan Sanchez 2021-02-18 13:01:01 +01:00
parent af5f0db7f8
commit 20d9a99f6b
5 changed files with 21 additions and 23 deletions

View File

@ -40,10 +40,13 @@
<div class="body"> <div class="body">
<h3 class="uppercase">{{client.socialName}}</h3> <h3 class="uppercase">{{client.socialName}}</h3>
<div> <div>
{{client.street}} {{client.postalAddress}}
</div> </div>
<div> <div>
{{client.fi}} {{client.postcodeCity}}
</div>
<div>
{{$t('fiscalId')}}: {{client.fi}}
</div> </div>
</div> </div>
</div> </div>

View File

@ -9,7 +9,7 @@ module.exports = {
name: 'invoice', name: 'invoice',
async serverPrefetch() { async serverPrefetch() {
this.invoice = await this.fetchInvoice(this.invoiceId); this.invoice = await this.fetchInvoice(this.invoiceId);
this.client = {}; this.client = await this.fetchClient(this.invoiceId);
this.address = {}; this.address = {};
this.sales = []; this.sales = [];
this.services = []; this.services = [];

View File

@ -1,8 +1,9 @@
title: Factura title: Factura
invoice: Factura invoice: Factura
clientId: Cliente clientId: Cliente
deliveryAddress: Dirección de entrega invoiceData: Datos de facturación
fiscalData: Datos fiscales fiscalId: CIF / NIF
invoiceRef: Factura {0}
saleLines: Líneas de pedido saleLines: Líneas de pedido
date: Fecha date: Fecha
reference: Ref. reference: Ref.
@ -21,7 +22,4 @@ subtotal: Subtotal
taxBreakdown: Desglose impositivo taxBreakdown: Desglose impositivo
packagings: Cubos y embalajes packagings: Cubos y embalajes
services: Servicios services: Servicios
vatType: Tipo de IVA
digitalSignature: Firma digital
invoiceRef: Factura {0}
plantPassport: Pasaporte fitosanitario plantPassport: Pasaporte fitosanitario

View File

@ -1,8 +1,12 @@
SELECT SELECT
c.id, c.id,
c.socialName, c.socialName,
c.street, c.street AS postalAddress,
c.fi IF (ios.taxAreaFk IS NOT NULL, CONCAT(cty.code, c.fi), c.fi) fi,
FROM ticket t CONCAT(c.postcode, ' - ', c.city) postcodeCity
JOIN client c ON c.id = t.clientFk FROM vn.invoiceOut io
WHERE t.id = ? JOIN vn.client c ON c.id = io.clientFk
JOIN vn.country cty ON cty.id = c.countryFk
LEFT JOIN vn.invoiceOutSerial ios ON ios.code = io.serial
AND ios.taxAreaFk = 'CEE'
WHERE io.id = ?

View File

@ -3,15 +3,8 @@ SELECT
io.clientFk, io.clientFk,
io.companyFk, io.companyFk,
io.ref, io.ref,
c.socialName, cny.code companyCode
c.street postalAddress,
cny.code companyCode,
IF (ios.taxAreaFk IS NOT NULL, CONCAT(cty.code, c.fi), c.fi) fi,
CONCAT(c.postcode,' - ',c.city) postcodeCity
FROM vn.invoiceOut io FROM vn.invoiceOut io
JOIN vn.client c ON c.id = io.clientFk JOIN vn.client c ON c.id = io.clientFk
JOIN vn.country cty ON cty.id = c.countryFk
JOIN company cny ON cny.id = io.companyFk JOIN company cny ON cny.id = io.companyFk
LEFT JOIN vn.invoiceOutSerial ios ON ios.code = io.serial
AND ios.taxAreaFk = 'CEE'
WHERE io.id = ? WHERE io.id = ?