CREATE VIEW [dbo].[_ComisionVta]
AS
SELECT     dbo._COMISION.TipoFac, dbo._COMISION.NumeroD, dbo._COMISION.FechaE, dbo._COMISION.VEND AS CodVend, dbo.SAVEND.Descrip AS NomVend, dbo._COMISION.CodClie, dbo._COMISION.Descrip, 
                      dbo._COMISION.CodItem, dbo._COMISION.Descrip1, dbo._COMISION.Cantidad, dbo._COMISION.TOTAL, dbo._COMISION.Costo, dbo._COMISION.Precio, dbo._COMISION.FACTOR, dbo._COMISION.ORDENC, dbo._COMISION.esexento, 
                          (SELECT     TOP (1) Monto
                            FROM          dbo.SACVEN
                            WHERE      (CodVend = dbo._COMISION.VEND) AND (TipoRgo = 5) AND (NroUnico = 1)) AS PorComision
FROM         dbo.SAVEND INNER JOIN
                      dbo._COMISION ON dbo.SAVEND.CodVend = dbo._COMISION.VEND