USE [dbmov]
GO
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'V_FcrtIngresos'
GO
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'V_FcrtIngresos'
GO
/****** Object:  View [dbo].[V_FcrtIngresos]    Script Date: 25/11/2020 17:06:46 ******/
DROP VIEW [dbo].[V_FcrtIngresos]
GO
/****** Object:  View [dbo].[V_FcrtIngresos]    Script Date: 25/11/2020 17:06:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[V_FcrtIngresos]
AS
SELECT        F.FAC_NUM, F.FAC_TIP, F.FAC_CIA, F.FAC_VAL, F.FAC_COS, C.CIU_DES, D.DET_VAL AS ValDetall, D.DET_COS AS CostDetall, D.DET_PES, D.DET_CAN
FROM            dbo.FACTURAS AS F INNER JOIN
                         dbo.DETMOV AS D ON F.FAC_NUM = D.DET_NUM AND F.FAC_TIP = D.DET_TIP AND F.FAC_CIA = D.DET_CIA INNER JOIN
                         dbpar.dbo.CIUDADES AS C ON D.DET_ORI = C.CIU_COD
GO