SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


IF EXISTS (SELECT * FROM sys.objects 
   WHERE object_id = OBJECT_ID(N'Pvta_FacturaH_Linea') )
DROP View Pvta_FacturaH_Linea
GO

Create VIEW Pvta_FacturaH_Linea
AS 
/* =================================
	Date: Feb 02,2016
   =================================	      
*/

 Select Id_Fali,
         Id_Fact,
         Precio_Neto,
         Cantidad = dbo.Get_Cant_Art_Post_Hist(id_fali),
         Precio   = Sum(dbo.Get_Cant_Art_Post_Hist(id_fali) * Precio_neto)
     From RESTHFAL 
     Group by id_fali,id_fact,precio_neto


GO



