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">
<h3 class="uppercase">{{client.socialName}}</h3>
<div>
{{client.street}}
{{client.postalAddress}}
</div>
<div>
{{client.fi}}
{{client.postcodeCity}}
</div>
<div>
{{$t('fiscalId')}}: {{client.fi}}
</div>
</div>
</div>

View File

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

View File

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

View File

@ -1,8 +1,12 @@
SELECT
c.id,
c.socialName,
c.street,
c.fi
FROM ticket t
JOIN client c ON c.id = t.clientFk
WHERE t.id = ?
c.street AS postalAddress,
IF (ios.taxAreaFk IS NOT NULL, CONCAT(cty.code, c.fi), c.fi) fi,
CONCAT(c.postcode, ' - ', c.city) postcodeCity
FROM vn.invoiceOut io
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.companyFk,
io.ref,
c.socialName,
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
cny.code companyCode
FROM vn.invoiceOut io
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
LEFT JOIN vn.invoiceOutSerial ios ON ios.code = io.serial
AND ios.taxAreaFk = 'CEE'
WHERE io.id = ?