Vista SQL para Facturas ventas con lineas de A3ERP

SELECT dbo.CABEFACV.IDFACV, dbo.CABEFACV.SERIE AS Serie, dbo.CABEFACV.NUMDOC AS Numero, dbo.CABEFACV.FECHA AS Fecha, dbo.CABEFACV.CODCLI AS Cliente, dbo.CABEFACV.NOMCLI AS [Cliente nombre],
dbo.LINEFACT.CODART AS Articulo, dbo.ARTICULO.DESCART AS [Articulo descripcion], dbo.LINEFACT.UNIDADES AS Unidades, dbo.LINEFACT.PRECIO AS Precio, dbo.LINEFACT.BASEMONEDA AS Importe,
dbo.LINEFACT.PRCMEDIO AS [Precio coste], dbo.PROVINCI.NOMPROVI AS Provincia, dbo.PAISES.NOMPAIS AS Pais, dbo.REPRESEN.NOMREP AS [Representante nombre], dbo.LINEFACT.CODREP AS Representante,
dbo.ARTICULO.CAR1 AS Familia, dbo.Caracter_Art_1.DESCCAR AS [Familia descripcion], dbo.CABEFACV.POBCLI AS Poblacion
FROM dbo.CABEFACV LEFT OUTER JOIN
dbo.PAISES ON dbo.PAISES.CODPAIS = dbo.CABEFACV.CODPAIS LEFT OUTER JOIN
dbo.PROVINCI ON dbo.CABEFACV.CODPROVI = dbo.PROVINCI.CODPROVI LEFT OUTER JOIN
dbo.LINEFACT ON dbo.LINEFACT.IDFACV = dbo.CABEFACV.IDFACV LEFT OUTER JOIN
dbo.REPRESEN ON dbo.REPRESEN.CODREP = dbo.LINEFACT.CODREP LEFT OUTER JOIN
dbo.ARTICULO ON dbo.ARTICULO.CODART = dbo.LINEFACT.CODART LEFT OUTER JOIN
dbo.Caracter_Art_1 ON dbo.ARTICULO.CAR1 = dbo.Caracter_Art_1.CODCAR

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.