
GO
/****** Object:  Table [dbo].[MenuMaster]    Script Date: 19/07/2019 6:34:28 PM ******/
DROP TABLE [dbo].[MenuMaster]
GO
/****** Object:  Table [dbo].[MenuMaster]    Script Date: 19/07/2019 6:34:28 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MenuMaster](
	[MenuID] [int] IDENTITY(1,1) NOT NULL,
	[MenuText] [varchar](100) NOT NULL CONSTRAINT [DF__MenuMaste__MenuT__7760A435]  DEFAULT (''),
	[MainMenuID] [int] NULL,
	[MenuOrder] [int] NULL,
	[IsActive] [int] NULL CONSTRAINT [DF_MenuMaster_IsActive]  DEFAULT ((1)),
	[FormName] [varchar](100) NOT NULL CONSTRAINT [DF__MenuMaste__FormN__7854C86E]  DEFAULT (''),
	[HeadingFlg] [int] NOT NULL CONSTRAINT [DF__MenuMaste__Headi__7948ECA7]  DEFAULT ((0)),
 CONSTRAINT [PK_MenuMaster] PRIMARY KEY CLUSTERED 
(
	[MenuID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[MenuMaster] ON 


GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1, N'Member Admin', 0, 1, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (2, N'Master', 0, 2, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (3, N'Entry', 0, 3, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (4, N'Corporate Actions', 0, 4, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (5, N'Reports', 0, 5, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (6, N'Advance Reports', 0, 6, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (7, N'Tools Utilities', 0, 7, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (8, N'Backup', 0, 8, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (9, N'Latest Update', 0, 9, 1, N'Entry.UpdateLatest	', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (10, N'Remote Software', 1134, 3, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (12, N'Change Member (F9)', 1, 3, 1, N'Details', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (13, N'Change Financial Year (F8)', 1, 5, 1, N'Details', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (14, N'Member Master', 1, 2, 1, N'Member_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (15, N'Financial Year Master', 1, 4, 1, N'FinancialYearMaster', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (16, N'Configuration', 1, 7, 1, N'ConfigurationForm', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (17, N'Account Master', 2, 2, 1, N'Account_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (18, N'Family Master', 1, 1, 1, N'Family_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (19, N'Demat Master', 2, 5, 1, N'Demat_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (20, N'Consultant Master', 2, 4, 1, N'Consultant', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (21, N'Industry Master', 2, 6, 1, N'Industry_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (22, N'Narration Master', 2, 9, 1, N'Narration_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (23, N'Mutual Fund', 2, 8, 1, N'Mutual_fund_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (24, N'Fund Family Master', 23, 1, 1, N'Fund_Family', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (25, N'Mutual Fund Master', 23, 2, 1, N'MutualFundMaster', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (26, N'Fund Category Master', 23, 3, 1, N'Fund_Category_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (27, N'Script Master ( Equity and F && O )', 2, 12, 1, N'Script_Equity_FO', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (28, N'Group Master', 2, 1, 1, N'Group', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (31, N'Opening Balance', 2, 3, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (32, N'Opening Account Balance', 31, 1, 1, N'Masters.OpeningTrailBalance', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (33, N'Opening Stock ( Equity ,  F&&O , M.F.)', 31, 2, 1, N'OpeningStock', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (34, N'Broker Bill ( Eq / F&&O / Com )', 3, 1, 1, N'Broker_s_Bill', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (36, N'Rights Received Entry', 4, 2, 1, N'Rights_rec', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (37, N'Dividend Received Entry', 4, 5, 1, N'DividendRe', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (38, N'Split / Merger / Demerger / Amalgmation', 4, 4, 1, N'Merger_Demerger', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (39, N'Single Receipt / Payment', 1141, 1, 1, N'CashBank_Voucher_Entry', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (40, N'Capital Gain-Loss', 5, 1, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (44, N'Mutual Fund Bill Entry', 3, 9, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (52, N'Other Investment Master', 2, 7, 1, N'Investment_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (53, N'Master Report', 1139, 1, 1, N'Reports.Master_Report', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (55, N'Journal Voucher Entry', 3, 8, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1054, N'Insurance', 3, 11, 1, N'Entry.Insurancefrm', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1055, N'Dividend Re-investment', 3, 15, 1, N'Devidend_Re_investment', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1056, N'Bank Statement Import', 3, 4, 1, N'UploadBankStatmentFileFormat', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1057, N'M 2 M ( Returns on Investment )', 5, 4, 1, N'Reports.StockPosition_ROI_Improved', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1059, N'Demat a/c wise ', 5, 10, 1, N'Reports.Rpt_Dematacwise_Stock_Holding_Position', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1060, N'Dividend Report', 5, 20, 1, N'Reports.Rpt_divident_report', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1061, N'Postal && Other Investment Report', 5, 19, 1, N'Reports.Rpt_postal_other_investmentreport', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1062, N'FDR / Other Investment Entry', 3, 12, 1, N'Other_Investments', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1063, N'Account Master Report', 1139, 2, 1, N'Reports.AccountmasterReport', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1065, N'Bank Reconciliation Statement', 5, 21, 1, N't_bankreco', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1066, N'Income && Expense Invoice', 3, 16, 1, N'Entry.Income_Expense_invoice_Entry', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1067, N'Upload Bhav copy', 3, 17, 1, N'UploadDailyRates', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1068, N'Multi Receipt / Payment', 1141, 2, 1, N'MultiReceipt', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1069, N'Demat Stock Transfer', 3, 10, 1, N'Stock_Transfer', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1070, N'F.D.R. report ', 5, 17, 1, N'Reports.Rpt_FD_Assured_Interest', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1072, N'FDR / Other Investment Maturity', 3, 14, 1, N'Postal_Other_investment_Maturity_Details', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1073, N'F && O Lot Detail(s)', 2, 13, 1, N'LotQuantity', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1075, N'Copy Broker Script Information Existing Member', 1140, 1, 1, N'CopyBrokerScripts', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1076, N'Update Broker Script Information', 1140, 2, 1, N't_Brokerwise_Script_Master', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1077, N'Script Master Download  ', 1140, 3, 1, N't_ScriptMaster', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1078, N'Scriptwise - Qtywise report ', 5, 6, 1, N'Reports.Scripwise_Qtywise', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1079, N'Consultant Transfer', 7, 3, 1, N'Tools.Consultant_Transfer', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1081, N'Bank Statement Common Account Match', 7, 2, 1, N'Tools.Match_Bank_Statement', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1082, N'Delete Auto JV', 7, 4, 1, N't_deleteautojv', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1083, N'Manual Upload Script Master', 1140, 4, 1, N'Importscripts', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1084, N'Global Report With Expense Amount', 7, 12, 1, N'Tools.Update_Data_With_Text_Amount_In_Net_Amount', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1086, N'Account Ledger', 1088, 1, 1, N'Account_Ledger', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1087, N'STT- 10 DB Report', 5, 15, 1, N'Reports.STT_scriptwise', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1088, N'Financial Ledger', 5, 5, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1089, N'Family / Memberwise Account Ledger', 1088, 2, 1, N'Familywise_Account_Ledger', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1090, N'Script Account Ledger', 1088, 3, 1, N'Reports.Rpt_script_account_ledger', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1092, N'Export To Winman', 6, 4, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1093, N'Short Term / Long Term  - Winman', 1092, 1, 1, N'Reports.Export_To_WinMan_LongTerm_Improved', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1096, N'Stock Filter', 5, 12, 1, N'Reports.Rpt_stock_filter', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1097, N'Broker Bill / Mutual Fund Register', 5, 8, 1, N'Reports.BrokerBillRegister', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1098, N'Family / Memberwise BrokerBill Register', 5, 9, 1, N'Reports.Rpt_familymember_wise_broker_bill_register', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1099, N'Final Statement', 5, 23, 1, N'Reports.Rpt_final_statement', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1100, N'Broker''s Bill Expense Report', 5, 13, 1, N'Reports.rpt_brokerage_statement_other_chg', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1103, N'ST , LT && Speculation', 40, 1, 1, N'MonthwisePNL_Improved', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1106, N'Single Journal Entry', 55, 1, 1, N'Journal_Voucher_Entry', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1107, N'Multi Journal Entry', 55, 2, 1, N'Multi_Journal_Voucher_Entry', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1108, N'Database Backup', 8, 1, 1, N'Tools.BackupDB', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1109, N'Update Broker Account', 7, 11, 1, N't_recalculate_brokersledger', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1110, N'User Configuration', 1, 6, 0, N'Member_Admin.UserConfiguration', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1113, N'Margin Entry', 3, 19, 1, N'Margin_Entry', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1114, N'Contra Entry', 3, 20, 1, N'Entry.Contra_Entry', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1115, N'Purchase sale Report', 6, 2, 1, N'Reports.PurchaseSale_Monthwsie_Report', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1116, N'User Rights', 7, 13, 1, N'Member_Admin.UserRight', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1117, N'Generate License', 1134, 1, 1, N'Tools.FrmCheckLicense', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1118, N'Buy-back Entry', 4, 10, 1, N'Entry.BuybackEntry', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1119, N'Advance Tax Report', 6, 1, 1, N'Reports.CapitalStockSummary', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1120, N'Shortcut Keys', 1134, 2, 1, N'Tools.Shortkeys', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1124, N'Stock in trade (Auto JV Purchase/Sale)', 7, 17, 1, N'Tools.AutoJv_For_StockInTrade', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1125, N'Broker''s Bill Expenses SetUp', 7, 5, 1, N'Tools.Expense_Auto_Setting', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1126, N'Short Term/Long Term/Speculation', 40, 2, 1, N'StockHolding_Equity_ShortTerm_Improved', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1129, N'I.P.O', 4, 11, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1130, N'IPO ( Appln && Allotment )', 1129, 1, 1, N'Entry.IPOENTRY', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1131, N'IPO Reports', 1129, 2, 1, N'Entry.IPO_Reports', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1132, N'Trades file / Bulk data upload', 3, 3, 1, N'Entry.Upload_Trade_File_format', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1133, N'Export to Tally', 6, 5, 0, N'ExportForTally', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1134, N'Help', 0, 10, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1135, N'Exit', 0, 11, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1136, N'Brokerwise Capital Gain-Loss', 40, 4, 1, N'Reports.Broker_StockHoldingPostion_Monthwise_Improved', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1137, N'Familywise Capital Gain-Loss', 40, 5, 1, N'Reports.Familywise_Monthwise_Report_Improved', 2)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1138, N'LTCG (Grandfathering Provision)', 5, 3, 1, N'StockHolding_Equity_LTCG', 2)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1139, N'Masters', 5, 7, 1, N'', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1140, N'Script Master', 7, 10, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1141, N'Receipt Payment', 3, 6, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1143, N'Mutual Fund Manual Entry', 44, 1, 1, N'Mutul_FundBill', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1144, N'Mutual Fund Auto upload Entry', 44, 2, 1, N'UploadMFTradeFile', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1145, N'Auto JV Upload', 6, 7, 1145, N'UploadJVFormat', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1147, N'Rename Script', 6, 10, 1, N'Tools.ScriptRename', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1150, N'Auto CE / PE Sq Entry', 6, 6, 1, N'Tools.AutoCEPEEntry', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1152, N'Apply License', 1134, 4, 1, N'Tools.DecryptAndApplyLicense', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1153, N'Update BF / CF Entries', 6, 9, 1, N'Entry.UpdateBFCFEntries', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1154, N'Interest Calculation', 6, 8, 0, N'InterestCalculation', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1155, N'Comprehansive Report', 6, 11, 0, N'rpt_ComprehansiveReport', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1156, N'Bonus Entry', 4, 1, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1157, N'Bonus Manual Entry', 1156, 1, 1, N'Bonus_rec', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1158, N'Bonus Auto Upload', 1156, 2, 1, N'Entry.Bonus_Rights_AutoUpload', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1159, N'Reminder /To do list', 7, 1, 1, N'ToDolist', 1)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1160, N'Re-Transfer', 7, 16, 1, N'', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1161, N'Re-Calculate Stock in Trade( Equity )', 1160, 1, 1, N't_recalculatestockintrade', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1162, N'Re-Transfer Closing Stock From Previous Year', 1160, 2, 1, N'Tools.ReStockTransfer', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1163, N'Re-Transfer Account Closing Balance from Prev Year', 1160, 3, 1, N'retransfer_closing', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1164, N'Re-Transfer Pending Bank Reco', 1160, 4, 1, N't_retransfer_bankreco', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1165, N'Journal Register', 55, 3, 1, N'Journal_Voucher', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1166, N'Re-Transfer Expense From Previous Year', 1160, 5, 1, N'Re_Transfer_Expense_from_pre_Year', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1167, N'Mark Intraday', 7, 19, 1, N'Tools.Mark_IntraDay', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1168, N'Opening Account Master', 31, 3, 1, N'Masters.Acc_Master_Autoupload', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1169, N'Member Expense Transfer', 1160, 6, 1, N'Util.MemberExpenseTransfer', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1171, N'FeedBack',1134, 5, 1, N'Tools.FeedBack', 0)
GO
INSERT [dbo].[MenuMaster] ([MenuID], [MenuText], [MainMenuID], [MenuOrder], [IsActive], [FormName], [HeadingFlg]) VALUES (1170, N'Script Wise Expense', 5, 25, 1, N'Tools.ScriptWiseExpense', 0)
GO
SET IDENTITY_INSERT [dbo].[MenuMaster] OFF
GO

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferD__isint__75281A12]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] DROP CONSTRAINT [DF__TransferD__isint__75281A12]
END

GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferD__amoun__7433F5D9]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] DROP CONSTRAINT [DF__TransferD__amoun__7433F5D9]
END

GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferDa__rate__733FD1A0]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] DROP CONSTRAINT [DF__TransferDa__rate__733FD1A0]
END

GO
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferDat__qty__724BAD67]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] DROP CONSTRAINT [DF__TransferDat__qty__724BAD67]
END

GO
/****** Object:  Table [dbo].[TransferData]    Script Date: 14/05/2019 6:30:26 PM ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TransferData]') AND type in (N'U'))
DROP TABLE [dbo].[TransferData]
GO
/****** Object:  Table [dbo].[TransferData]    Script Date: 14/05/2019 6:30:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TransferData]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TransferData](
	[id] [int] NULL,
	[Trans_No] [varchar](20) NULL,
	[sr_no] [int] NULL,
	[script_name] [varchar](500) NULL,
	[script_Code] [varchar](max) NULL,
	[holding_type] [varchar](200) NULL,
	[Act_Type] [varchar](20) NULL,
	[Broker_Code] [varchar](100) NULL,
	[Consultant_Code] [varchar](20) NULL,
	[DP_Code] [varchar](50) NULL,
	[bill_no] [varchar](100) NULL,
	[trans_dt] [datetime] NULL,
	[qty] [float] NULL,
	[rate] [float] NULL,
	[amount] [float] NULL,
	[isintraday] [bit] NULL,
	[consultant_name] [varchar](500) NULL,
	[BillType] [varchar](20) NULL,
	[StrikePrice] [float] NULL,
	[OptionType] [varchar](50) NULL,
	[MonthYear] [varchar](50) NULL,
	[Last_dt] [varchar](50) NULL,
	[Exp_Rate] [float] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferDat__qty__724BAD67]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] ADD  DEFAULT ((0)) FOR [qty]
END

GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferDa__rate__733FD1A0]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] ADD  DEFAULT ((0)) FOR [rate]
END

GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferD__amoun__7433F5D9]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] ADD  DEFAULT ((0)) FOR [amount]
END

GO
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF__TransferD__isint__75281A12]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TransferData] ADD  DEFAULT ((0)) FOR [isintraday]
END

GO


IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'todolist')
                 
BEGIN
	CREATE TABLE [dbo].[todolist](
	[SrNo] [int] IDENTITY(1,1) NOT NULL,
	[member_code] [varchar](max) NULL,
	[event_msg] [varchar](max) NULL,
	[repeat_type] [varchar](50) NULL,
	[date_show] [datetime] NULL,
	[popup_date] [datetime] NULL,
	[flag] [int] NULL,
	[sys_date] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

END	

GO
/****** Object:  Table [dbo].[HistryBonus_Rights_DivScriptUpdate]    Script Date: 21/10/2019 12:14:51 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HistryBonus_Rights_DivScriptUpdate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HistryBonus_Rights_DivScriptUpdate](
	[ScriptcodeOld] [varchar](20) NULL,
	[ScriptNameOld] [varchar](100) NULL,
	[ScriptcodeNew] [varchar](20) NULL,
	[ScriptNameNew] [varchar](100) NULL,
	[InvestmentType] [varchar](5) NULL,
	[SrNo] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[HistryBrokerBill_DematinfoScriptUpdate]    Script Date: 21/10/2019 12:14:51 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HistryBrokerBill_DematinfoScriptUpdate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HistryBrokerBill_DematinfoScriptUpdate](
	[ScriptcodeOld] [varchar](20) NULL,
	[ScriptNameOld] [varchar](100) NULL,
	[ScriptcodeNew] [varchar](20) NULL,
	[ScriptNameNew] [varchar](100) NULL,
	[SrNo] [varchar](max) NULL,
	[InvestmentType] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[HistryBrokerBill_TransScriptUpdate]    Script Date: 21/10/2019 12:14:51 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HistryBrokerBill_TransScriptUpdate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HistryBrokerBill_TransScriptUpdate](
	[ScriptcodeOld] [varchar](20) NULL,
	[ScriptNameOld] [varchar](100) NULL,
	[ScriptcodeNew] [varchar](20) NULL,
	[ScriptNameNew] [varchar](100) NULL,
	[InvestmentType] [varchar](5) NULL,
	[SrNo] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[HistryEQDividend_TransScriptUpdat]    Script Date: 21/10/2019 12:14:51 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HistryEQDividend_TransScriptUpdat]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HistryEQDividend_TransScriptUpdat](
	[ScriptcodeOld] [varchar](20) NULL,
	[ScriptNameOld] [varchar](100) NULL,
	[ScriptcodeNew] [varchar](20) NULL,
	[ScriptNameNew] [varchar](100) NULL,
	[InvestmentType] [varchar](5) NULL,
	[SrNo] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[HistryIPOScriptUpdate]    Script Date: 21/10/2019 12:14:51 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HistryIPOScriptUpdate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HistryIPOScriptUpdate](
	[ScriptcodeOld] [varchar](20) NULL,
	[ScriptNameOld] [varchar](100) NULL,
	[ScriptcodeNew] [varchar](20) NULL,
	[ScriptNameNew] [varchar](100) NULL,
	[InvestmentType] [varchar](5) NULL,
	[SrNo] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO


IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'Mst_Account'
                 AND COLUMN_NAME = 'ExpenseSetting') 
BEGIN
	ALTER TABLE Mst_Account ADD ExpenseSetting Varchar(1)
END

GO	

IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'InternalAccountMaster'
                 AND COLUMN_NAME = 'ExpenseSetting') 
BEGIN
	ALTER TABLE InternalAccountMaster ADD ExpenseSetting Varchar(1)
END
GO	
IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'BrokerBill_Trans'
                 AND COLUMN_NAME = 'IsTallyTransfer') 
BEGIN
	ALTER TABLE BrokerBill_Trans ADD IsTallyTransfer bit
END
GO	
IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'AC_Trans'
                 AND COLUMN_NAME = 'IsTallyTransfer') 
BEGIN
	ALTER TABLE AC_Trans ADD IsTallyTransfer bit
END
GO	
IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'Global_no'
                 AND COLUMN_NAME = 'Exported') 
BEGIN
	ALTER TABLE Global_no ADD Exported bit
END
GO	




IF NOT EXISTS(SELECT * FROM   InternalAccountMaster WHERE Ac_code='1100050' )
BEGIN
Insert Into InternalAccountmaster(member_code,Year_code,Ac_code,Ac_name,Grp_name,Grp_id,Effect,Effect1,Op_Bal,Op_Cal,InternalEntry)
Values ('','','1100050','SHORT TERM GAIN/LOSS (MUTUAL FUND)','CAPITAL','4','L','C','0','0','1')
END
GO


IF NOT EXISTS(SELECT * FROM   InternalAccountMaster WHERE Ac_code='1100051' )
BEGIN
Insert Into InternalAccountmaster(member_code,Year_code,Ac_code,Ac_name,Grp_name,Grp_id,Effect,Effect1,Op_Bal,Op_Cal,InternalEntry)
Values ('','','1100051','LONG TERM GAIN/LOSS (MUTUAL FUND)','CAPITAL','4','L','C','0','0','1')

END
GO



IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'BrokerBill_BrokerExpenseFnO')
                 
BEGIN
	
CREATE TABLE [dbo].[BrokerBill_BrokerExpenseFnO](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[MemberCode] [varchar](50) NOT NULL,
	[YearCode] [varchar](50) NOT NULL,
	[BrokerCode] [varchar](50) NOT NULL,
	[R_F_B_STT] [float] NOT NULL,
	[R_F_S_STT] [float] NOT NULL,
	[R_O_B_STT] [float] NOT NULL,
	[R_O_S_STT] [float] NOT NULL,
	[R_F_B_Stamp] [float] NOT NULL,
	[R_F_S_Stamp] [float] NOT NULL,
	[R_O_B_Stamp] [float] NOT NULL,
	[R_O_S_Stamp] [float] NOT NULL,
	[R_F_B_Sebi] [float] NOT NULL,
	[R_F_S_Sebi] [float] NOT NULL,
	[R_O_B_Sebi] [float] NOT NULL,
	[R_O_S_Sebi] [float] NOT NULL,
	[R_F_B_B_Trans] [float] NOT NULL,
	[R_F_S_B_Trans] [float] NOT NULL,
	[R_O_B_B_Trans] [float] NOT NULL,
	[R_O_S_B_Trans] [float] NOT NULL,
	[R_F_B_N_Trans] [float] NOT NULL,
	[R_F_S_N_Trans] [float] NOT NULL,
	[R_O_B_N_Trans] [float] NOT NULL,
	[R_O_S_N_Trans] [float] NOT NULL,
	[R_F_B_Turn] [float] NOT NULL,
	[R_F_S_Turn] [float] NOT NULL,
	[R_O_B_Turn] [float] NOT NULL,
	[R_O_S_Turn] [float] NOT NULL,
	[R_F_B_Demat] [float] NOT NULL,
	[R_F_S_Demat] [float] NOT NULL,
	[R_O_B_Demat] [float] NOT NULL,
	[R_O_S_Demat] [float] NOT NULL,
	[R_F_B_GST] [float] NOT NULL,
	[R_F_S_GST] [float] NOT NULL,
	[R_O_B_GST] [float] NOT NULL,
	[R_O_S_GST] [float] NOT NULL,
	[R_F_B_Clear] [float] NOT NULL,
	[R_F_S_Clear] [float] NOT NULL,
	[R_O_B_Clear] [float] NOT NULL,
	[R_O_S_Clear] [float] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]


END
Go

IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'BrokerBill_ScriptExpense')
                 
BEGIN
	

CREATE TABLE [dbo].[BrokerBill_ScriptExpense](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[MemberCode] [varchar](50) NOT NULL,
	[YearCode] [varchar](50) NOT NULL,
	[Trans_No] [varchar](50) NOT NULL,
	[Sr_No] [int] NOT NULL,
	[Bill_no] [varchar](50) NOT NULL,
	[isFNOBill] [int] NOT NULL,
	[Script_Code] [varchar](50) NOT NULL,
	[Qty] [float] NULL,
	[BROKERAGE] [float] NULL,
	[BANK_CHARGES] [float] NULL,
	[Clearing] [float] NULL,
	[COMMODITY_TRANSACTION_TAX] [float] NULL,
	[CONMIN] [float] NULL,
	[DEMAT_CHARGES] [float] NULL,
	[DEMAT_SCRIP_CHGS] [float] NULL,
	[EXTRA_CHARGES] [float] NULL,
	[GST] [float] NULL,
	[GSTE] [float] NULL,
	[MIS_CHARGES] [float] NULL,
	[OTHER_CHARGES] [float] NULL,
	[ROUND_OFF] [float] NULL,
	[SEBI_CHARGES] [float] NULL,
	[SEBI_TRANSACTION_CHARGES] [float] NULL,
	[SEBI_TURNOVER_CHARGES] [float] NULL,
	[SECURITY_TRANSACTION_TAX] [float] NULL,
	[SERVICE_TAX] [float] NULL,
	[Stamp_Duty] [float] NULL,
	[TRANSACTION_CHARGES] [float] NULL,
	[TURNOVER_CHGS] [float] NULL,
PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

END
GO


IF NOT EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'BrokerBill_BrokerExpenseEquity')
                 
BEGIN

CREATE TABLE [dbo].[BrokerBill_BrokerExpenseEquity](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[MemberCode] [varchar](50) NOT NULL,
	[YearCode] [varchar](50) NOT NULL,
	[BrokerCode] [varchar](50) NOT NULL,
	[R_D_B_STT] [float] NOT NULL,
	[R_D_S_STT] [float] NOT NULL,
	[R_I_B_STT] [float] NOT NULL,
	[R_I_S_STT] [float] NOT NULL,
	[R_D_B_Stamp] [float] NOT NULL,
	[R_D_S_Stamp] [float] NOT NULL,
	[R_I_B_Stamp] [float] NOT NULL,
	[R_I_S_Stamp] [float] NOT NULL,
	[R_D_B_Sebi] [float] NOT NULL,
	[R_D_S_Sebi] [float] NOT NULL,
	[R_I_B_Sebi] [float] NOT NULL,
	[R_I_S_Sebi] [float] NOT NULL,
	[R_D_B_B_Trans] [float] NOT NULL,
	[R_D_S_B_Trans] [float] NOT NULL,
	[R_I_B_B_Trans] [float] NOT NULL,
	[R_I_S_B_Trans] [float] NOT NULL,
	[R_D_B_N_Trans] [float] NOT NULL,
	[R_D_S_N_Trans] [float] NOT NULL,
	[R_I_B_N_Trans] [float] NOT NULL,
	[R_I_S_N_Trans] [float] NOT NULL,
	[R_D_B_Turn] [float] NOT NULL,
	[R_D_S_Turn] [float] NOT NULL,
	[R_I_B_Turn] [float] NOT NULL,
	[R_I_S_Turn] [float] NOT NULL,
	[R_D_B_Demat] [float] NOT NULL,
	[R_D_S_Demat] [float] NOT NULL,
	[R_I_B_Demat] [float] NOT NULL,
	[R_I_S_Demat] [float] NOT NULL,
	[R_D_B_GST] [float] NOT NULL,
	[R_D_S_GST] [float] NOT NULL,
	[R_I_B_GST] [float] NOT NULL,
	[R_I_S_GST] [float] NOT NULL,
	[R_D_B_Clear] [float] NOT NULL,
	[R_D_S_Clear] [float] NOT NULL,
	[R_I_B_Clear] [float] NOT NULL,
	[R_I_S_Clear] [float] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

END
GO	



IF EXISTS(SELECT *
          FROM   INFORMATION_SCHEMA.COLUMNS
          WHERE  TABLE_NAME = 'Upload_MF_FundHouse_Master')
                 
BEGIN
ALTER TABLE Upload_MF_FundHouse_Master
ALTER COLUMN FundHouseName nvarchar(maX) null;


END
GO


IF EXISTS(SELECT *
          FROM   InternalAccountMaster
          WHERE  Ac_code='1100044')
                 
BEGIN
Update InternalAccountMaster Set Grp_Name='INCOME (INDIRECT)' where  Ac_code='1100044'

END
GO


IF EXISTS(SELECT *
          FROM   InternalAccountMaster
          WHERE  Ac_code='1100043')
                 
BEGIN
Update InternalAccountMaster Set Grp_Name='EXPENSES (INDIRECT)' where Ac_code='1100043'

END
GO


IF EXISTS(SELECT *
          FROM   Mst_Account
          WHERE  Ac_code='1100044')
                 
BEGIN
Update Mst_Account Set Grp_Name='INCOME (INDIRECT)' where   AC_Code='1100044'

END
GO


IF EXISTS(SELECT *
          FROM   Mst_Account
          WHERE  Ac_code='1100043')
                 
BEGIN
Update Mst_Account Set Grp_Name='EXPENSES (INDIRECT)' where   AC_Code='1100043'

END
GO



