USE [EnVisage]
GO

/****** Object:  View [dbo].[VW_ExpenditureCategory]    Script Date: 06/07/2016 10:39:13 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[VW_ExpenditureCategory]
AS
SELECT        A.Id, A.ExpenditureId, A.GLId, A.UOMId, A.CreditId, A.Type, A.UseType, A.CGEFX, A.SortOrder, A.WksSubjectToFee, A.SystemAttributeOne, A.SystemAttributeTwo, 
                         A.Name, A.AllowResourceAssignment, (CASE WHEN (A.CreditId IS NULL) THEN A.Name ELSE A.Name + ' (' + B.Name + ')' END) AS ExpCategoryWithCcName
FROM            dbo.ExpenditureCategory AS A LEFT OUTER JOIN
                         dbo.CreditDepartment AS B ON A.CreditId = B.Id

GO


