IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'TT_CHALAN_OL', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'TT_CHALAN_OL'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'TT_CHALAN_OL', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'TT_CHALAN_OL'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'storehistview', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehistview'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'storehistview', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehistview'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'storehistview', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehistview'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'storehist_view1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehist_view1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'storehist_view1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehist_view1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'storebamtview', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storebamtview'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'storebamtview', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storebamtview'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'sptbrs_v1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'sptbrs_v1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'sptbrs_v1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'sptbrs_v1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'ROOM_GUEST', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ROOM_GUEST'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'ROOM_GUEST', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ROOM_GUEST'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'ROOM_GUEST', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ROOM_GUEST'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'phview_forservice', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'phview_forservice'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'phview_forservice', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'phview_forservice'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'KitSale31', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KitSale31'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'KitSale31', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KitSale31'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'KitSale31', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KitSale31'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'KITSALE3', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITSALE3'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'KITSALE3', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITSALE3'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'KITSALE3', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITSALE3'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'kitmast_v', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'kitmast_v'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'kitmast_v', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'kitmast_v'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'KITITEM', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITITEM'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'KITITEM', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITITEM'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'KITITEM', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITITEM'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'CURRENTKOT_V11', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CURRENTKOT_V11'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'CURRENTKOT_V11', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CURRENTKOT_V11'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'CURRENTKOT_V11', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CURRENTKOT_V11'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'currentkot_v1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'currentkot_v1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'currentkot_v1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'currentkot_v1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'CO_REST_OL', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CO_REST_OL'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'CO_REST_OL', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane2' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CO_REST_OL'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'CO_REST_OL', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CO_REST_OL'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'BillView_Revenue1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'BillView_Revenue1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'BillView_Revenue1', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'BillView_Revenue1'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'bh', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'bh'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'bh', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'bh'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'a_kitmast_v', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'a_kitmast_v'
GO
IF  EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'a_kitmast_v', NULL,NULL))
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'a_kitmast_v'
GO
/****** Object:  View [dbo].[VouView]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[VouView]'))
DROP VIEW [dbo].[VouView]
GO
/****** Object:  View [dbo].[Vou_view]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[Vou_view]'))
DROP VIEW [dbo].[Vou_view]
GO
/****** Object:  View [dbo].[VCH_GL]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[VCH_GL]'))
DROP VIEW [dbo].[VCH_GL]
GO
/****** Object:  View [dbo].[TT_CHALAN_OL]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TT_CHALAN_OL]'))
DROP VIEW [dbo].[TT_CHALAN_OL]
GO
/****** Object:  View [dbo].[tallynew]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[tallynew]'))
DROP VIEW [dbo].[tallynew]
GO
/****** Object:  View [dbo].[TALLYDR]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TALLYDR]'))
DROP VIEW [dbo].[TALLYDR]
GO
/****** Object:  View [dbo].[storeview]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[storeview]'))
DROP VIEW [dbo].[storeview]
GO
/****** Object:  View [dbo].[storehistview]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[storehistview]'))
DROP VIEW [dbo].[storehistview]
GO
/****** Object:  View [dbo].[storehist_view1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[storehist_view1]'))
DROP VIEW [dbo].[storehist_view1]
GO
/****** Object:  View [dbo].[storebamtview]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[storebamtview]'))
DROP VIEW [dbo].[storebamtview]
GO
/****** Object:  View [dbo].[sptbrs_v1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[sptbrs_v1]'))
DROP VIEW [dbo].[sptbrs_v1]
GO
/****** Object:  View [dbo].[sptbrs_ad_v]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[sptbrs_ad_v]'))
DROP VIEW [dbo].[sptbrs_ad_v]
GO
/****** Object:  View [dbo].[sptbrooms_v]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[sptbrooms_v]'))
DROP VIEW [dbo].[sptbrooms_v]
GO
/****** Object:  View [dbo].[spbills]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[spbills]'))
DROP VIEW [dbo].[spbills]
GO
/****** Object:  View [dbo].[phview_forservice]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[phview_forservice]'))
DROP VIEW [dbo].[phview_forservice]
GO
/****** Object:  View [dbo].[PH_VIEW2]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PH_VIEW2]'))
DROP VIEW [dbo].[PH_VIEW2]
GO
/****** Object:  View [dbo].[PH_VIEW11]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PH_VIEW11]'))
DROP VIEW [dbo].[PH_VIEW11]
GO
/****** Object:  View [dbo].[mybillsv]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[mybillsv]'))
DROP VIEW [dbo].[mybillsv]
GO
/****** Object:  View [dbo].[ledgernew]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ledgernew]'))
DROP VIEW [dbo].[ledgernew]
GO
/****** Object:  View [dbo].[KS_M_UW]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KS_M_UW]'))
DROP VIEW [dbo].[KS_M_UW]
GO
/****** Object:  View [dbo].[KITSALE]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITSALE]'))
DROP VIEW [dbo].[KITSALE]
GO
/****** Object:  View [dbo].[kitmast_v]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kitmast_v]'))
DROP VIEW [dbo].[kitmast_v]
GO
/****** Object:  View [dbo].[guest_view_new]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[guest_view_new]'))
DROP VIEW [dbo].[guest_view_new]
GO
/****** Object:  View [dbo].[GP_View]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[GP_View]'))
DROP VIEW [dbo].[GP_View]
GO
/****** Object:  View [dbo].[dummybillview]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[dummybillview]'))
DROP VIEW [dbo].[dummybillview]
GO
/****** Object:  View [dbo].[doorcust_view]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[doorcust_view]'))
DROP VIEW [dbo].[doorcust_view]
GO
/****** Object:  View [dbo].[DAYBK]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[DAYBK]'))
DROP VIEW [dbo].[DAYBK]
GO
/****** Object:  View [dbo].[currentkot_v1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[currentkot_v1]'))
DROP VIEW [dbo].[currentkot_v1]
GO
/****** Object:  View [dbo].[cry_CASHFLOW]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[cry_CASHFLOW]'))
DROP VIEW [dbo].[cry_CASHFLOW]
GO
/****** Object:  View [dbo].[CO1GRNO_UNION]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CO1GRNO_UNION]'))
DROP VIEW [dbo].[CO1GRNO_UNION]
GO
/****** Object:  View [dbo].[CO_FY]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CO_FY]'))
DROP VIEW [dbo].[CO_FY]
GO
/****** Object:  View [dbo].[chalanview1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[chalanview1]'))
DROP VIEW [dbo].[chalanview1]
GO
/****** Object:  View [dbo].[CASHFLOW]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CASHFLOW]'))
DROP VIEW [dbo].[CASHFLOW]
GO
/****** Object:  View [dbo].[BSTAQ8772N]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BSTAQ8772N]'))
DROP VIEW [dbo].[BSTAQ8772N]
GO
/****** Object:  View [dbo].[BSQVI1904C]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BSQVI1904C]'))
DROP VIEW [dbo].[BSQVI1904C]
GO
/****** Object:  View [dbo].[BSEPC5717L]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BSEPC5717L]'))
DROP VIEW [dbo].[BSEPC5717L]
GO
/****** Object:  View [dbo].[BSDGD7899W]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BSDGD7899W]'))
DROP VIEW [dbo].[BSDGD7899W]
GO
/****** Object:  View [dbo].[BSAIU2400Y]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BSAIU2400Y]'))
DROP VIEW [dbo].[BSAIU2400Y]
GO
/****** Object:  View [dbo].[BnqAdv_MIS]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BnqAdv_MIS]'))
DROP VIEW [dbo].[BnqAdv_MIS]
GO
/****** Object:  View [dbo].[Bnq_MIS]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[Bnq_MIS]'))
DROP VIEW [dbo].[Bnq_MIS]
GO
/****** Object:  View [dbo].[BillView_Revenue1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BillView_Revenue1]'))
DROP VIEW [dbo].[BillView_Revenue1]
GO
/****** Object:  View [dbo].[billprint]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[billprint]'))
DROP VIEW [dbo].[billprint]
GO
/****** Object:  View [dbo].[bhtot]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[bhtot]'))
DROP VIEW [dbo].[bhtot]
GO
/****** Object:  View [dbo].[bh]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[bh]'))
DROP VIEW [dbo].[bh]
GO
/****** Object:  View [dbo].[advance_total_1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[advance_total_1]'))
DROP VIEW [dbo].[advance_total_1]
GO
/****** Object:  View [dbo].[addroom_v]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[addroom_v]'))
DROP VIEW [dbo].[addroom_v]
GO
/****** Object:  View [dbo].[balsheet_view1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[balsheet_view1]'))
DROP VIEW [dbo].[balsheet_view1]
GO
/****** Object:  View [dbo].[balsheet_view]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[balsheet_view]'))
DROP VIEW [dbo].[balsheet_view]
GO
/****** Object:  View [dbo].[Win_BillView_4]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[Win_BillView_4]'))
DROP VIEW [dbo].[Win_BillView_4]
GO
/****** Object:  View [dbo].[onacrc_view]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[onacrc_view]'))
DROP VIEW [dbo].[onacrc_view]
GO
/****** Object:  View [dbo].[TRIAL]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TRIAL]'))
DROP VIEW [dbo].[TRIAL]
GO
/****** Object:  View [dbo].[GLTB]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[GLTB]'))
DROP VIEW [dbo].[GLTB]
GO
/****** Object:  View [dbo].[KitSale31]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KitSale31]'))
DROP VIEW [dbo].[KitSale31]
GO
/****** Object:  View [dbo].[KITSALE3]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITSALE3]'))
DROP VIEW [dbo].[KITSALE3]
GO
/****** Object:  View [dbo].[KITHISTAMT_KR1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITHISTAMT_KR1]'))
DROP VIEW [dbo].[KITHISTAMT_KR1]
GO
/****** Object:  View [dbo].[KITHISTAMT]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITHISTAMT]'))
DROP VIEW [dbo].[KITHISTAMT]
GO
/****** Object:  View [dbo].[F2V1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[F2V1]'))
DROP VIEW [dbo].[F2V1]
GO
/****** Object:  View [dbo].[ph_room1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ph_room1]'))
DROP VIEW [dbo].[ph_room1]
GO
/****** Object:  View [dbo].[billview_forbrowse]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[billview_forbrowse]'))
DROP VIEW [dbo].[billview_forbrowse]
GO
/****** Object:  View [dbo].[billview]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[billview]'))
DROP VIEW [dbo].[billview]
GO
/****** Object:  View [dbo].[OCC_CHART]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[OCC_CHART]'))
DROP VIEW [dbo].[OCC_CHART]
GO
/****** Object:  View [dbo].[GUEST_VIEW_ADV]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[GUEST_VIEW_ADV]'))
DROP VIEW [dbo].[GUEST_VIEW_ADV]
GO
/****** Object:  View [dbo].[CURRENTKOT_V11]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CURRENTKOT_V11]'))
DROP VIEW [dbo].[CURRENTKOT_V11]
GO
/****** Object:  View [dbo].[CO_REST_OL]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CO_REST_OL]'))
DROP VIEW [dbo].[CO_REST_OL]
GO
/****** Object:  View [dbo].[ADV_Guest]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ADV_Guest]'))
DROP VIEW [dbo].[ADV_Guest]
GO
/****** Object:  View [dbo].[roomduesbh1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[roomduesbh1]'))
DROP VIEW [dbo].[roomduesbh1]
GO
/****** Object:  View [dbo].[RoomDuesVCon]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[RoomDuesVCon]'))
DROP VIEW [dbo].[RoomDuesVCon]
GO
/****** Object:  View [dbo].[phoneview1_total]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[phoneview1_total]'))
DROP VIEW [dbo].[phoneview1_total]
GO
/****** Object:  View [dbo].[phoneview1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[phoneview1]'))
DROP VIEW [dbo].[phoneview1]
GO
/****** Object:  View [dbo].[adv_gues1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[adv_gues1]'))
DROP VIEW [dbo].[adv_gues1]
GO
/****** Object:  View [dbo].[adv_gue11]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[adv_gue11]'))
DROP VIEW [dbo].[adv_gue11]
GO
/****** Object:  View [dbo].[Win_BillView_7]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[Win_BillView_7]'))
DROP VIEW [dbo].[Win_BillView_7]
GO
/****** Object:  View [dbo].[TT_MIS]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TT_MIS]'))
DROP VIEW [dbo].[TT_MIS]
GO
/****** Object:  View [dbo].[ROOM_GUEST]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ROOM_GUEST]'))
DROP VIEW [dbo].[ROOM_GUEST]
GO
/****** Object:  View [dbo].[PH_ROOM]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PH_ROOM]'))
DROP VIEW [dbo].[PH_ROOM]
GO
/****** Object:  View [dbo].[PH_1VIEW]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PH_1VIEW]'))
DROP VIEW [dbo].[PH_1VIEW]
GO
/****** Object:  View [dbo].[B1ROOM_GUEST]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[B1ROOM_GUEST]'))
DROP VIEW [dbo].[B1ROOM_GUEST]
GO
/****** Object:  View [dbo].[advance_total]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[advance_total]'))
DROP VIEW [dbo].[advance_total]
GO
/****** Object:  View [dbo].[F3V2]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[F3V2]'))
DROP VIEW [dbo].[F3V2]
GO
/****** Object:  View [dbo].[F3V1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[F3V1]'))
DROP VIEW [dbo].[F3V1]
GO
/****** Object:  View [dbo].[F2V00]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[F2V00]'))
DROP VIEW [dbo].[F2V00]
GO
/****** Object:  View [dbo].[billview__F1V0]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[billview__F1V0]'))
DROP VIEW [dbo].[billview__F1V0]
GO
/****** Object:  View [dbo].[Win_BillView_6]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[Win_BillView_6]'))
DROP VIEW [dbo].[Win_BillView_6]
GO
/****** Object:  View [dbo].[PH_MIS]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PH_MIS]'))
DROP VIEW [dbo].[PH_MIS]
GO
/****** Object:  View [dbo].[PH_11VIEW]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PH_11VIEW]'))
DROP VIEW [dbo].[PH_11VIEW]
GO
/****** Object:  View [dbo].[KITITEM]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITITEM]'))
DROP VIEW [dbo].[KITITEM]
GO
/****** Object:  View [dbo].[kithist_post]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kithist_post]'))
DROP VIEW [dbo].[kithist_post]
GO
/****** Object:  View [dbo].[KitGroupSale_111]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KitGroupSale_111]'))
DROP VIEW [dbo].[KitGroupSale_111]
GO
/****** Object:  View [dbo].[KitGroupsale_11]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KitGroupsale_11]'))
DROP VIEW [dbo].[KitGroupsale_11]
GO
/****** Object:  View [dbo].[kitgroupsale_5]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kitgroupsale_5]'))
DROP VIEW [dbo].[kitgroupsale_5]
GO
/****** Object:  View [dbo].[kitgroupsale_4]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kitgroupsale_4]'))
DROP VIEW [dbo].[kitgroupsale_4]
GO
/****** Object:  View [dbo].[a_kitmast_v]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[a_kitmast_v]'))
DROP VIEW [dbo].[a_kitmast_v]
GO
/****** Object:  View [dbo].[kitgroupsale_31]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kitgroupsale_31]'))
DROP VIEW [dbo].[kitgroupsale_31]
GO
/****** Object:  View [dbo].[kitgroupsale_3]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kitgroupsale_3]'))
DROP VIEW [dbo].[kitgroupsale_3]
GO
/****** Object:  View [dbo].[KitGroupSale_2]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KitGroupSale_2]'))
DROP VIEW [dbo].[KitGroupSale_2]
GO
/****** Object:  View [dbo].[tallycrdr1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[tallycrdr1]'))
DROP VIEW [dbo].[tallycrdr1]
GO
/****** Object:  View [dbo].[kitviewf12total]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kitviewf12total]'))
DROP VIEW [dbo].[kitviewf12total]
GO
/****** Object:  View [dbo].[KITVIEWF12]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITVIEWF12]'))
DROP VIEW [dbo].[KITVIEWF12]
GO
/****** Object:  View [dbo].[PHVIEW3]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PHVIEW3]'))
DROP VIEW [dbo].[PHVIEW3]
GO
/****** Object:  View [dbo].[PH_2VIEW]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PH_2VIEW]'))
DROP VIEW [dbo].[PH_2VIEW]
GO
/****** Object:  View [dbo].[CO_PHONE_OL]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CO_PHONE_OL]'))
DROP VIEW [dbo].[CO_PHONE_OL]
GO
/****** Object:  View [dbo].[GUEST_VIEW1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[GUEST_VIEW1]'))
DROP VIEW [dbo].[GUEST_VIEW1]
GO
/****** Object:  View [dbo].[BILHIST1_VIEW]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[BILHIST1_VIEW]'))
DROP VIEW [dbo].[BILHIST1_VIEW]
GO
/****** Object:  View [dbo].[KIT_ROOM1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KIT_ROOM1]'))
DROP VIEW [dbo].[KIT_ROOM1]
GO
/****** Object:  View [dbo].[KIT_ROOM]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KIT_ROOM]'))
DROP VIEW [dbo].[KIT_ROOM]
GO
/****** Object:  View [dbo].[KIT_HISTAMT_KR1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KIT_HISTAMT_KR1]'))
DROP VIEW [dbo].[KIT_HISTAMT_KR1]
GO
/****** Object:  View [dbo].[TALLYCRDR]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TALLYCRDR]'))
DROP VIEW [dbo].[TALLYCRDR]
GO
/****** Object:  View [dbo].[TALLYCR1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TALLYCR1]'))
DROP VIEW [dbo].[TALLYCR1]
GO
/****** Object:  View [dbo].[TALLYCR]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[TALLYCR]'))
DROP VIEW [dbo].[TALLYCR]
GO
/****** Object:  View [dbo].[LEDGER1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[LEDGER1]'))
DROP VIEW [dbo].[LEDGER1]
GO
/****** Object:  View [dbo].[LEDGER]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[LEDGER]'))
DROP VIEW [dbo].[LEDGER]
GO
/****** Object:  View [dbo].[KITSALE_MODE_USERWISE]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITSALE_MODE_USERWISE]'))
DROP VIEW [dbo].[KITSALE_MODE_USERWISE]
GO
/****** Object:  View [dbo].[kithistamt22]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kithistamt22]'))
DROP VIEW [dbo].[kithistamt22]
GO
/****** Object:  View [dbo].[KITMIS]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITMIS]'))
DROP VIEW [dbo].[KITMIS]
GO
/****** Object:  View [dbo].[KITHISTAMT2]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITHISTAMT2]'))
DROP VIEW [dbo].[KITHISTAMT2]
GO
/****** Object:  View [dbo].[KIT_HISTAMT]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KIT_HISTAMT]'))
DROP VIEW [dbo].[KIT_HISTAMT]
GO
/****** Object:  View [dbo].[KITHIST_ST2]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITHIST_ST2]'))
DROP VIEW [dbo].[KITHIST_ST2]
GO
/****** Object:  View [dbo].[KITHIST_ST1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITHIST_ST1]'))
DROP VIEW [dbo].[KITHIST_ST1]
GO
/****** Object:  View [dbo].[KITHIST_ST]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITHIST_ST]'))
DROP VIEW [dbo].[KITHIST_ST]
GO
/****** Object:  View [dbo].[kitview1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kitview1]'))
DROP VIEW [dbo].[kitview1]
GO
/****** Object:  View [dbo].[KITSALE2]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KITSALE2]'))
DROP VIEW [dbo].[KITSALE2]
GO
/****** Object:  View [dbo].[kng2]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kng2]'))
DROP VIEW [dbo].[kng2]
GO
/****** Object:  View [dbo].[kng1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[kng1]'))
DROP VIEW [dbo].[kng1]
GO
/****** Object:  View [dbo].[KitGroupSale_1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KitGroupSale_1]'))
DROP VIEW [dbo].[KitGroupSale_1]
GO
/****** Object:  View [dbo].[KitGroupSale]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[KitGroupSale]'))
DROP VIEW [dbo].[KitGroupSale]
GO
/****** Object:  View [dbo].[CO_REST_OL1]    Script Date: 30/03/2026 11:33:48 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CO_REST_OL1]'))
DROP VIEW [dbo].[CO_REST_OL1]
GO
/****** Object:  View [dbo].[CO_REST_OL1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[CO_REST_OL1]
AS
SELECT     dbo.company.NAME AS coname, dbo.company.COMPANY AS COCODE, dbo.RESTCO.CHANNEL AS RCODE, dbo.RESTCO.NAME AS chname, 
                      dbo.OUTLET.CODE AS OCODE, dbo.OUTLET.NAME AS olname, dbo.OUTLET.GRNO, dbo.OUTLET.GRNO_TRF, dbo.OUTLET.CO1GRNO, 
                      dbo.OUTLET.LUX, dbo.OUTLET.SELFDEAL, dbo.OUTLET.SC_ACTNUM, dbo.OUTLET.STSET, dbo.OUTLET.SCSET, dbo.OUTLET.HNO_MYBOOK, 
                      dbo.OUTLET.RO_ACTNUM, dbo.OUTLET.DC_ACTNUM, dbo.OUTLET.ST_ACTNUM, dbo.OUTLET.BILLDATE, dbo.OUTLET.KOTNO, dbo.OUTLET.KOTDATE, 
                      dbo.OUTLET.ACTNUM, dbo.RESTCO.billposition1, dbo.RESTCO.billposition2, dbo.RESTCO.SHNAME, dbo.OUTLET.SC, 
                      dbo.OUTLET.FREEFOODVOUCHING, dbo.RESTCO.htl_receivable, dbo.OUTLET.hno_htlbook, dbo.RESTCO.self_receivable, dbo.company.add1, 
                      dbo.company.add2, dbo.company.city, dbo.company.phone, dbo.company.email, dbo.company.website, dbo.OUTLET.AUTOKOT, 
                      dbo.OUTLET.CURDATE, dbo.OUTLET.SALETAXNO, dbo.OUTLET.G_STAXINCL, dbo.RESTCO.line1, dbo.RESTCO.line2, dbo.OUTLET.G_cutter, 
                      dbo.OUTLET.ScRate, dbo.OUTLET.Duplicate, dbo.OUTLET.RoundOff, dbo.OUTLET.bno, dbo.OUTLET.VATONST
FROM         dbo.company INNER JOIN
                      dbo.RESTCO ON dbo.company.COMPANY = dbo.RESTCO.COMPANY INNER JOIN
                      dbo.OUTLET ON dbo.RESTCO.CHANNEL = dbo.OUTLET.CHANNEL






GO
/****** Object:  View [dbo].[KitGroupSale]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[KitGroupSale]
AS
SELECT kithist.ctrlno,kithist.bno,kithist.kot,kithist.code,
kithist.[name],kithist.qty,kithist.rate,isnull(kithist.strate,0) strate,kithist.tax,kithist.discount,
    KITHIST.QTY * KITHIST.RATE + KITHIST.TAX - KITHIST.DISCOUNT
     AS Amt, kitprime.grp AS grp, KITGROUP.NAME AS grpname, 
    KITMAST.ICODE AS icode, kitprime.class AS class, 
    kitprime.subclass AS subclass
FROM KITMAST INNER JOIN
    kitprime ON KITMAST.ICODE = kitprime.icode INNER JOIN
    KITGROUP ON 
    kitprime.grp = KITGROUP.CODE RIGHT OUTER JOIN
    KITHIST ON KITMAST.CODE = KITHIST.CODE















GO
/****** Object:  View [dbo].[KitGroupSale_1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[KitGroupSale_1]
AS
SELECT     dbo.KitGroupSale.ctrlno, dbo.KitGroupSale.bno, dbo.KitGroupSale.kot, dbo.KitGroupSale.code, dbo.KitGroupSale.name, dbo.KitGroupSale.qty, dbo.KitGroupSale.rate, 
                      dbo.KitGroupSale.strate, dbo.KitGroupSale.tax, dbo.KitGroupSale.discount, dbo.KitGroupSale.Amt, dbo.KitGroupSale.grp, dbo.KitGroupSale.grpname, 
                      dbo.KitGroupSale.icode, dbo.KitGroupSale.class, dbo.KitGroupSale.subclass, dbo.KITHIST1.TXNDT, dbo.KITHIST1.OUTLET, dbo.CO_REST_OL1.OCODE, 
                      dbo.CO_REST_OL1.coname, dbo.CO_REST_OL1.COCODE, dbo.CO_REST_OL1.RCODE, dbo.CO_REST_OL1.chname, dbo.CO_REST_OL1.olname, dbo.KITHIST1.SPLIT, 
                      dbo.KITHIST1.PMODE, dbo.KITHIST1.STSET, dbo.KITHIST1.ROAMT, dbo.KITHIST1.TNO, dbo.KITHIST1.PAX, dbo.KITHIST1.Ptype, dbo.KITHIST1.txntime
FROM         dbo.KITHIST1 INNER JOIN
                      dbo.KitGroupSale ON dbo.KITHIST1.BNO = dbo.KitGroupSale.bno INNER JOIN
                      dbo.CO_REST_OL1 ON dbo.KITHIST1.OUTLET = dbo.CO_REST_OL1.OCODE






GO
/****** Object:  View [dbo].[kng1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[kng1]
AS
SELECT     kg1.TXNDT, kg1.bno, SUM(CASE WHEN strate = 0 THEN 0 ELSE (qty * rate) - discount END) AS taxable, SUM(CASE WHEN strate = 0 THEN (qty * rate) 
                      - discount ELSE 0 END) AS nontaxable, kg1.SPLIT, kg1.PMODE, MIN(kg1.RCODE) AS rcode, kg1.OCODE, SUM(kg1.qty * kg1.rate) AS sale, SUM(kg1.tax) AS tax, 
                      SUM(kg1.discount) AS discount, kg1.strate, kg1.STSET, SUM(CASE WHEN strate = 0 THEN 0 ELSE discount END) AS tdiscount, 
                      SUM(CASE WHEN strate <> 0 THEN 0 ELSE discount END) AS ntdiscount, MIN(k1.SCAMT) AS scamt, MIN(k1.ROAMT) AS roamt, MIN(k1.ServiceTax) AS servicetax, 
                      MIN(k1.CESS) AS cess, k1.FinalAmt
FROM         dbo.KitGroupSale_1 AS kg1 INNER JOIN
                      dbo.KITHIST1 AS k1 ON kg1.bno = k1.BNO
WHERE     (kg1.SPLIT <> 'F') AND (kg1.PMODE <> 6)
GROUP BY kg1.TXNDT, kg1.SPLIT, kg1.PMODE, kg1.OCODE, kg1.strate, kg1.STSET, kg1.bno, kg1.OCODE, k1.FinalAmt






GO
/****** Object:  View [dbo].[kng2]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[kng2]
AS
SELECT     TXNDT, bno, taxable, nontaxable, SPLIT, PMODE, rcode, OCODE, sale, tax, discount, strate, STSET, tdiscount, ntdiscount, scamt, roamt, servicetax, cess, 
                      CASE WHEN pmode = 1 THEN finalamt ELSE 0 END AS cash, CASE WHEN pmode = 2 THEN finalamt ELSE 0 END AS rs, 
                      CASE WHEN pmode = 3 THEN finalamt ELSE 0 END AS br, CASE WHEN pmode = 4 THEN finalamt ELSE 0 END AS gl, 
                      CASE WHEN pmode = 5 THEN finalamt ELSE 0 END AS crcard, DATEDIFF(d, '1/1/2000', TXNDT) AS ddf
FROM         dbo.kng1






GO
/****** Object:  View [dbo].[KITSALE2]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[KITSALE2]
AS
SELECT KITHIST1.BNO AS CNO, KITHIST1.PMODE, 
    SUM(KITHIST.RATE * KITHIST.QTY + KITHIST.TAX - KITHIST.DISCOUNT)
     + KITHIST1.ROAMT + KITHIST1.SCAMT AS NETT, 
    KITHIST1.DRATE, KITHIST1.ROAMT, KITHIST1.TXNDT, 
    KITHIST1.SNO AS [BILL NO], KITHIST1.OUTLET, 
    KITHIST1.SCAMT, KITHIST1.SCRATE, KITHIST1.LUX, 
    KITHIST1.usernm
FROM KITHIST1 INNER JOIN
    KITHIST ON KITHIST1.BNO = KITHIST.BNO
GROUP BY KITHIST1.BNO, KITHIST1.ROAMT, KITHIST1.PMODE, 
    KITHIST1.TXNDT, KITHIST1.DRATE, KITHIST1.SNO, 
    KITHIST1.OUTLET, KITHIST1.SCAMT, KITHIST1.SCRATE, 
    KITHIST1.LUX, KITHIST1.usernm















GO
/****** Object:  View [dbo].[kitview1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[kitview1]
AS
SELECT     TXNDT, mop0 = CASE WHEN pmode = 1 THEN nett ELSE 0 END, mop1 = CASE WHEN pmode = 5 THEN nett ELSE 0 END, mop2 = 0, 
                      mop3 = CASE WHEN pmode = 4 THEN nett ELSE 0 END, mop4 = CASE WHEN pmode = 3 THEN nett ELSE 0 END, 
                      mop5 = CASE WHEN pmode = 6 THEN nett ELSE 0 END
FROM         dbo.KITSALE2















GO
/****** Object:  View [dbo].[KITHIST_ST]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









/****** Object:  View dbo.KITHIST_ST    Script Date: 1/20/03 11:51:45 AM ******/
CREATE VIEW [dbo].[KITHIST_ST]
AS
SELECT KITHIST1.BNO, KITHIST1.DRATE, KITHIST1.TXNDT, 
    KITHIST1.GNO, KITHIST1.OUTLET, KITHIST1.RNO, 
    KITHIST1.PMODE, KITHIST1.SNO, KITHIST1.SPLIT, 
    KITHIST1.SELFDEAL, KITHIST1.WNO, KITHIST1.ROAMT, 
    KITHIST1.SCAMT, KITHIST1.RATETYPE, KITHIST1.SCRATE, 
    KITHIST1.STSET, KITHIST1.SCSET, KITHIST.KOT, 
    KITHIST.CODE, KITHIST.QTY, KITHIST.RATE, KITHIST.STRATE, 
    KITHIST.TAX, KITHIST.DISCOUNT, 
    KITHIST.QTY * KITHIST.RATE AS amt, KITHIST1.LUX
FROM KITHIST1 INNER JOIN
    KITHIST ON KITHIST1.BNO = KITHIST.BNO















GO
/****** Object:  View [dbo].[KITHIST_ST1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









/****** Object:  View dbo.KITHIST_ST1    Script Date: 1/20/03 11:51:46 AM ******/
CREATE VIEW [dbo].[KITHIST_ST1]
AS
SELECT KITHIST_ST.*, 
    'txbl' = CASE WHEN stset = 0 THEN amt ELSE amt - discount END
FROM KITHIST_ST















GO
/****** Object:  View [dbo].[KITHIST_ST2]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









/****** Object:  View dbo.KITHIST_ST2    Script Date: 1/20/03 11:51:46 AM ******/
CREATE VIEW [dbo].[KITHIST_ST2]
AS
SELECT TXNDT, OUTLET, STRATE, SUM(TAX) AS TAX, SUM(txbl) 
    AS TXBL
FROM KITHIST_ST1
GROUP BY TXNDT, OUTLET, STRATE















GO
/****** Object:  View [dbo].[KIT_HISTAMT]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[KIT_HISTAMT]
AS
SELECT        COUNT(*) AS Expr1, SUM(QTY * RATE + TAX - DISCOUNT) AS amt, BNO, SUM(QTY * RATE) AS QTYRATE, SUM(TAX) AS tax, SUM(DISCOUNT) AS discount, SUM(ST) 
                         AS st1, SUM(CESS) AS cess1, SUM(SC) AS sc1
FROM            dbo.KITHIST
GROUP BY BNO






GO
/****** Object:  View [dbo].[KITHISTAMT2]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[KITHISTAMT2]
AS
SELECT        SUM(dbo.KIT_HISTAMT.amt) AS AMT, CONVERT(varchar(20), dbo.KITHIST1.TXNDT, 106) AS txndt, dbo.KITHIST1.OUTLET, dbo.KITHIST1.ROAMT, 
                         dbo.KITHIST1.SCAMT AS Expr1, dbo.KITHIST1.LUX, dbo.KITHIST1.usernm, dbo.KIT_HISTAMT.BNO, dbo.KITHIST1.FinalAmt, dbo.KITHIST1.ServiceTax, 
                         dbo.KITHIST1.CESS, dbo.KIT_HISTAMT.st1, dbo.KIT_HISTAMT.cess1, dbo.KIT_HISTAMT.sc1
FROM            dbo.KIT_HISTAMT INNER JOIN
                         dbo.KITHIST1 ON dbo.KIT_HISTAMT.BNO = dbo.KITHIST1.BNO
GROUP BY dbo.KITHIST1.TXNDT, dbo.KITHIST1.OUTLET, dbo.KITHIST1.ROAMT, dbo.KITHIST1.SCAMT, dbo.KITHIST1.LUX, dbo.KITHIST1.usernm, dbo.KIT_HISTAMT.BNO, 
                         dbo.KITHIST1.FinalAmt, dbo.KITHIST1.ServiceTax, dbo.KITHIST1.CESS, dbo.KIT_HISTAMT.st1, dbo.KIT_HISTAMT.cess1, dbo.KIT_HISTAMT.sc1






GO
/****** Object:  View [dbo].[KITMIS]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[KITMIS]
AS
SELECT        dbo.KITHIST1.TXNDT, dbo.RESTCO.COMPANY, dbo.RESTCO.NAME, dbo.RESTCO.CHANNEL, dbo.KITHIST1.GNO, dbo.KITHIST1.PMODE AS MOP, 
                         dbo.KITHISTAMT2.BNO, dbo.KITHIST1.OUTLET, dbo.OUTLET.NAME AS olname, dbo.KITHISTAMT2.ServiceTax + dbo.KITHISTAMT2.st1 AS servicetax, 
                         dbo.KITHISTAMT2.cess1 + dbo.KITHISTAMT2.CESS AS cess, dbo.KITHISTAMT2.sc1, dbo.KITHISTAMT2.FinalAmt AS amount
FROM            dbo.KITHIST1 INNER JOIN
                         dbo.OUTLET ON dbo.KITHIST1.OUTLET = dbo.OUTLET.CODE INNER JOIN
                         dbo.RESTCO ON dbo.OUTLET.CHANNEL = dbo.RESTCO.CHANNEL INNER JOIN
                         dbo.KITHISTAMT2 ON dbo.KITHIST1.BNO = dbo.KITHISTAMT2.BNO
GROUP BY dbo.KITHIST1.TXNDT, dbo.KITHIST1.LUX, dbo.RESTCO.COMPANY, dbo.RESTCO.NAME, dbo.RESTCO.CHANNEL, dbo.KITHIST1.GNO, dbo.KITHIST1.PMODE, 
                         dbo.KITHISTAMT2.AMT, dbo.KITHISTAMT2.ROAMT, dbo.KITHISTAMT2.BNO, dbo.KITHIST1.OUTLET, dbo.OUTLET.NAME, dbo.KITHISTAMT2.FinalAmt, 
                         dbo.KITHISTAMT2.ServiceTax, dbo.KITHISTAMT2.CESS, dbo.KITHISTAMT2.st1, dbo.KITHISTAMT2.sc1, dbo.KITHISTAMT2.cess1





GO
/****** Object:  View [dbo].[kithistamt22]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[kithistamt22]
AS
SELECT SUM(KIT_HISTAMT.amt) AS AMT, KITHIST1.TXNDT, 
    KITHIST1.OUTLET, KITHIST1.ROAMT, KITHIST1.SCAMT, 
    KITHIST1.LUX, KITHIST1.usernm, KITHIST1.PMODE, 
    KITHIST1.BNO, KITHIST1.SNO
FROM KIT_HISTAMT INNER JOIN
    KITHIST1 ON KIT_HISTAMT.BNO = KITHIST1.BNO
GROUP BY KITHIST1.TXNDT, KITHIST1.OUTLET, KITHIST1.ROAMT, 
    KITHIST1.SCAMT, KITHIST1.LUX, KITHIST1.usernm, 
    KITHIST1.PMODE, KITHIST1.BNO, KITHIST1.SNO















GO
/****** Object:  View [dbo].[KITSALE_MODE_USERWISE]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[KITSALE_MODE_USERWISE]
AS
SELECT OUTLET.NAME, OUTLET.CHANNEL, 
    RESTCO.NAME AS chname, RESTCO.COMPANY, 
    kithistamt22.TXNDT, kithistamt22.OUTLET, 
    kithistamt22.usernm, kithistamt22.PMODE, 
    SUM(kithistamt22.AMT + kithistamt22.ROAMT + kithistamt22.SCAMT)
     AS amt, restpmode.name AS pmname
FROM OUTLET INNER JOIN
    RESTCO ON 
    OUTLET.CHANNEL = RESTCO.CHANNEL INNER JOIN
    kithistamt22 ON 
    OUTLET.CODE = kithistamt22.OUTLET INNER JOIN
    restpmode ON 
    kithistamt22.PMODE = restpmode.pmode
GROUP BY OUTLET.NAME, OUTLET.CHANNEL, RESTCO.NAME, 
    RESTCO.COMPANY, kithistamt22.TXNDT, 
    kithistamt22.OUTLET, kithistamt22.usernm, 
    kithistamt22.PMODE, restpmode.name















GO
/****** Object:  View [dbo].[LEDGER]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[LEDGER]
AS
SELECT TXNDT, PARTIC, GRNO, COMPANY, FY, 
    'DEBIT' = CASE WHEN AMTTYP = 'D' THEN STR(AMT, 12, 2) 
    ELSE '' END, 
    'CREDIT' = CASE WHEN AMTTYP = 'C' THEN STR(AMT, 12, 2) 
    ELSE '' END, VOUCHERS.BALANCE, [USER], ACTNUM, 
    VOUCHERS.TXNNO,
    VOUCHERS.TXNNO2,
    'DEBIT_I' = CASE WHEN AMTTYP = 'D' THEN AMT ELSE 0 END, 
    'CREDIT_I' = CASE WHEN AMTTYP = 'C' THEN AMT ELSE 0 END,
     'BALCRDR' = CASE WHEN BALANCE < 0 THEN STR(- BALANCE,
     14, 2) + ' Dr' ELSE STR(BALANCE, 14, 2) + ' Cr' END,
CUSNAM=(SELECT CGP_DESC FROM GLPRIMLD WHERE GLPRIMLD.FY=VOUCHERS.FY AND GLPRIMLD.CGP_ACTNO=VOUCHERS.ACTNUM)
FROM VOUCHERS
WHERE AMT <> 0

















GO
/****** Object:  View [dbo].[LEDGER1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO







CREATE VIEW [dbo].[LEDGER1]
AS
SELECT     dbo.LEDGER.*, dbo.company.NAME AS CONAME, dbo.GLPRIMLD.CGP_DESC AS CGP_DESC, dbo.GLPRIMLD.ADD1 AS add1, 
                      dbo.GLPRIMLD.ADD2 AS add2, dbo.GLPRIMLD.CITY AS city, dbo.GLPRIMLD.PHONE AS phone, dbo.company.add1 AS coadd1, 
                      dbo.company.add2 AS coadd2, dbo.company.city AS cocity
FROM         dbo.LEDGER LEFT OUTER JOIN
                      dbo.GLPRIMLD ON dbo.LEDGER.COMPANY = dbo.GLPRIMLD.COMPANY AND dbo.LEDGER.FY = dbo.GLPRIMLD.FY AND 
                      dbo.LEDGER.ACTNUM = dbo.GLPRIMLD.CGP_ACTNO LEFT OUTER JOIN
                      dbo.company ON dbo.LEDGER.COMPANY = dbo.company.COMPANY













GO
/****** Object:  View [dbo].[TALLYCR]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









/****** Object:  View dbo.TALLYCR    Script Date: 1/20/03 11:51:44 AM ******/
CREATE VIEW [dbo].[TALLYCR]
AS
SELECT TXNDT, COMPANY, FY, AMTTYP, 
    CREDIT = CASE WHEN AMTTYP = 'C' THEN SUM(AMT) 
    ELSE 0 END, GRNO
FROM VOUCHERS
WHERE AMTTYP = 'C' AND AMT <> 0
GROUP BY TXNDT, COMPANY, FY, GRNO, AMTTYP















GO
/****** Object:  View [dbo].[TALLYCR1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[TALLYCR1]
AS
SELECT TXNDT, COMPANY, FY, AMTTYP, 
    DEBIT = CASE WHEN AMTTYP = 'D' THEN SUM(AMT) 
    ELSE 0 END, GRNO
FROM VOUCHERS
WHERE AMTTYP = 'D' AND AMT <> 0
GROUP BY TXNDT, COMPANY, FY, GRNO, AMTTYP















GO
/****** Object:  View [dbo].[TALLYCRDR]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









--DROP VIEW TALLYCRDR
CREATE VIEW [dbo].[TALLYCRDR]
AS
SELECT     ISNULL(dbo.TALLYCR.GRNO, dbo.TALLYCR1.GRNO) AS grno, ISNULL(dbo.TALLYCR.CREDIT, 0) AS credit, ISNULL(dbo.TALLYCR.FY, dbo.TALLYCR1.FY) 
                      AS fy, ISNULL(dbo.TALLYCR.COMPANY, dbo.TALLYCR1.COMPANY) AS company, ISNULL(dbo.TALLYCR.TXNDT, dbo.TALLYCR1.TXNDT) AS txndt, 
                      ISNULL(dbo.TALLYCR1.DEBIT, 0) AS debit
FROM         dbo.TALLYCR FULL OUTER JOIN
                      dbo.TALLYCR1 ON dbo.TALLYCR.TXNDT = dbo.TALLYCR1.TXNDT AND dbo.TALLYCR.COMPANY = dbo.TALLYCR1.COMPANY AND 
                      dbo.TALLYCR.FY = dbo.TALLYCR1.FY AND dbo.TALLYCR.GRNO = dbo.TALLYCR1.GRNO















GO
/****** Object:  View [dbo].[KIT_HISTAMT_KR1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[KIT_HISTAMT_KR1]
AS
SELECT SUM(amt) AS AMT, BNO, SUM(QTYRATE) AS QTYRATE, 
    SUM(TAX) AS TAX, SUM(DISCOUNT) AS DISCOUNT
FROM KIT_HISTAMT
GROUP BY BNO















GO
/****** Object:  View [dbo].[KIT_ROOM]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[KIT_ROOM]
AS
SELECT     dbo.KITHIST1.DRATE, dbo.KITHIST1.TXNDT, dbo.KITHIST1.OUTLET, dbo.KITHIST1.GNO, dbo.KITHIST1.RNO, dbo.KITHIST1.PMODE, dbo.KITHIST1.SNO, 
                      dbo.KITHIST1.SPLIT, dbo.KITHIST1.SELFDEAL, dbo.KITHIST1.WNO, dbo.KITHIST1.ROAMT, dbo.KITHIST1.RATETYPE, dbo.KITHIST1.SCAMT, 
                      dbo.KITHIST1.SCRATE, dbo.KITHIST1.STSET, dbo.KITHIST1.SCSET, dbo.KITHIST1.CRNAME, dbo.KITHIST1.CRNUM, dbo.KITHIST1.CRTYPE, 
                      dbo.OUTLET.CHANNEL, dbo.RESTCO.COMPANY, dbo.KITHIST1.LUX, 
                      dbo.KIT_HISTAMT_KR1.AMT + dbo.KITHIST1.ROAMT + dbo.KITHIST1.SCAMT AS AMT, dbo.KIT_HISTAMT_KR1.BNO, dbo.KIT_HISTAMT_KR1.QTYRATE, 
                      dbo.KIT_HISTAMT_KR1.TAX, dbo.KIT_HISTAMT_KR1.DISCOUNT, dbo.KITHIST1.FinalAmt
FROM         dbo.KIT_HISTAMT_KR1 INNER JOIN
                      dbo.KITHIST1 ON dbo.KIT_HISTAMT_KR1.BNO = dbo.KITHIST1.BNO LEFT OUTER JOIN
                      dbo.RESTCO INNER JOIN
                      dbo.OUTLET ON dbo.RESTCO.CHANNEL = dbo.OUTLET.CHANNEL ON dbo.KITHIST1.OUTLET = dbo.OUTLET.CODE
WHERE     (dbo.KITHIST1.PMODE = 2)















GO
/****** Object:  View [dbo].[KIT_ROOM1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[KIT_ROOM1]
AS
SELECT     dbo.KIT_ROOM.DRATE, dbo.KIT_ROOM.TXNDT, dbo.KIT_ROOM.OUTLET, dbo.KIT_ROOM.GNO, dbo.KIT_ROOM.RNO, dbo.KIT_ROOM.PMODE, 
                      dbo.KIT_ROOM.SNO, dbo.KIT_ROOM.SPLIT, dbo.KIT_ROOM.SELFDEAL, dbo.KIT_ROOM.WNO, dbo.KIT_ROOM.ROAMT, dbo.KIT_ROOM.RATETYPE, 
                      dbo.KIT_ROOM.SCAMT, dbo.KIT_ROOM.SCRATE, dbo.KIT_ROOM.STSET, dbo.KIT_ROOM.CRNAME, dbo.KIT_ROOM.CRNUM, dbo.KIT_ROOM.SCSET, 
                      dbo.KIT_ROOM.CRTYPE, dbo.KIT_ROOM.CHANNEL, dbo.KIT_ROOM.COMPANY, dbo.KIT_ROOM.LUX, dbo.KIT_ROOM.AMT, dbo.KIT_ROOM.BNO, 
                      dbo.KIT_ROOM.QTYRATE, dbo.KIT_ROOM.TAX, dbo.KIT_ROOM.DISCOUNT, dbo.OUTLET.NAME, 
                      'NEWSPLIT' = CASE WHEN SPLIT = 'N' THEN 'A' WHEN SPLIT = 'Y' THEN 'B' ELSE 'C' END
FROM         dbo.KIT_ROOM INNER JOIN
                      dbo.OUTLET ON dbo.KIT_ROOM.OUTLET = dbo.OUTLET.CODE















GO
/****** Object:  View [dbo].[BILHIST1_VIEW]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[BILHIST1_VIEW]
AS
SELECT     dbo.BILLHIST1.*
FROM         dbo.BILLHIST1
WHERE     (COMPANY = 1) AND (SPLIT = 'N')















GO
/****** Object:  View [dbo].[GUEST_VIEW1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[GUEST_VIEW1]
AS
SELECT     TOP 100 PERCENT dbo.GUEST.CNO, dbo.GUEST.GNO, dbo.GUEST.ENO, dbo.GUEST.RNO, CONVERT(varchar(20), dbo.GUEST.CI_DATE, 103) 
                      AS [CHK IN DATE], CONVERT(varchar(20), dbo.GUEST.CO_DATE, 103) AS [CHK OUT DATE], dbo.GUEST.GRNO, dbo.GUEST.FOODPLAN, 
                      dbo.GUEST.RENT, dbo.GUEST.DISCOUNT, dbo.GUEST.SC, dbo.GUEST.MALE, dbo.GUEST.FEMALE, dbo.GUEST.CHILD, dbo.GUEST.CI_TIME, 
                      dbo.GUEST.CO_TIME, dbo.BILHIST1_VIEW.BNO, dbo.GUEST.CI_DATE, dbo.GUEST.CO_DATE, CONVERT(CHAR(10), dbo.GUEST.CI_DATE, 8) 
                      AS [CHK IN TIME], CONVERT(CHAR(10), dbo.GUEST.CO_DATE, 8) AS [CHK OUT TIME], dbo.GUEST.grpname, dbo.GUEST.grpcounter, 
                      dbo.GUEST.userchkin, dbo.GUEST.userchkout, dbo.GUEST.LT, dbo.BILHIST1_VIEW.MOP, dbo.BILHIST1_VIEW.ADVANCE, dbo.GUEST.FP_details, 
                      dbo.GCOMPANY.NAME AS gcompany, dbo.GUEST.Address, dbo.GUEST.Name, dbo.GUEST.Add1, dbo.GUEST.Add2, dbo.GUEST.Add3, dbo.GUEST.City, 
                      dbo.GUEST.State, dbo.GUEST.Phone, dbo.GUEST.email, dbo.GUEST.company, dbo.GUEST.PIN, dbo.GUEST.fax
FROM         dbo.GUEST LEFT OUTER JOIN
                      dbo.BILHIST1_VIEW ON dbo.GUEST.BRNO = dbo.BILHIST1_VIEW.BRNO LEFT OUTER JOIN
                      dbo.GCOMPANY ON dbo.GUEST.company = dbo.GCOMPANY.COMNO
ORDER BY dbo.GUEST.GNO DESC















GO
/****** Object:  View [dbo].[CO_PHONE_OL]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









/****** Object:  View dbo.CO_PHONE_OL    Script Date: 1/20/03 11:51:44 AM ******/
CREATE VIEW [dbo].[CO_PHONE_OL]
AS
SELECT     dbo.PHOUTLET.OUTLET, dbo.PHOUTLET.NAME, dbo.PHOUTLET.COMPANY, dbo.PHOUTLET.GL_ACTNUM, dbo.PHOUTLET.DC_ACTNUM, 
                      dbo.PHOUTLET.SNO, dbo.PHOUTLET.BILLDATE, dbo.PHOUTLET.GRNO, dbo.PHOUTLET.GRNO_TRF, dbo.PHOUTLET.SELFDEAL, 
                      dbo.PHOUTLET.HNO_MYBOOK, dbo.PHOUTLET.HNO_HTLBOOK, dbo.PHOUTLET.CO1GRNO, dbo.COMPANY.NAME AS CONAME, dbo.COMPANY.add1, 
                      dbo.COMPANY.add2, dbo.COMPANY.city, dbo.COMPANY.phone, dbo.COMPANY.email, dbo.COMPANY.website, dbo.COMPANY.info1, 
                      dbo.COMPANY.info2, dbo.PHOUTLET.BILLPOSITION1, dbo.PHOUTLET.LUX, dbo.PHOUTLET.BILLPOSITION2, dbo.PHOUTLET.SHNAME, 
                      dbo.PHOUTLET.SC
FROM         dbo.PHOUTLET INNER JOIN
                      dbo.COMPANY ON dbo.PHOUTLET.COMPANY = dbo.COMPANY.COMPANY















GO
/****** Object:  View [dbo].[PH_2VIEW]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[PH_2VIEW]
AS
SELECT dbo.PHONE.OUTLET, dbo.PHONE.TXNDT, 
    dbo.PHONE.PMODE, dbo.PHONE.CNO, dbo.PHONE.SNO, 
    SUM(dbo.PHHIST.AMOUNT) AS AMOUNT, dbo.PHONE.DAMT, 
    dbo.PHONE.LUX, dbo.PHONE.GNO, dbo.PHONE.DRATE, 
    dbo.PHONE.CD_NUM, dbo.PHONE.CD_NAME, 
    dbo.PHONE.CD_TYPE, dbo.PHONE.SPLIT, dbo.PHONE.RNO, 
    dbo.PHONE.CRNAME, dbo.PHONE.CRNUM, 
    dbo.PHONE.CRTYPE, dbo.PHONE.txntime
FROM dbo.PHONE INNER JOIN
    dbo.PHHIST ON dbo.PHONE.CNO = dbo.PHHIST.CNO
GROUP BY dbo.PHONE.OUTLET, dbo.PHONE.TXNDT, 
    dbo.PHONE.PMODE, dbo.PHONE.CNO, dbo.PHONE.SNO, 
    dbo.PHONE.DAMT, dbo.PHONE.LUX, dbo.PHONE.GNO, 
    dbo.PHONE.DRATE, dbo.PHONE.CD_NUM, 
    dbo.PHONE.CD_NAME, dbo.PHONE.CD_TYPE, 
    dbo.PHONE.SPLIT, dbo.PHONE.RNO, dbo.PHONE.CRNAME, 
    dbo.PHONE.CRNUM, dbo.PHONE.CRTYPE, dbo.PHONE.txntime















GO
/****** Object:  View [dbo].[PHVIEW3]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO












CREATE VIEW [dbo].[PHVIEW3]
AS
SELECT PHHIST.PARTIC, PHHIST.AMOUNT AS AMT, 
    restpmode.name AS PAYMENT, 
    GUEST_VIEW1.NAME AS GNAME, 
    GUEST_VIEW1.ADD1 AS GADD1, 
    GUEST_VIEW1.ADD2 AS GADD2, 
    GUEST_VIEW1.ADD3 AS GADD3, 
    GUEST_VIEW1.CITY AS GCITY, GUEST_VIEW1.PIN AS GPIN, 
    GUEST_VIEW1.STATE AS GSTATE, 
    GUEST_VIEW1.PHONE AS GPHONE, 
    GUEST_VIEW1.FAX AS GFAX, 
    GUEST_VIEW1.EMAIL AS GEMAIL, 
    GUEST_VIEW1.COMPANY AS GCOMPANY, 
    GUEST_VIEW1.CNO AS GCNO, GUEST_VIEW1.ENO AS GENO, 
    GUEST_VIEW1.RNO AS GRNO, 
    GUEST_VIEW1.[CHK IN DATE] AS cid, 
    GUEST_VIEW1.[CHK OUT DATE] AS cod, 
    GUEST_VIEW1.GRNO AS GGRNO, 
    GUEST_VIEW1.FOODPLAN AS GFOODPLAN, 
    GUEST_VIEW1.RENT AS GRENT, 
    GUEST_VIEW1.DISCOUNT AS GDISCOUNT, 
    GUEST_VIEW1.SC AS GSC, GUEST_VIEW1.MALE AS GMALE, 
    GUEST_VIEW1.FEMALE AS GFEMALE, 
    GUEST_VIEW1.CHILD AS GCHIL, 
    GUEST_VIEW1.CI_TIME AS GCI_TIME, 
    GUEST_VIEW1.CO_TIME AS GCO_TIME, 
    GUEST_VIEW1.BNO AS GBNO, 
    GUEST_VIEW1.CI_DATE AS GCI_DATE, 
    GUEST_VIEW1.CO_DATE AS GCO_DATE, 
    GUEST_VIEW1.[CHK IN TIME] AS cit, 
    GUEST_VIEW1.[CHK OUT TIME] AS cot, 
    GUEST_VIEW1.grpname AS GRNPNAME, 
    CO_PHONE_OL.NAME AS OLNAME, 
    CO_PHONE_OL.COMPANY AS company, 
    CO_PHONE_OL.CONAME AS coname, 
    CO_PHONE_OL.add1 AS COADD1, 
    CO_PHONE_OL.add2 AS COADD2, 
    CO_PHONE_OL.city AS COCITY, 
    CO_PHONE_OL.phone AS COPHONE, 
    CO_PHONE_OL.email AS COEMAIL, 
    CO_PHONE_OL.website AS website, 
    CO_PHONE_OL.SHNAME AS shname, 
    GUEST_VIEW1.ADDRESS AS gaddress, PH_2VIEW.*
FROM CO_PHONE_OL RIGHT OUTER JOIN
    PH_2VIEW ON 
    CO_PHONE_OL.OUTLET = PH_2VIEW.OUTLET LEFT OUTER JOIN
    GUEST_VIEW1 ON 
    PH_2VIEW.GNO = GUEST_VIEW1.GNO LEFT OUTER JOIN
    restpmode ON 
    PH_2VIEW.PMODE = restpmode.pmode RIGHT OUTER JOIN
    PHHIST ON PH_2VIEW.CNO = PHHIST.CNO



















GO
/****** Object:  View [dbo].[KITVIEWF12]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[KITVIEWF12]
AS
SELECT     dbo.KITHIST1.BNO, dbo.KITHIST1.TXNDT, dbo.KITHIST1.PMODE AS MOP, 
                      dbo.KIT_HISTAMT_KR1.AMT + dbo.KITHIST1.ROAMT + dbo.KITHIST1.SCAMT AS amt, dbo.KITHIST1.usernm, dbo.KITHIST1.txntime, 
                      dbo.WAITER.NAME AS WNAME, dbo.KITHIST1.SNO, dbo.KITHIST1.ROAMT, dbo.KITHIST1.OUTLET, dbo.KITHIST1.RNO, dbo.KITHIST1.SPLIT, 
                      dbo.KITHIST1.Ptype
FROM         dbo.KITHIST1 LEFT OUTER JOIN
                      dbo.KIT_HISTAMT_KR1 ON dbo.KITHIST1.BNO = dbo.KIT_HISTAMT_KR1.BNO LEFT OUTER JOIN
                      dbo.WAITER ON dbo.KITHIST1.WNO = dbo.WAITER.CODE















GO
/****** Object:  View [dbo].[kitviewf12total]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[kitviewf12total]
AS
SELECT TXNDT, 
    cashsales = CASE WHEN mop = 1 THEN amt ELSE 0 END, 
    roomservice = CASE WHEN mop = 2 THEN amt ELSE 0 END, 
    billrec = CASE WHEN mop = 3 THEN amt ELSE 0 END, 
    glaccount = CASE WHEN mop = 4 THEN amt ELSE 0 END, 
    creditcard = CASE WHEN mop = 5 THEN amt ELSE 0 END, 
    complementary = CASE WHEN mop = 6 THEN amt ELSE 0 END, 
    OUTLET, split,ptype
FROM KITVIEWF12















GO
/****** Object:  View [dbo].[tallycrdr1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









/****** Object:  View dbo.tallycrdr1    Script Date: 1/20/03 11:51:45 AM ******/
CREATE VIEW [dbo].[tallycrdr1]
AS
SELECT CONVERT(datetime, DATENAME(dd, TXNDT) 
    + '/' + DATENAME(mm, TXNDT) + '/' + DATENAME(yy, TXNDT)) 
    AS txndt, SUM(DEBIT) AS debit, SUM(CREDIT) AS credit, 
    COMPANY, FY, GRNO
FROM TALLYCRDR
GROUP BY COMPANY, FY, GRNO, CONVERT(datetime, 
    DATENAME(dd, TXNDT) + '/' + DATENAME(mm, TXNDT) 
    + '/' + DATENAME(yy, TXNDT))















GO
/****** Object:  View [dbo].[KitGroupSale_2]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[KitGroupSale_2]
AS
SELECT txndt, SUM(Amt) AS Amt, grpname, rcode, split, pmode, 
    ocode, SUM(QTY * RATE) AS sale, SUM(TAX) AS tax, 
    SUM(DISCOUNT) AS discount, class, subclass
FROM KitGroupSale_1
GROUP BY txndt, rcode, grpname, split, pmode, ocode, class, 
    subclass















GO
/****** Object:  View [dbo].[kitgroupsale_3]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[kitgroupsale_3]
AS
SELECT     dbo.KitGroupSale_1.code, dbo.KitGroupSale_1.name, dbo.KitGroupSale_1.txndt, SUM(dbo.KitGroupSale_1.qty * dbo.KitGroupSale_1.rate) AS sale, 
                      SUM(dbo.KitGroupSale_1.qty) AS qty, SUM(dbo.KitGroupSale_1.tax) AS tax, SUM(dbo.KitGroupSale_1.discount) AS discount, dbo.KitGroupSale_1.grp, 
                      dbo.KitGroupSale_1.grpname, SUM(dbo.KitGroupSale_1.Amt) AS amt, dbo.KitGroupSale_1.rcode, dbo.KitGroupSale_1.split, dbo.KitGroupSale_1.pmode, 
                      dbo.KitGroupSale_1.icode, dbo.KitGroupSale_1.class, dbo.KitGroupSale_1.subclass, dbo.KITCLASS.Name AS Classname, dbo.KITCLASS_2.NAME AS subClassname, 
                      dbo.KitGroupSale_1.outlet, dbo.KitGroupSale_1.roamt, dbo.KitGroupSale_1.strate, dbo.KitGroupSale_1.tno, dbo.KitGroupSale_1.pax, dbo.KitGroupSale_1.ptype, 
                      dbo.KitGroupSale_1.txntime
FROM         dbo.KitGroupSale_1 INNER JOIN
                      dbo.KITCLASS ON dbo.KitGroupSale_1.class = dbo.KITCLASS.code INNER JOIN
                      dbo.KITCLASS_2 ON dbo.KitGroupSale_1.subclass = dbo.KITCLASS_2.CODE
GROUP BY dbo.KitGroupSale_1.code, dbo.KitGroupSale_1.name, dbo.KitGroupSale_1.txndt, dbo.KitGroupSale_1.grp, dbo.KitGroupSale_1.grpname, dbo.KitGroupSale_1.rcode, 
                      dbo.KitGroupSale_1.split, dbo.KitGroupSale_1.pmode, dbo.KitGroupSale_1.icode, dbo.KitGroupSale_1.class, dbo.KitGroupSale_1.subclass, dbo.KITCLASS.Name, 
                      dbo.KITCLASS_2.NAME, dbo.KitGroupSale_1.outlet, dbo.KitGroupSale_1.roamt, dbo.KitGroupSale_1.strate, dbo.KitGroupSale_1.tno, dbo.KitGroupSale_1.pax, 
                      dbo.KitGroupSale_1.ptype, dbo.KitGroupSale_1.txntime






GO
/****** Object:  View [dbo].[kitgroupsale_31]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[kitgroupsale_31]
AS
SELECT CODE, NAME, txndt, 
    sale = CASE WHEN (pmode <> 6 OR
    split NOT IN ('F', 'C')) THEN sale ELSE 0 END, 
    freeqty = CASE WHEN (pmode <> 6 OR
    split NOT IN ('F', 'C')) THEN 0 ELSE qty END, 
    chgdqty = CASE WHEN (pmode <> 6 OR
    split NOT IN ('F', 'C')) THEN qty ELSE 0 END, 
    amt = CASE WHEN (pmode <> 6 OR
    split NOT IN ('F', 'C')) THEN amt ELSE 0 END, 
    tax = CASE WHEN (pmode <> 6 OR
    split NOT IN ('F', 'C')) THEN tax ELSE 0 END, 
    discount = CASE WHEN (pmode <> 6 OR
    split NOT IN ('F', 'C')) THEN discount ELSE 0 END, grp, 
    grpname, rcode, split, pmode, icode, class, subclass, 
    Classname, subClassname,tno,pax,ptype
FROM kitgroupsale_3















GO
/****** Object:  View [dbo].[a_kitmast_v]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[a_kitmast_v]
AS
SELECT        dbo.KITMAST.outlet, dbo.KITMAST.CODE, dbo.KITMAST.RATE, dbo.KITMAST.TAX, dbo.KITMAST.NOTAXCATEGORY, dbo.KITMAST.RATE1, dbo.KITMAST.RATE2, dbo.KITMAST.STATUS, dbo.KITMAST.ICODE, 
                         dbo.kitprime.name, dbo.kitprime.class, dbo.kitprime.grp, dbo.kitprime.rcode, dbo.kitprime.subclass, dbo.kitprime.NoRate, dbo.kitprime.Unit, dbo.kitprime.hsn
FROM            dbo.KITMAST LEFT OUTER JOIN
                         dbo.kitprime ON dbo.KITMAST.ICODE = dbo.kitprime.icode


GO
/****** Object:  View [dbo].[kitgroupsale_4]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[kitgroupsale_4]
AS
SELECT kitgroupsale_3.txndt, kitgroupsale_3.sale, 
    kitgroupsale_3.qty, kitgroupsale_3.tax, 
    kitgroupsale_3.discount, kitgroupsale_3.grpname, 
    kitgroupsale_3.amt, kitgroupsale_3.split, 
    kitgroupsale_3.pmode, a_kitmast_v.outlet, a_kitmast_v.CODE, 
    a_kitmast_v.RATE, a_kitmast_v.NOTAXCATEGORY, 
    a_kitmast_v.RATE1, a_kitmast_v.RATE2, a_kitmast_v.ICODE, 
    a_kitmast_v.STATUS, a_kitmast_v.name, a_kitmast_v.class, 
    a_kitmast_v.grp, a_kitmast_v.rcode
FROM a_kitmast_v LEFT OUTER JOIN
    kitgroupsale_3 ON a_kitmast_v.ICODE = kitgroupsale_3.icode















GO
/****** Object:  View [dbo].[kitgroupsale_5]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[kitgroupsale_5]
AS
SELECT txndt, 
    SUM(CASE WHEN strate = 0 THEN 0 ELSE qty * rate END) 
    AS taxable, 
    SUM(CASE WHEN strate = 0 THEN qty * rate ELSE 0 END) 
    AS nontaxable, split, pmode, rcode, SUM(QTY * RATE) AS sale, 
    SUM(TAX) AS tax, SUM(DISCOUNT) AS discount, STRATE, stset, 
    SUM(CASE WHEN strate = 0 THEN 0 ELSE discount END) 
    AS tdiscount, 
    SUM(CASE WHEN strate <> 0 THEN 0 ELSE discount END) 
    AS ntdiscount
FROM KitGroupSale_1
GROUP BY txndt, rcode, split, pmode, rcode, STRATE, stset















GO
/****** Object:  View [dbo].[KitGroupsale_11]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[KitGroupsale_11]
AS
SELECT KITHIST1.TXNDT, SUM(KITHIST1.ROAMT) AS roamt, 
    SUM(KITHIST1.SCAMT) AS scamt, KITHIST1.PMODE, 
    KITHIST1.SPLIT, KITHIST1.OUTLET, 
    CO_REST_OL1.RCODE
FROM KITHIST1 INNER JOIN
    CO_REST_OL1 ON 
    KITHIST1.OUTLET = CO_REST_OL1.OCODE
GROUP BY KITHIST1.TXNDT, KITHIST1.PMODE, KITHIST1.SPLIT, 
    KITHIST1.OUTLET, CO_REST_OL1.RCODE















GO
/****** Object:  View [dbo].[KitGroupSale_111]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[KitGroupSale_111]
AS
SELECT KITGROUP.NAME, CO_REST_OL1.RCODE
FROM KITGROUP INNER JOIN
    CO_REST_OL1 ON 
    KITGROUP.RCODE = CO_REST_OL1.RCODE















GO
/****** Object:  View [dbo].[kithist_post]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[kithist_post]
AS
SELECT KITHIST1.TXNDT AS txndt, KITHIST1.ROAMT AS roamt, 
    KITHIST1.SCAMT AS scamt, KIT_HISTAMT.QTYRATE, 
    KIT_HISTAMT.BNO, KIT_HISTAMT.discount, KIT_HISTAMT.tax, 
    KITHIST1.PMODE
FROM KIT_HISTAMT LEFT OUTER JOIN
    KITHIST1 ON KIT_HISTAMT.BNO = KITHIST1.BNO















GO
/****** Object:  View [dbo].[KITITEM]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[KITITEM]
AS
SELECT     dbo.KITHIST.CTRLNO, dbo.KITHIST.BNO, dbo.KITHIST.KOT, dbo.KITHIST.CODE, dbo.KITHIST.NAME, dbo.KITHIST.QTY, dbo.KITHIST.RATE, dbo.KITHIST.STRATE, dbo.KITHIST.TAX, dbo.KITHIST.DISCOUNT, dbo.KITHIST.preference, dbo.KITHIST.ST, dbo.KITHIST.CESS, 
                  dbo.KITHIST.SC, dbo.KITHIST.cess2, dbo.KITHIST1.TXNDT, dbo.RESTCO.COMPANY, dbo.KITHIST1.OUTLET, dbo.OUTLET.CHANNEL, dbo.KITHIST.QTY * dbo.KITHIST.RATE AS amt, dbo.KITGROUP.NAME AS grpname, dbo.KITHIST1.PMODE, dbo.KITHIST1.SNO, 
                  dbo.a_kitmast_v.name AS iname, dbo.a_kitmast_v.RATE AS orate, dbo.a_kitmast_v.grp, DATEDIFF(d, CONVERT(DATETIME, '1990-01-01 00:00:00', 102), dbo.KITHIST1.TXNDT) AS DTD
FROM        dbo.OUTLET LEFT OUTER JOIN
                  dbo.RESTCO ON dbo.OUTLET.CHANNEL = dbo.RESTCO.CHANNEL RIGHT OUTER JOIN
                  dbo.KITHIST1 ON dbo.OUTLET.CODE = dbo.KITHIST1.OUTLET RIGHT OUTER JOIN
                  dbo.KITGROUP INNER JOIN
                  dbo.a_kitmast_v ON dbo.KITGROUP.CODE = dbo.a_kitmast_v.grp INNER JOIN
                  dbo.KITHIST ON dbo.a_kitmast_v.CODE = dbo.KITHIST.CODE ON dbo.KITHIST1.BNO = dbo.KITHIST.BNO


GO
/****** Object:  View [dbo].[PH_11VIEW]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[PH_11VIEW]
AS
SELECT CNO, SUM(AMOUNT) AS AMOUNT
FROM dbo.PHHIST
GROUP BY CNO















GO
/****** Object:  View [dbo].[PH_MIS]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[PH_MIS]
AS
SELECT     dbo.PHONE.TXNDT, dbo.PHONE.PMODE AS mop, dbo.PHONE.OUTLET, 
                      SUM(dbo.PH_11VIEW.AMOUNT - dbo.PHONE.DAMT + dbo.PHONE.SCAMT + dbo.PHONE.stamt) AS amount, dbo.PHOUTLET.COMPANY, 
                      dbo.PHOUTLET.NAME
FROM         dbo.PHONE INNER JOIN
                      dbo.PH_11VIEW ON dbo.PHONE.CNO = dbo.PH_11VIEW.CNO INNER JOIN
                      dbo.PHOUTLET ON dbo.PHONE.OUTLET = dbo.PHOUTLET.OUTLET
GROUP BY dbo.PHONE.TXNDT, dbo.PHONE.PMODE, dbo.PHONE.OUTLET, dbo.PHOUTLET.COMPANY, dbo.PHOUTLET.NAME






GO
/****** Object:  View [dbo].[Win_BillView_6]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[Win_BillView_6]
AS
SELECT gname = name, billtype = 'Service B', billdate = txndt, 
    billno = outlet, 
    cash = CASE WHEN mop = 1 THEN amount ELSE 0 END, 
    creditcard = CASE WHEN mop = 5 THEN amount ELSE 0 END, 
    ddch = 0, 
    glaccts = CASE WHEN mop = 4 THEN amount ELSE 0 END, 
    billrec = CASE WHEN mop = 3 THEN amount ELSE 0 END, 
    roomservice = CASE WHEN mop = 2 THEN amount ELSE 0 END,
     complementary = CASE WHEN mop = 6 THEN amount ELSE 0 END,
     details = '', company
FROM ph_mis















GO
/****** Object:  View [dbo].[billview__F1V0]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[billview__F1V0]
AS
SELECT     dbo.LTMASTER.SDT, dbo.LTMASTER.EDT, dbo.LTTABLE.SAMT, dbo.LTTABLE.EAMT, dbo.LTTABLE.FAMT, dbo.LTMASTER.TNO, 
                      dbo.LTTABLE.LRATE
FROM         dbo.LTMASTER INNER JOIN
                      dbo.LTTABLE ON dbo.LTMASTER.TNO = dbo.LTTABLE.TNO















GO
/****** Object:  View [dbo].[F2V00]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[F2V00]
AS
SELECT isnull((CASE WHEN billhist.LT = 0 THEN CASE WHEN EXISTS
        (SELECT *
      FROM ltontariff
      WHERE ltontariff = 'Y' AND billhist.txndt BETWEEN sdt AND 
           edt) THEN
        (SELECT tariff = (CASE WHEN guest.male + guest.female > 1 THEN
            isnull(rent2, 0) ELSE isnull(rent1, 0) END)*((select count(*) from addroom where addroom.gno=billhist.gno and addroom.rno<>billhist.rno)+1)
      FROM room
      WHERE room.rno =guest.rno) ELSE isnull(billhist.RENT, 0) 
    END ELSE 0 END), 0) AS rentNLTnew, 
    isnull((CASE WHEN billhist.LT <> 0 THEN CASE WHEN EXISTS
        (SELECT *
      FROM ltontariff
      WHERE ltontariff = 'Y' AND billhist.txndt BETWEEN sdt AND 
           edt) THEN
        (SELECT tariff = (CASE WHEN guest.male + guest.female > 1 THEN
            isnull(rent2, 0) ELSE isnull(rent1, 0) END)*((select count(*) from addroom where addroom.gno=billhist.gno and addroom.rno<>billhist.rno)+1)
      FROM room
      WHERE room.rno = guest.rno) ELSE isnull(billhist.RENT, 0) 
    END ELSE 0 END), 0) AS rentLTnew, 
    isnull((CASE WHEN billhist.LT = 0 THEN CASE WHEN EXISTS
        (SELECT *
      FROM ltontariff
      WHERE ltontariff = 'Y' AND billhist.txndt BETWEEN sdt AND 
           edt) THEN
        (SELECT tariff = (CASE WHEN guest.male + guest.female > 1 THEN
            isnull(rentrate22, 0) ELSE isnull(rentrate21, 0) END)*((select count(*) from addroom where addroom.gno=billhist.gno and addroom.rno<>billhist.rno)+1)
      FROM room
      WHERE room.rno = guest.rno) ELSE isnull(billhist.RENT, 0) 
    END ELSE 0 END), 0) AS rentNLTnew1, 
    isnull((CASE WHEN billhist.LT <> 0 THEN CASE WHEN EXISTS
        (SELECT *
      FROM ltontariff
      WHERE ltontariff = 'Y' AND billhist.txndt BETWEEN sdt AND 
           edt) THEN
        (SELECT tariff = (CASE WHEN guest.male + guest.female > 1 THEN
            isnull(rentrate22, 0) ELSE isnull(rentrate21, 0) END)*((select count(*) from addroom where addroom.gno=billhist.gno and addroom.rno<>billhist.rno)+1)
      FROM room
      WHERE room.rno = guest.rno) ELSE isnull(billhist.RENT, 0) 
    END ELSE 0 END), 0) AS rentLTnew1, 
    CASE WHEN billhist.LT = 0 THEN billhist.RENT ELSE 0 END AS rentNLT,
     CASE WHEN billhist.LT <> 0 THEN billhist.RENT ELSE 0 END AS
     rentLT, billhist.DISCOUNT, ITEM1, ITEM2, ITEM3, ITEM4, 
    ITEM5, ITEM6, ITEM7, ITEM8, ITEM9, ITEM10, billhist.SC, 
    billhist.LT, TOTAL, billhist.CNO, 
    CASE WHEN billhist.lt = 0 THEN 0 ELSE taxable END AS taxable,
     CASE WHEN billhist.lt = 0 THEN total ELSE total - (billhist.rent +
     billhist.lt - billhist.discount + taxable) 
    END AS nontaxable
, roomcnt =
                          (SELECT     cnt
                            FROM          (SELECT     COUNT(*) AS cnt
                                                    FROM          addroom
                                                    WHERE      addroom.gno = billhist.gno AND addroom.rno <> billhist.rno) AS a) + 1, lrate=
                           (select max(lrate)  from billview__f1v0 as f1v0 where datediff(d,'1/1/90',billhist.txndt) between datediff(d,'1/1/90',f1v0.sdt) and datediff(d,'1/1/90',f1v0.edt))
FROM BILLHIST JOIN
    guest ON billhist.gno = guest.gno
WHERE billhist.company = 1















GO
/****** Object:  View [dbo].[F3V1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[F3V1]
AS
SELECT     dbo.BILLHIST.GNO, dbo.BILLHIST.TXNDT, dbo.BILLHIST.COMPANY, dbo.BILLHIST.SPLIT, dbo.BILLHIST.RENT, dbo.BILLHIST.DISCOUNT, 
                      dbo.BILLHIST.LT, dbo.BILLHIST.TOTAL, dbo.billhist.cno,
                          (SELECT     COUNT(*)
                            FROM          addroom
                            WHERE      addroom.gno = billhist.gno) + 1 AS rcnt,
isnull(CASE WHEN EXISTS
        (SELECT *
      FROM ltontariff
      WHERE ltontariff = 'Y' AND billhist.txndt BETWEEN sdt AND 
           edt) THEN
        (SELECT tariff = (CASE WHEN guest.male + guest.female > 1 THEN
            isnull(rent2, 0) ELSE isnull(rent1, 0) END)*((select count(*) from addroom where addroom.gno=billhist.gno and addroom.rno<>billhist.rno)+1)
      FROM room
      WHERE room.rno =guest.rno) ELSE isnull(billhist.RENT, 0) 
    END , 0) AS TRent
FROM         dbo.BILLHIST INNER JOIN
                      dbo.GUEST ON dbo.BILLHIST.GNO = dbo.GUEST.GNO CROSS JOIN
                      dbo.ROOM CROSS JOIN
                      dbo.ADDROOM
WHERE     (dbo.BILLHIST.COMPANY = 1) AND (dbo.BILLHIST.SPLIT = 'N' OR
                      dbo.BILLHIST.SPLIT = ' ')















GO
/****** Object:  View [dbo].[F3V2]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[F3V2]
AS
SELECT     GNO, SUM(RENT) AS Expr1, SUM(DISCOUNT) AS Expr2, SUM(LT) AS Expr3, SUM(TOTAL) AS Expr4, cno, MAX(rcnt) AS Expr6, SUM(TRent) 
                      AS Expr5
FROM         dbo.F3V1
GROUP BY GNO, cno















GO
/****** Object:  View [dbo].[advance_total]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[advance_total]
AS
SELECT [total] = SUM(amount), gno
FROM advance
GROUP BY gno















GO
/****** Object:  View [dbo].[B1ROOM_GUEST]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO








CREATE VIEW [dbo].[B1ROOM_GUEST]
AS
SELECT ROOM.RNO, ROOM.GNO, GUEST.CNO, GUEST.ENO, 
    GUEST.CI_DATE, GUEST.CO_DATE, GUEST.RENT, 
    GUEST.DISCOUNT, GUEST.SC, GUESTAD.ADDRESS, 
    GUESTAD.NAME, GUESTAD.ADD1, GUESTAD.ADD2, 
    GUESTAD.ADD3, GUESTAD.CITY, GUESTAD.STATE, 
    GUESTAD.PHONE, GUESTAD.PIN, GUESTAD.FAX, 
    GUESTAD.EMAIL, GUESTAD.LIKES, GUESTAD.LASTVISIT, 
    GUEST.MALE, GUEST.FEMALE, GUEST.CHILD, 
    GFOODPLAN.NAME AS foodplan, ISNULL(GCOMPANY.NAME, '') 
    AS company, ROOM.GRPNAME, ROOM.ROOMTYPE, 
    ROOM.TIME, ROOM.RENT1, ROOM.RENT2, 
    advance_total.total, GUEST.EXPECTEDDEP, 
    GUEST.reserve_ref, GUEST.reserve_adv, 
    GUEST.reserve_adv_cno
FROM GUESTAD INNER JOIN
    GUEST ON GUESTAD.CNO = GUEST.CNO INNER JOIN
    GFOODPLAN ON 
    GUEST.FOODPLAN = GFOODPLAN.PLANTYPE INNER JOIN
    ROOM ON GUEST.GNO = ROOM.GNO LEFT OUTER JOIN
    advance_total ON 
    GUEST.GNO = advance_total.gno LEFT OUTER JOIN
    GCOMPANY ON GUESTAD.COMPANY = GCOMPANY.COMNO
















GO
/****** Object:  View [dbo].[PH_1VIEW]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[PH_1VIEW]
AS
SELECT CONVERT(varchar(20), dbo.PHONE.TXNDT, 6) AS txndt, 
    dbo.PHONE.PMODE, dbo.restpmode.name, 
    dbo.PHONE.OUTLET, 
    SUM(dbo.PH_11VIEW.AMOUNT - dbo.PHONE.DAMT) 
    AS NETT
FROM dbo.PHONE INNER JOIN
    dbo.restpmode ON 
    dbo.PHONE.PMODE = dbo.restpmode.pmode INNER JOIN
    dbo.PH_11VIEW ON 
    dbo.PHONE.CNO = dbo.PH_11VIEW.CNO
GROUP BY CONVERT(varchar(20), dbo.PHONE.TXNDT, 6), 
    dbo.PHONE.PMODE, dbo.restpmode.name, dbo.PHONE.OUTLET















GO
/****** Object:  View [dbo].[PH_ROOM]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[PH_ROOM]
AS
SELECT PHONE.OUTLET, PHONE.TXNDT, PHONE.PMODE, 
    PHONE.GNO, PHONE.CNO, PHONE.DRATE, PHONE.DAMT, 
    PHONE.SPLIT, PHONE.SELFDEAL, PH_2VIEW.AMOUNT, 
    PH_2VIEW.AMOUNT - PH_2VIEW.DAMT AS AMT, 
    PHOUTLET.COMPANY, PHONE.LUX, PHONE.SNO
FROM PH_2VIEW INNER JOIN
    PHONE ON PH_2VIEW.CNO = PHONE.CNO INNER JOIN
    PHOUTLET ON 
    PH_2VIEW.OUTLET = PHOUTLET.OUTLET
WHERE (PHONE.PMODE = 2)















GO
/****** Object:  View [dbo].[ROOM_GUEST]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[ROOM_GUEST]
AS
SELECT        dbo.ROOM.RNO, dbo.ROOM.GNO, dbo.GUEST.CNO, dbo.GUEST.ENO, dbo.GUEST.CI_DATE, dbo.GUEST.CO_DATE, dbo.GUEST.RENT, dbo.GUEST.DISCOUNT, dbo.GUEST.SC, dbo.GUEST.MALE, 
                         dbo.GUEST.FEMALE, dbo.GUEST.CHILD, dbo.GFOODPLAN.NAME AS foodplan, dbo.ROOM.GRPNAME, dbo.ROOM.ROOMTYPE, dbo.ROOM.TIME, dbo.ROOM.RENT1, dbo.ROOM.RENT2, dbo.advance_total.total, 
                         ISNULL(dbo.GUEST.EXPECTEDDEP, '') AS EXPECTEDDEP, dbo.GUEST.reserve_ref, dbo.GUEST.reserve_adv, dbo.GUEST.reserve_adv_cno, dbo.GUEST.QNAME, dbo.GUEST.qcheck, dbo.GUEST.userchkin, 
                         dbo.GUEST.FOODPLAN AS food, dbo.GUEST.Name, dbo.GUEST.Add1, dbo.GUEST.Add2, dbo.GUEST.Add3, dbo.GUEST.City, dbo.GUEST.State, dbo.GUEST.Phone, dbo.GUEST.email, dbo.GUEST.Address, 
                         dbo.GUEST.nationality, dbo.GUEST.company, dbo.GUEST.fax, dbo.GUEST.PIN, dbo.GCOMPANY.NAME AS COName, dbo.GUEST.VoucherNo, dbo.GUEST.IDtype, dbo.GUEST.IDNo, dbo.GUEST.CarNo, 
                         dbo.GUEST.LTTYpe, dbo.GUEST.NettRent, dbo.GUEST.gstin
FROM            dbo.GUEST LEFT OUTER JOIN
                         dbo.GFOODPLAN ON dbo.GUEST.FOODPLAN = dbo.GFOODPLAN.PLANTYPE INNER JOIN
                         dbo.ROOM ON dbo.GUEST.GNO = dbo.ROOM.GNO LEFT OUTER JOIN
                         dbo.GCOMPANY ON dbo.GUEST.company = dbo.GCOMPANY.COMNO LEFT OUTER JOIN
                         dbo.advance_total ON dbo.GUEST.GNO = dbo.advance_total.gno


GO
/****** Object:  View [dbo].[TT_MIS]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[TT_MIS]
AS
SELECT     dbo.toutlet.name, dbo.toutlet.company, dbo.CHALAN.mop, SUM(dbo.CHALAN.finalamt) AS amount, dbo.toutlet.outlet, dbo.CHALAN.finaldate
FROM         dbo.toutlet INNER JOIN
                      dbo.CHALAN ON dbo.toutlet.outlet = dbo.CHALAN.OUTLET
GROUP BY dbo.toutlet.name, dbo.toutlet.company, dbo.CHALAN.mop, dbo.toutlet.outlet, dbo.CHALAN.finaldate















GO
/****** Object:  View [dbo].[Win_BillView_7]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[Win_BillView_7]
AS
SELECT gname = name, billtype = 'TT Bills', billdate = finaldate, 
    billno = outlet, 
    cash = CASE WHEN mop = 1 THEN amount ELSE 0 END, 
    creditcard = CASE WHEN mop = 5 THEN amount ELSE 0 END, 
    DDCh = 0, 
    glaccts = CASE WHEN mop = 4 THEN amount ELSE 0 END, 
    billrec = CASE WHEN mop = 3 THEN amount ELSE 0 END, 
    roomservice = CASE WHEN mop = 2 THEN amount ELSE 0 END,
     complementary = CASE WHEN mop = 6 THEN amount ELSE 0 END,
     details = '', company
FROM TT_mis















GO
/****** Object:  View [dbo].[adv_gue11]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[adv_gue11]
AS
SELECT     dbo.BILLHIST1.*
FROM         dbo.BILLHIST1
WHERE     (COMPANY = 1) AND (SPLIT = 'N')















GO
/****** Object:  View [dbo].[adv_gues1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[adv_gues1]
AS
SELECT     TOP 100 PERCENT dbo.GUEST.CNO, dbo.GUEST.GNO, dbo.GUEST.ENO, dbo.GUEST.RNO, CONVERT(varchar(20), dbo.GUEST.CI_DATE, 103) 
                      AS [CHK IN DATE], CONVERT(varchar(20), dbo.GUEST.CO_DATE, 103) AS [CHK OUT DATE], dbo.GUEST.GRNO, dbo.GUEST.FOODPLAN, 
                      dbo.GUEST.RENT, dbo.GUEST.DISCOUNT, dbo.GUEST.SC, dbo.GUEST.MALE, dbo.GUEST.FEMALE, dbo.GUEST.CHILD, dbo.GUEST.CI_TIME, 
                      dbo.GUEST.CO_TIME, dbo.adv_gue11.BNO, dbo.GUEST.CI_DATE, dbo.GUEST.CO_DATE, CONVERT(CHAR(10), dbo.GUEST.CI_DATE, 8) 
                      AS [CHK IN TIME], CONVERT(CHAR(10), dbo.GUEST.CO_DATE, 8) AS [CHK OUT TIME], dbo.GUEST.grpname, dbo.GUEST.grpcounter, 
                      dbo.GUEST.userchkin, dbo.GUEST.userchkout, dbo.GUEST.LT, dbo.adv_gue11.MOP, dbo.adv_gue11.ADVANCE, dbo.GUEST.FP_details, 
                      dbo.GUEST.BRNO, dbo.GUEST.Name, dbo.GUEST.Add1, dbo.GUEST.Add2, dbo.GUEST.Add3, dbo.GUEST.City, dbo.GUEST.State, dbo.GUEST.Phone, 
                      dbo.GUEST.fax, dbo.GUEST.email, dbo.GUEST.nationality, dbo.GUEST.Address, dbo.GUEST.PIN
FROM         dbo.GUEST LEFT OUTER JOIN
                      dbo.adv_gue11 ON dbo.GUEST.BRNO = dbo.adv_gue11.BRNO
ORDER BY dbo.GUEST.GNO DESC















GO
/****** Object:  View [dbo].[phoneview1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[phoneview1]
AS
SELECT TXNDT, 
    mop0 = CASE WHEN pmode = 1 THEN amount - damt ELSE 0 END,
     mop1 = CASE WHEN pmode = 5 THEN amount - damt ELSE 0 END,
     mop2 = 0, 
    mop3 = CASE WHEN pmode = 4 THEN amount - damt ELSE 0 END,
     mop4 = CASE WHEN pmode = 3 THEN amount - damt ELSE 0 END,
     mop5 = CASE WHEN pmode = 6 THEN amount - damt ELSE 0 END
FROM dbo.PH_2VIEW















GO
/****** Object:  View [dbo].[phoneview1_total]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[phoneview1_total]
AS
SELECT txndt, outlet, cno, dtdiff = datediff(d, '1/1/90', txndt), 
    cash = CASE WHEN pmode = 1 THEN amount - damt ELSE 0 END,
     rs = CASE WHEN pmode = 2 THEN amount - damt ELSE 0 END, 
    br = CASE WHEN pmode = 3 THEN amount - damt ELSE 0 END, 
    gl = CASE WHEN pmode = 4 THEN amount - damt ELSE 0 END, 
    cc = CASE WHEN pmode = 5 THEN amount - damt ELSE 0 END, 
    cp = CASE WHEN pmode = 6 THEN amount - damt ELSE 0 END,split
FROM PH_2VIEW















GO
/****** Object:  View [dbo].[RoomDuesVCon]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[RoomDuesVCon]
AS
SELECT     gno, SUM(ISNULL(amount, 0)) AS amount, split, company
FROM         dbo.RoomDues
GROUP BY gno, split, company















GO
/****** Object:  View [dbo].[roomduesbh1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









create view [dbo].[roomduesbh1] as 
select cno,isnull((select sum(isnull(amount,0)) from roomduesvcon where gno in (select gno from guest where brno=billhist1.brno) and company=billhist1.company and split=billhist1.split),0) roomdues   from billhist1















GO
/****** Object:  View [dbo].[ADV_Guest]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[ADV_Guest]
AS
SELECT     dbo.ADVANCE.CNO, dbo.ADVANCE.GNO, dbo.ADVANCE.TXNDT, dbo.ADVANCE.COMPANY, dbo.ADVANCE.ANO, dbo.ADVANCE.MOP, 
                      dbo.ADVANCE.CRCARDNUM, dbo.ADVANCE.CRCARDNAME, dbo.ADVANCE.CRCARDBANK, dbo.ADVANCE.GRNO, dbo.ADVANCE.AMOUNT, 
                      dbo.ADVANCE.GLACTNUM, dbo.ADVANCE.SPLIT, dbo.company.NAME AS coname, dbo.company.add1 AS coadd1, dbo.company.add2 AS coadd2, 
                      dbo.company.city AS cocity, dbo.company.phone, dbo.company.email, dbo.company.website, dbo.company.info1, dbo.company.info2, 
                      dbo.adv_GUES1.Address, dbo.adv_GUES1.Name, dbo.adv_GUES1.Add1, dbo.adv_GUES1.Add2, dbo.adv_GUES1.Add3, dbo.adv_GUES1.City, 
                      dbo.adv_GUES1.ENO, dbo.adv_GUES1.RNO, dbo.adv_GUES1.CI_DATE, dbo.adv_GUES1.CO_DATE, dbo.ADVANCE.Narration
FROM         dbo.ADVANCE INNER JOIN
                      dbo.company ON dbo.ADVANCE.COMPANY = dbo.company.COMPANY INNER JOIN
                      dbo.adv_GUES1 ON dbo.ADVANCE.GNO = dbo.adv_GUES1.GNO















GO
/****** Object:  View [dbo].[CO_REST_OL]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[CO_REST_OL]
AS
SELECT        dbo.company.NAME AS coname, dbo.company.COMPANY AS COCODE, dbo.RESTCO.CHANNEL AS RCODE, dbo.RESTCO.NAME AS chname, dbo.OUTLET.CODE AS OCODE, dbo.OUTLET.NAME AS olname, dbo.OUTLET.GRNO, 
                         dbo.OUTLET.GRNO_TRF, dbo.OUTLET.CO1GRNO, dbo.OUTLET.LUX, dbo.OUTLET.SELFDEAL, dbo.OUTLET.SC_ACTNUM, dbo.OUTLET.STSET, dbo.OUTLET.SCSET, dbo.OUTLET.HNO_MYBOOK, dbo.OUTLET.RO_ACTNUM, 
                         dbo.OUTLET.DC_ACTNUM, dbo.OUTLET.ST_ACTNUM, dbo.OUTLET.BILLDATE, dbo.OUTLET.KOTNO, dbo.OUTLET.KOTDATE, dbo.OUTLET.ACTNUM, dbo.RESTCO.billposition1, dbo.RESTCO.billposition2, dbo.RESTCO.SHNAME, 
                         dbo.OUTLET.SC, dbo.OUTLET.FREEFOODVOUCHING, dbo.RESTCO.htl_receivable, dbo.OUTLET.hno_htlbook, dbo.RESTCO.self_receivable, dbo.company.add1, dbo.company.add2, dbo.company.city, dbo.company.phone, 
                         dbo.company.email, dbo.company.website, dbo.OUTLET.AUTOKOT, dbo.OUTLET.CURDATE, dbo.OUTLET.SALETAXNO, dbo.OUTLET.G_STAXINCL, dbo.RESTCO.line1, dbo.RESTCO.line2, dbo.OUTLET.G_cutter, 
                         dbo.OUTLET.Duplicate, dbo.OUTLET.ScRate, dbo.OUTLET.RoundOff, dbo.OUTLET.bno, dbo.OUTLET.guestdetails, dbo.OUTLET.VATONST
FROM            dbo.company INNER JOIN
                         dbo.RESTCO ON dbo.company.COMPANY = dbo.RESTCO.COMPANY INNER JOIN
                         dbo.OUTLET ON dbo.RESTCO.CHANNEL = dbo.OUTLET.CHANNEL
GO
/****** Object:  View [dbo].[CURRENTKOT_V11]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[CURRENTKOT_V11]
AS
SELECT        dbo.currentkot.OUTLET, dbo.currentkot.KOT, dbo.currentkot.CODE, dbo.currentkot.QTY, dbo.currentkot.RATE, dbo.currentkot.STRATE, dbo.currentkot.TAX, dbo.currentkot.PEND_TYPE, dbo.currentkot.BNO AS CUR_BNO, 
                         dbo.currentkot.BILLTIME, dbo.doorcust.name AS ddname, dbo.doorcust.area AS ddarea, dbo.doorcust.discountrate AS dddrate, dbo.currentkot.WAITER, dbo.currentkot.DRATE, dbo.currentkot.DAMT, dbo.currentkot.SCRATE, 
                         dbo.currentkot.SCAMT, dbo.currentkot.ROAMT, dbo.currentkot.ratetype, dbo.WAITER.NAME AS wname, dbo.B1ROOM_GUEST.RNO, dbo.B1ROOM_GUEST.NAME AS Guestname, dbo.currentkot.sno, dbo.currentkot.nett, 
                         dbo.currentkot.kotctrlno, dbo.CO_REST_OL.coname, dbo.CO_REST_OL.COCODE, dbo.CO_REST_OL.RCODE, dbo.CO_REST_OL.chname, dbo.CO_REST_OL.OCODE, dbo.CO_REST_OL.olname, dbo.CO_REST_OL.GRNO, 
                         dbo.CO_REST_OL.GRNO_TRF, dbo.CO_REST_OL.CO1GRNO, dbo.CO_REST_OL.LUX, dbo.CO_REST_OL.SELFDEAL, dbo.CO_REST_OL.SC_ACTNUM, dbo.CO_REST_OL.STSET, dbo.CO_REST_OL.SCSET, 
                         dbo.CO_REST_OL.HNO_MYBOOK, dbo.CO_REST_OL.RO_ACTNUM, dbo.CO_REST_OL.DC_ACTNUM, dbo.CO_REST_OL.ST_ACTNUM, dbo.CO_REST_OL.bno, dbo.CO_REST_OL.BILLDATE, dbo.CO_REST_OL.KOTNO, 
                         dbo.CO_REST_OL.KOTDATE, dbo.CO_REST_OL.ACTNUM, dbo.CO_REST_OL.billposition1, dbo.CO_REST_OL.billposition2, dbo.CO_REST_OL.SHNAME, dbo.CO_REST_OL.SC, dbo.CO_REST_OL.FREEFOODVOUCHING, 
                         dbo.CO_REST_OL.htl_receivable, dbo.CO_REST_OL.hno_htlbook, dbo.CO_REST_OL.self_receivable, dbo.CO_REST_OL.add1, dbo.CO_REST_OL.add2, dbo.CO_REST_OL.city, dbo.CO_REST_OL.email, dbo.CO_REST_OL.phone, 
                         dbo.CO_REST_OL.AUTOKOT, dbo.CO_REST_OL.website, dbo.CO_REST_OL.CURDATE, dbo.CO_REST_OL.SALETAXNO, dbo.CO_REST_OL.G_STAXINCL, dbo.CO_REST_OL.line1, dbo.CO_REST_OL.line2, 
                         dbo.CO_REST_OL.G_cutter, dbo.CO_REST_OL.Duplicate, dbo.a_kitmast_v.name, dbo.currentkot.servicetax, dbo.currentkot.cess, dbo.a_kitmast_v.Unit, dbo.currentkot.ppcouponamt, dbo.currentkot.st1, dbo.currentkot.cess1, 
                         dbo.currentkot.sc1, dbo.currentkot.cess21, dbo.currentkot.packingchgs, dbo.currentkot.kotconstant, dbo.currentkot.GSTIN, dbo.currentkot.PEND_CODE
FROM            dbo.currentkot LEFT OUTER JOIN
                         dbo.a_kitmast_v ON dbo.currentkot.CODE = dbo.a_kitmast_v.CODE LEFT OUTER JOIN
                         dbo.B1ROOM_GUEST ON dbo.currentkot.PEND_CODE = STR(dbo.B1ROOM_GUEST.GNO) LEFT OUTER JOIN
                         dbo.doorcust ON dbo.currentkot.PEND_CODE = STR(dbo.doorcust.ctrlno) LEFT OUTER JOIN
                         dbo.WAITER ON dbo.currentkot.WAITER = dbo.WAITER.CODE LEFT OUTER JOIN
                         dbo.CO_REST_OL ON dbo.currentkot.OUTLET = dbo.CO_REST_OL.OCODE
GO
/****** Object:  View [dbo].[GUEST_VIEW_ADV]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO












CREATE VIEW [dbo].[GUEST_VIEW_ADV]
AS
SELECT     dbo.ADVANCE.CNO, dbo.ADVANCE.GNO, dbo.ADVANCE.TXNDT, dbo.ADVANCE.COMPANY, dbo.ADVANCE.ANO, dbo.ADVANCE.MOP, 
                      dbo.ADVANCE.CRCARDNUM, dbo.ADVANCE.CRCARDNAME, dbo.ADVANCE.CRCARDBANK, dbo.ADVANCE.GRNO, dbo.ADVANCE.AMOUNT, 
                      dbo.ADVANCE.GLACTNUM, dbo.ADVANCE.SPLIT, dbo.company.NAME AS coname, dbo.company.add1 AS coadd1, dbo.company.add2 AS coadd2, 
                      dbo.company.city AS cocity, dbo.company.phone, dbo.company.email, dbo.company.website, dbo.company.info1, dbo.company.info2, 
                      dbo.ADVANCE.usernm, dbo.adv_GUES1.ADDRESS, dbo.adv_GUES1.NAME, dbo.adv_GUES1.ADD1, dbo.adv_GUES1.ADD2, dbo.adv_GUES1.ADD3, 
                      dbo.adv_GUES1.CITY, dbo.adv_GUES1.ENO, dbo.adv_GUES1.RNO, dbo.adv_GUES1.CI_DATE, dbo.adv_GUES1.CO_DATE, 
                      dbo.ADVANCE.Narration
FROM         dbo.ADVANCE INNER JOIN
                      dbo.company ON dbo.ADVANCE.COMPANY = dbo.company.COMPANY INNER JOIN
                      dbo.adv_GUES1 ON dbo.ADVANCE.GNO = dbo.adv_GUES1.GNO



















GO
/****** Object:  View [dbo].[OCC_CHART]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[OCC_CHART]
AS
SELECT     dbo.ROOM.RNO, dbo.GUEST_VIEW1.Address, dbo.GUEST_VIEW1.Name, dbo.GUEST_VIEW1.Add1, dbo.GUEST_VIEW1.Add2, dbo.GUEST_VIEW1.Add3,
                       dbo.GUEST_VIEW1.City, dbo.GUEST_VIEW1.State, dbo.GUEST_VIEW1.Phone, dbo.GUEST_VIEW1.email, dbo.GUEST_VIEW1.CNO, 
                      dbo.GUEST_VIEW1.GNO, dbo.GUEST_VIEW1.ENO, dbo.GUEST_VIEW1.[CHK IN DATE], dbo.GUEST_VIEW1.[CHK OUT DATE], dbo.GUEST_VIEW1.GRNO, 
                      dbo.GUEST_VIEW1.FOODPLAN, dbo.GUEST_VIEW1.RENT, dbo.GUEST_VIEW1.DISCOUNT, dbo.GUEST_VIEW1.SC, dbo.GUEST_VIEW1.MALE, 
                      dbo.GUEST_VIEW1.FEMALE, dbo.GUEST_VIEW1.CHILD, dbo.GUEST_VIEW1.CI_TIME, dbo.GUEST_VIEW1.CO_TIME, dbo.GUEST_VIEW1.CI_DATE, 
                      dbo.GUEST_VIEW1.CO_DATE, dbo.GUEST_VIEW1.[CHK IN TIME], dbo.GUEST_VIEW1.[CHK OUT TIME], dbo.GUEST_VIEW1.grpname, 
                      dbo.GCOMPANY.NAME AS COMPANY, dbo.GUEST_VIEW1.FP_details, dbo.GFOODPLAN.NAME AS FPname, dbo.GFOODPLAN.DESCRIPTION, 
                      dbo.GUEST_VIEW1.PIN
FROM         dbo.GFOODPLAN RIGHT OUTER JOIN
                      dbo.GUEST_VIEW1 ON dbo.GFOODPLAN.PLANTYPE = dbo.GUEST_VIEW1.FOODPLAN LEFT OUTER JOIN
                      dbo.GCOMPANY ON dbo.GUEST_VIEW1.company = dbo.GCOMPANY.COMNO RIGHT OUTER JOIN
                      dbo.ROOM ON dbo.GUEST_VIEW1.GNO = dbo.ROOM.GNO















GO
/****** Object:  View [dbo].[billview]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[billview]
AS
SELECT     dbo.BILLHIST1.CNO, dbo.BILLHIST1.COMPANY, dbo.BILLHIST1.SPLIT, dbo.BILLHIST1.BNO, dbo.BILLHIST1.TXNDT, MAX(dbo.BILLHIST1.ADVANCE) 
                      AS ADVANCE, dbo.BILLHIST1.CRNAME, dbo.BILLHIST1.CRNUM, dbo.BILLHIST1.CRTYPE, dbo.BILLHIST1.GLACTNO, dbo.BILLHIST1.GRNO, 
                      dbo.BILLHIST1.MOP, dbo.company.NAME AS compname, dbo.company.add1, dbo.company.add2, dbo.company.city, dbo.company.phone, 
                      dbo.company.email, dbo.company.website, dbo.company.info1, dbo.company.info2, dbo.billmode.payment, SUM(dbo.BILLHIST.TOTAL) AS total, 
                      MAX(dbo.BILLHIST1.SPLDISCOUNT) AS SPLDISCOUNT, SUM(dbo.BILLHIST.RENT) AS rent, SUM(dbo.BILLHIST.DISCOUNT) AS discount, 
                      SUM(dbo.BILLHIST.LT) AS lt, MAX(dbo.BILLHIST1.foodbill) AS foodbill, SUM(dbo.BILLHIST.ITEM1) AS item1, SUM(dbo.BILLHIST.ITEM2) AS item2, 
                      SUM(dbo.BILLHIST.ITEM3) AS item3, SUM(dbo.BILLHIST.ITEM4) AS item4, SUM(dbo.BILLHIST.ITEM5) AS item5, SUM(dbo.BILLHIST.ITEM6) AS item6, 
                      SUM(dbo.BILLHIST.ITEM7) AS item7, SUM(dbo.BILLHIST.ITEM8) AS item8, SUM(dbo.BILLHIST.ITEM9) AS item9, SUM(dbo.BILLHIST.ITEM10) AS item10, 
                      SUM(dbo.BILLHIST.SC) AS sc, dbo.BILLHIST1.BRNO, MAX(dbo.GUEST.CNO) AS GCNO, SUM(dbo.RoomDues.amount) AS roomdues, dbo.GUEST.PIN, 
                      dbo.GUEST.nationality, dbo.GUEST.Address, dbo.GUEST.email AS Expr1, dbo.GUEST.Phone AS Expr2, dbo.GUEST.Name, dbo.GUEST.Add1 AS Expr3, 
                      dbo.GUEST.Add3, dbo.GUEST.Add2 AS Expr4, dbo.GUEST.City AS Expr5, dbo.GUEST.State
FROM         dbo.BILLHIST1 INNER JOIN
                      dbo.GUEST ON dbo.BILLHIST1.BRNO = dbo.GUEST.BRNO LEFT OUTER JOIN
                      dbo.BILLHIST ON dbo.BILLHIST1.CNO = dbo.BILLHIST.CNO LEFT OUTER JOIN
                      dbo.RoomDues ON dbo.GUEST.GNO = dbo.RoomDues.gno LEFT OUTER JOIN
                      dbo.billmode ON dbo.BILLHIST1.MOP = dbo.billmode.mop LEFT OUTER JOIN
                      dbo.company ON dbo.BILLHIST1.COMPANY = dbo.company.COMPANY
GROUP BY dbo.BILLHIST1.CNO, dbo.BILLHIST1.COMPANY, dbo.BILLHIST1.SPLIT, dbo.BILLHIST1.BNO, dbo.BILLHIST1.TXNDT, dbo.BILLHIST1.CRNAME, 
                      dbo.BILLHIST1.CRNUM, dbo.BILLHIST1.CRTYPE, dbo.BILLHIST1.GLACTNO, dbo.BILLHIST1.GRNO, dbo.BILLHIST1.MOP, dbo.company.NAME, 
                      dbo.company.add1, dbo.company.add2, dbo.company.city, dbo.company.phone, dbo.company.email, dbo.company.website, dbo.company.info1, 
                      dbo.company.info2, dbo.billmode.payment, dbo.BILLHIST1.BRNO, dbo.GUEST.PIN, dbo.GUEST.nationality, dbo.GUEST.Address, dbo.GUEST.email, 
                      dbo.GUEST.Phone, dbo.GUEST.Name, dbo.GUEST.Add1, dbo.GUEST.Add3, dbo.GUEST.Add2, dbo.GUEST.City, dbo.GUEST.State















GO
/****** Object:  View [dbo].[billview_forbrowse]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[billview_forbrowse]
AS
SELECT     dbo.billview.*,
                          (SELECT     MAX(lrate)
                            FROM          billview__f1v0 AS f1v0
                            WHERE      datediff(d, '1/1/90', billview.txndt) BETWEEN datediff(d, '1/1/90', f1v0.sdt) AND datediff(d, '1/1/90', f1v0.edt)) AS lrate
FROM         dbo.billview
WHERE     (COMPANY = 1) AND (SPLIT = 'N')















GO
/****** Object:  View [dbo].[ph_room1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[ph_room1] 
AS
SELECT     dbo.PH_ROOM.OUTLET, dbo.PH_ROOM.TXNDT, dbo.PH_ROOM.PMODE, dbo.PH_ROOM.GNO, dbo.PH_ROOM.CNO, dbo.PH_ROOM.DRATE, 
                      dbo.PH_ROOM.SNO, dbo.PH_ROOM.DAMT, dbo.PH_ROOM.SPLIT, dbo.PH_ROOM.SELFDEAL, dbo.PH_ROOM.AMOUNT, dbo.PH_ROOM.AMT, 
                      dbo.PH_ROOM.COMPANY, dbo.PH_ROOM.LUX, dbo.PHOUTLET.NAME, 
                      'newsplit' = CASE WHEN split = 'N' THEN 'A' WHEN split = 'Y' THEN 'B' ELSE 'C' END
FROM         dbo.PH_ROOM INNER JOIN
                      dbo.PHOUTLET ON dbo.PH_ROOM.OUTLET = dbo.PHOUTLET.OUTLET















GO
/****** Object:  View [dbo].[F2V1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[F2V1]
AS
SELECT SUM(rentNLT) AS rentNLT, SUM(rentLT) AS rentLT, 
    SUM(rentNLTnew1) AS rentNLTnew1, SUM(rentLTnew1) 
    AS rentLTnew1, SUM(rentNLTnew) AS rentNLTnew, 
    SUM(rentLTnew) AS rentLTnew, SUM(DISCOUNT) AS discount, 
    SUM(ITEM1) AS item1, SUM(ITEM2) AS item2, SUM(ITEM3) 
    AS item3, SUM(ITEM4) AS item4, SUM(ITEM5) AS item5, 
    SUM(ITEM6) AS item6, SUM(ITEM7) AS item7, SUM(ITEM8) 
    AS item8, SUM(ITEM9) AS item9, SUM(ITEM10) AS item10, 
    SUM(SC) AS sc, SUM(LT) AS lt, SUM(TOTAL) AS total, CNO, 
    SUM(CASE WHEN lt = 0 THEN 0 ELSE taxable END) 
    AS taxable, SUM(nontaxable) AS nontaxable
FROM f2v00
GROUP BY CNO















GO
/****** Object:  View [dbo].[KITHISTAMT]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









/****** Object:  View dbo.KITHISTAMT    Script Date: 1/20/03 11:51:45 AM ******/
CREATE VIEW [dbo].[KITHISTAMT]
AS
SELECT     COUNT(*) AS Expr1, SUM(QTY * RATE + TAX - DISCOUNT) AS amt, BNO, SUM(QTY * RATE) AS QTYRATE, SUM(TAX) AS tax, SUM(DISCOUNT) 
                      AS discount
FROM         dbo.KITHIST
GROUP BY BNO















GO
/****** Object:  View [dbo].[KITHISTAMT_KR1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









/****** Object:  View dbo.KITHISTAMT_KR1    Script Date: 1/20/03 11:51:46 AM ******/
CREATE VIEW [dbo].[KITHISTAMT_KR1]
AS
SELECT SUM(amt) AS AMT, BNO, SUM(QTYRATE) AS QTYRATE, 
    SUM(TAX) AS TAX, SUM(DISCOUNT) AS DISCOUNT
FROM KITHISTAMT
GROUP BY BNO















GO
/****** Object:  View [dbo].[KITSALE3]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Object:  View dbo.KITSALE3    Script Date: 1/20/03 11:51:46 AM ******/
CREATE VIEW [dbo].[KITSALE3]
AS
SELECT        dbo.KITHIST1.BNO, dbo.KITHIST.RATE * dbo.KITHIST.QTY AS NETT, dbo.KITHIST.QTY, dbo.KITHIST.RATE, dbo.KITHIST.STRATE, dbo.KITHIST.TAX, dbo.KITHIST.DISCOUNT, dbo.KITHIST.KOT, dbo.KITHIST1.OUTLET, 
                         dbo.KITHIST1.TXNDT, dbo.KITHIST1.DRATE, dbo.KITHIST1.GNO, dbo.KITHIST1.RNO, dbo.KITHIST1.PMODE, dbo.KITHIST1.SNO, dbo.KITHIST1.WNO, dbo.KITHIST1.ROAMT, dbo.KITHIST1.SCAMT, dbo.KITHIST1.CRNAME, 
                         dbo.KITHIST1.CRNUM, dbo.KITHIST1.CRTYPE, dbo.KITHIST1.usernm, dbo.KITHIST1.txntime, dbo.KITHIST1.SPLIT, dbo.WAITER.NAME AS wname, dbo.restpmode.name AS Pmodename, dbo.KITHIST.NAME, dbo.KITHIST1.TNO, 
                         dbo.KITHIST1.PAX, dbo.KITHIST1.Ptype, dbo.KITHIST1.autoposting, dbo.KITHIST.CTRLNO, dbo.KITHIST1.ServiceTax, dbo.KITHIST1.CESS, dbo.a_kitmast_v.CODE, dbo.a_kitmast_v.ICODE, dbo.a_kitmast_v.Unit, 
                         dbo.KITHIST1.ppcouponamt, dbo.a_kitmast_v.hsn, dbo.KITHIST1.gstin, dbo.KITHIST1.packingchgs, dbo.KITHIST1.ndiscount, dbo.KITHIST1.FinalAmt, dbo.KITHIST.ST AS st1, dbo.KITHIST.CESS AS cess1, dbo.KITHIST.SC AS sc1, 
                         dbo.KITHIST.cess2, dbo.KITHIST1.ndiscgst, dbo.a_kitmast_v.name AS iname
FROM            dbo.KITHIST1 INNER JOIN
                         dbo.KITHIST ON dbo.KITHIST1.BNO = dbo.KITHIST.BNO LEFT OUTER JOIN
                         dbo.a_kitmast_v ON dbo.KITHIST.CODE = dbo.a_kitmast_v.CODE LEFT OUTER JOIN
                         dbo.restpmode ON dbo.KITHIST1.PMODE = dbo.restpmode.pmode LEFT OUTER JOIN
                         dbo.WAITER ON dbo.KITHIST1.WNO = dbo.WAITER.CODE
GO
/****** Object:  View [dbo].[KitSale31]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[KitSale31]
AS
SELECT        dbo.restpmode.name AS payment, dbo.WAITER.NAME AS waiter, dbo.GUEST.Address, dbo.GUEST.Name AS Guestname, dbo.KITSALE3.BNO, dbo.KITSALE3.NETT, dbo.KITSALE3.QTY, dbo.KITSALE3.RATE, 
                         dbo.KITSALE3.STRATE, dbo.KITSALE3.TAX, dbo.KITSALE3.DISCOUNT, dbo.KITSALE3.KOT, dbo.KITSALE3.OUTLET, dbo.KITSALE3.TXNDT, dbo.KITSALE3.DRATE, dbo.KITSALE3.GNO, dbo.KITSALE3.RNO, dbo.KITSALE3.PMODE, 
                         dbo.KITSALE3.SNO, dbo.KITSALE3.WNO, dbo.KITSALE3.ROAMT, dbo.KITSALE3.SCAMT, dbo.KITSALE3.CRNAME, dbo.KITSALE3.CRNUM, dbo.KITSALE3.CRTYPE, dbo.KITSALE3.usernm, dbo.KITSALE3.txntime, 
                         dbo.KITSALE3.SPLIT, dbo.KITSALE3.wname, dbo.KITSALE3.Pmodename, dbo.KITSALE3.NAME, dbo.KITSALE3.TNO, dbo.KITSALE3.PAX, dbo.KITSALE3.Ptype, dbo.KITSALE3.autoposting, dbo.KITSALE3.CTRLNO, 
                         dbo.KITSALE3.ServiceTax, dbo.KITSALE3.CESS, dbo.KITSALE3.CODE, dbo.KITSALE3.ICODE, dbo.KITSALE3.Unit, dbo.KITSALE3.ppcouponamt, dbo.KITSALE3.hsn, dbo.KITSALE3.gstin, dbo.KITSALE3.packingchgs, 
                         dbo.KITSALE3.ndiscount, dbo.KITSALE3.FinalAmt, dbo.KITSALE3.st1, dbo.KITSALE3.cess1, dbo.KITSALE3.sc1, dbo.KITSALE3.cess2, dbo.KITSALE3.ndiscgst, dbo.KITSALE3.iname
FROM            dbo.KITSALE3 LEFT OUTER JOIN
                         dbo.GUEST ON dbo.KITSALE3.GNO = dbo.GUEST.GNO LEFT OUTER JOIN
                         dbo.restpmode ON dbo.KITSALE3.PMODE = dbo.restpmode.pmode LEFT OUTER JOIN
                         dbo.WAITER ON dbo.KITSALE3.WNO = dbo.WAITER.CODE
GO
/****** Object:  View [dbo].[GLTB]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[GLTB]
AS
SELECT     dbo.GLPRIMLD.*, dbo.GLFLAG.NAME AS FLGNAME, dbo.GLGROUP.CODE AS GRPCODE, dbo.GLGROUP.NAME AS GRPNAME, 
                      dbo.GLPRIMLD.Deletable AS CRDR, dbo.GLPRIMLD.ONAC AS crdro
FROM         dbo.GLPRIMLD INNER JOIN
                      dbo.GLFLAG ON dbo.GLPRIMLD.FLAG = dbo.GLFLAG.CODE INNER JOIN
                      dbo.GLGROUP ON dbo.GLFLAG.[GROUP] = dbo.GLGROUP.CODE















GO
/****** Object:  View [dbo].[TRIAL]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









/****** Object:  View dbo.TRIAL    Script Date: 1/20/03 11:51:45 AM ******/
CREATE VIEW [dbo].[TRIAL]
AS
/*
SELECT COMPANY, FY, CGP_ACTNO, CGP_DESC, FLGNAME, 
    GRPNAME, FLAG, GRP, BALANCE, 
    'CREDITS' = CASE WHEN BALANCE >= 0 THEN BALANCE ELSE 0
     END, 
    'DEBITS' = CASE WHEN BALANCE < 0 THEN - BALANCE ELSE 0 END
FROM GLTB
*/
SELECT COMPANY, FY, CGP_ACTNO, CGP_DESC, FLGNAME, 
    GRPNAME, FLAG, GRP, BALANCE, 
    'CREDITS' = str(balance,20,2),
    'DEBITS' =  ' ','crs' = balance ,'drs' = 0
FROM GLTB where balance > 0
union
SELECT COMPANY, FY, CGP_ACTNO, CGP_DESC, FLGNAME, 
    GRPNAME, FLAG, GRP, BALANCE, 
    'CREDITS' = ' ', 
    'DEBITS' = str(- BALANCE,20,2) ,
    'crs' = 0,'drs' = -balance
FROM GLTB where balance < 0  















GO
/****** Object:  View [dbo].[onacrc_view]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[onacrc_view]
AS
SELECT OnAcRc.*, GLPRIMLD.CGP_DESC AS glname
FROM OnAcRc LEFT OUTER JOIN
    GLPRIMLD ON 
    OnAcRc.TxnGlNo = GLPRIMLD.CGP_ACTNO AND 
    OnAcRc.FY = GLPRIMLD.FY AND 
    OnAcRc.Company = GLPRIMLD.COMPANY















GO
/****** Object:  View [dbo].[Win_BillView_4]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[Win_BillView_4]
AS
SELECT gname = glname, billtype = 'On A/c Receipt', 
    billdate = txndt, billno = onacrcno, 
    cash = CASE WHEN mop = 1 THEN amount ELSE 0 END, 
    creditcard = CASE WHEN mop = 2 THEN amount ELSE 0 END, 
    ddch = CASE WHEN mop = 3 THEN amount ELSE 0 END, 
    glaccts = CASE WHEN mop = 4 THEN amount ELSE 0 END, 
    complementary = 0, details = ltrim(rtrim(crnum)) 
    + '-' + ltrim(rtrim(crname)) + '-' + ltrim(rtrim(crbank)), 
    company
FROM onacrc_view















GO
/****** Object:  View [dbo].[balsheet_view]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[balsheet_view]
AS
SELECT GLGROUP.NAME, SUM(GLPRIMLD.BALANCE) AS balance, 
    GLPRIMLD.COMPANY, GLPRIMLD.FY
FROM GLPRIMLD LEFT OUTER JOIN
    GLGROUP ON GLPRIMLD.GRP = GLGROUP.CODE
GROUP BY GLGROUP.NAME, GLPRIMLD.COMPANY, GLPRIMLD.FY















GO
/****** Object:  View [dbo].[balsheet_view1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[balsheet_view1]
AS
SELECT name, 
    asset = CASE WHEN balance < 0 THEN - balance ELSE 0 END, 
    liability = CASE WHEN balance > 0 THEN balance ELSE 0 END, 
    company, fy
FROM balsheet_view
WHERE balance <> 0















GO
/****** Object:  View [dbo].[addroom_v]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[addroom_v]
AS
SELECT ADDROOM.*, BILLHIST.TXNDT AS txndt
FROM ADDROOM LEFT OUTER JOIN
    BILLHIST ON ADDROOM.GNO = BILLHIST.GNO















GO
/****** Object:  View [dbo].[advance_total_1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[advance_total_1]
AS
SELECT SUM(AMOUNT) AS total, GNO, COMPANY, split
FROM ADVANCE
GROUP BY GNO, COMPANY, split















GO
/****** Object:  View [dbo].[bh]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[bh]
AS
SELECT        TOP 100 PERCENT MIN(TXNDT) AS txndt, MIN(COMPANY) AS company, MIN(SPLIT) AS split, SUM(RENT) AS rent, SUM(DISCOUNT) AS discount, SUM(ITEM1) AS item1, SUM(ITEM2) AS item2, SUM(ITEM3) 
                         AS item3, SUM(ITEM4) AS item4, SUM(ITEM5) AS item5, SUM(ITEM6) AS item6, SUM(ITEM7) AS item7, SUM(ITEM8) AS item8, SUM(ITEM9) AS item9, SUM(ITEM10) AS item10, SUM(SC) AS sc, SUM(LT) AS lt, 
                         SUM(TOTAL) AS total, MIN(CNO) AS cno, DATEDIFF(d, CONVERT(DATETIME, '1990-01-01 00:00:00', 102), TXNDT) AS Expr20, MIN(cess2) AS cess2, SUM(ST) AS st, SUM(CESS) AS cess, MIN('e') AS early, 
                         SUM(OtherChgs) AS OtherChgs, MIN(LRATE) AS LRATE
FROM            dbo.BILLHIST
WHERE        (CNO = 0)
GROUP BY DATEDIFF(d, CONVERT(DATETIME, '1990-01-01 00:00:00', 102), TXNDT), CNO


GO
/****** Object:  View [dbo].[bhtot]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[bhtot]
AS
SELECT CNO, SUM(TOTAL) AS total
FROM BILLHIST
GROUP BY CNO















GO
/****** Object:  View [dbo].[billprint]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[billprint]
AS
SELECT     dbo.BILLHIST.TXNDT, dbo.BILLHIST.RENT, dbo.BILLHIST.DISCOUNT, dbo.BILLHIST.ITEM1, dbo.BILLHIST.ITEM2, dbo.BILLHIST.OUTLET1, 
                      dbo.BILLHIST.OUTLET2, dbo.BILLHIST.ITEM3, dbo.BILLHIST.OUTLET3, dbo.BILLHIST.ITEM4, dbo.BILLHIST.ITEM5, dbo.BILLHIST.OUTLET4, 
                      dbo.BILLHIST.OUTLET5, dbo.BILLHIST.OUTLET6, dbo.BILLHIST.ITEM6, dbo.BILLHIST.ITEM7, dbo.BILLHIST.OUTLET7, dbo.BILLHIST.ITEM8, 
                      dbo.BILLHIST.OUTLET8, dbo.BILLHIST.ITEM9, dbo.BILLHIST.OUTLET9, dbo.BILLHIST.ITEM10, dbo.BILLHIST.SC, dbo.BILLHIST.OUTLET10, 
                      dbo.BILLHIST.LT, dbo.BILLHIST.TOTAL, dbo.BILLHIST1.CNO, dbo.BILLHIST1.SPLIT, dbo.BILLHIST1.BNO, dbo.BILLHIST1.TXNDT AS billdate, 
                      dbo.BILLHIST1.ADVANCE, dbo.BILLHIST1.CRNAME, dbo.BILLHIST1.CRNUM, dbo.BILLHIST1.CRTYPE, dbo.BILLHIST1.MOP, 
                      dbo.company.NAME AS coname, dbo.company.add1 AS coadd1, dbo.company.add2 AS coadd2, dbo.company.city AS cocity, 
                      dbo.company.phone AS cophone, dbo.company.email AS coemail, dbo.company.website, dbo.company.info1, dbo.company.info2, 
                      dbo.company.COMPANY, dbo.BILLHIST1.GRNO, dbo.BILLHIST1.OLNM1, dbo.BILLHIST1.OLNM2, dbo.BILLHIST1.OLNM3, dbo.BILLHIST1.OLNM4, 
                      dbo.BILLHIST1.OLNM5, dbo.BILLHIST1.OLNM6, dbo.BILLHIST1.OLNM7, dbo.BILLHIST1.OLNM8, dbo.BILLHIST1.OLNM9, dbo.BILLHIST1.OLNM10, 
                      dbo.BILLHIST1.SPLDISCOUNT, dbo.BILLHIST1.foodbill, dbo.BILLHIST.CTRLNO, dbo.BILLHIST1.BRNO
FROM         dbo.BILLHIST1 LEFT OUTER JOIN
                      dbo.company ON dbo.BILLHIST1.COMPANY = dbo.company.COMPANY LEFT OUTER JOIN
                      dbo.BILLHIST ON dbo.BILLHIST1.CNO = dbo.BILLHIST.CNO















GO
/****** Object:  View [dbo].[BillView_Revenue1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[BillView_Revenue1]
AS
SELECT        dbo.BILLHIST1.COMPANY, dbo.BILLHIST1.SPLIT, MIN(dbo.BILLHIST1.TXNDT) AS txndt, MIN(dbo.BILLHIST1.ADVANCE) AS advance, MIN(dbo.BILLHIST1.SPLDISCOUNT) AS spldiscount, MIN(dbo.BILLHIST1.foodbill) AS foodbill, 
                         MIN(dbo.BILLHIST1.MOP) AS mop, SUM(dbo.BILLHIST.RENT) AS rent, SUM(dbo.BILLHIST.DISCOUNT) AS discount, SUM(dbo.BILLHIST.ITEM1) AS item1, SUM(dbo.BILLHIST.ITEM2) AS item2, SUM(dbo.BILLHIST.ITEM3) AS item3, 
                         SUM(dbo.BILLHIST.ITEM4) AS item4, SUM(dbo.BILLHIST.ITEM5) AS item5, SUM(dbo.BILLHIST.ITEM6) AS item6, SUM(dbo.BILLHIST.ITEM7) AS item7, SUM(dbo.BILLHIST.ITEM8) AS item8, SUM(dbo.BILLHIST.ITEM9) AS item9, 
                         SUM(dbo.BILLHIST.ITEM10) AS item10, SUM(dbo.BILLHIST.SC) AS sc, SUM(dbo.BILLHIST.LT) AS lt, SUM(dbo.BILLHIST.TOTAL) AS total, SUM(dbo.BILLHIST.taxable) AS taxable, dbo.BILLHIST1.CNO, SUM(dbo.RoomDues.amount) 
                         AS roomdues, SUM(dbo.BILLHIST.ST) AS st, SUM(dbo.BILLHIST.CESS) AS cess, SUM(dbo.BILLHIST.OtherChgs) AS otherchgs, DATEDIFF(d, dbo.RoomDues.txndt, CONVERT(DATETIME, '2000-01-01 00:00:00', 102)) AS ddiff
FROM            dbo.BILLHIST1 INNER JOIN
                         dbo.BILLHIST ON dbo.BILLHIST1.CNO = dbo.BILLHIST.CNO LEFT OUTER JOIN
                         dbo.RoomDues ON dbo.BILLHIST.GNO = dbo.RoomDues.gno AND dbo.BILLHIST1.CNO = dbo.RoomDues.cno AND dbo.BILLHIST1.COMPANY = dbo.RoomDues.company AND dbo.BILLHIST1.SPLIT = dbo.RoomDues.split
GROUP BY dbo.BILLHIST1.SPLIT, dbo.BILLHIST1.COMPANY, dbo.BILLHIST1.CNO, DATEDIFF(d, dbo.RoomDues.txndt, CONVERT(DATETIME, '2000-01-01 00:00:00', 102))
GO
/****** Object:  View [dbo].[Bnq_MIS]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[Bnq_MIS]
AS
SELECT     dbo.banquet.billno, dbo.banquet.billdate, dbo.banquet.status, dbo.BanqMaster.Name AS bnqname, dbo.company.NAME AS Companyname, 
                      dbo.BanqMaster.Company, dbo.banquet.usernm2, dbo.banquet.billamount AS billamt, dbo.banquet.mop, dbo.banquet.crname, dbo.banquet.crnum, 
                      dbo.banquet.crbank, dbo.banquet.glnum, dbo.banquet.ctrlno, dbo.banquet.name
FROM         dbo.banquet LEFT OUTER JOIN
                      dbo.company RIGHT OUTER JOIN
                      dbo.BanqMaster ON dbo.company.COMPANY = dbo.BanqMaster.Company ON dbo.banquet.BnqNo = dbo.BanqMaster.BnqNo















GO
/****** Object:  View [dbo].[BnqAdv_MIS]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[BnqAdv_MIS]
AS
SELECT     dbo.BanqAdv.advrno, dbo.BanqAdv.txndt, dbo.BanqAdv.amount, dbo.BanqAdv.mop, dbo.BanqAdv.crnum, dbo.BanqAdv.crname, dbo.BanqAdv.crbank, 
                      dbo.BanqAdv.usernm, dbo.company.NAME AS companyname, dbo.BanqMaster.Company, dbo.BanqMaster.Name AS bnqname, dbo.BanqAdv.bnqctrlno,
                       dbo.banquet.ctrlno, dbo.banquet.name AS guestname
FROM         dbo.BanqMaster LEFT OUTER JOIN
                      dbo.company ON dbo.BanqMaster.Company = dbo.company.COMPANY RIGHT OUTER JOIN
                      dbo.banquet ON dbo.BanqMaster.BnqNo = dbo.banquet.BnqNo RIGHT OUTER JOIN
                      dbo.BanqAdv ON dbo.banquet.ctrlno = dbo.BanqAdv.bnqctrlno











GO
/****** Object:  View [dbo].[BSAIU2400Y]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[BSAIU2400Y] as SELECT flag,company,fy,GRPNAME,FLGNAME,cgp_desc,Credits = case when balance >= 0 then convert(varchar(20),balance)+ ' Cr' else '' end  ,Debits = case when balance < 0 then convert(varchar(20),-balance) + ' Dr' else '' end ,cgp_actno,drs=case when balance < 0 then balance else 0 end , crs = case when balance >= 0 then balance else 0 end,balance=(balance*100)/100,al,grp,opgbal, case when balance < 0 then cast(abs(balance) as varchar(20)) + ' Dr'  else cast((balance) as varchar(20)) + ' Cr' end as crdr,case when balance < 0 then (balance)+(opgbal) else 0 end AS CHECK2,case when balance >= 0 then (balance)+(opgbal) else 0 end AS CHECK1,cast((opgbal) as varchar(20)) + case when opgbal >= 0 then ' Cr' else ' Dr' end as crdro  FROM  (select grp,flag,company,fy,upper(cgp_desc) as cgp_desc,glgroup.name as grpname,glflag.name as flgname,cgp_actno,isnull(isnull(opgbal,0)  + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2016') and datediff(d,'1/1/90','31 Mar 2017')) ,0) -isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2016') and datediff(d,'1/1/90','31 Mar 2017')),0),0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2016')) ,0) - isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2016')) ,0) as balance ,isnull(opgbal,0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2016')) ,0)-isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2016')) ,0) as opgbal,al from glprimld b left join glgroup on b.grp=glgroup.code left join glflag on b.flag=glflag.code where company=1 and fy= 4) tb
GO
/****** Object:  View [dbo].[BSDGD7899W]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[BSDGD7899W] as SELECT flag,company,fy,GRPNAME,FLGNAME,cgp_desc,Credits = case when balance >= 0 then convert(varchar(20),balance)+ ' Cr' else '' end  ,Debits = case when balance < 0 then convert(varchar(20),-balance) + ' Dr' else '' end ,cgp_actno,drs=case when balance < 0 then balance else 0 end , crs = case when balance >= 0 then balance else 0 end,balance=(balance*100)/100,al,grp,opgbal, case when balance < 0 then cast(abs(balance) as varchar(20)) + ' Dr'  else cast((balance) as varchar(20)) + ' Cr' end as crdr,case when balance < 0 then (balance)+(opgbal) else 0 end AS CHECK2,case when balance >= 0 then (balance)+(opgbal) else 0 end AS CHECK1,cast((opgbal) as varchar(20)) + case when opgbal >= 0 then ' Cr' else ' Dr' end as crdro  FROM  (select grp,flag,company,fy,upper(cgp_desc) as cgp_desc,glgroup.name as grpname,glflag.name as flgname,cgp_actno,isnull(isnull(opgbal,0)  + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2019') and datediff(d,'1/1/90','31 Mar 2020')) ,0) -isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2019') and datediff(d,'1/1/90','31 Mar 2020')),0),0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) - isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) as balance ,isnull(opgbal,0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0)-isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) as opgbal,al from glprimld b left join glgroup on b.grp=glgroup.code left join glflag on b.flag=glflag.code where company=1 and fy= 14) tb
GO
/****** Object:  View [dbo].[BSEPC5717L]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[BSEPC5717L] as SELECT flag,company,fy,GRPNAME,FLGNAME,cgp_desc,Credits = case when balance >= 0 then convert(varchar(20),balance)+ ' Cr' else '' end  ,Debits = case when balance < 0 then convert(varchar(20),-balance) + ' Dr' else '' end ,cgp_actno,drs=case when balance < 0 then balance else 0 end , crs = case when balance >= 0 then balance else 0 end,balance=(balance*100)/100,al,grp,opgbal, case when balance < 0 then cast(abs(balance) as varchar(20)) + ' Dr'  else cast((balance) as varchar(20)) + ' Cr' end as crdr,case when balance < 0 then (balance)+(opgbal) else 0 end AS CHECK2,case when balance >= 0 then (balance)+(opgbal) else 0 end AS CHECK1,cast((opgbal) as varchar(20)) + case when opgbal >= 0 then ' Cr' else ' Dr' end as crdro  FROM  (select grp,flag,company,fy,upper(cgp_desc) as cgp_desc,glgroup.name as grpname,glflag.name as flgname,cgp_actno,isnull(isnull(opgbal,0)  + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2018') and datediff(d,'1/1/90','31 Mar 2019')) ,0) -isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2018') and datediff(d,'1/1/90','31 Mar 2019')),0),0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2018')) ,0) - isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2018')) ,0) as balance ,isnull(opgbal,0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2018')) ,0)-isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2018')) ,0) as opgbal,al from glprimld b left join glgroup on b.grp=glgroup.code left join glflag on b.flag=glflag.code where company=1 and fy= 10) tb
GO
/****** Object:  View [dbo].[BSQVI1904C]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[BSQVI1904C] as SELECT flag,company,fy,GRPNAME,FLGNAME,cgp_desc,Credits = case when balance >= 0 then convert(varchar(20),balance)+ ' Cr' else '' end  ,Debits = case when balance < 0 then convert(varchar(20),-balance) + ' Dr' else '' end ,cgp_actno,drs=case when balance < 0 then balance else 0 end , crs = case when balance >= 0 then balance else 0 end,balance=(balance*100)/100,al,grp,opgbal, case when balance < 0 then cast(abs(balance) as varchar(20)) + ' Dr'  else cast((balance) as varchar(20)) + ' Cr' end as crdr,case when balance < 0 then (balance)+(opgbal) else 0 end AS CHECK2,case when balance >= 0 then (balance)+(opgbal) else 0 end AS CHECK1,cast((opgbal) as varchar(20)) + case when opgbal >= 0 then ' Cr' else ' Dr' end as crdro  FROM  (select grp,flag,company,fy,upper(cgp_desc) as cgp_desc,glgroup.name as grpname,glflag.name as flgname,cgp_actno,isnull(isnull(opgbal,0)  + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2019') and datediff(d,'1/1/90','30 Jun 2019')) ,0) -isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2019') and datediff(d,'1/1/90','30 Jun 2019')),0),0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) - isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) as balance ,isnull(opgbal,0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0)-isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) as opgbal,al from glprimld b left join glgroup on b.grp=glgroup.code left join glflag on b.flag=glflag.code where company=2 and fy= 15) tb
GO
/****** Object:  View [dbo].[BSTAQ8772N]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[BSTAQ8772N] as SELECT flag,company,fy,GRPNAME,FLGNAME,cgp_desc,Credits = case when balance >= 0 then convert(varchar(20),balance)+ ' Cr' else '' end  ,Debits = case when balance < 0 then convert(varchar(20),-balance) + ' Dr' else '' end ,cgp_actno,drs=case when balance < 0 then balance else 0 end , crs = case when balance >= 0 then balance else 0 end,balance=(balance*100)/100,al,grp,opgbal, case when balance < 0 then cast(abs(balance) as varchar(20)) + ' Dr'  else cast((balance) as varchar(20)) + ' Cr' end as crdr,case when balance < 0 then (balance)+(opgbal) else 0 end AS CHECK2,case when balance >= 0 then (balance)+(opgbal) else 0 end AS CHECK1,cast((opgbal) as varchar(20)) + case when opgbal >= 0 then ' Cr' else ' Dr' end as crdro  FROM  (select grp,flag,company,fy,upper(cgp_desc) as cgp_desc,glgroup.name as grpname,glflag.name as flgname,cgp_actno,isnull(isnull(opgbal,0)  + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2019') and datediff(d,'1/1/90','31 Oct 2019')) ,0) -isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) between datediff(d,'1/1/90','01 Apr 2019') and datediff(d,'1/1/90','31 Oct 2019')),0),0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) - isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) as balance ,isnull(opgbal,0) + isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'C' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0)-isnull((select sum(isnull(amt,0)) from vouchers a where a.company=b.company and a.fy=b.fy and a.actnum=b.cgp_actno and amttyp = 'D' and datediff(d,'1/1/90',txndt) < datediff(d,'1/1/90','01 Apr 2019')) ,0) as opgbal,al from glprimld b left join glgroup on b.grp=glgroup.code left join glflag on b.flag=glflag.code where company=3 and fy= 13) tb
GO
/****** Object:  View [dbo].[CASHFLOW]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[CASHFLOW]
AS
SELECT     dbo.GLPRIMLD.COMPANY, dbo.GLPRIMLD.FY, dbo.GLPRIMLD.CGP_ACTNO, dbo.GLPRIMLD.CGP_DESC AS [TITLE OF ACCOUNT], 
                      STR(dbo.GLPRIMLD.CREDIT1 - dbo.GLPRIMLD.DEBIT1, 15, 2) AS JANUARY, STR(dbo.GLPRIMLD.CREDIT2 - dbo.GLPRIMLD.DEBIT2, 15, 2) 
                      AS FEBRUARY, STR(dbo.GLPRIMLD.CREDIT3 - dbo.GLPRIMLD.DEBIT3, 15, 2) AS MARCH, STR(dbo.GLPRIMLD.CREDIT4 - dbo.GLPRIMLD.DEBIT4, 15, 
                      2) AS APRIL, STR(dbo.GLPRIMLD.CREDIT5 - dbo.GLPRIMLD.DEBIT5, 15, 2) AS MAY, STR(dbo.GLPRIMLD.CREDIT6 - dbo.GLPRIMLD.DEBIT6, 15, 2) 
                      AS JUNE, STR(dbo.GLPRIMLD.CREDIT7 - dbo.GLPRIMLD.DEBIT7, 15, 2) AS JULY, STR(dbo.GLPRIMLD.CREDIT8 - dbo.GLPRIMLD.DEBIT8, 15, 2) 
                      AS AUGUST, STR(dbo.GLPRIMLD.CREDIT9 - dbo.GLPRIMLD.DEBIT9, 15, 2) AS SEPTEMBER, STR(dbo.GLPRIMLD.CREDIT10 - dbo.GLPRIMLD.DEBIT10, 
                      15, 2) AS OCTOBER, STR(dbo.GLPRIMLD.CREDIT11 - dbo.GLPRIMLD.DEBIT11, 15, 2) AS NOVEMBER, 
                      STR(dbo.GLPRIMLD.CREDIT12 - dbo.GLPRIMLD.DEBIT12, 15, 2) AS DECEMBER, dbo.GLPRIMLD.GRP, dbo.GLPRIMLD.FLAG, 
                      dbo.GLFLAG.NAME AS flgname, dbo.GLGROUP.NAME AS grpname, dbo.GLPRIMLD.BALANCE, dbo.GLPRIMLD.OPGBAL, 
                      dbo.GLSUBGRP.Name AS sgrpname
FROM         dbo.GLPRIMLD INNER JOIN
                      dbo.GLFLAG ON dbo.GLPRIMLD.FLAG = dbo.GLFLAG.CODE INNER JOIN
                      dbo.GLGROUP ON dbo.GLPRIMLD.GRP = dbo.GLGROUP.CODE INNER JOIN
                      dbo.GLSUBGRP ON dbo.GLPRIMLD.subgrp = dbo.GLSUBGRP.code















GO
/****** Object:  View [dbo].[chalanview1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[chalanview1]
AS
SELECT    txndt=finaldate, mop0 = CASE WHEN mop = 1 THEN amt-(finalbasic_t+finalbata_t) ELSE 0 END, mop1 = CASE WHEN mop = 5 THEN amt-(finalbasic_t+finalbata_t) ELSE 0 END, mop2 = 0, 
                      mop3 = CASE WHEN mop = 4 THEN amt-(finalbasic_t+finalbata_t) ELSE 0 END, mop4 = CASE WHEN mop = 3 THEN amt-(finalbasic_t+finalbata_t) ELSE 0 END, 
                      mop5 = CASE WHEN mop = 6 THEN amt-(finalbasic_t+finalbata_t) ELSE 0 END
FROM         dbo.CHALAN















GO
/****** Object:  View [dbo].[CO_FY]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[CO_FY]
AS
SELECT     dbo.COMPANY.COMPANY, dbo.COMPANY.NAME, dbo.COMPANY.add1, dbo.COMPANY.add2, dbo.COMPANY.city, dbo.COMPANY.phone, 
                      dbo.COMPANY.email, dbo.COMPANY.website, dbo.COMPANY.info1, dbo.COMPANY.info2, dbo.COMPANY.ADVRNO, dbo.COMPANY.ADVRDT, 
                      dbo.COMPANY.BNO, dbo.COMPANY.BDT, dbo.COMPANY.BNO1, dbo.COMPANY.BDT1, dbo.COMPANY.BNO2, dbo.COMPANY.BDT2, dbo.FINYEAR.FY, 
                      dbo.FINYEAR.[DATE], dbo.FINYEAR.DESCRIPTION, RTRIM(dbo.FINYEAR.DESCRIPTION) + '-' + dbo.COMPANY.NAME AS co_fyname
FROM         dbo.COMPANY RIGHT OUTER JOIN
                      dbo.FINYEAR ON dbo.COMPANY.COMPANY = dbo.FINYEAR.COMPANY















GO
/****** Object:  View [dbo].[CO1GRNO_UNION]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









/****** Object:  View dbo.CO1GRNO_UNION    Script Date: 1/20/03 11:51:44 AM ******/
CREATE VIEW [dbo].[CO1GRNO_UNION]
AS
SELECT CO1GRNO
FROM OUTLET
UNION
SELECT CO1GRNO
FROM PHOUTLET















GO
/****** Object:  View [dbo].[cry_CASHFLOW]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[cry_CASHFLOW]
AS
SELECT     dbo.GLPRIMLD.COMPANY, dbo.GLPRIMLD.FY, dbo.GLPRIMLD.CGP_ACTNO, dbo.GLPRIMLD.CGP_DESC AS [TITLE OF ACCOUNT], 
                      dbo.GLPRIMLD.CREDIT1 - dbo.GLPRIMLD.DEBIT1 AS JANUARY, dbo.GLPRIMLD.CREDIT2 - dbo.GLPRIMLD.DEBIT2 AS FEBRUARY, 
                      dbo.GLPRIMLD.CREDIT3 - dbo.GLPRIMLD.DEBIT3 AS MARCH, dbo.GLPRIMLD.CREDIT4 - dbo.GLPRIMLD.DEBIT4 AS APRIL, 
                      dbo.GLPRIMLD.CREDIT5 - dbo.GLPRIMLD.DEBIT5 AS MAY, dbo.GLPRIMLD.CREDIT6 - dbo.GLPRIMLD.DEBIT6 AS JUNE, 
                      dbo.GLPRIMLD.CREDIT7 - dbo.GLPRIMLD.DEBIT7 AS JULY, dbo.GLPRIMLD.CREDIT8 - dbo.GLPRIMLD.DEBIT8 AS AUGUST, 
                      dbo.GLPRIMLD.CREDIT9 - dbo.GLPRIMLD.DEBIT9 AS SEPTEMBER, dbo.GLPRIMLD.CREDIT10 - dbo.GLPRIMLD.DEBIT10 AS OCTOBER, 
                      dbo.GLPRIMLD.CREDIT11 - dbo.GLPRIMLD.DEBIT11 AS NOVEMBER, dbo.GLPRIMLD.CREDIT12 - dbo.GLPRIMLD.DEBIT12 AS DECEMBER, 
                      dbo.GLPRIMLD.GRP, dbo.GLPRIMLD.FLAG, dbo.GLFLAG.NAME AS flgname, dbo.GLGROUP.NAME AS grpname, dbo.GLPRIMLD.BALANCE, 
                      dbo.GLPRIMLD.OPGBAL, dbo.GLSUBGRP.Name AS sgrpname
FROM         dbo.GLPRIMLD INNER JOIN
                      dbo.GLFLAG ON dbo.GLPRIMLD.FLAG = dbo.GLFLAG.CODE INNER JOIN
                      dbo.GLGROUP ON dbo.GLPRIMLD.GRP = dbo.GLGROUP.CODE INNER JOIN
                      dbo.GLSUBGRP ON dbo.GLPRIMLD.subgrp = dbo.GLSUBGRP.code















GO
/****** Object:  View [dbo].[currentkot_v1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[currentkot_v1]
AS
SELECT        OUTLET, PEND_TYPE, BNO, sno, PEND_CODE
FROM            dbo.currentkot
GROUP BY OUTLET, PEND_TYPE, BNO, sno, PEND_CODE
GO
/****** Object:  View [dbo].[DAYBK]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









/****** Object:  View dbo.DAYBK    Script Date: 1/20/03 11:51:45 AM ******/
CREATE VIEW [dbo].[DAYBK]
AS
SELECT VOUCHERS.*, GLPRIMLD.CGP_DESC AS Expr1
FROM VOUCHERS INNER JOIN
    GLPRIMLD ON 
    VOUCHERS.COMPANY = GLPRIMLD.COMPANY AND 
    VOUCHERS.FY = GLPRIMLD.FY AND 
    VOUCHERS.ACTNUM = GLPRIMLD.CGP_ACTNO
WHERE (VOUCHERS.GRNO IN
        (SELECT grno
      FROM vouchers V1
      WHERE actnum = 1 AND V1.TXNDT = VOUCHERS.TXNDT))















GO
/****** Object:  View [dbo].[doorcust_view]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[doorcust_view]
AS
SELECT     dbo.doorcust_id.ID, dbo.doorcust.ctrlno, dbo.doorcust.name, dbo.doorcust.add1, dbo.doorcust.add2, dbo.doorcust.area, dbo.doorcust.phone, 
                      dbo.doorcust.discountrate
FROM         dbo.doorcust INNER JOIN
                      dbo.doorcust_id ON dbo.doorcust.ctrlno = dbo.doorcust_id.ctrlno















GO
/****** Object:  View [dbo].[dummybillview]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[dummybillview]
AS
SELECT BILLHIST.TXNDT, BILLHIST.RENT, BILLHIST.DISCOUNT, 
    BILLHIST.ITEM1, BILLHIST.ITEM2, BILLHIST.ITEM3, 
    BILLHIST.ITEM4, BILLHIST.ITEM5, BILLHIST.ITEM6, 
    BILLHIST.ITEM7, BILLHIST.ITEM8, BILLHIST.ITEM9, 
    BILLHIST.ITEM10, BILLHIST.LT, BILLHIST.SC, 
    BILLHIST.TOTAL, BILLHIST1.COMPANY AS billorder, 
    BILLHIST1.SPLIT AS section, BILLHIST.OUTLET1, 
    BILLHIST.OUTLET2, BILLHIST.OUTLET3, BILLHIST.OUTLET4, 
    BILLHIST.OUTLET5, BILLHIST.OUTLET6, BILLHIST.OUTLET7, 
    BILLHIST.OUTLET8, BILLHIST.OUTLET9, BILLHIST.OUTLET10, 
    BILLHIST.ctrlno, BILLHIST.taxable, BILLHIST.CNO, 
    BILLHIST.rno
FROM BILLHIST LEFT OUTER JOIN
    BILLHIST1 ON BILLHIST.CNO = BILLHIST1.CNO















GO
/****** Object:  View [dbo].[GP_View]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO



CREATE VIEW [dbo].[GP_View]     
AS
SELECT     dbo.GUEST.ENO, dbo.GUEST.RNO, dbo.GPASSPORT.*
FROM         dbo.GUEST RIGHT OUTER JOIN
                      dbo.GPASSPORT ON dbo.GUEST.GNO = dbo.GPASSPORT.GNO











GO
/****** Object:  View [dbo].[guest_view_new]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[guest_view_new]
AS
SELECT     CNO, GNO, ENO, RNO, CI_DATE, CO_DATE, FOODPLAN, RENT, DISCOUNT, SC, MALE, FEMALE, CHILD, grpcounter, userchkin, userchkout, grpname, 
                      BRNO, Address, Name, Add1, Add2, Add3, City, State, Phone, email, nationality, company
FROM         dbo.GUEST















GO
/****** Object:  View [dbo].[kitmast_v]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[kitmast_v]
AS
SELECT        dbo.KITMAST.outlet, dbo.KITMAST.CODE, dbo.KITMAST.RATE, dbo.KITMAST.TAX, dbo.KITMAST.NOTAXCATEGORY, dbo.KITMAST.RATE1, dbo.KITMAST.RATE2, dbo.KITMAST.STATUS, dbo.KITMAST.ICODE, dbo.kitprime.name, 
                         dbo.kitprime.class, dbo.kitprime.grp, dbo.kitprime.rcode, dbo.kitprime.subclass, dbo.kitprime.NoRate, dbo.kitprime.shcode, dbo.kitprime.preference, dbo.kitprime.shcodeud, dbo.kitprime.hsn, dbo.kitprime.TAXOrGST
FROM            dbo.KITMAST INNER JOIN
                         dbo.kitprime ON dbo.KITMAST.ICODE = dbo.kitprime.icode
GO
/****** Object:  View [dbo].[KITSALE]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









/****** Object:  View dbo.KITSALE    Script Date: 1/20/03 11:51:44 AM *****
*/
CREATE VIEW [dbo].[KITSALE]
AS
SELECT     TXNDT, PMODE, SUM(ROAMT) AS roamt, OUTLET, SUM(SCAMT) AS SCAMT
FROM         dbo.KITHIST1
GROUP BY TXNDT, PMODE, OUTLET















GO
/****** Object:  View [dbo].[KS_M_UW]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[KS_M_UW]
AS
SELECT     dbo.KITHIST1.BNO, dbo.KITHIST1.OUTLET, dbo.KITHIST1.TXNDT, dbo.KITHIST1.PMODE, dbo.KITHIST1.SPLIT, dbo.KITHIST1.ROAMT, 
                      dbo.KITHIST1.SCAMT, dbo.KITHIST1.STSET, dbo.KITHIST1.SCSET, dbo.KITHIST1.usernm, 
                      SUM(dbo.KITHIST.QTY * dbo.KITHIST.RATE + dbo.KITHIST.TAX - dbo.KITHIST.DISCOUNT) AS amt, dbo.RESTCO.COMPANY, dbo.OUTLET.CHANNEL, 
                      dbo.OUTLET.NAME, SUM(dbo.KITHIST.TAX) AS tax, dbo.KITHIST1.CRNAME, dbo.KITHIST1.RNO, dbo.KITHIST1.SNO, dbo.KITHIST1.FinalAmt
FROM         dbo.KITHIST INNER JOIN
                      dbo.KITHIST1 ON dbo.KITHIST.BNO = dbo.KITHIST1.BNO INNER JOIN
                      dbo.OUTLET ON dbo.KITHIST1.OUTLET = dbo.OUTLET.CODE INNER JOIN
                      dbo.RESTCO ON dbo.OUTLET.CHANNEL = dbo.RESTCO.CHANNEL
GROUP BY dbo.KITHIST1.BNO, dbo.KITHIST1.OUTLET, dbo.KITHIST1.TXNDT, dbo.KITHIST1.PMODE, dbo.KITHIST1.SPLIT, dbo.KITHIST1.ROAMT, 
                      dbo.KITHIST1.SCAMT, dbo.KITHIST1.STSET, dbo.KITHIST1.SCSET, dbo.KITHIST1.usernm, dbo.RESTCO.COMPANY, dbo.OUTLET.CHANNEL, 
                      dbo.OUTLET.NAME, dbo.KITHIST1.CRNAME, dbo.KITHIST1.RNO, dbo.KITHIST1.SNO, dbo.KITHIST1.FinalAmt






GO
/****** Object:  View [dbo].[ledgernew]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[ledgernew]
AS
SELECT TXNDT, PARTIC, GRNO, COMPANY, FY, 
    'DEBIT' = CASE WHEN AMTTYP = 'D' THEN STR(AMT, 12, 2) 
    ELSE '' END, 
    'CREDIT' = CASE WHEN AMTTYP = 'C' THEN STR(AMT, 12, 2) 
    ELSE '' END, VOUCHERS.BALANCE, [USER], ACTNUM, 
    VOUCHERS.TXNNO, 
  VOUCHERS.TXNNO2,
    'DEBIT_I' = CASE WHEN AMTTYP = 'D' THEN AMT ELSE 0 END, 
    'CREDIT_I' = CASE WHEN AMTTYP = 'C' THEN AMT ELSE 0 END,
     'BALCRDR' = CASE WHEN BALANCE < 0 THEN STR(- BALANCE,
     14, 2) + ' Dr' ELSE STR(BALANCE, 14, 2) + ' Cr' END,CUSNAM=(SELECT CGP_DESC FROM GLPRIMLD WHERE GLPRIMLD.FY=VOUCHERS.FY AND GLPRIMLD.CGP_ACTNO=VOUCHERS.ACTNUM),
others=dbo.vouddet(grno,txnno)

FROM VOUCHERS
WHERE AMT <> 0



















GO
/****** Object:  View [dbo].[mybillsv]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[mybillsv]
AS
SELECT     dbo.MYCUST.NAME, dbo.MYCUST.ADD1, dbo.MYCUST.ADD2, dbo.MYCUST.CITY, dbo.MYCUST.TYPE, dbo.MYBILLS.BNO, dbo.MYBILLS.PFROM, 
                      dbo.MYBILLS.PTO, dbo.MYBILLS.AMOUNT, dbo.MYBILLS.cno, dbo.MYBILLS.TXNDT, dbo.MYBILLS.btype, dbo.MYBILLS.Description
FROM         dbo.MYBILLS LEFT OUTER JOIN
                      dbo.MYCUST ON dbo.MYBILLS.cno = dbo.MYCUST.CNO















GO
/****** Object:  View [dbo].[PH_VIEW11]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[PH_VIEW11]
AS
SELECT     CNO, SUM(AMOUNT) AS AMOUNT
FROM         dbo.PHHIST
GROUP BY CNO















GO
/****** Object:  View [dbo].[PH_VIEW2]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[PH_VIEW2]
AS
SELECT     dbo.PHONE.OUTLET, dbo.PHONE.TXNDT, dbo.PHONE.PMODE, dbo.PHONE.CNO, dbo.PHONE.SNO, SUM(dbo.PHHIST.AMOUNT) AS AMOUNT, 
                      dbo.PHONE.DAMT, dbo.PHONE.LUX, dbo.PHONE.GNO, dbo.PHONE.DRATE, dbo.PHONE.CD_NUM, dbo.PHONE.CD_NAME, dbo.PHONE.CD_TYPE, 
                      dbo.PHONE.SPLIT, dbo.PHONE.RNO, dbo.PHONE.CRNAME, dbo.PHONE.CRNUM, dbo.PHONE.CRTYPE, dbo.PHONE.txntime
FROM         dbo.PHONE INNER JOIN
                      dbo.PHHIST ON dbo.PHONE.CNO = dbo.PHHIST.CNO
GROUP BY dbo.PHONE.OUTLET, dbo.PHONE.TXNDT, dbo.PHONE.PMODE, dbo.PHONE.CNO, dbo.PHONE.SNO, dbo.PHONE.DAMT, dbo.PHONE.LUX, 
                      dbo.PHONE.GNO, dbo.PHONE.DRATE, dbo.PHONE.CD_NUM, dbo.PHONE.CD_NAME, dbo.PHONE.CD_TYPE, dbo.PHONE.SPLIT, dbo.PHONE.RNO, 
                      dbo.PHONE.CRNAME, dbo.PHONE.CRNUM, dbo.PHONE.CRTYPE, dbo.PHONE.txntime















GO
/****** Object:  View [dbo].[phview_forservice]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[phview_forservice]
AS
SELECT        dbo.PHONE.CNO, dbo.PHONE.OUTLET, dbo.PHONE.TXNDT, dbo.PHONE.GNO, dbo.PHONE.SNO, dbo.PHONE.DAMT, dbo.PHHIST.PARTIC, dbo.PHHIST.AMOUNT, dbo.PHONE.SPLIT, dbo.PHONE.PMODE, dbo.PHONE.SCAMT, 
                         dbo.PHONE.finalamt, dbo.PHONE.stamt AS tax, dbo.PHOUTLET.COMPANY
FROM            dbo.PHONE INNER JOIN
                         dbo.PHHIST ON dbo.PHONE.CNO = dbo.PHHIST.CNO INNER JOIN
                         dbo.PHOUTLET ON dbo.PHONE.OUTLET = dbo.PHOUTLET.OUTLET
GO
/****** Object:  View [dbo].[spbills]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









create view [dbo].[spbills] 
as 
select cno,gno,rno,total,rent,lt,roomdues=isnull((select sum(isnull(amount,0)) from roomdues where gno=a.gno and company=1 and split='N'),0) from (
select cno,gno,rno,sum(total) total,sum(lt) lt , sum(rent-discount) rent from billhist where company=1 and split <> 'Y' group by gno,cno,rno) a















GO
/****** Object:  View [dbo].[sptbrooms_v]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[sptbrooms_v]
AS
SELECT     dbo.sptbrs1.roomtype, dbo.sptbrs1.noofrooms, dbo.sptbrs1.arrivedrooms, dbo.sptbrs1.cancelledrooms, dbo.sptbrs.ctrlno AS ctrlno_o, dbo.sptbrs.arrivaldate, 
                      dbo.sptbrs.departuredate, dbo.sptbrs.status AS sstatus, dbo.sptbrooms.ctrlno, dbo.sptbrooms.myctrlno, dbo.sptbrooms.rno, dbo.sptbrooms.status1, dbo.sptbrs.name, 
                      dbo.sptbrs.add1, dbo.sptbrs.add2, dbo.sptbrs.add3, dbo.sptbrs.city, dbo.sptbrs.state, dbo.sptbrs.phone, dbo.sptbrs.email, dbo.sptbrs.address, 
                      dbo.GCOMPANY.NAME AS company
FROM         dbo.sptbrs LEFT OUTER JOIN
                      dbo.GCOMPANY ON dbo.sptbrs.COMPANY = dbo.GCOMPANY.COMNO RIGHT OUTER JOIN
                      dbo.sptbrs1 RIGHT OUTER JOIN
                      dbo.sptbrooms ON dbo.sptbrs1.myctrlno = dbo.sptbrooms.myctrlno ON dbo.sptbrs.ctrlno = dbo.sptbrs1.ctrlno
WHERE     (dbo.sptbrs1.noofrooms > dbo.sptbrs1.arrivedrooms + dbo.sptbrs1.cancelledrooms)






GO
/****** Object:  View [dbo].[sptbrs_ad_v]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[sptbrs_ad_v]
AS
SELECT     dbo.sptbrs_ad.*, dbo.sptbrs.bookingdate AS bookingdate, dbo.sptbrs.arrivaldate AS arrivaldate, dbo.sptbrs.name AS name, dbo.sptbrs.add1 AS add1, 
                      dbo.sptbrs.add2 AS add2, dbo.sptbrs.add3 AS add3, dbo.sptbrs.city AS city, dbo.sptbrs.state AS state, dbo.sptbrs.address AS address, 
                      dbo.sptbrs.PIN AS pin
FROM         dbo.sptbrs INNER JOIN
                      dbo.sptbrs_ad ON dbo.sptbrs.ctrlno = dbo.sptbrs_ad.ctrlno















GO
/****** Object:  View [dbo].[sptbrs_v1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[sptbrs_v1]
AS
SELECT        dbo.sptbrs.ctrlno, dbo.sptbrs.arrivaldate, dbo.sptbrs.departuredate, dbo.sptbrs.status, SUM(dbo.sptbrs1.noofrooms) AS noofrooms, SUM(dbo.sptbrs1.arrivedrooms) AS arrivedrooms, 
                         dbo.GCOMPANY.NAME AS company, dbo.sptbrs.bookingdate, dbo.sptbrs.advancerecd, dbo.sptbrs.advanceadjd, dbo.sptbrs.cancellreason, dbo.sptbrs.cancelledon, dbo.sptbrs.bookedby, MAX(dbo.sptbrs.pickup) 
                         AS pickup, MAX(dbo.sptbrs.pickupinstrn) AS pickupinstrn, MAX(dbo.sptbrs.pickupreqd) AS pickupreqd, MAX(dbo.sptbrs.pickupstation) AS pickupstation, MAX(dbo.sptbrs.pickupfltno) AS pickupfltno, 
                         MAX(dbo.sptbrs.pickuptaxino) AS pickuptaxino, MAX(dbo.sptbrs.pickupsenttime) AS pickupsenttime, MAX(dbo.sptbrs.PickupDriver) AS PickupDriver, dbo.sptbrs1.rentagreed, dbo.sptbrs1.cancelledrooms, 
                         dbo.sptbrs.refundamount, dbo.sptbrs1.myctrlno, dbo.sptbrs1.roomtype, dbo.sptbrs.net, dbo.sptbrs.tentative, dbo.sptbrs.tent_upto, dbo.sptbrs.COMPANY AS comno, dbo.sptbrs.name, dbo.sptbrs.add1, 
                         dbo.sptbrs.add2, dbo.sptbrs.add3, dbo.sptbrs.city, dbo.sptbrs.state, dbo.sptbrs.phone, dbo.sptbrs.email, dbo.sptbrs.address, dbo.sptbrs.PIN, dbo.sptbrs.fax, dbo.sptbrs1.discount, 
                         dbo.GFOODPLAN.NAME AS fptypename, dbo.sptbrs1.fptype, dbo.sptbrs.memorandum, dbo.sptbrs.mktmgr, dbo.sptbrs1.lttype, dbo.sptbrs.ExtraBeds, dbo.sptbrs1.rent1, dbo.sptbrs1.rent2, 
                         dbo.sptbrs1.autobillamt
FROM            dbo.sptbrs1 LEFT OUTER JOIN
                         dbo.GFOODPLAN ON dbo.sptbrs1.fptype = dbo.GFOODPLAN.PLANTYPE RIGHT OUTER JOIN
                         dbo.GCOMPANY RIGHT OUTER JOIN
                         dbo.sptbrs ON dbo.GCOMPANY.COMNO = dbo.sptbrs.COMPANY ON dbo.sptbrs1.ctrlno = dbo.sptbrs.ctrlno
GROUP BY dbo.sptbrs.ctrlno, dbo.sptbrs.arrivaldate, dbo.sptbrs.departuredate, dbo.sptbrs.status, dbo.GCOMPANY.NAME, dbo.sptbrs.bookingdate, dbo.sptbrs.advancerecd, dbo.sptbrs.advanceadjd, 
                         dbo.sptbrs.cancellreason, dbo.sptbrs.cancelledon, dbo.sptbrs1.rentagreed, dbo.sptbrs1.cancelledrooms, dbo.sptbrs.refundamount, dbo.sptbrs1.myctrlno, dbo.sptbrs1.roomtype, dbo.sptbrs.net, 
                         dbo.sptbrs.tentative, dbo.sptbrs.tent_upto, dbo.sptbrs.COMPANY, dbo.sptbrs.name, dbo.sptbrs.add1, dbo.sptbrs.add2, dbo.sptbrs.add3, dbo.sptbrs.city, dbo.sptbrs.state, dbo.sptbrs.phone, dbo.sptbrs.email, 
                         dbo.sptbrs.address, dbo.sptbrs.PIN, dbo.sptbrs.fax, dbo.sptbrs1.discount, dbo.GFOODPLAN.NAME, dbo.sptbrs1.fptype, dbo.sptbrs.bookedby, dbo.sptbrs.memorandum, dbo.sptbrs.mktmgr, dbo.sptbrs1.lttype, 
                         dbo.sptbrs.ExtraBeds, dbo.sptbrs1.rent1, dbo.sptbrs1.rent2, dbo.sptbrs1.autobillamt


GO
/****** Object:  View [dbo].[storebamtview]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [dbo].[storebamtview]
AS
SELECT        dbo.storebills.bctrlno, MIN(dbo.storebills.txndt) AS txndt, SUM(dbo.storehist.price + dbo.storehist.cgstamt + dbo.storehist.sgstamt + dbo.storehist.igstamt + dbo.storehist.cessamt + dbo.storehist.saletax - dbo.storehist.damt) 
                         AS billamt, SUM(CASE WHEN dbo.storehist.saletax + sgstamt + igstamt + cgstamt <> 0 THEN dbo.storehist.price - damt ELSE 0 END) AS taxable, 
                         SUM(CASE WHEN dbo.storehist.saletax + sgstamt + igstamt + cgstamt = 0 THEN dbo.storehist.price - damt ELSE 0 END) AS nontaxable, SUM(dbo.storehist.saletax) AS saletax, SUM(dbo.storehist.damt) AS damt, 
                         MIN(dbo.storebills.otherchgs) AS otherchgs, MIN(dbo.storebills.supplier) AS supplier, MIN(dbo.storebills.storeno) AS storeno, MIN(dbo.storebills.amttyp) AS amttyp, MIN(dbo.storebills.chlno) AS chlno, 
                         MIN(dbo.storebills.invoiceno) AS invoiceno, dbo.storehist.strate, SUM(dbo.storehist.sgstamt) AS sgstamt, SUM(dbo.storehist.cgstamt) AS cgstamt, SUM(dbo.storehist.igstamt) AS igstamt,sum(cgstamt+sgstamt+igstamt) as GST
FROM            dbo.storebills INNER JOIN
                         dbo.storehist ON dbo.storebills.bctrlno = dbo.storehist.bctrlno
GROUP BY dbo.storebills.bctrlno, dbo.storehist.strate
GO
/****** Object:  View [dbo].[storehist_view1]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[storehist_view1]
AS
SELECT        dbo.storeitems.iname, dbo.storeitems.storedept, dbo.storeitems.luperhu, dbo.storeitems.luname, dbo.storeitems.huname, dbo.storeitems.storeno, dbo.storehist.amttyp, dbo.storehist.qty, dbo.storehist.rate, 
                         dbo.storehist.balance, dbo.storehist.price, dbo.storeitems.ctrlno, dbo.storebills.txndt, dbo.storebills.supplier, dbo.storebills.grno, dbo.storebills.saletax, dbo.storebills.txntyp, dbo.storebills.otherchgs, 
                         dbo.storebills.discount, dbo.storebills.stmode, dbo.storehist.hctrlno, dbo.storebills.bctrlno, dbo.storebills.Adjust, dbo.storebills.issuedtocode, dbo.storehist.damt
FROM            dbo.storehist LEFT OUTER JOIN
                         dbo.storeitems ON dbo.storehist.ctrlno = dbo.storeitems.ctrlno LEFT OUTER JOIN
                         dbo.storebills ON dbo.storehist.bctrlno = dbo.storebills.bctrlno

GO
/****** Object:  View [dbo].[storehistview]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[storehistview]
AS
SELECT        dbo.storeitems.iname, dbo.storeitems.ctrlno, dbo.storebills.txndt, dbo.storebills.chlno, dbo.storebills.usernm, dbo.storebills.invoiceno, dbo.storehist.bctrlno, dbo.storehist.qty, dbo.storehist.rate, dbo.storebills.supplier, 
                         dbo.storebills.grno, dbo.storebills.storeno, dbo.storehist.hctrlno, dbo.storehist.balance, dbo.storehist.price, dbo.storeitems.luname, dbo.storeitems.luperhu, dbo.storeitems.huname, dbo.storebills.saletax, 
                         dbo.storebills.otherchgs, dbo.storebills.discount, dbo.storebills.Adjust, dbo.storehist.amttyp, dbo.storebills.amttyp AS BillType, dbo.storebills.issuedtocode, dbo.storebills.CashType, dbo.storebills.issuedtotype, 
                         dbo.storehist.saletax AS staxind, dbo.storehist.strate, dbo.storehist.damt, dbo.storehist.sgstrate, dbo.storehist.sgstamt, dbo.storehist.igstrate, dbo.storehist.igstamt, dbo.storehist.cgstrate, dbo.storehist.cgstamt, 
                         dbo.storeitems.hsn, dbo.storeitems.loc, dbo.storehist.cessamt
FROM            dbo.storehist FULL OUTER JOIN
                         dbo.storebills ON dbo.storehist.bctrlno = dbo.storebills.bctrlno FULL OUTER JOIN
                         dbo.storeitems ON dbo.storehist.ctrlno = dbo.storeitems.ctrlno


GO
/****** Object:  View [dbo].[storeview]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[storeview]
AS
SELECT     dbo.COMPANY.NAME, dbo.store.storeno, dbo.store.storename, dbo.storeitems.ctrlno, dbo.storeitems.iname, dbo.storeitems.luperhu, 
                      dbo.storeitems.luname, dbo.storeitems.huname, dbo.storeitems.stock, dbo.storeitems.lpdate, dbo.storeitems.lidate, dbo.storeitems.rate, 
                      dbo.storeitems.indent, dbo.storeitems.ctrlno AS Expr1, dbo.COMPANY.COMPANY
FROM         dbo.COMPANY RIGHT OUTER JOIN
                      dbo.store ON dbo.COMPANY.COMPANY = dbo.store.company RIGHT OUTER JOIN
                      dbo.storeitems ON dbo.store.storeno = dbo.storeitems.storeno















GO
/****** Object:  View [dbo].[TALLYDR]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[TALLYDR]
AS
SELECT TXNDT, COMPANY, FY, AMTTYP, 
    DEBIT = CASE WHEN AMTTYP = 'D' THEN SUM(AMT) 
    ELSE 0 END, GRNO
FROM VOUCHERS
WHERE AMTTYP = 'D' AND AMT <> 0
GROUP BY TXNDT, COMPANY, FY, GRNO, AMTTYP















GO
/****** Object:  View [dbo].[tallynew]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[tallynew]
AS
SELECT     COMPANY, FY, DATEDIFF(d, CONVERT(DATETIME, '1990-01-01 00:00:00', 102), TXNDT) AS ddf, AMTTYP, SUM(AMT) AS Total, GRNO, MIN(TXNDT) 
                      AS txndt
FROM         dbo.VOUCHERS
GROUP BY COMPANY, FY, DATEDIFF(d, CONVERT(DATETIME, '1990-01-01 00:00:00', 102), TXNDT), AMTTYP, GRNO















GO
/****** Object:  View [dbo].[TT_CHALAN_OL]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[TT_CHALAN_OL]
AS
SELECT        dbo.TRAVELAGENT.NAME AS taname, dbo.TRAVELAGENT.GLACTNO, dbo.toutlet.name AS olname, dbo.toutlet.company, dbo.toutlet.advancerecd, 
                         dbo.toutlet.advancepaid, dbo.toutlet.PURCHASE1, dbo.toutlet.SALES1, dbo.toutlet.purchase2, dbo.toutlet.sales2, dbo.toutlet.purchase3, dbo.toutlet.sales3, 
                         dbo.toutlet.staxrate, dbo.toutlet.selfdeal, dbo.toutlet.hno_mybook, dbo.toutlet.hno_htlbook, dbo.toutlet.htl_purchase, dbo.toutlet.htl_sales, dbo.toutlet.htl_receivable, 
                         dbo.toutlet.lux, dbo.toutlet.billposition1, dbo.toutlet.billposition2, dbo.toutlet.my_receivable, dbo.CHALAN.OUTLET, dbo.CHALAN.CHCTRLNO, dbo.CHALAN.CHLNO, 
                         dbo.CHALAN.CHLDATE, dbo.CHALAN.STYPE, dbo.CHALAN.NAME, dbo.CHALAN.ADD1, dbo.CHALAN.ADD2, dbo.CHALAN.ADD3, dbo.CHALAN.CITY, dbo.CHALAN.STATE, 
                         dbo.CHALAN.PHONENO, dbo.CHALAN.DRIVER, dbo.CHALAN.SREADING, dbo.CHALAN.V_TYPE, dbo.CHALAN.V_MAKE, dbo.CHALAN.V_NUMBER, 
                         dbo.CHALAN.TRAVELAGENT, dbo.CHALAN.BASICAMT, dbo.CHALAN.PERKM, dbo.CHALAN.PERHOUR, dbo.CHALAN.BATA, dbo.CHALAN.TTTYPE, 
                         dbo.CHALAN.BASICAMT_T, dbo.CHALAN.PERKM_T, dbo.CHALAN.PERHOUR_T, dbo.CHALAN.BATA_T, dbo.CHALAN.ADVANCE, dbo.CHALAN.ADVANCE_T, 
                         dbo.CHALAN.finalamt, dbo.CHALAN.finalamt_T, dbo.CHALAN.pamt, dbo.CHALAN.pamt1, dbo.CHALAN.stax, dbo.CHALAN.totbata, dbo.CHALAN.totbata1, 
                         dbo.CHALAN.grno, dbo.CHALAN.grno_T, dbo.CHALAN.STATUS, dbo.CHALAN.ereading, dbo.CHALAN.NOTRAVELAGENT, dbo.CHALAN.OGNO, dbo.CHALAN.maxkm, 
                         dbo.CHALAN.maxhours, dbo.CHALAN.maxkm_t, dbo.CHALAN.maxhours_t, dbo.CHALAN.mop, dbo.CHALAN.CC_NAME, dbo.CHALAN.CC_NUM, dbo.CHALAN.CC_BANK, 
                         dbo.CHALAN.GLACTNUM, dbo.CHALAN.GNO, dbo.CHALAN.discount, dbo.CHALAN.finalbasic, dbo.CHALAN.finalbasic_t, dbo.CHALAN.finalbata, dbo.CHALAN.finalbata_t, 
                         dbo.CHALAN.finaltax, dbo.CHALAN.finaldate, dbo.CHALAN.split, dbo.CHALAN.grno_co1, dbo.CHALAN.amt, dbo.CHALAN.user1, dbo.CHALAN.user2, 
                         dbo.CHALAN.otherchgs, dbo.CHALAN.minkm, dbo.CHALAN.minkm_t, dbo.CHALAN.destination, dbo.CHALAN.ino, dbo.company.NAME AS CONAME, 
                         dbo.company.add1 AS COADD1, dbo.company.add2 AS COADD2, dbo.company.city AS COCITY, dbo.company.phone AS COPHONE, 
                         dbo.company.COMPANY AS Expr2, dbo.company.email AS coemail, dbo.company.website AS cowebsite, dbo.toutlet.otherchgsac, dbo.toutlet.bataac,dbo.chalan.cess
FROM            dbo.company RIGHT OUTER JOIN
                         dbo.toutlet ON dbo.company.COMPANY = dbo.toutlet.company RIGHT OUTER JOIN
                         dbo.CHALAN ON dbo.toutlet.outlet = dbo.CHALAN.OUTLET LEFT OUTER JOIN
                         dbo.TRAVELAGENT ON dbo.CHALAN.TRAVELAGENT = dbo.TRAVELAGENT.code




GO
/****** Object:  View [dbo].[VCH_GL]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO








/****** Object:  View dbo.VCH_GL    Script Date: 1/20/03 11:51:45 AM ******/
CREATE VIEW [dbo].[VCH_GL]
AS
SELECT     g.CGP_DESC, g.TDNO, g.ASSET, g.ONAC, v.TXNNO, CONVERT(datetime, DATENAME(dd, v.TXNDT) + '/' + DATENAME(mm, v.TXNDT) 
                      + '/' + DATENAME(yy, v.TXNDT)) AS txndt, v.AMTTYP, v.PARTIC, v.AMT, v.[USER], v.BALANCE, v.RECON, v.GRNO, v.FDRSNO, v.CHANNELCODE, 
                      v.COMPANY, v.FY, v.ACTNUM, v.REFNO, v.payee,v.txnno2
FROM         dbo.VOUCHERS v RIGHT OUTER JOIN
                      dbo.GLPRIMLD g ON v.COMPANY = g.COMPANY AND v.FY = g.FY AND v.ACTNUM = g.CGP_ACTNO















GO
/****** Object:  View [dbo].[Vou_view]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO









CREATE VIEW [dbo].[Vou_view]
AS
SELECT COMPANY, FY, ACTNUM, TXNDT, AMTTYP, SUM(AMT) 
    AS amt
FROM VOUCHERS
GROUP BY COMPANY, FY, ACTNUM, AMTTYP, TXNDT















GO
/****** Object:  View [dbo].[VouView]    Script Date: 30/03/2026 11:33:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO









CREATE VIEW [dbo].[VouView]
AS
SELECT     dbo.VOUCHERS.TXNDT, dbo.VOUCHERS.PARTIC, dbo.VOUCHERS.[USER], dbo.VOUCHERS.GRNO, dbo.GLPRIMLD.CGP_DESC, 
                      dbo.VOUCHERS.COMPANY, dbo.VOUCHERS.FY, dbo.VOUCHERS.ACTNUM, dbo.VOUCHERS.AMT, dbo.VOUCHERS.AMTTYP, dbo.VOUCHERS.TXNNO, 
                      dbo.VOUCHERS.ltxndt
FROM         dbo.VOUCHERS LEFT OUTER JOIN
                      dbo.GLPRIMLD ON dbo.VOUCHERS.COMPANY = dbo.GLPRIMLD.COMPANY AND dbo.VOUCHERS.FY = dbo.GLPRIMLD.FY AND 
                      dbo.VOUCHERS.ACTNUM = dbo.GLPRIMLD.CGP_ACTNO















GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "KITMAST"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "kitprime"
            Begin Extent = 
               Top = 6
               Left = 265
               Bottom = 136
               Right = 435
            End
            DisplayFlags = 280
            TopColumn = 8
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'a_kitmast_v'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'a_kitmast_v'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "BILLHIST"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 224
            End
            DisplayFlags = 280
            TopColumn = 38
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'bh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'bh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "BILLHIST1"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 224
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "BILLHIST"
            Begin Extent = 
               Top = 6
               Left = 262
               Bottom = 136
               Right = 448
            End
            DisplayFlags = 280
            TopColumn = 1
         End
         Begin Table = "RoomDues"
            Begin Extent = 
               Top = 7
               Left = 574
               Bottom = 216
               Right = 760
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'BillView_Revenue1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'BillView_Revenue1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "company"
            Begin Extent = 
               Top = 23
               Left = 17
               Bottom = 153
               Right = 187
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "RESTCO"
            Begin Extent = 
               Top = 18
               Left = 294
               Bottom = 148
               Right = 464
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "OUTLET"
            Begin Extent = 
               Top = 65
               Left = 511
               Bottom = 195
               Right = 718
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 50
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 2085
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Wi' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CO_REST_OL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'dth = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CO_REST_OL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CO_REST_OL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "currentkot"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 224
            End
            DisplayFlags = 280
            TopColumn = 9
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'currentkot_v1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'currentkot_v1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -384
         Left = 0
      End
      Begin Tables = 
         Begin Table = "currentkot"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 162
               Right = 226
            End
            DisplayFlags = 280
            TopColumn = 5
         End
         Begin Table = "a_kitmast_v"
            Begin Extent = 
               Top = 30
               Left = 475
               Bottom = 186
               Right = 686
            End
            DisplayFlags = 280
            TopColumn = 12
         End
         Begin Table = "B1ROOM_GUEST"
            Begin Extent = 
               Top = 245
               Left = 289
               Bottom = 401
               Right = 485
            End
            DisplayFlags = 280
            TopColumn = 1
         End
         Begin Table = "doorcust"
            Begin Extent = 
               Top = 237
               Left = 563
               Bottom = 393
               Right = 751
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "WAITER"
            Begin Extent = 
               Top = 243
               Left = 31
               Bottom = 377
               Right = 219
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "CO_REST_OL"
            Begin Extent = 
               Top = 456
               Left = 38
               Bottom = 612
               Right = 274
            End
            DisplayFlags = 280
            TopColumn = 2
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CURRENTKOT_V11'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CURRENTKOT_V11'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'CURRENTKOT_V11'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[41] 4[34] 2[6] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "OUTLET"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 162
               Right = 274
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "RESTCO"
            Begin Extent = 
               Top = 162
               Left = 38
               Bottom = 318
               Right = 226
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "KITHIST1"
            Begin Extent = 
               Top = 318
               Left = 38
               Bottom = 474
               Right = 254
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "KITGROUP"
            Begin Extent = 
               Top = 162
               Left = 264
               Bottom = 318
               Right = 452
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "a_kitmast_v"
            Begin Extent = 
               Top = 474
               Left = 38
               Bottom = 630
               Right = 249
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "KITHIST"
            Begin Extent = 
               Top = 474
               Left = 287
               Bottom = 630
               Right = 475
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 3585
         Al' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITITEM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'ias = 2535
         Table = 2955
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITITEM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITITEM'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "KITMAST"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 5
         End
         Begin Table = "kitprime"
            Begin Extent = 
               Top = 6
               Left = 265
               Bottom = 136
               Right = 435
            End
            DisplayFlags = 280
            TopColumn = 9
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'kitmast_v'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'kitmast_v'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[57] 4[4] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "KITHIST1"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 162
               Right = 254
            End
            DisplayFlags = 280
            TopColumn = 45
         End
         Begin Table = "KITHIST"
            Begin Extent = 
               Top = 108
               Left = 303
               Bottom = 264
               Right = 491
            End
            DisplayFlags = 280
            TopColumn = 8
         End
         Begin Table = "a_kitmast_v"
            Begin Extent = 
               Top = 38
               Left = 509
               Bottom = 194
               Right = 720
            End
            DisplayFlags = 280
            TopColumn = 7
         End
         Begin Table = "restpmode"
            Begin Extent = 
               Top = 318
               Left = 38
               Bottom = 430
               Right = 226
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "WAITER"
            Begin Extent = 
               Top = 318
               Left = 264
               Bottom = 452
               Right = 452
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITSALE3'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'        Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITSALE3'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KITSALE3'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[33] 4[30] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "GUEST"
            Begin Extent = 
               Top = 110
               Left = 428
               Bottom = 266
               Right = 656
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "restpmode"
            Begin Extent = 
               Top = 6
               Left = 264
               Bottom = 118
               Right = 452
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "WAITER"
            Begin Extent = 
               Top = 318
               Left = 38
               Bottom = 452
               Right = 226
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "KITSALE3"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 162
               Right = 226
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 47
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KitSale31'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'        Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KitSale31'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'KitSale31'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "PHONE"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 208
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "PHHIST"
            Begin Extent = 
               Top = 115
               Left = 289
               Bottom = 245
               Right = 459
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "PHOUTLET"
            Begin Extent = 
               Top = 34
               Left = 512
               Bottom = 164
               Right = 696
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'phview_forservice'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'phview_forservice'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "GUEST"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 238
            End
            DisplayFlags = 280
            TopColumn = 91
         End
         Begin Table = "GFOODPLAN"
            Begin Extent = 
               Top = 6
               Left = 276
               Bottom = 136
               Right = 446
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "ROOM"
            Begin Extent = 
               Top = 138
               Left = 38
               Bottom = 268
               Right = 219
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "GCOMPANY"
            Begin Extent = 
               Top = 138
               Left = 257
               Bottom = 268
               Right = 427
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "advance_total"
            Begin Extent = 
               Top = 270
               Left = 38
               Bottom = 366
               Right = 208
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or =' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ROOM_GUEST'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N' 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ROOM_GUEST'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ROOM_GUEST'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[53] 4[28] 2[18] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "sptbrs1"
            Begin Extent = 
               Top = 0
               Left = 336
               Bottom = 130
               Right = 527
            End
            DisplayFlags = 280
            TopColumn = 15
         End
         Begin Table = "GFOODPLAN"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 224
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "GCOMPANY"
            Begin Extent = 
               Top = 75
               Left = 15
               Bottom = 205
               Right = 201
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "sptbrs"
            Begin Extent = 
               Top = 191
               Left = 440
               Bottom = 319
               Right = 633
            End
            DisplayFlags = 280
            TopColumn = 51
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'sptbrs_v1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'sptbrs_v1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[31] 4[21] 2[30] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "storebills"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 224
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "storehist"
            Begin Extent = 
               Top = 6
               Left = 262
               Bottom = 136
               Right = 448
            End
            DisplayFlags = 280
            TopColumn = 21
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 15
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 12
         Column = 9180
         Alias = 2100
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storebamtview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storebamtview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "storehist"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 208
            End
            DisplayFlags = 280
            TopColumn = 17
         End
         Begin Table = "storeitems"
            Begin Extent = 
               Top = 6
               Left = 246
               Bottom = 136
               Right = 416
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "storebills"
            Begin Extent = 
               Top = 138
               Left = 38
               Bottom = 268
               Right = 208
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehist_view1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehist_view1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[50] 4[11] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "storehist"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 208
            End
            DisplayFlags = 280
            TopColumn = 21
         End
         Begin Table = "storebills"
            Begin Extent = 
               Top = 6
               Left = 246
               Bottom = 136
               Right = 416
            End
            DisplayFlags = 280
            TopColumn = 13
         End
         Begin Table = "storeitems"
            Begin Extent = 
               Top = 146
               Left = 261
               Bottom = 276
               Right = 431
            End
            DisplayFlags = 280
            TopColumn = 18
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 39
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehistview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehistview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'storehistview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -64
         Left = 0
      End
      Begin Tables = 
         Begin Table = "company"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 135
               Right = 208
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "toutlet"
            Begin Extent = 
               Top = 6
               Left = 246
               Bottom = 135
               Right = 416
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "CHALAN"
            Begin Extent = 
               Top = 138
               Left = 38
               Bottom = 267
               Right = 224
            End
            DisplayFlags = 280
            TopColumn = 65
         End
         Begin Table = "TRAVELAGENT"
            Begin Extent = 
               Top = 138
               Left = 262
               Bottom = 267
               Right = 432
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'TT_CHALAN_OL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'TT_CHALAN_OL'
GO
