USE [db_edits]
GO
/****** Object:  Table [dbo].[log_t_transaction_document]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction_document](
	[transaction_document_id] [bigint] NULL,
	[transaction_id] [bigint] NOT NULL,
	[document_type_id] [int] NOT NULL,
	[token] [varchar](30) NULL,
	[hashcode] [varchar](30) NULL,
	[document_index] [varchar](100) NULL,
	[document_name] [varchar](100) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_transaction_category]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_transaction_category](
	[transaction_category_id] [int] NULL,
	[transaction_category_code] [char](6) NOT NULL,
	[description] [varchar](150) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_transaction_category]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_transaction_category](
	[transaction_category_id] [int] IDENTITY(1,1) NOT NULL,
	[transaction_category_code] [char](6) NOT NULL,
	[description] [varchar](150) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_transa__89E73005246854D6] PRIMARY KEY CLUSTERED 
(
	[transaction_category_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_transaction_category] ON
INSERT [dbo].[m_transaction_category] ([transaction_category_id], [transaction_category_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'NB    ', N'New Business', N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_category] ([transaction_category_id], [transaction_category_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'PS    ', N'Policy Service', N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_category] ([transaction_category_id], [transaction_category_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'CL    ', N'Claim', N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_category] ([transaction_category_id], [transaction_category_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'CO    ', N'Collection', N'FMJ', CAST(0x0000A81C00000000 AS DateTime), N'FMJ', CAST(0x0000A81C00000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_transaction_category] OFF
/****** Object:  Table [dbo].[log_m_transaction_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_transaction_type](
	[transaction_type_id] [int] NULL,
	[transaction_type_code] [char](7) NULL,
	[transaction_category_id] [int] NOT NULL,
	[description] [varchar](150) NOT NULL,
	[remarks] [varchar](150) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_transaction_type]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_transaction_type](
	[transaction_type_id] [int] IDENTITY(1,1) NOT NULL,
	[transaction_type_code] [char](7) NULL,
	[transaction_category_id] [int] NOT NULL,
	[description] [varchar](150) NOT NULL,
	[remarks] [varchar](150) NULL,
	[footnote_receipt_form] [varchar](400) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_transa__439ABFC12838E5BA] PRIMARY KEY CLUSTERED 
(
	[transaction_type_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_transaction_type] ON
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'T000001', 3, N'Claim Accident Risk D', N'Claim Accident Risk D', NULL, N'KHU', CAST(0x0000A7AD01071D99 AS DateTime), N'BDA', CAST(0x0000A81800EBA9F0 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'T000002', 2, N'Policy Loan', N'Policy Loan', NULL, N'KHU', CAST(0x0000A7AD01086597 AS DateTime), N'EPO', CAST(0x0000A80E00A95F71 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'T000003', 3, N'Claim Death', N'', N'Jika dalam 14 hari dana belum masuk ke rekening, Anda dapat menghubungi contact center kami.', N'KHU', CAST(0x0000A7AD0109A477 AS DateTime), N'EPO', CAST(0x0000A82600B0E176 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'T000034', 2, N'Withdrawal Fund', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, N'T000034', 2, N'Change Single Top Up', N'Change Single Top Up', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A88693 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'T000034', 3, N'Claim HCP', N'Claim HCP', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A8A9BA AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'T000034', 2, N'Cancel From Inception / Surrender', N'CFI / Surrender', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A8DBFF AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'T000034', 2, N'Benefit Withdrawn / Maturity', N'Benefit Withdrawn / Maturity', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A90116 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'T000034', 2, N'Maturity', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A92469 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, N'T000034', 2, N'Reinstatement', N'', N'Jika dalam 7 hari kerja dana belum masuk ke rekening, Anda dapat menghubungi contact center kami.', N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'PPM', CAST(0x0000A81F01293860 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'T000034', 2, N'Pinjaman Polis', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A928AB AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, N'T000034', 2, N'Surrender (Tradisional)', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A937B2 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'T000034', 4, N'Change Premium Method (Pengajuan Pencabutan Autodebet Rekening BCA/CIMB Niaga/BNI 46/Mandiri)', N'', N'', N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A82500B1445D AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, N'T000034', 4, N'Change Premium Method (Pengajuan Pencabutan Autodebet Kartu Kredit)', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A81C00A76646 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, N'T000034', 2, N'Add Rider', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00A95B19 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'T000034', 2, N'Policy Loan', N'Policy Loan', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00AA3436 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'T000034', 3, N'Claim Health', N'Claim Health', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00AA64EA AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, N'T000034', 3, N'Claim TPD', N'Claim TPD', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00AA7D5C AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, N'T000034', 2, N'Policy Alteration Technical', N'Policy Alteration Technical', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00B91E29 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, N'T000034', 2, N'Policy Alteration Non Technical', N'Policy Alteration Non Technical', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00B92968 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, N'T000034', 4, N'Change Premium Method (Pengajuan Autodebet Rekening BCA/CIMB Niaga)', N'', N'', N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A82500B2C4D0 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, N'T000034', 4, N'Change Premium Method (Pengajuan Autodebet Kartu Kredit)', N'Change Premium Method (Pengajuan Autodebet Kartu Kredit)', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A81C00A7E4AC AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, N'T000034', 2, N'Occupation Height & Weight', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACAEE2 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, N'T000034', 2, N'Change Policy Holder Contact', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACCA7F AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, N'T000034', 2, N'Change Plan / Add Member / Delete Member', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACD12E AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, N'T000034', 2, N'Change Policy Holder', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACD713 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, N'T000034', 2, N'Change Premium Mode', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACDBB0 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, N'T000034', 2, N'Change Term', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACE024 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, N'T000034', 2, N'Decrease Face Amount', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACE67E AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, N'T000034', 2, N'Duplicate Policy Contract Reprint', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACEC34 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, N'T000034', 2, N'Increase Face Amount', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACF0F3 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, N'T000034', 2, N'Premium Holiday Registration', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00AD1E49 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, N'T000034', 2, N'Premium Holiday Cancellation', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00AD23F6 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, N'T000034', 2, N'Premium Redirection', N'', NULL, N'PPM', CAST(0x0000A7AF0126278C AS DateTime), N'EPO', CAST(0x0000A80E00ACF587 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, N'T000039', 3, N'Health Claim', N'', NULL, N'PPM', CAST(0x0000A7AF0126C83B AS DateTime), N'EPO', CAST(0x0000A80E00ACFA1F AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, N'T000039', 3, N'HCP', N'', NULL, N'PPM', CAST(0x0000A7AF0126C83B AS DateTime), N'EPO', CAST(0x0000A80E00ACFE64 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, N'T000039', 3, N'Accident', N'', NULL, N'PPM', CAST(0x0000A7AF0126C83B AS DateTime), N'EPO', CAST(0x0000A80E00AD0217 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, N'T000039', 3, N'TPD', N'', NULL, N'PPM', CAST(0x0000A7AF0126C83B AS DateTime), N'EPO', CAST(0x0000A80E00AD068E AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, N'T000039', 3, N'Death', N'', NULL, N'PPM', CAST(0x0000A7AF0126C83B AS DateTime), N'EPO', CAST(0x0000A80E00AD0B26 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, N'T000041', 1, N'Proposal Standard', N'', NULL, N'PPM', CAST(0x0000A7AF0127258E AS DateTime), N'EPO', CAST(0x0000A80E00AD149E AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, N'T000041', 1, N'Proposal Pro Accident', N'', NULL, N'PPM', CAST(0x0000A7AF0127258E AS DateTime), N'EPO', CAST(0x0000A80E00AD18AE AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, N'T000042', 2, N'Alteration Non Technical', N'POLICY ALTERATION  (NON TEKNIS)', NULL, N'FMJ', CAST(0x0000A8020108AB7C AS DateTime), N'EPO', CAST(0x0000A80E00AD2AB3 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, N'T000043', 2, N'Change Address', N'', NULL, N'ASP', CAST(0x0000A80E00EFB648 AS DateTime), N'ASP', CAST(0x0000A80E00EFB648 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, N'T000044', 3, N'Jet Claim Death', N'Jet Claim', N'Deskripsi', N'EPO', CAST(0x0000A80E01151E78 AS DateTime), N'ASP', CAST(0x0000A82400E3FCEB AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, N'T000045', 2, N'Change Premium Method Advanced Premium', N'Change Premium Method Advanced Premium', NULL, N'EPO', CAST(0x0000A81000A564DD AS DateTime), N'EPO', CAST(0x0000A81000A564DD AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, N'T000046', 2, N'Change By Client ID (Underwriting)', N'Change By Client Id', NULL, N'EPO', CAST(0x0000A81000A59A58 AS DateTime), N'ASP', CAST(0x0000A81100E49EBF AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, N'T000047', 3, N'Jet Claim Health', N'', NULL, N'ASP', CAST(0x0000A81100E44653 AS DateTime), N'ASP', CAST(0x0000A81100E44653 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (56, N'T000048', 2, N'Change by Client ID (Elise)', N'', NULL, N'ASP', CAST(0x0000A81100E48FBB AS DateTime), N'ASP', CAST(0x0000A81100E48FBB AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (60, N'T000049', 4, N'Change Permium Method (Pengajuan Autodebet Rekening BNI 46/CIMB Niaga)', N'', N'', N'EPO', CAST(0x0000A82500B3FCFA AS DateTime), N'EPO', CAST(0x0000A82500B43640 AS DateTime), N'0')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (61, N'T000050', 3, N'Test Claim Transaction Code', N'', NULL, N'ASP', CAST(0x0000A82501038DE2 AS DateTime), N'ASP', CAST(0x0000A8250103AB85 AS DateTime), N'1')
INSERT [dbo].[m_transaction_type] ([transaction_type_id], [transaction_type_code], [transaction_category_id], [description], [remarks], [footnote_receipt_form], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (62, N'T000051', 3, N'Test 2', N'', NULL, N'ASP', CAST(0x0000A8250103A6E1 AS DateTime), N'ASP', CAST(0x0000A8250103AE07 AS DateTime), N'1')
SET IDENTITY_INSERT [dbo].[m_transaction_type] OFF
/****** Object:  Table [dbo].[log_m_status]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_status](
	[status_id] [int] NULL,
	[status_code] [char](6) NOT NULL,
	[description] [varchar](50) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_status]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_status](
	[status_id] [int] IDENTITY(1,1) NOT NULL,
	[status_code] [char](6) NOT NULL,
	[description] [varchar](50) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_status__3683B531675F4696] PRIMARY KEY CLUSTERED 
(
	[status_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_status] ON
INSERT [dbo].[m_status] ([status_id], [status_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'STAT01', N'Draft', N'WHI', CAST(0x0000A77C00000000 AS DateTime), N'WHI', CAST(0x0000A77C00000000 AS DateTime), N'0')
INSERT [dbo].[m_status] ([status_id], [status_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'STAT02', N'Active', N'WHI', CAST(0x0000A77C00000000 AS DateTime), N'WHI', CAST(0x0000A77C00000000 AS DateTime), N'0')
INSERT [dbo].[m_status] ([status_id], [status_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'STAT03', N'Inactive', N'WHI', CAST(0x0000A77C00000000 AS DateTime), N'WHI', CAST(0x0000A77C00000000 AS DateTime), N'0')
INSERT [dbo].[m_status] ([status_id], [status_code], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'STAT04', N'Waiting', N'WHI', CAST(0x0000A7AF00000000 AS DateTime), N'WHI', CAST(0x0000A7AF00000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_status] OFF
/****** Object:  Table [dbo].[log_m_eform]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_eform](
	[eform_id] [int] NULL,
	[eform_code] [varchar](8) NULL,
	[transaction_type_id] [int] NOT NULL,
	[is_need_surat_kuasa] [char](1) NOT NULL,
	[remarks] [varchar](255) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[transaction_form_template_id] [smallint] NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_eform]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_eform](
	[eform_id] [int] IDENTITY(1,1) NOT NULL,
	[eform_code] [varchar](8) NULL,
	[transaction_type_id] [int] NOT NULL,
	[is_need_surat_kuasa] [char](1) NOT NULL,
	[remarks] [varchar](255) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_eform__E893FF5030CE2BBB] PRIMARY KEY CLUSTERED 
(
	[eform_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_eform] ON
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'FPS00001', 18, N'1', N'', 5, N'BDA', CAST(0x0000A80300D8D7B0 AS DateTime), N'BDA', CAST(0x0000A80300D8FB15 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'FCL00001', 43, N'1', N'', 5, N'BDA', CAST(0x0000A809009D77C0 AS DateTime), N'BDA', CAST(0x0000A809009F6E40 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, N'FPS00002', 50, N'1', N'', 5, N'EPO', CAST(0x0000A80A00C04680 AS DateTime), N'EPO', CAST(0x0000A80A00C1595D AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, N'FPS00003', 12, N'1', N'', 5, N'ASP', CAST(0x0000A80B010D57D4 AS DateTime), N'ASP', CAST(0x0000A81500FFEC17 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, NULL, 12, N'1', N'', 2, N'ASP', CAST(0x0000A80E0092C0FE AS DateTime), N'ASP', CAST(0x0000A80E0092C60D AS DateTime), N'1')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, NULL, 20, N' ', N'', 2, N'ASP', CAST(0x0000A80E0092F595 AS DateTime), N'ASP', CAST(0x0000A80E009313D4 AS DateTime), N'1')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, NULL, 16, N'1', N'', 2, N'ASP', CAST(0x0000A80E0098F271 AS DateTime), N'ASP', CAST(0x0000A80E009B5001 AS DateTime), N'1')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, N'FCL00002', 6, N'1', N'', 5, N'ASP', CAST(0x0000A80E00AD554B AS DateTime), N'ASP', CAST(0x0000A80E00AEEB75 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, N'FPS00004', 24, N'1', N'Policy Loan', 5, N'EPO', CAST(0x0000A80E00AD77CE AS DateTime), N'EPO', CAST(0x0000A80E00AEFBFB AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, N'FCL00003', 10, N'1', N'', 5, N'ASP', CAST(0x0000A80E00AEFE97 AS DateTime), N'ASP', CAST(0x0000A80E00B4E140 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, N'FPS00005', 16, N'1', N'Benefit Withdrawn / Maturity', 5, N'EPO', CAST(0x0000A80E00AF362D AS DateTime), N'EPO', CAST(0x0000A81200E8417C AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, N'FPS00006', 15, N'1', N'Cancel From Inception / Surrender', 5, N'EPO', CAST(0x0000A80E00B1AF69 AS DateTime), N'EPO', CAST(0x0000A81200E84620 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, N'FPS00007', 13, N'1', N'Change Single Top Up', 5, N'EPO', CAST(0x0000A80E00B3362E AS DateTime), N'EPO', CAST(0x0000A80E00B531DB AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, N'FCL00004', 14, N'1', N'', 5, N'ASP', CAST(0x0000A80E00B4EC9A AS DateTime), N'ASP', CAST(0x0000A80E00E64228 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, N'FPS00008', 27, N'1', N'Alteration Technical', 5, N'EPO', CAST(0x0000A80E00B8B5A2 AS DateTime), N'EPO', CAST(0x0000A80E00BF72A0 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, N'FCL00005', 25, N'1', N'', 5, N'ASP', CAST(0x0000A80E00BB46CF AS DateTime), N'ASP', CAST(0x0000A80E00E63AE4 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, N'FCO00001', 30, N'1', N'Change Premium Method (Pengajuan Autodebet Kartu Kredit)', 5, N'EPO', CAST(0x0000A80E00E025C9 AS DateTime), N'EPO', CAST(0x0000A82500AD9A01 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, N'FCO00002', 29, N'1', N'Change Premium Method (Pengajuan Autodebet Rekening BCA)', 5, N'EPO', CAST(0x0000A80E00E0F96D AS DateTime), N'EPO', CAST(0x0000A81200E8627C AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, N'FCO00003', 22, N'1', N'Change Premium Method (Pengajuan Pencabutan Autodebet Kartu Kredit)', 5, N'EPO', CAST(0x0000A80E00E2282F AS DateTime), N'EPO', CAST(0x0000A82500B7986C AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, N'FCO00004', 21, N'1', N'Change Premium Method (Pengajuan Pencabutan Autodebet Rekening BCA)', 5, N'EPO', CAST(0x0000A80E00E2F738 AS DateTime), N'EPO', CAST(0x0000A82500B9B572 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, N'FPS00009', 28, N'1', N'Policy Alteration Non Technical', 5, N'EPO', CAST(0x0000A80E00E4D4F9 AS DateTime), N'EPO', CAST(0x0000A80E00E57687 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, N'FCL00006', 26, N'1', N'', 5, N'ASP', CAST(0x0000A80E00E56595 AS DateTime), N'ASP', CAST(0x0000A80E00E64A40 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, N'FPS00010', 51, N'1', N'', 5, N'ASP', CAST(0x0000A80E00EFC485 AS DateTime), N'EPO', CAST(0x0000A8100093ED1E AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, N'FCL00007', 52, N'1', N'Jet Claim', 5, N'EPO', CAST(0x0000A80E01154813 AS DateTime), N'EPO', CAST(0x0000A80E0115AF20 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, N'FPS00011', 53, N'1', N'Change Premium Method Advanced Premium', 5, N'EPO', CAST(0x0000A81000ACE549 AS DateTime), N'PPM', CAST(0x0000A81D010F7130 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, N'FPS00012', 54, N'1', N'Change By Client Id', 5, N'EPO', CAST(0x0000A81000ADA492 AS DateTime), N'EPO', CAST(0x0000A81200E85924 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, N'FPS00013', 56, N'1', N'', 5, N'EPO', CAST(0x0000A812009E6D7A AS DateTime), N'EPO', CAST(0x0000A812009EFF69 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, N'FCL00008', 55, N'1', N'', 5, N'EPO', CAST(0x0000A812009E768F AS DateTime), N'EPO', CAST(0x0000A81200E82A37 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, N'FCL00009', 52, N'0', N'test  by Prib', 2, N'PPM', CAST(0x0000A82000F32689 AS DateTime), N'PPM', CAST(0x0000A82000F32689 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, N'FPS00014', 12, N'0', N'test Prib', 2, N'PPM', CAST(0x0000A82001137BFA AS DateTime), N'PPM', CAST(0x0000A82001137BFA AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, N'FPS00015', 13, N' ', N'test Prib lagi', 2, N'PPM', CAST(0x0000A8200115F006 AS DateTime), N'PPM', CAST(0x0000A8200115F006 AS DateTime), N'0')
INSERT [dbo].[m_eform] ([eform_id], [eform_code], [transaction_type_id], [is_need_surat_kuasa], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, N'FCO00005', 60, N'1', N'', 5, N'EPO', CAST(0x0000A82500B48597 AS DateTime), N'EPO', CAST(0x0000A82500B68E12 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_eform] OFF
/****** Object:  Table [dbo].[log_m_workflow_template]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_workflow_template](
	[workflow_template_id] [int] NULL,
	[workflow_template_code] [varchar](8) NOT NULL,
	[description] [varchar](225) NOT NULL,
	[remarks] [varchar](225) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_workflow_template]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_workflow_template](
	[workflow_template_id] [int] IDENTITY(1,1) NOT NULL,
	[workflow_template_code] [varchar](8) NOT NULL,
	[description] [varchar](225) NOT NULL,
	[remarks] [varchar](225) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_workfl__FBA079AD07970BFE] PRIMARY KEY CLUSTERED 
(
	[workflow_template_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_workflow_template] ON
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, N'TE4', N'Workflow Underwriting', N'Workflow Underwriting', 5, N'WHI', CAST(0x0000A7E500F05AC2 AS DateTime), N'ASP', CAST(0x0000A81000A6DDC4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, N'T01', N'Workflow Customer Care', N'Workflow Customer Care', 5, N'BDA', CAST(0x0000A80200BFC223 AS DateTime), N'EPO', CAST(0x0000A80700F0480C AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, N'T02', N'Workflow Claim', N'Workflow Claim', 5, N'ASP', CAST(0x0000A80300DAE27D AS DateTime), N'EPO', CAST(0x0000A80800B6E716 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, N'T04', N'Workflow Change Address', N'', 5, N'ASP', CAST(0x0000A80E00A09A7B AS DateTime), N'ASP', CAST(0x0000A80E00A39332 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, N'T05', N'Workflow Change Premium Method (Pencabutan Autodebet Kartu Kredit', N'', 2, N'ASP', CAST(0x0000A80E01004B02 AS DateTime), N'ASP', CAST(0x0000A80E0100C849 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, N'T06', N'Workflow Change Premium Method', N'', 5, N'ASP', CAST(0x0000A810009B2336 AS DateTime), N'ASP', CAST(0x0000A810009B2336 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, N'T07', N'Workflow Change Single Top Up', N'Workflow Change Single Top Up', 5, N'EPO', CAST(0x0000A81000A6970D AS DateTime), N'EPO', CAST(0x0000A8100112390E AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, N'T03', N'Workflow Client ID by Underwriting', N'Workflow Client ID by Underwriting', 5, N'EPO', CAST(0x0000A81000A6F345 AS DateTime), N'EPO', CAST(0x0000A81001125B60 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, N'T08', N'Workflow Client ID by Elise', N'', 5, N'ASP', CAST(0x0000A81000F46500 AS DateTime), N'ASP', CAST(0x0000A8150087762A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, N'T09', N'Workflow Jet Claim Health', N'', 5, N'ASP', CAST(0x0000A81100B2046F AS DateTime), N'ASP', CAST(0x0000A81100B2046F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template] ([workflow_template_id], [workflow_template_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, N'T10', N'Workflow Jet Claim Death', N'', 5, N'ASP', CAST(0x0000A81100B221D7 AS DateTime), N'ASP', CAST(0x0000A81100B221D7 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_workflow_template] OFF
/****** Object:  Table [dbo].[log_m_eform_workflow]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_eform_workflow](
	[eform_workflow_id] [int] NULL,
	[eform_id] [int] NOT NULL,
	[workflow_template_id] [int] NOT NULL,
	[effective_date] [date] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_eform_workflow]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_eform_workflow](
	[eform_workflow_id] [int] IDENTITY(1,1) NOT NULL,
	[eform_id] [int] NOT NULL,
	[workflow_template_id] [int] NOT NULL,
	[source_transaction_id] [smallint] NOT NULL,
	[effective_date] [date] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_eform___0F44CEBC0C5BC11B] PRIMARY KEY CLUSTERED 
(
	[eform_workflow_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_group_pic]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_group_pic](
	[group_pic_id] [int] NULL,
	[group_pic_code] [varchar](12) NOT NULL,
	[description] [varchar](225) NOT NULL,
	[remarks] [varchar](225) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [varchar](1) NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_group_pic]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_group_pic](
	[group_pic_id] [int] IDENTITY(1,1) NOT NULL,
	[group_pic_code] [varchar](12) NOT NULL,
	[description] [varchar](225) NOT NULL,
	[remarks] [varchar](225) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_group___0A8798C76A06A917] PRIMARY KEY CLUSTERED 
(
	[group_pic_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_group_pic] ON
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'CCA', N'Customer Care', N'', N'FMJ', CAST(0x0000A7FD00F1C463 AS DateTime), N'FMJ', CAST(0x0000A7FD00F1C463 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'HCCA', N'Head Customer Care', N'', N'FMJ', CAST(0x0000A7FD00F1D9AD AS DateTime), N'FMJ', CAST(0x0000A7FD00F1D9AD AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'CLM', N'Claim', N'Claim', N'ASP', CAST(0x0000A80300DCF68F AS DateTime), N'ASP', CAST(0x0000A80300DCF68F AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'UNW', N'Underwriting', N'Underwriting', N'ASP', CAST(0x0000A80900B2E4A3 AS DateTime), N'ASP', CAST(0x0000A80900B2E4A3 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, N'HUNW', N'Head Underwriting', N'', N'ASP', CAST(0x0000A809011065A0 AS DateTime), N'ASP', CAST(0x0000A809011065A0 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'HCLM', N'Head Claim', N'', N'EPO', CAST(0x0000A80A00AC8B2D AS DateTime), N'EPO', CAST(0x0000A80A00AEC614 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, N'CCE', N'Customer Care ELISE', N'', N'ASP', CAST(0x0000A80B009C1D6B AS DateTime), N'ASP', CAST(0x0000A80B009C1D6B AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'HCOL', N'Head Collection', N'', N'ASP', CAST(0x0000A810009C4E1B AS DateTime), N'ASP', CAST(0x0000A81C00ADE136 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, N'COL', N'Collection', N'', N'ASP', CAST(0x0000A810009D1BEA AS DateTime), N'ASP', CAST(0x0000A810009D1BEA AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, N'CNF', N'Customer Care and Finance', N'', N'ASP', CAST(0x0000A81000F65266 AS DateTime), N'ASP', CAST(0x0000A81000F65266 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'HCI', N'Head Claim Individu', N'', N'ASP', CAST(0x0000A81600F89EF1 AS DateTime), N'ASP', CAST(0x0000A81600FBBE87 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'CMD', N'Medical Advisor', N'', N'ASP', CAST(0x0000A81900AAE601 AS DateTime), N'ASP', CAST(0x0000A81900AAE601 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, N'DIR', N'Director', N'Director', N'ASP', CAST(0x0000A81900B09C94 AS DateTime), N'ASP', CAST(0x0000A81900B09C94 AS DateTime), N'0')
INSERT [dbo].[m_group_pic] ([group_pic_id], [group_pic_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, N'CIT', N'Claim Investigation Team', N'', N'EPO', CAST(0x0000A81E00A2989D AS DateTime), N'EPO', CAST(0x0000A81E00A2989D AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_group_pic] OFF
/****** Object:  Table [dbo].[log_m_workflow_template_stage]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_workflow_template_stage](
	[workflow_template_stage_id] [bigint] NOT NULL,
	[workflow_template_id] [int] NOT NULL,
	[description] [varchar](255) NOT NULL,
	[is_stage_approval] [char](1) NOT NULL,
	[approv_matrix_id] [int] NULL,
	[pic_is_requester] [char](1) NOT NULL,
	[group_pic_id] [int] NULL,
	[user_workflow_id] [int] NULL,
	[can_edit_information] [char](1) NOT NULL,
	[can_upload_document] [char](1) NOT NULL,
	[can_delete_document] [char](1) NOT NULL,
	[seq_number] [numeric](18, 0) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_workflow_template_stage]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_workflow_template_stage](
	[workflow_template_stage_id] [bigint] IDENTITY(1,1) NOT NULL,
	[workflow_template_id] [int] NOT NULL,
	[description] [varchar](255) NOT NULL,
	[is_stage_approval] [char](1) NOT NULL,
	[approv_matrix_id] [int] NULL,
	[pic_is_requester] [char](1) NOT NULL,
	[group_pic_id] [int] NULL,
	[user_workflow_id] [int] NULL,
	[can_edit_information] [char](1) NOT NULL,
	[can_upload_document] [char](1) NOT NULL,
	[can_delete_document] [char](1) NOT NULL,
	[seq_number] [numeric](18, 0) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_workfl__DA8575D21D864D1D] PRIMARY KEY CLUSTERED 
(
	[workflow_template_stage_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_workflow_template_stage] ON
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, 41, N'Create Transaction', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'BDA', CAST(0x0000A7E5010720A0 AS DateTime), N'BDA', CAST(0x0000A7E5010720A0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, 41, N'Create Transaction', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'BDA', CAST(0x0000A7E501072B30 AS DateTime), N'BDA', CAST(0x0000A7E501072B30 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, 40, N'Registration', N'0', NULL, N'1', NULL, 1, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'WHI', CAST(0x0000A7E600ACAEC9 AS DateTime), N'ASP', CAST(0x0000A80900FB0781 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, 40, N'Checking By Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'WHI', CAST(0x0000A7EC01128B09 AS DateTime), N'BDA', CAST(0x0000A82400A41925 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, 40, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'WHI', CAST(0x0000A7EC0112AA32 AS DateTime), N'WHI', CAST(0x0000A80E009EE33A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, 40, N'Document Validation', N'0', NULL, N'0', 14, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'FMJ', CAST(0x0000A7FD00F20010 AS DateTime), N'ASP', CAST(0x0000A809010F1D41 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, 40, N'Sent to Underwriting', N'0', NULL, N'0', 17, 3, N'1', N'1', N'1', CAST(5 AS Numeric(18, 0)), N'FMJ', CAST(0x0000A7FD00F24054 AS DateTime), N'ASP', CAST(0x0000A815010F2857 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, 42, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'BDA', CAST(0x0000A80200C01838 AS DateTime), N'BDA', CAST(0x0000A80200C01838 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, 42, N'Checking By Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'BDA', CAST(0x0000A80200C107F1 AS DateTime), N'BDA', CAST(0x0000A80200C107F1 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, 42, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'BDA', CAST(0x0000A80200C129B9 AS DateTime), N'BDA', CAST(0x0000A80200C129B9 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, 42, N'Document Validation', N'0', NULL, N'0', 14, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'BDA', CAST(0x0000A80200C1538B AS DateTime), N'ASP', CAST(0x0000A80900973622 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, 42, N'Transaction Process', N'0', NULL, N'0', 14, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'BDA', CAST(0x0000A80200C1998D AS DateTime), N'ASP', CAST(0x0000A80900A11800 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, 42, N'Approval Process', N'0', NULL, N'0', 15, 3, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'BDA', CAST(0x0000A80200C2E23C AS DateTime), N'ASP', CAST(0x0000A81100F0D29D AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, 43, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80300DB1664 AS DateTime), N'EPO', CAST(0x0000A80700F113A0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, 43, N'Checking By Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80300DC6E7E AS DateTime), N'ASP', CAST(0x0000A81900A51EEC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, 43, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80300DDF7C0 AS DateTime), N'ASP', CAST(0x0000A80900A3AFF0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, 43, N'Document Validation', N'0', NULL, N'0', 14, 3, N'1', N'1', N'1', CAST(4 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80300DF1124 AS DateTime), N'ASP', CAST(0x0000A81800B0BDEC AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, 43, N'Transaction Process', N'0', NULL, N'0', 16, 3, N'1', N'1', N'1', CAST(5 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80300E0455B AS DateTime), N'ASP', CAST(0x0000A823010114F4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, 43, N'Approval Process', N'0', NULL, N'0', 19, 3, N'0', N'0', N'0', CAST(7 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80300E1A1CF AS DateTime), N'ASP', CAST(0x0000A81600FADEE1 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (67, 40, N'Underwriting Process', N'0', NULL, N'0', 18, 3, N'1', N'1', N'0', CAST(6 AS Numeric(18, 0)), N'ASP', CAST(0x0000A809010D30F3 AS DateTime), N'ASP', CAST(0x0000A80901108D0F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (68, 40, N'Approval Process', N'0', NULL, N'0', 15, 3, N'1', N'1', N'0', CAST(7 AS Numeric(18, 0)), N'ASP', CAST(0x0000A809010D51A2 AS DateTime), N'BDA', CAST(0x0000A80B00E9AAF8 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (69, 40, N'sasa', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(8 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80A00A18B92 AS DateTime), N'ASP', CAST(0x0000A80A00A2A750 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (70, 40, N'Pending Process', N'0', NULL, N'0', 18, 3, N'1', N'1', N'0', CAST(8 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80A011B70B8 AS DateTime), N'ASP', CAST(0x0000A82000B12508 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (71, 40, N'Underwriter Decline', N'0', NULL, N'0', 18, 3, N'0', N'0', N'0', CAST(9 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80B00FC716D AS DateTime), N'ASP', CAST(0x0000A82000B132A4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (72, 44, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80E00A0DC07 AS DateTime), N'ASP', CAST(0x0000A80E00A0F909 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (73, 44, N'Checking By Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80E00A1F412 AS DateTime), N'ASP', CAST(0x0000A81500871CCC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (74, 44, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'0', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80E00A222E1 AS DateTime), N'ASP', CAST(0x0000A81500FADE91 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (75, 44, N'Approval Process', N'0', NULL, N'0', 15, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80E00A24866 AS DateTime), N'ASP', CAST(0x0000A80E00FBDBDC AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (76, 44, N'sssss', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'ASP', CAST(0x0000A80E00AA1719 AS DateTime), N'ASP', CAST(0x0000A80E00AA3A87 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (77, 46, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A810009B406E AS DateTime), N'ASP', CAST(0x0000A810009B406E AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (78, 46, N'Checking by Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A810009B91D4 AS DateTime), N'ASP', CAST(0x0000A810009E5477 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (79, 46, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'ASP', CAST(0x0000A810009BCDD1 AS DateTime), N'EPO', CAST(0x0000A81E00A727BC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (80, 46, N'Transaction Process', N'0', NULL, N'0', 22, 3, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'ASP', CAST(0x0000A810009CDE45 AS DateTime), N'ASP', CAST(0x0000A81C010C615F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (81, 46, N'Approval Process', N'0', NULL, N'0', 21, 3, N'0', N'0', N'0', CAST(6 AS Numeric(18, 0)), N'ASP', CAST(0x0000A810009D09BF AS DateTime), N'ASP', CAST(0x0000A81C010C68C9 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (82, 48, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000AEE135 AS DateTime), N'ASP', CAST(0x0000A81000AEE135 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (83, 48, N'Checking by Head Underwriting', N'0', NULL, N'0', NULL, 2, N'1', N'1', N'1', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000AFA127 AS DateTime), N'ASP', CAST(0x0000A81000B04E7E AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (84, 48, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000AFB758 AS DateTime), N'ASP', CAST(0x0000A81000AFB758 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (85, 48, N'Process Transaction', N'0', NULL, N'0', 14, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000AFE598 AS DateTime), N'ASP', CAST(0x0000A81000B0BCAF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (86, 48, N'Approval Process', N'0', NULL, N'0', 15, 3, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000B0B608 AS DateTime), N'ASP', CAST(0x0000A81100F35E26 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (87, 47, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000F08616 AS DateTime), N'ASP', CAST(0x0000A81000F08616 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (88, 47, N'Checking by Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000F0996D AS DateTime), N'EPO', CAST(0x0000A810010A693D AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (89, 49, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000F47932 AS DateTime), N'ASP', CAST(0x0000A81000F47932 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (90, 49, N'Checking by Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000F49FDE AS DateTime), N'ASP', CAST(0x0000A81500B1C387 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (91, 49, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000F4BFA4 AS DateTime), N'ASP', CAST(0x0000A81000F4BFA4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (92, 49, N'Transaction Process', N'0', NULL, N'0', 14, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000F4E6CA AS DateTime), N'ASP', CAST(0x0000A81000F4E6CA AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (93, 49, N'Approval Process', N'0', NULL, N'0', 15, 3, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81000F50514 AS DateTime), N'ASP', CAST(0x0000A81100F32175 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (94, 47, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'0', CAST(3 AS Numeric(18, 0)), N'EPO', CAST(0x0000A810010B00E1 AS DateTime), N'EPO', CAST(0x0000A810010C0AD1 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (95, 47, N'Transaction Process', N'0', NULL, N'0', 23, 3, N'1', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'EPO', CAST(0x0000A810010C42D4 AS DateTime), N'ASP', CAST(0x0000A81500A87F68 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (96, 47, N'Approval Process', N'0', NULL, N'0', 15, 3, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'EPO', CAST(0x0000A810010C830F AS DateTime), N'ASP', CAST(0x0000A81500A81ECF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (97, 51, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B23B13 AS DateTime), N'ASP', CAST(0x0000A81100B23B13 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (98, 51, N'Checking by Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B2585D AS DateTime), N'ASP', CAST(0x0000A81100B26ABF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (99, 51, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B2D46B AS DateTime), N'ASP', CAST(0x0000A81100B2E749 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (100, 51, N'Transaction Process', N'0', NULL, N'0', 16, 3, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B492FE AS DateTime), N'EPO', CAST(0x0000A81200F70AE1 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (101, 51, N'Approval Process', N'0', NULL, N'0', 19, 3, N'0', N'0', N'0', CAST(6 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B4B729 AS DateTime), N'EPO', CAST(0x0000A81200F714B5 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (102, 50, N'Registration', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(1 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B6CE7A AS DateTime), N'ASP', CAST(0x0000A81100B6DC02 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (103, 50, N'Checking by Head Elise', N'0', NULL, N'0', NULL, 2, N'0', N'0', N'0', CAST(2 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B6F0A6 AS DateTime), N'ASP', CAST(0x0000A81100B6F0A6 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (104, 50, N'Document Revision', N'0', NULL, N'1', NULL, NULL, N'1', N'1', N'1', CAST(3 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B70765 AS DateTime), N'ASP', CAST(0x0000A81100B712DF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (105, 50, N'Transaction Process', N'0', NULL, N'0', 16, 3, N'0', N'0', N'0', CAST(5 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B72D6C AS DateTime), N'ASP', CAST(0x0000A815008BBFCE AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (106, 50, N'Approval Process', N'0', NULL, N'0', 19, 3, N'0', N'0', N'0', CAST(6 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81100B74850 AS DateTime), N'ASP', CAST(0x0000A815008BC71C AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (107, 51, N'Document Validation', N'0', NULL, N'0', 14, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'EPO', CAST(0x0000A81200F703AB AS DateTime), N'EPO', CAST(0x0000A81200F703AB AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (108, 50, N'Document Validation', N'0', NULL, N'0', 14, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'ASP', CAST(0x0000A815008BB6B9 AS DateTime), N'ASP', CAST(0x0000A81800BFC471 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (109, 40, N'Reject Process', N'0', NULL, N'0', 15, 3, N'0', N'0', N'0', CAST(10 AS Numeric(18, 0)), N'ASP', CAST(0x0000A8160093F01B AS DateTime), N'ASP', CAST(0x0000A8160093F01B AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (110, 43, N'Document Validation Claim', N'0', NULL, N'0', 24, 3, N'0', N'0', N'0', CAST(6 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81600FAD8F5 AS DateTime), N'BDA', CAST(0x0000A81800E32434 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (111, 43, N'Medical Advise', N'0', NULL, N'0', 25, 3, N'0', N'0', N'0', CAST(6 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81900AB40B9 AS DateTime), N'EPO', CAST(0x0000A81E00A188D3 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (112, 43, N'Approval Director', N'0', NULL, N'0', 26, 3, N'0', N'0', N'0', CAST(8 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81900B0D60A AS DateTime), N'ASP', CAST(0x0000A81900B0D60A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (113, 46, N'Document Validation', N'0', NULL, N'0', 22, 3, N'0', N'0', N'0', CAST(4 AS Numeric(18, 0)), N'ASP', CAST(0x0000A81C010C4D8B AS DateTime), N'ASP', CAST(0x0000A81C010C5766 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (114, 43, N'Investigation Process ', N'0', NULL, N'0', 28, 3, N'0', N'1', N'0', CAST(9 AS Numeric(18, 0)), N'EPO', CAST(0x0000A81E00A2515A AS DateTime), N'EPO', CAST(0x0000A81E00A2E3EB AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (115, 43, N'Reject Process', N'0', NULL, N'0', 14, 3, N'0', N'1', N'0', CAST(10 AS Numeric(18, 0)), N'EPO', CAST(0x0000A81E00A39BBD AS DateTime), N'EPO', CAST(0x0000A81E00A39BBD AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (116, 46, N'Send to Bank', N'0', NULL, N'0', 22, 3, N'1', N'1', N'0', CAST(7 AS Numeric(18, 0)), N'EPO', CAST(0x0000A81E00A69810 AS DateTime), N'EPO', CAST(0x0000A81E00A69810 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_stage] ([workflow_template_stage_id], [workflow_template_id], [description], [is_stage_approval], [approv_matrix_id], [pic_is_requester], [group_pic_id], [user_workflow_id], [can_edit_information], [can_upload_document], [can_delete_document], [seq_number], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (117, 40, N'Extra Mortality Process', N'0', NULL, N'0', 14, 3, N'0', N'1', N'0', CAST(11 AS Numeric(18, 0)), N'ASP', CAST(0x0000A82700AFB843 AS DateTime), N'ASP', CAST(0x0000A82700AFB843 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_workflow_template_stage] OFF
/****** Object:  Table [dbo].[log_m_currency]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_currency](
	[currency_id] [int] NULL,
	[currency_code] [varchar](50) NOT NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_currency]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_currency](
	[currency_id] [int] NOT NULL,
	[currency_code] [varchar](50) NOT NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_curren__C7F543D34B8221F7] PRIMARY KEY CLUSTERED 
(
	[currency_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]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_m_currency] ON [dbo].[m_currency] 
(
	[currency_code] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
INSERT [dbo].[m_currency] ([currency_id], [currency_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'IDR', N'Indonesian Rupiah', 5, N'PPM', CAST(0x0000A77C00AD07B4 AS DateTime), N'PPM', CAST(0x0000A77C00AD07B4 AS DateTime), N'0')
INSERT [dbo].[m_currency] ([currency_id], [currency_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'USD', N'US Dollar', 5, N'PPM', CAST(0x0000A77C00AD07B4 AS DateTime), N'PPM', CAST(0x0000A77C00AD07B4 AS DateTime), N'0')
INSERT [dbo].[m_currency] ([currency_id], [currency_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'EUR', N'EURO', 5, N'PPM', CAST(0x0000A77C00AD07B4 AS DateTime), N'WHI', CAST(0x0000A78201016E5A AS DateTime), N'0')
INSERT [dbo].[m_currency] ([currency_id], [currency_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'SGD', N'Dollar SIngapore', 5, N'WHI', CAST(0x0000A782010EBE90 AS DateTime), N'WHI', CAST(0x0000A782010EBE90 AS DateTime), N'0')
/****** Object:  Table [dbo].[log_m_source_app]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_source_app](
	[source_app_id] [int] NULL,
	[source_app_code] [char](6) NOT NULL,
	[source_app_name] [varchar](50) NOT NULL,
	[source_main_url] [varchar](100) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_source_app]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_source_app](
	[source_app_id] [int] IDENTITY(1,1) NOT NULL,
	[source_app_code] [char](6) NOT NULL,
	[source_app_name] [varchar](50) NOT NULL,
	[source_main_url] [varchar](100) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_source__0F8687025AF96FB1] PRIMARY KEY CLUSTERED 
(
	[source_app_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_source_app] ON
INSERT [dbo].[m_source_app] ([source_app_id], [source_app_code], [source_app_name], [source_main_url], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'PL    ', N'Precentia Life', NULL, N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_source_app] OFF
/****** Object:  Table [dbo].[t_transaction_log]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_log](
	[t_transaction_log_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[transaction_type_id] [int] NOT NULL,
	[register_number] [varchar](9) NULL,
	[transaction_date] [datetime] NOT NULL,
	[source_app_id] [int] NULL,
	[policy_id_reference] [varchar](12) NOT NULL,
	[policy_holder_reference] [varchar](100) NOT NULL,
	[product_name_reference] [varchar](100) NOT NULL,
	[currency_id_reference] [varchar](20) NOT NULL,
	[is_policy_holder] [tinyint] NOT NULL,
	[customer] [varchar](100) NOT NULL,
	[address] [varchar](255) NOT NULL,
	[mobile_phone] [varchar](15) NOT NULL,
	[email_address] [varchar](30) NULL,
	[signature_url] [varchar](300) NULL,
	[signature_hashcode] [varchar](50) NULL,
	[photo_url] [varchar](300) NULL,
	[photo_hashcode] [varchar](50) NULL,
	[reference_number] [varchar](50) NULL,
	[currency_id] [int] NULL,
	[currency_code] [varchar](3) NULL,
	[transaction_value] [decimal](8, 2) NULL,
	[is_notify_document_completion] [tinyint] NULL,
	[notification_date] [datetime] NULL,
	[workflow_template_stage_id] [bigint] NULL,
	[user_id] [varchar](8) NOT NULL,
	[branch_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[eform_workflow_id] [int] NULL,
	[source_transaction_id] [smallint] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_t_transaction_log] PRIMARY KEY CLUSTERED 
(
	[t_transaction_log_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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_log] ON [dbo].[t_transaction_log] 
(
	[transaction_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_log_1] ON [dbo].[t_transaction_log] 
(
	[register_number] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[m_transaction_status]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_transaction_status](
	[transaction_status_id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](50) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [varchar](1) NOT NULL,
 CONSTRAINT [PK_m_transaction_status] PRIMARY KEY CLUSTERED 
(
	[transaction_status_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_transaction_status] ON
INSERT [dbo].[m_transaction_status] ([transaction_status_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Draft', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_status] ([transaction_status_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'On Process', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_status] ([transaction_status_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'Reject', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_status] ([transaction_status_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'Complete', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_status] ([transaction_status_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'Cancel', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_transaction_status] OFF
/****** Object:  Table [dbo].[log_t_transaction]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction](
	[transaction_id] [bigint] NULL,
	[transaction_type_id] [int] NOT NULL,
	[register_number] [varchar](9) NULL,
	[transaction_date] [datetime] NULL,
	[source_app_id] [int] NULL,
	[policy_id_reference] [varchar](12) NOT NULL,
	[policy_holder_reference] [varchar](100) NOT NULL,
	[product_name_reference] [varchar](100) NOT NULL,
	[currency_id_reference] [varchar](20) NOT NULL,
	[is_policy_holder] [char](1) NOT NULL,
	[customer] [varchar](100) NOT NULL,
	[address] [varchar](255) NOT NULL,
	[mobile_phone] [varchar](15) NOT NULL,
	[email_address] [varchar](30) NULL,
	[signature_url] [varchar](300) NULL,
	[photo_url] [varchar](300) NULL,
	[reference_number] [varchar](50) NULL,
	[currency_id] [int] NULL,
	[transaction_value] [decimal](8, 2) NULL,
	[is_notify_document_completion] [char](1) NULL,
	[notification_date] [datetime] NULL,
	[workflow_template_stage_id] [bigint] NULL,
	[user_id] [varchar](8) NOT NULL,
	[branch_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[t_transaction]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction](
	[transaction_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_type_id] [int] NOT NULL,
	[register_number] [varchar](9) NULL,
	[transaction_date] [datetime2](7) NULL,
	[source_app_id] [int] NULL,
	[policy_id_reference] [varchar](12) NOT NULL,
	[policy_holder_reference] [varchar](100) NOT NULL,
	[product_name_reference] [varchar](100) NOT NULL,
	[currency_id_reference] [varchar](3) NOT NULL,
	[is_policy_holder] [tinyint] NOT NULL,
	[customer] [varchar](100) NOT NULL,
	[address] [varchar](255) NOT NULL,
	[mobile_phone] [varchar](15) NOT NULL,
	[email_address] [varchar](30) NULL,
	[signature_url] [varchar](300) NULL,
	[signature_hashcode] [varchar](50) NULL,
	[photo_url] [varchar](300) NULL,
	[photo_hashcode] [varchar](50) NULL,
	[reference_number] [varchar](50) NULL,
	[currency_id] [int] NULL,
	[currency_code] [varchar](3) NULL,
	[transaction_value] [decimal](8, 2) NULL,
	[is_notify_document_completion] [tinyint] NULL,
	[notification_date] [datetime] NULL,
	[workflow_template_stage_id] [bigint] NULL,
	[user_id] [varchar](8) NOT NULL,
	[branch_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[eform_workflow_id] [int] NULL,
	[source_transaction_id] [smallint] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK__t_transa__85C600AF2BD46C74] PRIMARY KEY CLUSTERED 
(
	[transaction_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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_policy_id] ON [dbo].[t_transaction] 
(
	[policy_id_reference] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_t_transaction_reg_number] ON [dbo].[t_transaction] 
(
	[register_number] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_type_id] ON [dbo].[t_transaction] 
(
	[transaction_type_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[t_transaction_document]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_document](
	[transaction_document_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[document_type_id] [int] NOT NULL,
	[token] [varchar](30) NULL,
	[receive_doc_check] [bit] NOT NULL,
	[hashcode] [varchar](50) NULL,
	[document_index] [varchar](100) NULL,
	[document_name] [varchar](100) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__t_transa__AC0635CA3A228BCB] PRIMARY KEY CLUSTERED 
(
	[transaction_document_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [t_transaction_document_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_Update]      
ON [dbo].[t_transaction_document]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_document_id]) THEN '[transaction_document_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_id]) THEN '[transaction_id]-' ELSE '' END + 
CASE WHEN UPDATE([document_type_id]) THEN '[document_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([token]) THEN '[token]-' ELSE '' END + 
CASE WHEN UPDATE([hashcode]) THEN '[hashcode]-' ELSE '' END + 
CASE WHEN UPDATE([document_index]) THEN '[document_index]-' ELSE '' END + 
CASE WHEN UPDATE([document_name]) THEN '[document_name]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_t_transaction_document]
([transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_id]) as [transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_t_transaction_document]
([transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_id]) as [transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [t_transaction_document_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_Insert] 
ON [dbo].[t_transaction_document]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_t_transaction_document]
([transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_id]) as [transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [t_transaction_document_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_Delete]    
ON [dbo].[t_transaction_document]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_t_transaction_document]
([transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_id]) as [transaction_document_id],[transaction_id],[document_type_id],[token],[hashcode],[document_index],[document_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[log_t_transaction_history_process]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction_history_process](
	[transaction_history_process_id] [bigint] NULL,
	[transaction_id] [bigint] NOT NULL,
	[process_date] [datetime] NOT NULL,
	[user_id] [varchar](8) NOT NULL,
	[workflow_template_action_id] [bigint] NULL,
	[action_description] [varchar](200) NULL,
	[reason_id] [int] NULL,
	[remarks] [varchar](255) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_reason_category]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_reason_category](
	[reason_category_id] [int] NULL,
	[reason_category_code] [varchar](10) NULL,
	[description] [varchar](100) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_reason_category]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_reason_category](
	[reason_category_id] [int] IDENTITY(1,1) NOT NULL,
	[reason_category_code] [varchar](10) NULL,
	[description] [varchar](100) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_reason__681B69C15F891AA4] PRIMARY KEY CLUSTERED 
(
	[reason_category_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_reason_category] ON
INSERT [dbo].[m_reason_category] ([reason_category_id], [reason_category_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'R0001', N'Reject', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason_category] ([reason_category_id], [reason_category_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'R0002', N'Cancel', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason_category] ([reason_category_id], [reason_category_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'R0003', N'Need Revision', 5, N'FMJ', CAST(0x0000A7FD00000000 AS DateTime), N'FMJ', CAST(0x0000A7FD00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason_category] ([reason_category_id], [reason_category_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'R0004', N'Postpone', 5, N'EPO', CAST(0x0000A81200EFF7AD AS DateTime), N'EPO', CAST(0x0000A81200EFF7AD AS DateTime), N'0')
INSERT [dbo].[m_reason_category] ([reason_category_id], [reason_category_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'R0005', N'Not Use Reference No', 5, N'EPO', CAST(0x0000A81D00929C5A AS DateTime), N'EPO', CAST(0x0000A82500DCDF3A AS DateTime), N'0')
INSERT [dbo].[m_reason_category] ([reason_category_id], [reason_category_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'R0006', N'Extra Mortality', 5, N'EPO', CAST(0x0000A82000E69660 AS DateTime), N'EPO', CAST(0x0000A82000E69660 AS DateTime), N'0')
INSERT [dbo].[m_reason_category] ([reason_category_id], [reason_category_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'R0007', N'Decline', 5, N'EPO', CAST(0x0000A82000E69E7B AS DateTime), N'ASP', CAST(0x0000A8270095DB95 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_reason_category] OFF
/****** Object:  Table [dbo].[log_m_reason]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_reason](
	[reason_id] [int] NULL,
	[reason_category_id] [int] NOT NULL,
	[description] [varchar](225) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_reason]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_reason](
	[reason_id] [int] IDENTITY(1,1) NOT NULL,
	[reason_category_id] [int] NOT NULL,
	[description] [varchar](225) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_reason__846BB554644DCFC1] PRIMARY KEY CLUSTERED 
(
	[reason_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_reason] ON
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, 4, N'Dokumen tidak lengkap', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, 4, N'Dokumen tidak jelas', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, 4, N'KTP expired', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, 4, N'Tidak ada tandatangan Banch Manager', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, 4, N'Tidak ada tandatangan dari CS Pusat', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, 4, N'Duplikasi Pengajuan', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, 4, N'Tidak bisa mengubah plan', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, 4, N'Pembatalan pengajuan', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, 4, N'Transaksi tidak sesuai', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, 4, N'Nomor Polis tidak sesuai', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, 5, N'Nasabah batal mengajukan', 5, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, 6, N'Dokumen Kurang', 5, N'ASP', CAST(0x0000A81500F92A99 AS DateTime), N'ASP', CAST(0x0000A81500F92A99 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, 14, N'Menunggu hasil medical', 5, N'ASP', CAST(0x0000A8160090E616 AS DateTime), N'ASP', CAST(0x0000A8160090E616 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, 15, N'Not Use Reference No.', 5, N'EPO', CAST(0x0000A82500DCDBA4 AS DateTime), N'EPO', CAST(0x0000A82500DCDBA4 AS DateTime), N'0')
INSERT [dbo].[m_reason] ([reason_id], [reason_category_id], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, 17, N'Decline', 5, N'ASP', CAST(0x0000A8270095D91A AS DateTime), N'ASP', CAST(0x0000A8270095D91A AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_reason] OFF
/****** Object:  Table [dbo].[t_transaction_history_process]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_history_process](
	[transaction_history_process_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[process_date] [datetime] NOT NULL,
	[user_id] [varchar](8) NOT NULL,
	[workflow_template_action_id] [bigint] NULL,
	[action_description] [varchar](200) NULL,
	[reason_id] [int] NULL,
	[remarks] [varchar](255) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK__t_transa__ED3D41C657B2EEB2] PRIMARY KEY CLUSTERED 
(
	[transaction_history_process_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [t_transaction_history_process_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_history_process_Update]      
ON [dbo].[t_transaction_history_process]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_history_process_id]) THEN '[transaction_history_process_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_id]) THEN '[transaction_id]-' ELSE '' END + 
CASE WHEN UPDATE([process_date]) THEN '[process_date]-' ELSE '' END + 
CASE WHEN UPDATE([user_id]) THEN '[user_id]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_action_id]) THEN '[workflow_template_action_id]-' ELSE '' END + 
CASE WHEN UPDATE([reason_id]) THEN '[reason_id]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_t_transaction_history_process]
([transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_process_id]) as [transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_t_transaction_history_process]
([transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_process_id]) as [transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [t_transaction_history_process_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_history_process_Insert] 
ON [dbo].[t_transaction_history_process]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_t_transaction_history_process]
([transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_process_id]) as [transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [t_transaction_history_process_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_history_process_Delete]    
ON [dbo].[t_transaction_history_process]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_t_transaction_history_process]
([transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_process_id]) as [transaction_history_process_id],[transaction_id],[process_date],[user_id],[workflow_template_action_id],[reason_id],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[log_t_transaction_document_file]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction_document_file](
	[transaction_document_file_id] [bigint] NULL,
	[transaction_document_id] [bigint] NOT NULL,
	[document_name] [varchar](100) NOT NULL,
	[document_url] [varchar](100) NOT NULL,
	[hashcode_ori] [varchar](30) NOT NULL,
	[hashcode] [varchar](30) NOT NULL,
	[upload_by] [varchar](8) NOT NULL,
	[upload_date] [datetime] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[t_transaction_document_file]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_document_file](
	[transaction_document_file_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_document_id] [bigint] NOT NULL,
	[document_name] [varchar](200) NULL,
	[document_url] [varchar](100) NOT NULL,
	[hashcode_ori] [varchar](50) NOT NULL,
	[hashcode] [varchar](50) NOT NULL,
	[upload_by] [varchar](8) NOT NULL,
	[upload_date] [datetime] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__t_transa__0AB7A9E43FDB6521] PRIMARY KEY CLUSTERED 
(
	[transaction_document_file_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [t_transaction_document_file_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_file_Update]      
ON [dbo].[t_transaction_document_file]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_document_file_id]) THEN '[transaction_document_file_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_document_id]) THEN '[transaction_document_id]-' ELSE '' END + 
CASE WHEN UPDATE([document_name]) THEN '[document_name]-' ELSE '' END + 
CASE WHEN UPDATE([document_url]) THEN '[document_url]-' ELSE '' END + 
CASE WHEN UPDATE([hashcode_ori]) THEN '[hashcode_ori]-' ELSE '' END + 
CASE WHEN UPDATE([hashcode]) THEN '[hashcode]-' ELSE '' END + 
CASE WHEN UPDATE([upload_by]) THEN '[upload_by]-' ELSE '' END + 
CASE WHEN UPDATE([upload_date]) THEN '[upload_date]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_t_transaction_document_file]
([transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_id]) as [transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_t_transaction_document_file]
([transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_id]) as [transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [t_transaction_document_file_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_file_Insert] 
ON [dbo].[t_transaction_document_file]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_t_transaction_document_file]
([transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_id]) as [transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [t_transaction_document_file_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_file_Delete]    
ON [dbo].[t_transaction_document_file]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_t_transaction_document_file]
([transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_id]) as [transaction_document_file_id],[transaction_document_id],[document_name],[document_url],[hashcode_ori],[hashcode],[upload_by],[upload_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[log_t_transaction_document_file_history]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction_document_file_history](
	[transaction_document_file_history_id] [bigint] NULL,
	[transaction_document_file_id] [bigint] NOT NULL,
	[workflow_template_stage_id] [bigint] NOT NULL,
	[process_date] [datetime] NOT NULL,
	[user_id] [int] NOT NULL,
	[token] [varchar](30) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_user]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_user](
	[user_id] [int] NULL,
	[username] [varchar](8) NOT NULL,
	[user_fullname] [varchar](50) NOT NULL,
	[branch_id] [int] NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_user]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_user](
	[user_id] [int] IDENTITY(1,1) NOT NULL,
	[username] [varchar](8) NOT NULL,
	[user_fullname] [varchar](50) NOT NULL,
	[branch_id] [int] NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK__m_user__B9BE370F09B45E9A] PRIMARY KEY CLUSTERED 
(
	[user_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_m_user_unq] UNIQUE NONCLUSTERED 
(
	[username] 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
CREATE NONCLUSTERED INDEX [IX_m_user_user_fullname] ON [dbo].[m_user] 
(
	[user_fullname] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_user_username_idx] ON [dbo].[m_user] 
(
	[username] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_user] ON
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'WHI', N'Wahyu Hidayat', 1, 5, N'WHI', CAST(0x0000A77C00000000 AS DateTime), N'WHI', CAST(0x0000A7B50137F291 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'FMJ', N'Fahrul Mundjid', 1, 5, N'FMJ', CAST(0x0000A78D00000000 AS DateTime), N'WHI', CAST(0x0000A7DF00AC9220 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'PPM', N'Pribadi Pamungkas', 1, 5, N'PPM', CAST(0x0000A78D00000000 AS DateTime), N'WHI', CAST(0x0000A7B50137E8F6 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'KHU', N'Khoirul Huda', 1, 5, N'WHI', CAST(0x0000A7A900F17015 AS DateTime), N'BDA', CAST(0x0000A80200E2C71E AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'BDA', N'Barnas Danu', 1, 5, N'WHI', CAST(0x0000A7E400AAA4AB AS DateTime), N'WHI', CAST(0x0000A7E400AAA4AB AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'JWT', N'Jaenul Waton', 1, 5, N'PPM', CAST(0x0000A7FD00FE5B9F AS DateTime), N'PPM', CAST(0x0000A7FD00FE5B9F AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, N'HDW', N'Hutomo Dwi Putranto', 1, 5, N'FMJ', CAST(0x0000A7FD0100309F AS DateTime), N'ASP', CAST(0x0000A80A010E5C58 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'YPE', N'Yosep Pernandos Siagian', 1, 5, N'FMJ', CAST(0x0000A7FD01003AE1 AS DateTime), N'EPO', CAST(0x0000A81600FBED6C AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, N'IGU', N'I Gusti Nyoman Anom Suteja', 2, 5, N'FMJ', CAST(0x0000A7FD0100E768 AS DateTime), N'ASP', CAST(0x0000A80A010F5039 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'ASP', N'Anggia Sekar Putri', 1, 5, N'KHU', CAST(0x0000A80100FC3B7A AS DateTime), N'KHU', CAST(0x0000A80100FC3B7A AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, N'EPO', N'Ernica Putri Oktavia', 1, 5, N'ASP', CAST(0x0000A80100FD26DB AS DateTime), N'ASP', CAST(0x0000A80200E62B86 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'NRF', N'Nanry Rifani', 30, 5, N'ASP', CAST(0x0000A80A009C91D3 AS DateTime), N'ASP', CAST(0x0000A81500EC4F71 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'ABU', N'Andriyadi Budiman', 30, 5, N'ASP', CAST(0x0000A80A009CA044 AS DateTime), N'ASP', CAST(0x0000A80A009CA044 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, N'MNH', N'Meganita Nur Hedy Aaaij', 1, 5, N'ASP', CAST(0x0000A80A009CAA9B AS DateTime), N'EPO', CAST(0x0000A80A00A4DF09 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, N'MSA', N'Monika Sari', 1, 5, N'ASP', CAST(0x0000A80A009D6CAF AS DateTime), N'ASP', CAST(0x0000A80A009D6CAF AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, N'ASY', N'Achmad Syarifuddin', 1, 5, N'ASP', CAST(0x0000A80A009D7618 AS DateTime), N'ASP', CAST(0x0000A80E00F28159 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, N'IHA', N'Indri Hapsari', 1, 5, N'EPO', CAST(0x0000A80A00A13DE1 AS DateTime), N'ASP', CAST(0x0000A80A010E82CE AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, N'LDE', N'Liana Dewi', 1, 5, N'EPO', CAST(0x0000A80A00A4517A AS DateTime), N'EPO', CAST(0x0000A80A00A4908A AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, N'RRH', N'Reina Rahmatika', 1, 5, N'EPO', CAST(0x0000A80A00A52027 AS DateTime), N'EPO', CAST(0x0000A80A00A55B05 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, N'ROK', N'Rindu Okta Miliawati', 1, 5, N'EPO', CAST(0x0000A80A00A56B0F AS DateTime), N'EPO', CAST(0x0000A80A00A56B0F AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, N'AFI', N'Anisa Firdausi', 1, 5, N'EPO', CAST(0x0000A80A00ACC010 AS DateTime), N'EPO', CAST(0x0000A80A00ACC010 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, N'SYS', N'System', 1, 5, N'FMJ', CAST(0x0000A80A00000000 AS DateTime), N'FMJ', CAST(0x0000A80A00000000 AS DateTime), 99)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, N'KAT', N'Katherine', 1, 5, N'ASP', CAST(0x0000A812008E0753 AS DateTime), N'ASP', CAST(0x0000A812008E0753 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, N'BSU', N'Budi Sulistyowati,Aaij,Iccso', 1, 5, N'ASP', CAST(0x0000A812008E12F3 AS DateTime), N'ASP', CAST(0x0000A812008E12F3 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, N'FSH', N'Febrina Shakuntala P', 1, 5, N'ASP', CAST(0x0000A812008E25BD AS DateTime), N'ASP', CAST(0x0000A812008E25BD AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, N'RJA', N'Roudhotul Janah', 1, 5, N'EPO', CAST(0x0000A81200FB3012 AS DateTime), N'EPO', CAST(0x0000A81200FB3012 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, N'RSP', N'Rudi S.P.Pakpahan,Aaak Aaaij', 1, 5, N'EPO', CAST(0x0000A81200FCF175 AS DateTime), N'EPO', CAST(0x0000A81200FCF175 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, N'SAN', N'Stephanus Anton M.S, Aaij', 30, 5, N'EPO', CAST(0x0000A815009C3C86 AS DateTime), N'EPO', CAST(0x0000A815009C3C86 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, N'DIS', N'Debby Ismah Elong', 1, 5, N'ASP', CAST(0x0000A81500EA0262 AS DateTime), N'ASP', CAST(0x0000A81500EA31E7 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (56, N'NDE', N'Natalia Desi Saputri', 1, 5, N'ASP', CAST(0x0000A81500EACF53 AS DateTime), N'ASP', CAST(0x0000A81500EACF53 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (57, N'NIR', N'Nike Irawati Butarbutar', 1, 5, N'ASP', CAST(0x0000A81500FEAEC4 AS DateTime), N'ASP', CAST(0x0000A81500FEAEC4 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (58, N'NHN', N'Nurfadilah Hannum', 1, 5, N'ASP', CAST(0x0000A81500FF76D2 AS DateTime), N'ASP', CAST(0x0000A81500FF76D2 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (59, N'MAP', N'Mieke Apriska', 1, 5, N'ASP', CAST(0x0000A81500FF7F3C AS DateTime), N'ASP', CAST(0x0000A81500FF7F3C AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (60, N'DAW', N'Darwindo', 1, 5, N'ASP', CAST(0x0000A81600F9A042 AS DateTime), N'ASP', CAST(0x0000A81600F9A042 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (61, N'AAU', N'Alvin Augusta', 1, 5, N'ASP', CAST(0x0000A81900A6228B AS DateTime), N'ASP', CAST(0x0000A81900A6228B AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (62, N'DSO', N'David Soetadi, Fsai, Aaij', 1, 5, N'ASP', CAST(0x0000A81900AE5A15 AS DateTime), N'ASP', CAST(0x0000A81900AE5A15 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (63, N'INU', N'Indra Nurzainsyah Noer', 1, 5, N'ASP', CAST(0x0000A81900B807D0 AS DateTime), N'ASP', CAST(0x0000A81900B807D0 AS DateTime), 0)
INSERT [dbo].[m_user] ([user_id], [username], [user_fullname], [branch_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (64, N'EBO', N'Eko Boedi Santoso', 1, 5, N'EPO', CAST(0x0000A81E00B697E4 AS DateTime), N'EPO', CAST(0x0000A81E00B697E4 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_user] OFF
/****** Object:  Table [dbo].[t_transaction_document_file_history]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_document_file_history](
	[transaction_document_file_history_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_document_file_id] [bigint] NOT NULL,
	[workflow_template_stage_id] [bigint] NOT NULL,
	[process_date] [datetime] NOT NULL,
	[user_id] [int] NOT NULL,
	[token] [varchar](30) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__t_transa__8056332444A01A3E] PRIMARY KEY CLUSTERED 
(
	[transaction_document_file_history_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [t_transaction_document_file_history_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_file_history_Update]      
ON [dbo].[t_transaction_document_file_history]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_document_file_history_id]) THEN '[transaction_document_file_history_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_document_file_id]) THEN '[transaction_document_file_id]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_stage_id]) THEN '[workflow_template_stage_id]-' ELSE '' END + 
CASE WHEN UPDATE([process_date]) THEN '[process_date]-' ELSE '' END + 
CASE WHEN UPDATE([user_id]) THEN '[user_id]-' ELSE '' END + 
CASE WHEN UPDATE([token]) THEN '[token]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_t_transaction_document_file_history]
([transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_history_id]) as [transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_t_transaction_document_file_history]
([transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_history_id]) as [transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [t_transaction_document_file_history_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_file_history_Insert] 
ON [dbo].[t_transaction_document_file_history]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_t_transaction_document_file_history]
([transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_history_id]) as [transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [t_transaction_document_file_history_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_document_file_history_Delete]    
ON [dbo].[t_transaction_document_file_history]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_t_transaction_document_file_history]
([transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_document_file_history_id]) as [transaction_document_file_history_id],[transaction_document_file_id],[workflow_template_stage_id],[process_date],[user_id],[token],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[m_alteration_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_alteration_type](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](160) NOT NULL,
	[is_technical] [tinyint] NOT NULL,
	[created_by] [varchar](8) NULL,
	[created_date] [datetime] NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_alteration_type] 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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_m_alteration_type_desc] ON [dbo].[m_alteration_type] 
(
	[description] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_alteration_type_desc_tech] ON [dbo].[m_alteration_type] 
(
	[description] ASC,
	[is_technical] ASC,
	[is_delete] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_alteration_type_is_tech] ON [dbo].[m_alteration_type] 
(
	[is_technical] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_alteration_type] ON
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Change Address', 0, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 1)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'Change Beneficiary', 0, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'Change Policy Holder Contact', 0, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'Change Service Unit', 0, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'Duplicate Policy Contract Reprint', 0, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'Premium Holiday Cancelation', 0, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'Premium Holiday Registration', 0, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, N'Addition of Rider', 1, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'Change Date of Birth', 1, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'Change Exclusion Extra Loading', 1, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, N'Change Exclusion After Policy Reward', 1, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'Change Gender', 1, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'Change Occupation, Height and  Weight', 1, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'Change Plan/Add Member/Delete Member', 1, N'WHI', CAST(0x0000A7FC00B642B3 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'Change Policy Holder', 1, N'WHI', CAST(0x0000A7FC00B821BC AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'Change Premium Mode', 1, N'WHI', CAST(0x0000A7FC00B8DD69 AS DateTime), NULL, NULL, 1)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, N'Change Term', 1, N'WHI', CAST(0x0000A7FC00B8F1C5 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'Decrease Face Amount', 1, N'WHI', CAST(0x0000A7FC00B910D7 AS DateTime), NULL, NULL, 1)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, N'Delete Rider', 1, N'WHI', CAST(0x0000A7FC00B99485 AS DateTime), NULL, NULL, 1)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'Fund Switching', 1, N'WHI', CAST(0x0000A7FC00B9B921 AS DateTime), NULL, NULL, 1)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, N'Increase Face Amount', 1, N'WHI', CAST(0x0000A7FC00B9CCE8 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, N'Multiple Alteration', 1, N'WHI', CAST(0x0000A7FC00B9DBA8 AS DateTime), NULL, NULL, 0)
INSERT [dbo].[m_alteration_type] ([id], [description], [is_technical], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'Premium Redirection', 1, N'WHI', CAST(0x0000A7FC00B9F49C AS DateTime), NULL, NULL, 0)
SET IDENTITY_INSERT [dbo].[m_alteration_type] OFF
/****** Object:  Table [dbo].[log_t_transaction_task]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction_task](
	[transaction_task_id] [bigint] NULL,
	[transaction_id] [bigint] NOT NULL,
	[process_id_transaction_task] [bigint] NOT NULL,
	[user_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_t_transaction_form]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction_form](
	[transaction_form_id] [bigint] NULL,
	[transaction_id] [bigint] NULL,
	[transaction_sub_type] [int] NULL,
	[currency] [varchar](10) NULL,
	[money_loans] [varchar](50) NULL,
	[term] [varchar](50) NULL,
	[identity_date] [datetime] NULL,
	[amount] [varchar](30) NULL,
	[submission_date] [datetime] NULL,
	[source_of_fund_id] [int] NULL,
	[gross_income_id] [int] NULL,
	[gross_income_year_id] [int] NULL,
	[is_settlement] [char](1) NULL,
	[settlement_name] [varchar](50) NULL,
	[policy_no] [varchar](50) NULL,
	[is_transfer_bank] [char](1) NULL,
	[in_currency] [varchar](50) NULL,
	[beneficiary_name] [varchar](100) NULL,
	[bank_name] [varchar](100) NULL,
	[branch] [varchar](100) NULL,
	[account_no] [varchar](50) NULL,
	[transfer_amount] [varchar](50) NULL,
	[remarks] [varchar](255) NULL,
	[created_by] [varchar](8) NULL,
	[created_date] [datetime] NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [char](1) NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_s_m_log_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_s_m_log_type](
	[log_type_id] [tinyint] NOT NULL,
	[icon] [varchar](20) NULL,
	[description] [varchar](20) NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_s_error_code]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_s_error_code](
	[error_code] [smallint] NOT NULL,
	[error_description] [varchar](100) NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_s_action_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_s_action_type](
	[id_action_type] [tinyint] NOT NULL,
	[description] [varchar](40) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_s_action_list]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_s_action_list](
	[action_id] [int] NULL,
	[action_name] [varchar](60) NULL,
	[action_type] [tinyint] NOT NULL,
	[condition_field] [varchar](500) NULL,
	[result_object] [varchar](60) NULL,
	[result_field] [varchar](1000) NULL,
	[default_order] [varchar](20) NULL,
	[max_result_row] [smallint] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_workflow_template_action]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_workflow_template_action](
	[workflow_template_action_id] [bigint] NULL,
	[workflow_template_stage_id] [bigint] NULL,
	[description] [varchar](255) NOT NULL,
	[is_final_action] [char](1) NOT NULL,
	[workflow_template_id] [int] NULL,
	[destination_stage_id] [int] NULL,
	[is_send_notif_to_requester] [char](1) NOT NULL,
	[is_send_notif_to_next_pic] [char](1) NOT NULL,
	[is_notif_document_completion] [char](1) NOT NULL,
	[is_check_mandatory_document] [char](1) NOT NULL,
	[is_remarks_mandatory] [char](1) NULL,
	[is_fill_reference_number] [char](1) NOT NULL,
	[is_check_transaction_status_core] [char](1) NULL,
	[code_transaction_status] [varchar](50) NULL,
	[is_need_reason] [char](1) NOT NULL,
	[reason_category_id] [int] NULL,
	[transaction_status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_user_organization]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_user_organization](
	[user_organization_id] [bigint] NULL,
	[user_id_organization] [varchar](8) NOT NULL,
	[effective_date] [date] NOT NULL,
	[organization_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_pic]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_pic](
	[pic_id] [int] NULL,
	[pic_code] [varchar](8) NOT NULL,
	[description] [varchar](50) NOT NULL,
	[remarks] [varchar](255) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_organization]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_organization](
	[organization_id] [int] NULL,
	[organization_code] [varchar](8) NULL,
	[description] [varchar](60) NOT NULL,
	[level_type_id] [int] NOT NULL,
	[user_id_head] [varchar](8) NULL,
	[organization_id_parent] [int] NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_level_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_level_type](
	[level_type_id] [int] NULL,
	[level_type_code] [varchar](8) NOT NULL,
	[description] [varchar](60) NOT NULL,
	[head_description] [varchar](60) NOT NULL,
	[seq_number] [numeric](18, 0) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_group_pic_detail]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_group_pic_detail](
	[group_pic_detail_id] [bigint] NULL,
	[group_pic_id] [int] NOT NULL,
	[source_app_id] [int] NULL,
	[branch_id] [varchar](5) NOT NULL,
	[transaction_type_id] [varchar](5) NOT NULL,
	[user_id_group_pic_detail] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_group_menu_mapping]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_group_menu_mapping](
	[group_menu_mapping_id] [int] NULL,
	[group_menu_id] [int] NOT NULL,
	[menu_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_group_menu]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_group_menu](
	[group_menu_id] [int] NULL,
	[group_menu_code] [varchar](6) NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_eform_setting_detail]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_eform_setting_detail](
	[eform_setting_detail_id] [int] NULL,
	[eform_setting_id] [bigint] NOT NULL,
	[component_type_id] [bigint] NOT NULL,
	[label] [varchar](50) NULL,
	[row] [numeric](18, 0) NULL,
	[column_order] [numeric](18, 0) NULL,
	[width] [numeric](18, 0) NULL,
	[height] [numeric](18, 0) NULL,
	[data_type_id] [int] NULL,
	[source_data] [varchar](50) NULL,
	[saved_value] [varchar](50) NULL,
	[view_value] [varchar](50) NULL,
	[data_lenght] [varchar](50) NULL,
	[is_mandatory_field] [char](1) NOT NULL,
	[is_used_for_approval] [char](1) NOT NULL,
	[is_sub_question] [char](1) NOT NULL,
	[component_id_parent] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_eform_setting]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_eform_setting](
	[eform_setting_id] [bigint] NULL,
	[eform_id] [int] NOT NULL,
	[description] [varchar](50) NOT NULL,
	[effective_date] [date] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_eform_document]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_eform_document](
	[eform_document_id] [int] NULL,
	[eform_id] [int] NOT NULL,
	[document_id] [int] NOT NULL,
	[minimum_files] [numeric](18, 0) NOT NULL,
	[maximum_files] [numeric](18, 0) NOT NULL,
	[seq_number] [numeric](18, 0) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_document_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_document_type](
	[document_type_id] [int] NULL,
	[document_type_code] [varchar](50) NOT NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [varchar](1) NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_document]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_document](
	[document_id] [int] NULL,
	[document_code] [varchar](8) NULL,
	[description] [varchar](200) NOT NULL,
	[remarks] [varchar](255) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_data_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_data_type](
	[data_type_id] [int] NULL,
	[data_type_code] [varchar](50) NOT NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [varchar](1) NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_component_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_component_type](
	[component_type_id] [bigint] NULL,
	[component_type_code] [varchar](8) NOT NULL,
	[description] [varchar](50) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_city]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_city](
	[city_id] [int] NULL,
	[city_code] [char](6) NULL,
	[province_id] [int] NOT NULL,
	[city_name] [varchar](160) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_branch]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_branch](
	[branch_id] [int] NULL,
	[branch_code] [varchar](8) NOT NULL,
	[description] [varchar](150) NOT NULL,
	[address] [varchar](255) NULL,
	[city_id] [int] NOT NULL,
	[province_id] [int] NOT NULL,
	[postal_code] [varchar](10) NULL,
	[phone_number_1] [varchar](30) NULL,
	[phone_number_2] [varchar](30) NULL,
	[user_pic] [varchar](8) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_transaction_form_template]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_transaction_form_template](
	[transaction_form_template_id] [smallint] NULL,
	[description] [varchar](150) NOT NULL,
	[filename] [varchar](200) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_DDLEvents]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_DDLEvents](
	[EventDate] [datetime] NOT NULL,
	[EventType] [nvarchar](64) NULL,
	[EventDDL] [nvarchar](max) NULL,
	[EventXML] [xml] NULL,
	[DatabaseName] [nvarchar](255) NULL,
	[SchemaName] [nvarchar](255) NULL,
	[ObjectName] [nvarchar](255) NULL,
	[HostName] [varchar](64) NULL,
	[IPAddress] [varchar](32) NULL,
	[ProgramName] [nvarchar](255) NULL,
	[LoginName] [nvarchar](255) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_gross_income_year]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_gross_income_year](
	[gross_income_year_id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](160) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_gross_income_year] PRIMARY KEY CLUSTERED 
(
	[gross_income_year_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_gross_income_year] ON
INSERT [dbo].[m_gross_income_year] ([gross_income_year_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'> 25.000.000 - 50.000.000', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), 0)
INSERT [dbo].[m_gross_income_year] ([gross_income_year_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'> 50.000.000 - 100.000.000', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), 0)
INSERT [dbo].[m_gross_income_year] ([gross_income_year_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'> 300.000.000 - 500.000.000', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), 0)
INSERT [dbo].[m_gross_income_year] ([gross_income_year_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'> 500.000.000', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_gross_income_year] OFF
/****** Object:  Table [dbo].[m_gross_income]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_gross_income](
	[gross_income_id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](160) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_gross_income] PRIMARY KEY CLUSTERED 
(
	[gross_income_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_gross_income] ON
INSERT [dbo].[m_gross_income] ([gross_income_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N's/d 25.000.000', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), 0)
INSERT [dbo].[m_gross_income] ([gross_income_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'> 100.000.000 - 300.000.000', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_gross_income] OFF
/****** Object:  Table [dbo].[m_source_transaction]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_source_transaction](
	[source_transaction_id] [smallint] IDENTITY(1,1) NOT NULL,
	[description] [varchar](255) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [bit] NOT NULL,
 CONSTRAINT [PK_m_source_transaction] PRIMARY KEY CLUSTERED 
(
	[source_transaction_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_source_transaction] ON
INSERT [dbo].[m_source_transaction] ([source_transaction_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Walk In', N'PPM', CAST(0x0000A81600000000 AS DateTime), N'PPM', CAST(0x0000A81600000000 AS DateTime), 0)
INSERT [dbo].[m_source_transaction] ([source_transaction_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'Phone, email, apps, mail, etc', N'PPM', CAST(0x0000A81600000000 AS DateTime), N'PPM', CAST(0x0000A81600000000 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_source_transaction] OFF
/****** Object:  Table [dbo].[m_source_of_funds]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_source_of_funds](
	[source_of_funds_id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](160) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_source_of_funds] PRIMARY KEY CLUSTERED 
(
	[source_of_funds_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_source_of_funds] ON
INSERT [dbo].[m_source_of_funds] ([source_of_funds_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Salary', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80C00000000 AS DateTime), 0)
INSERT [dbo].[m_source_of_funds] ([source_of_funds_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'Grant', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80C00000000 AS DateTime), 0)
INSERT [dbo].[m_source_of_funds] ([source_of_funds_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'Income From Business', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80C00000000 AS DateTime), 0)
INSERT [dbo].[m_source_of_funds] ([source_of_funds_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'Income From Home  Sales', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80C00000000 AS DateTime), 0)
INSERT [dbo].[m_source_of_funds] ([source_of_funds_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'Income From Vehicle Sales', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80C00000000 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_source_of_funds] OFF
/****** Object:  Table [dbo].[m_reinstatement_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_reinstatement_type](
	[m_reinstatement_type_id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](160) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_reinstatement_type] PRIMARY KEY CLUSTERED 
(
	[m_reinstatement_type_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_reinstatement_type] ON
INSERT [dbo].[m_reinstatement_type] ([m_reinstatement_type_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Reinstatement', N'WHI', CAST(0x0000A7F300000000 AS DateTime), N'WHI', CAST(0x0000A7F300000000 AS DateTime), 0)
INSERT [dbo].[m_reinstatement_type] ([m_reinstatement_type_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'Rider Reinstatement', N'WHI', CAST(0x0000A7F300000000 AS DateTime), N'WHI', CAST(0x0000A7F300000000 AS DateTime), 0)
INSERT [dbo].[m_reinstatement_type] ([m_reinstatement_type_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'Surrender Lapse Reinstatement', N'WHI', CAST(0x0000A7F300000000 AS DateTime), N'WHI', CAST(0x0000A7F300000000 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_reinstatement_type] OFF
/****** Object:  Table [dbo].[m_transaction_task_status]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_transaction_task_status](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](160) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_transaction_task_status] 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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_transaction_task_status] ON
INSERT [dbo].[m_transaction_task_status] ([id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Taken', N'WHI', CAST(0x0000A7AB00000000 AS DateTime), N'WHI', CAST(0x0000A7AB00000000 AS DateTime), 0)
INSERT [dbo].[m_transaction_task_status] ([id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'Available', N'WHI', CAST(0x0000A7AB00000000 AS DateTime), N'WHI', CAST(0x0000A7AB00000000 AS DateTime), 0)
INSERT [dbo].[m_transaction_task_status] ([id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'Not Available', N'WHI', CAST(0x0000A7AB00000000 AS DateTime), N'WHI', CAST(0x0000A7AB00000000 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_transaction_task_status] OFF
/****** Object:  Table [dbo].[t_transaction_task]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_task](
	[transaction_task_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[process_sequence] [int] NOT NULL,
	[user_id] [varchar](8) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__t_transa__BD4B9E624B4D17CD] PRIMARY KEY CLUSTERED 
(
	[transaction_task_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_menu]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_menu](
	[menu_id] [int] NULL,
	[menu_category_id] [int] NOT NULL,
	[url] [varchar](400) NULL,
	[description] [varchar](255) NOT NULL,
	[level] [int] NOT NULL,
	[menu_id_parent] [int] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [char](1) NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_t_transaction_history_workflow]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_t_transaction_history_workflow](
	[transaction_history_workflow_id] [bigint] NULL,
	[transaction_id] [bigint] NOT NULL,
	[workflow_template_stage_id] [bigint] NULL,
	[last_user] [varchar](8) NOT NULL,
	[last_submit_date] [varchar](50) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[t_transaction_history_workflow]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_history_workflow](
	[transaction_history_workflow_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[workflow_template_stage_id] [bigint] NULL,
	[last_user] [varchar](8) NOT NULL,
	[last_submit_date] [datetime] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NULL,
 CONSTRAINT [PK__t_transa__E535BB3F6418C597] PRIMARY KEY CLUSTERED 
(
	[transaction_history_workflow_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [t_transaction_history_workflow_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_history_workflow_Update]      
ON [dbo].[t_transaction_history_workflow]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_history_workflow_id]) THEN '[transaction_history_workflow_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_id]) THEN '[transaction_id]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_stage_id]) THEN '[workflow_template_stage_id]-' ELSE '' END + 
CASE WHEN UPDATE([last_user]) THEN '[last_user]-' ELSE '' END + 
CASE WHEN UPDATE([last_submit_date]) THEN '[last_submit_date]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_t_transaction_history_workflow]
([transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_workflow_id]) as [transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_t_transaction_history_workflow]
([transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_workflow_id]) as [transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [t_transaction_history_workflow_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_history_workflow_Insert] 
ON [dbo].[t_transaction_history_workflow]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_t_transaction_history_workflow]
([transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_workflow_id]) as [transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [t_transaction_history_workflow_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_history_workflow_Delete]    
ON [dbo].[t_transaction_history_workflow]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_t_transaction_history_workflow]
([transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_history_workflow_id]) as [transaction_history_workflow_id],[transaction_id],[workflow_template_stage_id],[last_user],[last_submit_date],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[log_m_user_menu]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_user_menu](
	[user_menu_id] [int] NULL,
	[user_menu] [varchar](8) NOT NULL,
	[is_group_menu] [char](1) NOT NULL,
	[group_menu_id] [int] NOT NULL,
	[is_include] [char](1) NOT NULL,
	[is_exclude] [char](1) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [t_transaction_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_Update]      
ON [dbo].[t_transaction]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_id]) THEN '[transaction_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_type_id]) THEN '[transaction_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([register_number]) THEN '[register_number]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_date]) THEN '[transaction_date]-' ELSE '' END + 
CASE WHEN UPDATE([source_app_id]) THEN '[source_app_id]-' ELSE '' END + 
CASE WHEN UPDATE([policy_id_reference]) THEN '[policy_id_reference]-' ELSE '' END + 
CASE WHEN UPDATE([policy_holder_reference]) THEN '[policy_holder_reference]-' ELSE '' END + 
CASE WHEN UPDATE([product_name_reference]) THEN '[product_name_reference]-' ELSE '' END + 
CASE WHEN UPDATE([currency_id_reference]) THEN '[currency_id_reference]-' ELSE '' END + 
CASE WHEN UPDATE([is_policy_holder]) THEN '[is_policy_holder]-' ELSE '' END + 
CASE WHEN UPDATE([customer]) THEN '[customer]-' ELSE '' END + 
CASE WHEN UPDATE([address]) THEN '[address]-' ELSE '' END + 
CASE WHEN UPDATE([mobile_phone]) THEN '[mobile_phone]-' ELSE '' END + 
CASE WHEN UPDATE([email_address]) THEN '[email_address]-' ELSE '' END + 
CASE WHEN UPDATE([signature_url]) THEN '[signature_url]-' ELSE '' END + 
CASE WHEN UPDATE([photo_url]) THEN '[photo_url]-' ELSE '' END + 
CASE WHEN UPDATE([reference_number]) THEN '[reference_number]-' ELSE '' END + 
CASE WHEN UPDATE([currency_id]) THEN '[currency_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_value]) THEN '[transaction_value]-' ELSE '' END + 
CASE WHEN UPDATE([is_notify_document_completion]) THEN '[is_notify_document_completion]-' ELSE '' END + 
CASE WHEN UPDATE([notification_date]) THEN '[notification_date]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_stage_id]) THEN '[workflow_template_stage_id]-' ELSE '' END + 
CASE WHEN UPDATE([user_id]) THEN '[user_id]-' ELSE '' END + 
CASE WHEN UPDATE([branch_id]) THEN '[branch_id]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_t_transaction]
([transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_id]) as [transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_t_transaction]
([transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_id]) as [transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [t_transaction_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_Insert] 
ON [dbo].[t_transaction]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_t_transaction]
([transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_id]) as [transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [t_transaction_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_Delete]    
ON [dbo].[t_transaction]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_t_transaction]
([transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_id]) as [transaction_id],[transaction_type_id],[register_number],[transaction_date],[source_app_id],[policy_id_reference],[policy_holder_reference],[product_name_reference],[currency_id_reference],[is_policy_holder],[customer],[address],[mobile_phone],[email_address],[signature_url],[photo_url],[reference_number],[currency_id],[transaction_value],[is_notify_document_completion],[notification_date],[workflow_template_stage_id],[user_id],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[log_m_approv_matrix_detail]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_approv_matrix_detail](
	[approv_matrix_detail_id] [bigint] NULL,
	[approv_matrix_id] [int] NOT NULL,
	[maximum_value] [decimal](12, 2) NOT NULL,
	[level_type_id] [int] NOT NULL,
	[currency_id] [int] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [TTransactionTriggerUpdate]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[TTransactionTriggerUpdate] 
   ON  [dbo].[t_transaction]
   AFTER UPDATE
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    INSERT INTO t_transaction_log
	(
		transaction_id,
		transaction_type_id,
		register_number,
		transaction_date,
		source_app_id,
		policy_id_reference,
		policy_holder_reference,	
		product_name_reference,	
		currency_id_reference,	
		is_policy_holder,	
		customer,	
		address,	
		mobile_phone,	
		email_address,	
		signature_url,	
		photo_url,	
		reference_number,	
		currency_id,
		currency_code,	
		transaction_value,	
		is_notify_document_completion,	
		notification_date,	
		workflow_template_stage_id,	
		user_id,	
		branch_id,	
		status_id,	
		created_by,	
		created_date,
		is_delete,
		signature_hashcode,
		photo_hashcode
	) 
	SELECT 
	
		transaction_id,
		transaction_type_id,
		register_number,
		transaction_date,
		source_app_id,
		policy_id_reference,
		policy_holder_reference,	
		product_name_reference,	
		currency_id_reference,	
		is_policy_holder,	
		customer,	
		address,	
		mobile_phone,	
		email_address,	
		signature_url,	
		photo_url,	
		reference_number,	
		currency_id,
		currency_code,	
		transaction_value,	
		is_notify_document_completion,	
		notification_date,	
		workflow_template_stage_id,	
		user_id,	
		branch_id,	
		status_id,	
		created_by,	
		created_date,
		is_delete,
		signature_hashcode,
		photo_hashcode
	
	FROM inserted;

END
GO
/****** Object:  Table [dbo].[m_user_group_menu_mapping]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_user_group_menu_mapping](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[user_id] [varchar](3) NOT NULL,
	[group_menu_id] [int] NOT NULL,
	[created_by] [varchar](3) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](3) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_user_group_menu_mapping] 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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_m_user_group_menu_mapping] ON [dbo].[m_user_group_menu_mapping] 
(
	[user_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_user_group_menu_mapping_1] ON [dbo].[m_user_group_menu_mapping] 
(
	[group_menu_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_user_group_menu_mapping_2] ON [dbo].[m_user_group_menu_mapping] 
(
	[user_id] ASC,
	[group_menu_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_user_group_menu_mapping] ON
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'JWT', 4, N'WHI', CAST(0x0000A7DE00FBD025 AS DateTime), N'WHI', CAST(0x0000A7DE00FBD025 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'FMJ', 9, N'WHI', CAST(0x0000A7DF00AC4775 AS DateTime), N'WHI', CAST(0x0000A7DF00AC4775 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'PPM', 4, N'PPM', CAST(0x0000A7DF00000000 AS DateTime), N'PPM', CAST(0x0000A7DF00000000 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'BDA', 4, N'WHi', CAST(0x0000A7E4010B8650 AS DateTime), N'WHi', CAST(0x0000A7E4010B8650 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'ASP', 4, N'KHU', CAST(0x0000A80100FC4EFE AS DateTime), N'KHU', CAST(0x0000A80100FC4EFE AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'EPO', 4, N'ASP', CAST(0x0000A80100FD3B09 AS DateTime), N'ASP', CAST(0x0000A80100FD3B09 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'ASY', 9, N'EPO', CAST(0x0000A80A00A3340D AS DateTime), N'EPO', CAST(0x0000A80A00A3340D AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, N'ABU', 9, N'EPO', CAST(0x0000A80A00A36381 AS DateTime), N'EPO', CAST(0x0000A80A00A36381 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'NRF', 9, N'EPO', CAST(0x0000A80A00A3A2AD AS DateTime), N'ASP', CAST(0x0000A81500EC45B2 AS DateTime), 1)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'YPE', 8, N'EPO', CAST(0x0000A80A00A3C2AF AS DateTime), N'EPO', CAST(0x0000A80A00A3C2AF AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, N'LDE', 8, N'EPO', CAST(0x0000A80A00A46C27 AS DateTime), N'EPO', CAST(0x0000A80A00A46C27 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'MNH', 6, N'EPO', CAST(0x0000A80A00A4B501 AS DateTime), N'EPO', CAST(0x0000A80A00A4B501 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, N'ROK', 8, N'EPO', CAST(0x0000A80A00A58A0C AS DateTime), N'EPO', CAST(0x0000A80A00A58A0C AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'HDW', 8, N'ASP', CAST(0x0000A80A010DC2A8 AS DateTime), N'ASP', CAST(0x0000A80A010DC2A8 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'IHA', 10, N'ASP', CAST(0x0000A80A010E8101 AS DateTime), N'ASP', CAST(0x0000A80A010E8101 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'IGU', 9, N'ASP', CAST(0x0000A80A010F4107 AS DateTime), N'ASP', CAST(0x0000A80A010F4107 AS DateTime), 0)
INSERT [dbo].[m_user_group_menu_mapping] ([id], [user_id], [group_menu_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'AAU', 10, N'ASP', CAST(0x0000A81900A630CF AS DateTime), N'ASP', CAST(0x0000A81900A63464 AS DateTime), 1)
SET IDENTITY_INSERT [dbo].[m_user_group_menu_mapping] OFF
/****** Object:  Table [dbo].[m_user_workflow]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_user_workflow](
	[user_workflow_id] [int] IDENTITY(1,1) NOT NULL,
	[user_workflow_code] [varchar](1) NOT NULL,
	[user_workflow_name] [varchar](1) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_user_w__61D043C62DA7A64D] PRIMARY KEY CLUSTERED 
(
	[user_workflow_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[s_log]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[s_log](
	[log_id] [bigint] IDENTITY(1,1) NOT NULL,
	[date] [datetime] NOT NULL,
	[request_parameter] [nvarchar](max) NULL,
	[response] [nvarchar](max) NULL,
 CONSTRAINT [PK_s_log] PRIMARY KEY CLUSTERED 
(
	[log_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]
GO
/****** Object:  Table [dbo].[t_transaction_task_log]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_task_log](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_task_id] [bigint] NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[process_sequence] [int] NOT NULL,
	[user_id] [varchar](8) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK_t_transaction_task_log] 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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[t_transaction_form_log]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_form_log](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_form_id] [bigint] NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[register_number] [varchar](9) NOT NULL,
	[transaction_sub_type] [int] NULL,
	[currency] [varchar](10) NULL,
	[money_loans] [varchar](50) NULL,
	[term] [varchar](50) NULL,
	[installment_date] [date] NULL,
	[identity_date] [datetime] NULL,
	[amount] [varchar](30) NULL,
	[submission_date] [datetime] NULL,
	[source_of_fund_id] [int] NULL,
	[gross_income_id] [int] NULL,
	[gross_income_year_id] [int] NULL,
	[is_settlement] [tinyint] NULL,
	[settlement_name] [varchar](50) NULL,
	[policy_no] [varchar](50) NULL,
	[is_transfer_bank] [tinyint] NULL,
	[in_currency] [varchar](50) NULL,
	[beneficiary_name] [varchar](100) NULL,
	[bank_name] [varchar](100) NULL,
	[branch] [varchar](100) NULL,
	[account_no] [varchar](50) NULL,
	[transfer_amount] [varchar](50) NULL,
	[remarks] [varchar](255) NULL,
	[reinstatement_type] [int] NULL,
	[m_alteration_type_id] [int] NULL,
	[event_date] [date] NULL,
	[settlement_policy_no] [varchar](160) NULL,
	[is_cancel_from_inception] [tinyint] NULL,
	[is_surrender] [tinyint] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_t_transaction_form_log] 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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_form_log] ON [dbo].[t_transaction_form_log] 
(
	[transaction_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_form_log_1] ON [dbo].[t_transaction_form_log] 
(
	[register_number] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[s_user_session]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[s_user_session](
	[session_id] [varchar](50) NOT NULL,
	[signature] [varchar](100) NOT NULL,
	[username] [varchar](3) NOT NULL,
	[first_login] [datetime] NULL,
	[last_activity] [datetime] NULL,
	[session_expire] [datetime] NULL,
	[ip_address] [varchar](30) NULL,
	[user_agent] [varchar](300) NULL,
 CONSTRAINT [PK_s_user_session] PRIMARY KEY CLUSTERED 
(
	[session_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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_sig_s_user_session] ON [dbo].[s_user_session] 
(
	[signature] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_sig_uid_s_user_session] ON [dbo].[s_user_session] 
(
	[signature] ASC,
	[username] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_uid_s_user_session] ON [dbo].[s_user_session] 
(
	[username] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[log_m_approv_matrix]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_approv_matrix](
	[approv_matrix_id] [int] NULL,
	[approv_matrix_code] [char](8) NULL,
	[description] [varchar](225) NOT NULL,
	[remarks] [varchar](225) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_province]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_province](
	[province_id] [int] NULL,
	[province_code] [char](6) NULL,
	[province_name] [varchar](30) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[log_m_menu_category]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log_m_menu_category](
	[menu_category_id] [int] NULL,
	[description] [varchar](160) NULL,
	[created_by] [varchar](3) NULL,
	[created_date] [datetime] NULL,
	[modified_by] [varchar](3) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NULL,
	[AuditDataState] [varchar](10) NULL,
	[AuditDMLAction] [varchar](10) NULL,
	[AuditUser] [sysname] NULL,
	[AuditDateTime] [datetime] NULL,
	[UpdateColumns] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[x_dev_sit]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[x_dev_sit](
	[No] [tinyint] IDENTITY(1,1) NOT NULL,
	[Module] [varchar](50) NULL,
	[Date_Raised] [date] NULL,
	[Issue_Descriptions] [varchar](max) NULL,
	[Raised_By] [varchar](3) NULL,
	[PIC] [varchar](3) NULL,
	[Priority] [varchar](1) NULL,
	[Type] [varchar](20) NULL,
	[Status] [varchar](20) NULL,
	[Resolution] [varchar](255) NULL,
	[Target_Date] [date] NULL,
	[Closed_Date] [date] NULL,
	[Comment] [varchar](255) NULL,
	[created_by] [varchar](8) NULL,
	[created_date] [datetime] NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
 CONSTRAINT [PK_x_dev_sit] PRIMARY KEY CLUSTERED 
(
	[No] 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].[x_dev_sit] ON
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (1, N'Master Document', CAST(0x323D0B00 AS Date), N'Current Condition:
Pada kebutuhan user terdapat dokumen dengan nama ''Kwitansi Laboratorium Berikut Copy Resep Sebelum Perawatan''. Pada saat di menambahkan dokumen dengan deskripsi tersebut gagal disimpan. 

Need:
Pada field deskripsi dapat diinput lebih banyak karakter.Current Condition:
Pada kebutuhan user terdapat dokumen dengan nama ''Kwitansi Laboratorium Berikut Copy Resep Sebelum Perawatan''. Pada saat di menambahkan dokumen dengan deskripsi tersebut gagal disimpan. 

Need:
Pada field deskripsi dapat diinput lebih banyak karakter.', N'BDA', N'FMJ', N'H', N'BUGS', N'CLOSED', N'Fix & Need Recheck', CAST(0x333D0B00 AS Date), CAST(0x333D0B00 AS Date), NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (2, N'Master Transaction Type', CAST(0x323D0B00 AS Date), N'Current Condition:
Gagal membuat tipe transaksi baru. Saat ditekan tombol save muncul pesan error "Internal Server Error".

Need:
User dapat membuat tipe transaksi baru.Current Condition:
Gagal membuat tipe transaksi baru. Saat ditekan tombol save muncul pesan error "Internal Server Error".

Need:
User dapat membuat tipe transaksi baru.', N'BDA', N'KHU', N'H', N'BUGS', N'Retest', N'Fix & Need Recheck', CAST(0x333D0B00 AS Date), CAST(0x333D0B00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82500AF05BA AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (3, N'Matriks Approval', CAST(0x323D0B00 AS Date), N'Action Delete pada daftar matriks di layar Approval Matriks hanya muncul untuk status = "Draft"', N'BDA', N'FMJ', N'M', N'BUGS', N'CLOSED', N'Fix & Need Recheck', CAST(0x333D0B00 AS Date), NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (4, N'Matriks Approval', CAST(0x323D0B00 AS Date), N'Current Condition:
Pada field deskripsi matriks tidak dapat menulis angka.

Need:
User dapat menulis angka pada deskripsi
Current Condition:
Pada field deskripsi matriks tidak dapat menulis angka.

Need:
User dapat menulis angka pada deskripsi
', N'BDA', N'FMJ', N'H', N'BUGS', N'CLOSED', N'Fix & Need Recheck', CAST(0x333D0B00 AS Date), CAST(0x333D0B00 AS Date), NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (5, N'Matriks Approval', CAST(0x323D0B00 AS Date), N'Current Condition:
Pada detail approval matriks user dapat menginput nilai maksimum untuk Level PIC Approval yang sama. (pada AM170001 pic dept head memiliki dua nilai maksimum).

Need:
Satu level PIC Approver hanya boleh memiliki satu nilai maksimum.
Current Condition:
Pada detail approval matriks user dapat menginput nilai maksimum untuk Level PIC Approval yang sama. (pada AM170001 pic dept head memiliki dua nilai maksimum).

Need:
Satu level PIC Approver hanya boleh memiliki satu nilai maksimum.
', N'BDA', N'KHU', N'H', N'CHANGE REQUEST', N'Open', N'On progress validation', CAST(0x353D0B00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82001043316 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (6, N'Matriks Approval', CAST(0x323D0B00 AS Date), N'Current Condition:
Error ketika menekan tombol save setelah melakukan perubahan data pada layar update matrix parameter.

Need:
User dapat menyimpan perubahan data pada layar update matrix parameter
Current Condition:
Error ketika menekan tombol save setelah melakukan perubahan data pada layar update matrix parameter.

Need:
User dapat menyimpan perubahan data pada layar update matrix parameter
', N'BDA', N'KHU', N'H', N'BUGS', N'Open', N'Fix & Need Recheck', CAST(0x333D0B00 AS Date), CAST(0x333D0B00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82001052C06 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (7, N'Matriks Approval', CAST(0x323D0B00 AS Date), N'Current Condition:
Fungsi delete parameter matriks pada layar approval matrix information belum dapat digunakan. Ketika user menekan action delete sistem tidak mengeluarkan respon apapun.

Need:
User dapat menghapus data parameter matrix.
Current Condition:
Fungsi delete parameter matriks pada layar approval matrix information belum dapat digunakan. Ketika user menekan action delete sistem tidak mengeluarkan respon apapun.

Need:
User dapat menghapus data parameter matrix.
', N'BDA', N'FMJ', N'H', N'BUGS', N'CLOSED', N'Fix & Need Recheck', CAST(0x333D0B00 AS Date), CAST(0x333D0B00 AS Date), NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (8, N'Master Branch', CAST(0x333D0B00 AS Date), N'Current Condition:
User tidak bisa menulis angka pada field deskripsi layar create branch.

Need:
User dapat menulis angka pada deskripsi
Current Condition:
User tidak bisa menulis angka pada field deskripsi layar create branch.

Need:
User dapat menulis angka pada deskripsi
', N'BDA', N'WHI', N'H', N'BUGS', N'Closed', N'Fix & Need Recheck', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A824009BCA1A AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (9, N'Master Branch', CAST(0x333D0B00 AS Date), N'Current Condition:
Gagal membuat data cabang baru. Saat menekan tombol save pada layar create branch sistem mengeluarkan respon "Internal Server Error".

Need:
user dapat membuat data cabang baru
Current Condition:
Gagal membuat data cabang baru. Saat menekan tombol save pada layar create branch sistem mengeluarkan respon "Internal Server Error".

Need:
user dapat membuat data cabang baru
', N'BDA', N'FMJ', N'H', N'BUGS', N'CLOSED', N'Fix & Need Recheck', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (10, N'Matriks Approval', CAST(0x333D0B00 AS Date), N'Current Condition:
Saat user menyimpan update  informasi detail matriks, seperti deskripsi dan status, informasi yang ditampilkan pada grid tabel tidak langsung terupdate.

Need:
Data yang ditampilkan pada grid akan langsung terupdate saat user mengubah informasi detail matriks.Current Condition:
Saat user menyimpan update  informasi detail matriks, seperti deskripsi dan status, informasi yang ditampilkan pada grid tabel tidak langsung terupdate.

Need:
Data yang ditampilkan pada grid akan langsung terupdate saat user mengubah informasi detail matriks.', N'BDA', N'FMJ', N'L', N'BUGS', N'CLOSED', N'Fix & Need Recheck', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (11, N'Master Level', CAST(0x333D0B00 AS Date), N'Current Condition:
Saat klik menu master level sistem menampilkan layar master organization

Need:
Seharusnya sistem menampilkan layar master levelCurrent Condition:
Saat klik menu master level sistem menampilkan layar master organization

Need:
Seharusnya sistem menampilkan layar master level', N'BDA', N'FMJ', N'H', N'BUGS', N'CLOSED', N'Fix & Need Recheck', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (12, N'Master Organization', CAST(0x333D0B00 AS Date), N'Current Condition:
Pada tabel daftar organisasi belum ditampilkan informasi Head dari organisasi tersebut.

Need:
Sistem menampilkan informasi head dari organisasi
Current Condition:
Pada tabel daftar organisasi belum ditampilkan informasi Head dari organisasi tersebut.

Need:
Sistem menampilkan informasi head dari organisasi
', N'BDA', N'FMJ', N'L', N'BUGS', N'CLOSED', N'Fix & Need Recheck', CAST(0x343D0B00 AS Date), CAST(0x343D0B00 AS Date), NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (13, N'Master Organization', CAST(0x333D0B00 AS Date), N'Current Condition:
Pada tabel daftar organisasi belum ditampilkan informasi Head dari organisasi tersebut.

Need:
Pada tabel daftar organisasi ditampilkan informasi Head dari organisasi tersebut.Current Condition:
Pada tabel daftar organisasi belum ditampilkan informasi Head dari organisasi tersebut.

Need:
Pada tabel daftar organisasi ditampilkan informasi Head dari organisasi tersebut.', N'BDA', N'FMJ', N'L', N'BUGS', N'CLOSED', N'Fix & Need Recheck', CAST(0x343D0B00 AS Date), CAST(0x343D0B00 AS Date), NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (14, N'Master Organization', CAST(0x333D0B00 AS Date), N'Current Condition:
Pada saat melakukan perubahan level organisasi (seperti dari department ke division, division ke directorate, atau sebaliknya) sistem tidak melakukan pengecekan data. Hal ini akan mengakibatkan kesalahan sistem sewaktu menjalankan mekanisme pencarian pic approver.

Need:
Sistem melakukan validasi saat user melakukan perubahan level. Berikut validasi yang dibutuhkan:
1. Jika organisasi tersebut berubah menjadi level dengan nomor sequence lebih besar maka sistem akan melakukan pengecekan apakah ada organisasi dengan nomor sequence yang sama atau lebih kecil dari dirinya menggunakan organisasi tersebut sebagai parent.
2. Jika ya, maka sistem akan menolak proses dan mengeluarakan pesan "Data can not be saved. There are other data that use this data as parents!"
3. Jika tidak, maka sistem akan memproses penyimpanan data.Current Condition:
Pada saat melakukan perubahan level organisasi (seperti dari department ke division, division ke directorate, atau sebaliknya) sistem tidak melakukan pengecekan data. Hal ini akan mengakibatkan kesalahan sistem sewaktu menjalankan mekanisme pencarian pic approver.

Need:
Sistem melakukan validasi saat user melakukan perubahan level. Berikut validasi yang dibutuhkan:
1. Jika organisasi tersebut berubah menjadi level dengan nomor sequence lebih besar maka sistem akan melakukan pengecekan apakah ada organisasi dengan nomor sequence yang sama atau lebih kecil dari dirinya menggunakan organisasi tersebut sebagai parent.
2. Jika ya, maka sistem akan menolak proses dan mengeluarakan pesan "Data can not be saved. There are other data that use this data as parents!"
3. Jika tidak, maka sistem akan memproses penyimpanan data.', N'BDA', N'FMJ', N'H', N'CHANGE REQUEST', N'Closed', N'On progress', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82000914F9D AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (15, N'Master PIC', CAST(0x333D0B00 AS Date), N'Current Condition:
Gagal saat membuat data master PIC baru. Saat klik tombol save muncul pesan "An Error Was Encountered. The action you have requested is not allowed."

Need:
User dapat membuat data master PIC Baru.Current Condition:
Gagal saat membuat data master PIC baru. Saat klik tombol save muncul pesan "An Error Was Encountered. The action you have requested is not allowed."

Need:
User dapat membuat data master PIC Baru.', N'BDA', N'FMJ', N'H', N'BUGS', N'CLOSED', N'Fix & Need Recheck', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (16, N'Master E-Form', CAST(0x333D0B00 AS Date), N'Current Condition:
Field Transaction Category pada layar Create E-Form tidak rapi.

Need:
Mohon dapat dirapikan posisinya.', N'BDA', N'FMJ', N'L', N'BUGS', N'CLOSED', N'Fix & Need Recheck', CAST(0x343D0B00 AS Date), CAST(0x343D0B00 AS Date), NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (17, N'Master Organization', CAST(0x343D0B00 AS Date), N'Current Condition:
Sistem tidak dapat menyimpan data organisasi jika tidak ada data head.

Need:
Field Head bersifat optional.', N'BDA', N'FMJ', N'M', N'BUGS', N'Closed', N'Fix & Need Recheck', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82000917C0E AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (18, N'Master Branch', CAST(0x343D0B00 AS Date), N'Current Condition:
Pada field province pilihan provinsi Bali ada dua.

Need:
Hapus salah satu data master untuk provinsi Bali', N'BDA', N'WHI', N'L', N'DATA MASTER', N'Closed', N'Fix & Need Recheck', CAST(0x7B3D0B00 AS Date), CAST(0x7E3D0B00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A824009C0528 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (19, N'Master E-Form', CAST(0x343D0B00 AS Date), N'Current Condition:
User dapat membuat dua template eform untuk satu tipe transaksi yang sama dan dua template tersebut memiliki status = ''Active''. Hal ini akan membuat error logic sistem saat menjalankan proses transaksi.

Need:
Untuk menghindari error logic pada proses transaksi perlu ditambahkan logic, sebagai berikut:
1. Ketika user:
    a. Membuat template e-form baru maka sistem akan melakukan pengecekan ke data base apakah pada DB sudah terdaftar eform dengan tipe transaksi yang sama dan memiliki status = ''Active'' atau ''Draft''.
    b. Mengubah status eform menjadi active maka sistem akan melakukan pengecekan ke data base apakah pada DB sudah terdaftar eform dengan tipe transaksi yang sama dan memiliki status = ''Active''.
    c. Mengubah tipe transaksi maka sistem akan melakukan pengecekan ke data base apakah pada DB sudah terdaftar eform dengan tipe transaksi yang sama dan memiliki status = ''Active'' atau ''Draft''.
2. Jika ada maka sistem akan menolak proses dan mengeluarkan pesan error "Data cannot be saved.
3. Jika tidak ada maka sistem akan menyimpan data yang diisi oleh user.', N'BDA', N'PPM', N'H', N'CHANGE REQUEST', N'OPEN', N'On progress', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (20, N'Master E-Form', CAST(0x343D0B00 AS Date), N'Current Condition:
Ketika user menambahkan tipe dokumen pada eform, berikut respon sistem:
1. Dokumen yang ditambahkan tidak langsung ditampilkan pada tabel daftar dokumen. User harus keluar dari layar E-form information kemudian masuk kembali ke layar tersebut untuk melihat dokumen yang ditambahkan.
2. Dokumen yang ditambahkan tersebut disimpan sebanyak 4 kali dalam satu proses. Sehingga sistem akan menampilkan 4 row dokumen dengan tipe yang sama.
3. Saat user menambahkan dokumen yang kedua sistem menolak proses penyimpanan data dan mengeluarkan pesan error "An Error Was Encountered.The action you have requested is not allowed." sebanyak empat kali.
4. Contoh saat menambahkan dokumen untuk eform dengan kode FCL00001.

Need:
1. Saat user menambahkan atau mengubah informasi dokumen maka informasi yang ditampilkan pada grid akan langsung ter-update.
2. Satu kali proses penambahan dokumen sistem hanya akan memproses satu kali penyimpanan. 
3. User dapat menambahkan lebih dari satu dokumen pada satu template eform.
4. Satu tipe dokumen hanya dapat ditambahkan satu kali pada satu template eform.', N'BDA', N'PPM', N'H', N'BUGS', N'Closed', N'Fix & Need Recheck', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'Satu dokumen masih dapat di add lebih dari satu kali', NULL, NULL, N'BDA', CAST(0x0000A82400A5DD0F AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (21, N'Master E-Form', CAST(0x343D0B00 AS Date), N'Current Condition:
Pada saat mengelola informasi dokumen yang perlu diupload pada E-From user dapat menginput jumlah maksimal lebih kecil dari jumlah minimal file yang harus diupload. Kondisi ini dapat menyebabkan error pada saat transaksi.

Need:
Sistem melakukan validasi pada saat proses penyimpanan informasi dokumen pada eform, bahwa nilai pada field maksimum tidak boleh lebih kecil dari jumlah minimum. Nilai yang dimasukkan juga tidak boleh lebih kecil dari 0.', N'BDA', N'PPM', N'H', N'CHANGE REQUEST', N'Open', N'On progress', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A8200105E493 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (22, N'Master E-Form', CAST(0x343D0B00 AS Date), N'Current Condition:
Berikut kondisi yang terjadi pada saat menambahkan template workflow:
1. Tanggal efektif bisa diisi lebih kecil dari tanggal hari ini.
2. Belum ada field "Source Transaction".
3. Data akan disimpan dengan default status Draft. Namum belum ada action atau tombol untuk mengaktifkan template workflow tersebut.

Need:
1. Tanggal efektif tidak boleh diisi lebih kecil dari tanggal hari ini.
2. Membutuhkan field "Source Transaction".
3. Butuh action atau tombol untuk mengaktifkan template workflow tersebut.', N'BDA', N'PPM', N'H', N'BUGS', N'Open', N'On progress', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A8200105D6C9 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (23, N'Master PIC', CAST(0x353D0B00 AS Date), N'Current Condition:
Jika kode pic diisi dengan huruf kecil maka sistem tetap menyimpan dengan huruf kecil.

Need:
Untuk standar, kode pic akan selalu tersimpan dengan huruf kapital. (Contoh seperti kode cabang)', N'BDA', N'KHU', N'L', N'CHANGE REQUEST', N'Retest', N'Fix & Need Recheck', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82500AE5EB1 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (24, N'Master Level', CAST(0x353D0B00 AS Date), N'Current Condition:
Informasi sequence number pada layar Create dan Edit Level Organization dapat diinput nilai negatif.

Need:
Angka yang paling kecil diinput = 0', N'BDA', N'KHU', N'L', N'CHANGE REQUEST', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A8200105C9BB AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (25, N'Create User', CAST(0x653D0B00 AS Date), N'Current Condition: 
Penulisan nama Employee hanya bisa huruf

Need :
Nama Employee ada yang menggunakan titik, contoh : Rudi S.Pakpahan, M. Febrianto', N'ASP', N'', N'L', N'BUGS', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A8200091BA5E AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (26, N'Create User', CAST(0x653D0B00 AS Date), N'Current Condition: 
Saat membuat user baru, nama user yang tidak otomatis muncul case contoh : NRF. User tersebut tidak ada nama panjangnya, setelah di submit dan akan di edit terlampir pesan error seperti (DataTables warning: table id=datatable-user-menu - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1)
', N'ASP', N'', N'L', N'BUGS', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A824009C7DCD AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (27, N'Action Stage', CAST(0x653D0B00 AS Date), N'Current Condition :
Jika user mengedit informasi is final action dari pilihan yes ke no field destination stage tidak muncul

Need:
Setelah Final Action dipilih NO, seharusnya Destination Stage langsung muncul tanpa harus di simpan terlebih dahulu.', N'ASP', N'KHU', NULL, N'BUGS', N'OPEN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (28, N'Master', CAST(0x653D0B00 AS Date), N'Current Condition : 
Tombol close di sebelah kiri dan tombol save di sebelah kanan

Need :
Sebaiknya tombol save di sebelah kiri dan tombol close di sebelah kanan', N'ASP', N'', N'L', N'CHANGE REQUEST', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82300ACC60E AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (29, N'Master', CAST(0x653D0B00 AS Date), N'Current Condition : 
Tidak ada tombol search

Need :
Diberikan tombol search untuk memudahkan saat pencarian ', N'ASP', N'PPM', N'L', N'CHANGE REQUEST', N'Closed', N'Sudah ditambahkan Search', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A824009CAB9F AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (30, N'Add Matrix PIC', CAST(0x653D0B00 AS Date), N'Current Condition : 
Saat add baru history penambahan sebelumnya masih muncul

Need :
Tampilan saat klik add itu per field kosong ', N'EPO', NULL, NULL, N'BUGS', N'OPEN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (31, N'Transaction Type', CAST(0x653D0B00 AS Date), N'Current Condition : 
Transaction code berurutan sesuai angka, bukan sesuai abjad pada bagian Description

Need :
Tampilan seperti Master Document berurutan deskripsi sesuai abjad', N'EPO', NULL, NULL, N'CHANGE REQUEST', N'OPEN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (32, N'Register-Form', CAST(0x653D0B00 AS Date), N'Current Condition : 
Kolom address di register-form kecil kolomnya

Need :
diperbesar untuk kolom addressnya', N'EPO', NULL, NULL, N'CHANGE REQUEST', N'DONE', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (33, N'Tanda Terima', CAST(0x653D0B00 AS Date), N'Current Condition : 
Belum ada logo ELI, untuk notes posisi agak ditengah

Need :
penambahan logo, notes posisi di sebelah kiri ', N'EPO', N'', N'L', N'CHANGE REQUEST', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82000A26C1B AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (34, N'Add Menu User Management', CAST(0x653D0B00 AS Date), N'Current Condition : 
Belum ada tanda select all pada tampilan

Need :
penambahan select all pada menu action ', N'EPO', NULL, NULL, N'CHANGE REQUEST', N'OPEN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (35, N'oustanding transaction', CAST(0x653D0B00 AS Date), N'Current Condition : 
outstanding transaction, informasi tidak terproses

Need :
', N'EPO', N'PPM', N'L', N'BUGS', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00B6B84B AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (36, N'Notfifikasi', CAST(0x653D0B00 AS Date), N'Current Condition : 
search by what?

Need :
Comment dialog diganti dengan "Please select the inquiry parameter (by policy information or policy holder information)? "
', N'EPO', NULL, N'L', N'CHANGE REQUEST', N'CLOSED', N'Fix & Need Recheck', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (37, N'Outstanding transaction', CAST(0x653D0B00 AS Date), N'Current Condition : 
saat take, di release tidak ada reason

Need :
ada reason saat release
', N'EPO', N'KHU', N'M', N'CHANGE REQUEST', N'Closed', N'Add field remarks pada saat user akan melakukan release task', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00B682C2 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (38, N'halaman awal', CAST(0x653D0B00 AS Date), N'Current Condition : 
tulisan saja

Need :
Dashboard diperbaharui dengan tampilan yang lebih menarik
', N'EPO', N'', N'M', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'PPM: Mohon dijelaskan secara detail tampilan yang menarik seperti apa.', NULL, NULL, N'PPM', CAST(0x0000A823009D5930 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (39, N'Signature', CAST(0x663D0B00 AS Date), N'Current Condition : 
nama, jam, tanggal

Need :
nama,  tanggal, jam
', N'EPO', NULL, N'L', N'CHANGE REQUEST', N'OPEN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (40, N'History ', CAST(0x663D0B00 AS Date), N'Current Condition : 
nama nanry di PIC muncul 2 kali 

Need :
diharapkan nama pic tidak tampil double 
', N'EPO', N'PPM', N'H', N'BUGS', N'Closed', N'Fix SP', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A82000894BE8 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (41, N'Reason', CAST(0x663D0B00 AS Date), N'Current Condition : 
reason belum bisa di tambah

Need :
master tabel reason
', N'EPO', N'KHU', N'H', N'CHANGE REQUEST', N'Retest', N'Fix & Need Recheck', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82500ACCC80 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (42, N'Master Action', CAST(0x663D0B00 AS Date), N'Current Condition : 
-

Need :
tambah flag wajib ada remarks
', N'EPO', NULL, N'M', N'CHANGE REQUEST', N'OPEN', N'Untuk Dev : Lihat detail layar di sheet 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (43, N'E-CCM history', CAST(0x663D0B00 AS Date), N'Current Condition : 
-

Need :
saat take dan approve ada nama user
', N'EPO', N'FMJ', N'L', N'CHANGE REQUEST', N'Closed', N'Add user ', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00B70923 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (44, N'Master Action', CAST(0x693D0B00 AS Date), N'Current Condition : 
-
Need :
ditambahkan flag untuk mengecek status transaksi di PL
', N'BDA', NULL, N'M', N'CHANGE REQUEST', N'OPEN', N'Untuk Dev : Lihat detail layar di sheet 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (45, N'Submit Task Transaction', CAST(0x693D0B00 AS Date), N'Current Condition : 
-
Need :
Ketika menginput informasi reference number sistem akan mengecek :
1. apakah sudah digunakan di transaksi edits yang lain? Jika sudah maka sistem akan menolak proses dan mengeluarkan pesan "Duplicate Reference No. with Register No [RegisterNumber EDITS]! "
2. apakah nomor transaksi sudah terdaftar di aplikasi core sistem? Jika sudah maka sistem akan menolak proses dan mengeluarkan pesan "Reference No. not found. Please input Register No. from Core System!"
', N'BDA', N'PPM', N'H', N'CHANGE REQUEST', N'Retest', N'Ubah stored procedure', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'Mohon diingatkan ke developer jika database dipindah ke production, karena isi stored procedure proc_submit_transaction harus diubah', NULL, NULL, N'PPM', CAST(0x0000A82400C3D4C3 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (46, N'Submit Task Transaction', CAST(0x693D0B00 AS Date), N'Current Condition : 
-
Need :
- Ketika submit sistem akan mengecek apakah action yang dipilih memiliki flag "Check transaction status from core system" = "yes".
- Jika ya maka sistem akan mengambil mengecek status transaksi pada aplikasi core berdasarkan nomor referensi yang pada register yang sedang diproses.
- Jika status transaksi core system termasuk ke kode status yang diperbolehkan (diambil dari field code transaction status pada maintain action) maka sistem akan memperboleh transaksi untuk lanjut ke tahap berikutnya.
- Jika tidak maka sistem akan menolak proses dan mengeluarkan pesan "Please process transaction on core system first!"
- Jika flag "check transaction status from core system" = "No" maka sistem akan memproses transaksi seperti keadaan sekarang.
', N'BDA', NULL, N'M', N'CHANGE REQUEST', N'CLOSED', N'Fix & Need Recheck', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (47, N'Submit Task Transaction', CAST(0x693D0B00 AS Date), N'Current Condition : 
-
Need :
- Ketika submit sistem akan mengecek apakah action yang dipilih memiliki flag "mandatory remarks" = "Yes".
- Jika ya maka field pada remarks bersifat wajib diisi oleh user. Jika user tidak mengisi field tersebut maka sistem akan menolak proses dan mengeluarkan pesan notifikasi "Please fill in the remarks field".', N'BDA', N'PPM', N'H', N'CHANGE REQUEST', N'Retest', N'Ubah stored procedure', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'PPM', CAST(0x0000A81E00914A38 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (48, N'Transaction Information _ Tab Document', CAST(0x693D0B00 AS Date), N'Current Condition : 
Tidak muncul dokumen surat kuasa.

Need :
Pada saat membuat transaksi dengan flag "Customer is Policy" = "No" sistem akan mengecek flag "Need ''Surat Kuasa'' if not policy holder" pada template eform yang digunakan.
- Jika flag tersebut bernilai = "Yes" maka sistem akan menambahkan tipe dokumen surat kuasa 
', N'BDA', N'PPM', N'M', N'REQUIREMENT', N'OPEN', N'Requirement ada di FS halaman 111 penjelasan Field Customer is Policy Holder pada halaman information Transaction.', NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (49, N'Halaman delegate untuk administrator', CAST(0x693D0B00 AS Date), N'Current Condition : 
-
Need :
Menambahkan layar delegate untuk administrator (BPM)
', N'BDA', N'KHU', N'M', N'CHANGE REQUEST', N'Closed', N'Create New Menu', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'Untuk Dev : Lihat detail layar di sheet 2.', NULL, NULL, N'BDA', CAST(0x0000A81C00B6F13D AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (50, N'Menu Register Transaction', CAST(0x693D0B00 AS Date), N'Current Condition : 
-
Need :
Ubah nama menu Register Transaction menjadi Register Walk In Transaction
', N'BDA', N'', N'L', N'CHANGE REQUEST', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A820009465AF AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (51, N'Menu Register Transaction', CAST(0x693D0B00 AS Date), N'Current Condition : 
-
Need :
Menambah satu menu Register Transaction. Menu ini akan dijadikan menu register transaksi untuk nasabah yang mengirimkan dokumen transaksi melalui email ataupun surat. Untuk data transaksi yang diregister melalui layar ini tidak perlu tanda tangan dan photo customer sebagai validasi. Namun sistem akan menyediakan satu tipe dokumen, yaitu "Transaction Form" sebagai mandatori dokumen yang wajib diisi oleh user.
', N'BDA', N'', N'H', N'CHANGE REQUEST', N'Retest', N'Untuk Dev: case ini harus menambahkan tipe sumber transaksi pada workflow yang digunakan untuk memilih workflow yang akan digunakan pada saat proses. Untuk penambahan kolom tersebut sudah dijelaskan pada FSD. (lihat bagian 4.1.1.11.3.10.3)', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82300AD0296 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (52, N'Form Non Tecnical', CAST(0x6B3D0B00 AS Date), N'Current Condition : -


Need :
Take out (Delete) Change Address dalam form Non Technical ', N'ASP', N'', N'L', N'CHANGE REQUEST', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82000A103B1 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (53, N'Tanda Terima ', CAST(0x6B3D0B00 AS Date), N'Current Condition : 
Jenis Transaksi : (berasal dari menu Transaction Type/E-Form)
Contohnya : 
Jenis Transaksi : Reinstatement

Need :
Jenis Transaksi :  (berasal dari menu Transaction Type/E-Form) - Type pada form 
Contohnya:
Jenis Transaksi : Reinstatement - Rider Reinstatement

Form yang terdapat type nya adalah form: 
1. Benefit Withdrawn/Maturity
2. Cancel Form Inception/Surrender
3. Alteration Technical
4. Alteration Non Technical
5. Reinstatement
', N'EPO', N'', N'L', N'CHANGE REQUEST', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82000A295C8 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (54, N'Tanda Terima ', CAST(0x6B3D0B00 AS Date), N'Current Condition : 
PT EQUITY LIFE INDONESIA
elise : Jabodetabek 


Need :
Description 
Address
City - Province 

Contoh:
Kantor Pelayanan Bandung
Graha Equity Life, Jl. Ir.H. Juanda (Dago) No.130C
Kabupaten Bandung - Jawa Barat', N'EPO', N'', N'L', N'CHANGE REQUEST', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82000A2CE20 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (55, N'Tanda Terima', CAST(0x6B3D0B00 AS Date), N'Current Condition : 
Dicetak oleh : PPM [13/10/2017 16:15:51]


Need :
PPM [13/10/2017 16:15:51]', N'EPO', N'', N'L', N'CHANGE REQUEST', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82000A2DB7A AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (56, N'Master Workflow', CAST(0x6C3D0B00 AS Date), N'Current Condition : 
Bugs saat mengisi add stage workflow untuk bagian PIC is Requester, pilihan YES tetapi muncul pilihan PIC. Tidak bisa save tanpa memilih PIC (walupun pilihan PIC is Requester YES)

Need:
Bila pilihan PIC is Requester YES, harusnya pilihan PIC tidak muncul', N'ASP', N'', N'L', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00C29619 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (57, N'Form Technical', CAST(0x6C3D0B00 AS Date), N'Current Condition : 
-

Need:
Take out (Delete) Change Premium Mode, Decrease Face Amount, Delete Rider, Fund switching dalam form Technical ', N'EPO', N'', N'M', N'CHANGE REQUEST', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82000A11290 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (58, N'Master Organization', CAST(0x6D3D0B00 AS Date), N'Current Condition : 
Penulisan nama di bagian Head letters only

Need:
Seharusnya bisa penggunaan karakter seperti . , 
contoh : Budi Sulistyowati, AAIJ, ICCSO', N'ASP', N'', N'M', N'BUGS', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82000949154 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (59, N'Workflow Setting', CAST(0x6D3D0B00 AS Date), N'Current Condition : 
Saat penambahan workflow hanya 1 kali tapi yang muncul di tampilan 10
contoh : Workflow pada Change Single Top Up

Need:
Seharusnya saat penambahan 1 kali, muncul tampilan juga 1 kali untuk workflow yang ditambahkan', N'EPO', N'PPM', N'H', N'BUGS', N'Retest', N'Fix javascript', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'BDA:
Cara Repro :
1. Klik Menu Master E- Form
2. Edit Salah satu E-form
3. Keluar dengan tombol closed
4. Edit lagi salah satu E-Form
5. Masuk tab worklflow
6. Klik tombol Add save 
7. Workflow akan tambah dua kali', NULL, NULL, N'PPM', CAST(0x0000A81D010070A4 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (60, N'Eform Documents Setting', CAST(0x6D3D0B00 AS Date), N'Current Condition : 
Saat penambahan documents hingga melebihi 10 documents, semua documents tampil pada 1 halaman, stuck tidak dapat di scroll ke atas atau kebawah
contoh : eform Jet Claim Death 

Need:
Seharusnya saat penambahan melebihi 10 documents, sisanya terdapat pada halaman berikutnya, bisa di scroll ke atas atau ke bawah
contoh:
25 documents
page 1 = 10 Documents, page 2 : 10 documents, page 3 : 5 documents ', N'EPO', N'PPM', N'L', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00B74A65 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (61, N'Eform Documents Setting', CAST(0x6D3D0B00 AS Date), N'Current Condition : 
-

Need:
Add Document, di Document Type tambahkan kolom untuk search document untuk memudahkan menambahkan document di drop down nya', N'EPO', N'', N'L', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00C1BBE3 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (62, N'Register Transaction', CAST(0x703D0B00 AS Date), N'Current Condition : 
Saat mencari informasi polis, tidak bisa bila menekan tombol enter. Harus menggunakan tombol search.

Need:
Bisa menggunakan enter saat mencari informasi polis', N'ASP', N'', N'L', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82300F454B0 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (63, N'Layar Task Transaction', CAST(0x703D0B00 AS Date), N'Current Condition : 
Sistem tidak bisa disubmit jika user harus menginput reason meskipun user sudah memilih reason

Need:
Transaksi bisa disubmit', N'ASP', N'WHI', N'H', N'BUGS', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82000F016AB AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (64, N'Master Transaction Type', CAST(0x703D0B00 AS Date), N'Current Condition : 
-
Need:
Ditambahkan field untuk deskripsi yang akan ditampilkan pada tanda terima', N'ASP', N'', N'L', N'CHANGE REQUEST', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'Double dengan nomor 65', NULL, NULL, N'BDA', CAST(0x0000A82000889444 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (65, N'Master Transaction Type', CAST(0x703D0B00 AS Date), N'Current Condition : 
-

Need:
Ditambahkan field untuk deskripsi yang akan ditampilkan pada tanda terima', N'ASP', N'', N'L', N'CHANGE REQUEST', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A82000A2EBA4 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (66, N'Layar Informasi Transaksi', CAST(0x703D0B00 AS Date), N'Current Condition : 
Pada saat memasukan amount tidak ada (. dan ,)

Need:
Semua field amount pada layar transaksi ditambahkan (. dan ,) untuk memudahkan user (10.000.000)', N'ASP', N'', N'L', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00B9CA91 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (67, N'Layar Transaction Information', CAST(0x703D0B00 AS Date), N'Current Condition : 
Semaua field amount pada layar transaksi mandatory * 

Need:
Semaua field amount layar pada  transaksi Tidak mandatory', N'EPO', N'', N'L', N'CHANGE REQUEST', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'FMJ', CAST(0x0000A820010356E2 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (68, N'Form Withdrawl Fund', CAST(0x703D0B00 AS Date), N'Current Condition : 
Pada saat memasukan amount tidak ada (.)

Need:
Ditambahkan untuk memudahkan user (10.000.000)', N'ASP', N'', N'L', N'Change Request', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A81C00B912FD AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (69, N'Alteration Type', CAST(0x703D0B00 AS Date), N'Current Condition : 
Alteration Type masih ada pilihan nya

Need:
Harus nya tidak ada pilihan alteration type', N'ASP', N'', N'L', N'BUGS', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'Confirm ASP 20171030 diclose', NULL, NULL, N'BDA', CAST(0x0000A81C00BF2EA7 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (70, N'Reinstatment', CAST(0x703D0B00 AS Date), N'Current Condition : 
Choice pada Form yang terdapat type: 
1. Benefit Withdrawn/Maturity
2. Cancel Form Inception/Surrender
3. Alteration Technical
4. Alteration Non Technical
5. Reinstatement

Tidak tampil pada user berikutnya (next PIC) contoh : Requester submit di Head Requester tidak tampil

Need:
Choice harusnya tampil pada next PIC', N'ASP', N'', N'L', N'BUGS', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'BDA', CAST(0x0000A824009FE9CE AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (71, N'Layar Task Transaction Information', CAST(0x703D0B00 AS Date), N'Current Condition : 
Field Reference Number terkadang tidak tampil saat registrasi, padahal pilihan pada workflow sudah di YES

Need:
Refernce number tampil sesuai workflow', N'ASP', N'', N'L', N'BUGS', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', NULL, NULL, N'WHI', CAST(0x0000A82000F095A5 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (77, N'Layar Document Transaction', CAST(0x713D0B00 AS Date), N'Current Condition : 
Checklist di document receive sudah di tick mark, saat di save hilang tidak ada tick mark

Need:
Saat di save atau di refresh seharusnya tidak hilang tick mark nya"
', N'EPO', N'PPM', N'M', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81C00C3E0E0 AS DateTime), N'BDA', CAST(0x0000A81C00C3E0E0 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (78, N'Transaction Form', CAST(0x713D0B00 AS Date), N'"Current Condition : 
Requester input data pada form, sudah di simpan >> berhasil.
Stage kemudian di Head Requester semua data isian di form hilang 
contoh testing transaksi klaim user AFI nomor registrasi 171000109:
- event date hilang sebelumnya sudah diisi oleh user
- Allocatin of funds/benefits  hilang sebelumnya sudah diisi oleh user
- choice pada customer is policy holder hilang sebelumnya sudah diisi oleh user


Need:
di stage head requester seharusnya ada data isian dari requester"
', N'EPO', N'WHI', N'H', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81D00C1856F AS DateTime), N'FMJ', CAST(0x0000A82300F48E7D AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (79, N'Menu Compliance', CAST(0x733D0B00 AS Date), N'"Current Condition : 
-


Need:
Compliance (internal audit) dapat mencari dokumen transaksi secara random, kemudian dapat memberikan keterangan terhadap dokumen apakah sudah sesuai dengan aturan atau masih terdapat kekurangan"
', N'EPO', N'', N'M', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00A74D4C AS DateTime), N'BDA', CAST(0x0000A81E00A74D4C AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (80, N'Document Transaction', CAST(0x733D0B00 AS Date), N'"Current Condition : 
hanya jpeg


Need:
user dapat melakukan input document selain format jpeg, "
', N'RIS', N'', N'M', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00A76D22 AS DateTime), N'BDA', CAST(0x0000A81E00A7AB03 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (81, N'Tanda Terima', CAST(0x733D0B00 AS Date), N'"Current Condition : 
pdf (hanya print)


Need:
user dapat memilih memberikan notifikasi berupa email tanda terima atau pdf (print)"
', N'RIS', N'', N'M', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00A79888 AS DateTime), N'BDA', CAST(0x0000A81E00A79888 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (82, N'Customer is Policy Holder (Form)', CAST(0x743D0B00 AS Date), N'"Current Condition : 
Customer is Policy Holder dalam form masih bisa dipilih 


Need:
Harusnya otomatis mengikuti pilihan saat register awal"
', N'ASP', N'', N'H', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00A8D3C5 AS DateTime), N'BDA', CAST(0x0000A81E00A8D3C5 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (83, N'History Transaksi', CAST(0x743D0B00 AS Date), N'"Current Condition : 
Saat workflow dijalankan pada need dispensation form dan dikembalikan ke requester (document revision) saat akan disubmit oleh Head Elise, notifikasi ke mas darwindo tidak ada di history, padahal saat pertama dapat notifikasi


Need:
Notifikasi harusnya ada ke user daw (darwindo)"
', N'ASP', N'BDA', N'M', N'BUGS', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x793D0B00 AS Date), N'Sudah sesuai dengan spesifikasi, dimana task akan kembali ke PIC yang mengambil task tersebut', N'BDA', CAST(0x0000A81E00A9385B AS DateTime), N'BDA', CAST(0x0000A81E00A9385B AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (84, N'Outstanding Document Transaction', CAST(0x933D0B00 AS Date), N'"Current Condition : 
User pilih salah satu document “take”, user ingin kembali ke halaman awal oustanding document transaction kemudian keluar notif (DataTables warning table id=datable-ajax error. (BUGS)

Need:
Tidak notif error, minimal ada notif contoh: harus relase dari task tersebut"
', N'ASP', N'', N'L', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00AA7B80 AS DateTime), N'BDA', CAST(0x0000A81E00AA7B80 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (85, N'Form Claim Death', CAST(0x933D0B00 AS Date), N'"Current Condition : 
Saat sudah diisi lengkap di halaman tsb (form claim death) kemudian di save keluar notifikasi internal server error, data yang sudah di input di Transfer to Bank Account tidak tersimpan

Need:
Data tersimpan"
', N'ASP', N'', N'M', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00AAB37B AS DateTime), N'BDA', CAST(0x0000A81E00AAB37B AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (86, N'Form Claim Death', CAST(0x933D0B00 AS Date), N'"Current Condition : 
Ketika user ingin melakukan edit informasi pada layar form information saat menekan tombol save keluar  “ Error” You havent take customer photo , padahal photo sudah di take

Need:
Data tersimpan tanpa ada pesan error"
', N'ASP', N'', N'H', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00AB3FEB AS DateTime), N'BDA', CAST(0x0000A81E00AB3FEB AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (87, N'Form Claim Death', CAST(0x933D0B00 AS Date), N'"Current Condition : 
Di halaman form (Form Claim Death) user tidak simpan, namun tetap masih bisa terproses setelah klik action di halaman task information

Need:
Bila data tidak di simpan user, task tidak bisa terproses"
', N'ASP', N'', N'H', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81E00AB64E2 AS DateTime), N'BDA', CAST(0x0000A81E00AB64E2 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (88, N'Master Workflow Template', CAST(0x773D0B00 AS Date), N'"Current Condition : 
-

Need:
Ditambahkan menu copy workflow untuk memudahkan penambahan workflow dengan alur yang sama"
', N'EPO', N'', N'M', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81F00E4DF50 AS DateTime), N'BDA', CAST(0x0000A81F00E4DF50 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (89, N'Inquiry History', CAST(0x593D0B00 AS Date), N'"Current Condition : 
-

Need:
User dapat melihat transaksi yang sudah diproses di aplikasi EDITS. Sistem dapat membatasi data yang dilihat berdasarkan kategori transaksi"
', N'RIS', N'', N'M', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81F00E55D32 AS DateTime), N'BDA', CAST(0x0000A81F00E55D32 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (90, N'Walk in Transaction', CAST(0x793D0B00 AS Date), N'"Current Condition : 
Buka Menu pada 
- Walk in Transaction
- Pilih Claim
- Tidak ada Jet Claim Death
Padahal di Transaction Type sudah active, dan e-form juga sudah active untuk Jet Claim Death tersebut.


Need:
Buka Menu pada 
- Walk in Transaction
- Pilih Claim
- Ada Jet Claim Death
Transaction Type dan e-form active untuk Jet Claim Death tersebut.
"
', N'EPO', N'', N'H', N'BUGS', N'Closed', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81F00E5BC77 AS DateTime), N'WHI', CAST(0x0000A82300AE98BC AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (91, N'Tanda Terima', CAST(0x7A3D0B00 AS Date), N'"Current Condition : 
Tanda Terima
- Draft Tanda terima bagian bawah yang sudah diserahkan melalui email
- ""Jika dalam 7 hari dana belum masuk ke rekening, Anda dapat menghubungi contact center kami.""
- Belum ada maintenance untuk transaksi yang berupa pengeluaran uang dan non pengeluaran


Need:
Tanda Terima
- Draft Tanda terima bagian bawah yang sudah diserahkan melalui email
- ""Jika dalam 7 hari dana belum masuk ke rekening, Anda dapat menghubungi contact center kami.""
- Ada maintenance untuk transaksi yang berupa pengeluaran uang dan non pengeluaran
- Untuk waktunya (dalam berapa hari di keterangan tsb) bisa di maintenance misal menjadi 7 hari dan 14 hari 
"
', N'EPO', N'', N'M', N'CHANGE REQUEST', N'Retest', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81F00E62FEB AS DateTime), N'FMJ', CAST(0x0000A82000A2FDC5 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (92, N'Master E-Form', CAST(0x7A3D0B00 AS Date), N'"Current Condition : 
form code semua sama


Need:
seharusnya otomatis berurutan angka dan berbeda
"
', N'EPO', N'PPM', N'H', N'BUGS', N'Retest', N'Perbaikan di trigger tabel. Sebelumnya adalah per tipe transaksi, saat ini telah diubah per kategori transaksi', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A81F00E64F26 AS DateTime), N'PPM', CAST(0x0000A82001165233 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (93, N'Master Workflow ', CAST(0x783D0B00 AS Date), N'Current Condition:
Informasi destination stage pada list action tidak sesuai dengan informasi destination stage yang sesungguhnya.

Need:
Seharusnya informasi destination stage susuai', N'EPO', N'', N'H', N'BUGS', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A82000F5C316 AS DateTime), N'BDA', CAST(0x0000A82000F623BE AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (94, N'All', CAST(0x7B3D0B00 AS Date), N'Semua menu yang ada pilihan Status (Draft, Active, Inactive), perlu dibuat rule yaitu saat create new statusnya adalah Draft. Kemudian dari Draft bisa diubah jadi Active. Status Active hanya bisa diubah menjadi Inactive (tidak bisa diubah ke Draft), dst.

Usulan solusi:
Agar tidak hardcode, pada tabel m_status dibuat kolom baru berisi status next yg diperbolehkan.
Pertanyaannya: jika status next yg diperbolehkan lebih dari 1, apakah diinput di satu kolom?', N'PPM', N'', N'L', N'CHANGE REQUEST', N'Open', N'', CAST(0x823D0B00 AS Date), CAST(0x5B950A00 AS Date), N'', N'PPM', CAST(0x0000A82001206743 AS DateTime), N'PPM', CAST(0x0000A82001206743 AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (95, N'Register Transaction', CAST(0x713D0B00 AS Date), N'"Current Condition : 
Saat CUSTOMER IS POLICY HOLDER DI PILIH NO, muncul nama otomatis policy holder


Need:
Seharusnya ketika dipilih NO pada CUSTOMER IS POLICY HOLDER tidak muncul nama Customer (seharusnya blank)"
', N'EPO', N'', N'L', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'BDA', CAST(0x0000A82400A0C89D AS DateTime), N'BDA', CAST(0x0000A82400A0C89D AS DateTime))
INSERT [dbo].[x_dev_sit] ([No], [Module], [Date_Raised], [Issue_Descriptions], [Raised_By], [PIC], [Priority], [Type], [Status], [Resolution], [Target_Date], [Closed_Date], [Comment], [created_by], [created_date], [modified_by], [modified_date]) VALUES (96, N'Transaction', CAST(0x7F3D0B00 AS Date), N'ToDo:
Saat submit, lakukan pengecekan untuk seting:
- Check Transaction Status in Core System
- Code Transaction Status', N'PPM', N'PPM', N'L', N'CHANGE REQUEST', N'Open', N'', CAST(0x5B950A00 AS Date), CAST(0x5B950A00 AS Date), N'', N'PPM', CAST(0x0000A82400C64382 AS DateTime), N'PPM', CAST(0x0000A82400C64382 AS DateTime))
SET IDENTITY_INSERT [dbo].[x_dev_sit] OFF
/****** Object:  Table [dbo].[user_menu_access]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[user_menu_access](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[user_id] [varchar](3) NOT NULL,
	[menu_id] [int] NOT NULL,
	[group_id] [int] NULL,
	[is_exclude] [tinyint] NOT NULL,
	[created_by] [varchar](3) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](3) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_province]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_province](
	[province_id] [int] IDENTITY(1,1) NOT NULL,
	[province_code] [char](6) NULL,
	[province_name] [varchar](30) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_provin__08DCB60F5ECA0095] PRIMARY KEY CLUSTERED 
(
	[province_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_m_province_code_unq] UNIQUE NONCLUSTERED 
(
	[province_code] 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
CREATE NONCLUSTERED INDEX [IX_m_province] ON [dbo].[m_province] 
(
	[province_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_province_name_idx] ON [dbo].[m_province] 
(
	[province_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_province] ON
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'JA    ', N'Jakarta', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'BA    ', N'Bali Test', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'1')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'PRV001', N'Bali', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'PRV002', N'Bangka Belitung', N'FMJ', CAST(0x0000A7BA00000000 AS DateTime), N'FMJ', CAST(0x0000A7BA00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'PRV003', N'Banten', N'FMJ', CAST(0x0000A7BB00000000 AS DateTime), N'FMJ', CAST(0x0000A7BB00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'PRV004', N'Bengkulu', N'FMJ', CAST(0x0000A7BC00000000 AS DateTime), N'FMJ', CAST(0x0000A7BC00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'PRV005', N'DI Yogyakarta', N'FMJ', CAST(0x0000A7BD00000000 AS DateTime), N'FMJ', CAST(0x0000A7BD00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, N'PRV006', N'DKI Jakarta', N'FMJ', CAST(0x0000A7BE00000000 AS DateTime), N'FMJ', CAST(0x0000A7BE00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'PRV007', N'Gorontalo', N'FMJ', CAST(0x0000A7BF00000000 AS DateTime), N'FMJ', CAST(0x0000A7BF00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'PRV008', N'Jambi', N'FMJ', CAST(0x0000A7C000000000 AS DateTime), N'FMJ', CAST(0x0000A7C000000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, N'PRV009', N'Jawa Barat', N'FMJ', CAST(0x0000A7C100000000 AS DateTime), N'FMJ', CAST(0x0000A7C100000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'PRV010', N'Jawa Tengah', N'FMJ', CAST(0x0000A7C200000000 AS DateTime), N'FMJ', CAST(0x0000A7C200000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, N'PRV011', N'Jawa Timur', N'FMJ', CAST(0x0000A7C300000000 AS DateTime), N'FMJ', CAST(0x0000A7C300000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'PRV012', N'Kalimantan Barat', N'FMJ', CAST(0x0000A7C400000000 AS DateTime), N'FMJ', CAST(0x0000A7C400000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'PRV013', N'Kalimantan Selatan', N'FMJ', CAST(0x0000A7C500000000 AS DateTime), N'FMJ', CAST(0x0000A7C500000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'PRV014', N'Kalimantan Tengah', N'FMJ', CAST(0x0000A7C600000000 AS DateTime), N'FMJ', CAST(0x0000A7C600000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'PRV015', N'Kalimantan Timur', N'FMJ', CAST(0x0000A7C700000000 AS DateTime), N'FMJ', CAST(0x0000A7C700000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, N'PRV016', N'Kalimantan Utara', N'FMJ', CAST(0x0000A7C800000000 AS DateTime), N'FMJ', CAST(0x0000A7C800000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'PRV017', N'Kepulauan Riau', N'FMJ', CAST(0x0000A7C900000000 AS DateTime), N'FMJ', CAST(0x0000A7C900000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, N'PRV018', N'Lampung', N'FMJ', CAST(0x0000A7CA00000000 AS DateTime), N'FMJ', CAST(0x0000A7CA00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'PRV019', N'Maluku', N'FMJ', CAST(0x0000A7CB00000000 AS DateTime), N'FMJ', CAST(0x0000A7CB00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, N'PRV020', N'Maluku Utara', N'FMJ', CAST(0x0000A7CC00000000 AS DateTime), N'FMJ', CAST(0x0000A7CC00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, N'PRV021', N'Nanggroe Aceh Darussalam (NAD)', N'FMJ', CAST(0x0000A7CD00000000 AS DateTime), N'FMJ', CAST(0x0000A7CD00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'PRV022', N'Nusa Tenggara Barat (NTB)', N'FMJ', CAST(0x0000A7CE00000000 AS DateTime), N'FMJ', CAST(0x0000A7CE00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'PRV023', N'Nusa Tenggara Timur (NTT)', N'FMJ', CAST(0x0000A7CF00000000 AS DateTime), N'FMJ', CAST(0x0000A7CF00000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, N'PRV024', N'Papua', N'FMJ', CAST(0x0000A7D000000000 AS DateTime), N'FMJ', CAST(0x0000A7D000000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, N'PRV025', N'Papua Barat', N'FMJ', CAST(0x0000A7D100000000 AS DateTime), N'FMJ', CAST(0x0000A7D100000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, N'PRV026', N'Riau', N'FMJ', CAST(0x0000A7D200000000 AS DateTime), N'FMJ', CAST(0x0000A7D200000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, N'PRV027', N'Sulawesi Barat', N'FMJ', CAST(0x0000A7D300000000 AS DateTime), N'FMJ', CAST(0x0000A7D300000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, N'PRV028', N'Sulawesi Selatan', N'FMJ', CAST(0x0000A7D400000000 AS DateTime), N'FMJ', CAST(0x0000A7D400000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, N'PRV029', N'Sulawesi Tengah', N'FMJ', CAST(0x0000A7D500000000 AS DateTime), N'FMJ', CAST(0x0000A7D500000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, N'PRV030', N'Sulawesi Tenggara', N'FMJ', CAST(0x0000A7D600000000 AS DateTime), N'FMJ', CAST(0x0000A7D600000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, N'PRV031', N'Sulawesi Utara', N'FMJ', CAST(0x0000A7D700000000 AS DateTime), N'FMJ', CAST(0x0000A7D700000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, N'PRV032', N'Sumatera Barat', N'FMJ', CAST(0x0000A7D800000000 AS DateTime), N'FMJ', CAST(0x0000A7D800000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, N'PRV033', N'Sumatera Selatan', N'FMJ', CAST(0x0000A7D900000000 AS DateTime), N'FMJ', CAST(0x0000A7D900000000 AS DateTime), N'0')
INSERT [dbo].[m_province] ([province_id], [province_code], [province_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, N'PRV034', N'Sumatera Utara', N'FMJ', CAST(0x0000A7DA00000000 AS DateTime), N'FMJ', CAST(0x0000A7DA00000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_province] OFF
/****** Object:  Table [dbo].[m_menu_category]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_menu_category](
	[menu_category_id] [int] IDENTITY(1,1) NOT NULL,
	[description] [varchar](160) NULL,
	[created_by] [varchar](3) NULL,
	[created_date] [datetime] NULL,
	[modified_by] [varchar](3) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NULL,
 CONSTRAINT [PK_m_menu_category] PRIMARY KEY CLUSTERED 
(
	[menu_category_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_menu_category] ON
INSERT [dbo].[m_menu_category] ([menu_category_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Master', N'WHI', CAST(0x0000A79100000000 AS DateTime), N'WHI', CAST(0x0000A79100000000 AS DateTime), 0)
INSERT [dbo].[m_menu_category] ([menu_category_id], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'Primary', N'WHI', CAST(0x0000A79100000000 AS DateTime), N'WHI', CAST(0x0000A79100000000 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_menu_category] OFF
/****** Object:  Table [dbo].[m_component_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_component_type](
	[component_type_id] [bigint] IDENTITY(1,1) NOT NULL,
	[component_type_code] [varchar](8) NOT NULL,
	[description] [varchar](50) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_compon__B2C43C5D3C3FDE67] PRIMARY KEY CLUSTERED 
(
	[component_type_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[t_transaction_form]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[t_transaction_form](
	[transaction_form_id] [bigint] IDENTITY(1,1) NOT NULL,
	[transaction_id] [bigint] NOT NULL,
	[register_number] [varchar](9) NOT NULL,
	[transaction_sub_type] [int] NULL,
	[currency] [varchar](10) NULL,
	[money_loans] [varchar](50) NULL,
	[term] [varchar](50) NULL,
	[installment_date] [date] NULL,
	[identity_date] [datetime] NULL,
	[amount] [varchar](30) NULL,
	[submission_date] [datetime] NULL,
	[source_of_fund_id] [int] NULL,
	[gross_income_id] [int] NULL,
	[gross_income_year_id] [int] NULL,
	[is_settlement] [tinyint] NULL,
	[settlement_name] [varchar](50) NULL,
	[policy_no] [varchar](50) NULL,
	[is_transfer_bank] [tinyint] NULL,
	[in_currency] [varchar](50) NULL,
	[beneficiary_name] [varchar](100) NULL,
	[bank_name] [varchar](100) NULL,
	[branch] [varchar](100) NULL,
	[account_no] [varchar](50) NULL,
	[transfer_amount] [varchar](50) NULL,
	[amount_of_drawn] [varchar](50) NULL,
	[amount_of_benefits] [varchar](50) NULL,
	[remarks] [varchar](255) NULL,
	[reinstatement_type] [int] NULL,
	[m_alteration_type_id] [int] NULL,
	[event_date] [date] NULL,
	[settlement_policy_no] [varchar](160) NULL,
	[is_cancel_from_inception] [tinyint] NULL,
	[is_surrender] [tinyint] NULL,
	[is_benefit_type] [tinyint] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK__t_transa__F57D76D86E2C3FB6] PRIMARY KEY CLUSTERED 
(
	[transaction_form_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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_form_trans_id] ON [dbo].[t_transaction_form] 
(
	[transaction_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_t_transaction_form_transaction_id] ON [dbo].[t_transaction_form] 
(
	[transaction_id] ASC,
	[is_delete] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Trigger [log_m_transaction_form_template_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[log_m_transaction_form_template_Update]      
ON [dbo].[log_m_transaction_form_template]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_form_template_id]) THEN '[transaction_form_template_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([filename]) THEN '[filename]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END + 
CASE WHEN UPDATE([AuditDataState]) THEN '[AuditDataState]-' ELSE '' END + 
CASE WHEN UPDATE([AuditDMLAction]) THEN '[AuditDMLAction]-' ELSE '' END + 
CASE WHEN UPDATE([AuditUser]) THEN '[AuditUser]-' ELSE '' END + 
CASE WHEN UPDATE([AuditDateTime]) THEN '[AuditDateTime]-' ELSE '' END + 
CASE WHEN UPDATE([UpdateColumns]) THEN '[UpdateColumns]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_log_m_transaction_form_template]
([transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],[AuditDataState],[AuditDMLAction],[AuditUser],[AuditDateTime],[UpdateColumns],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],[AuditDataState],[AuditDMLAction],[AuditUser],[AuditDateTime],[UpdateColumns],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_log_m_transaction_form_template]
([transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],[AuditDataState],[AuditDMLAction],[AuditUser],[AuditDateTime],[UpdateColumns],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],[AuditDataState],[AuditDMLAction],[AuditUser],[AuditDateTime],[UpdateColumns],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [log_m_transaction_form_template_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[log_m_transaction_form_template_Delete]    
ON [dbo].[log_m_transaction_form_template]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_log_m_transaction_form_template]
([transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],[AuditDataState],[AuditDMLAction],[AuditUser],[AuditDateTime],[UpdateColumns],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],[AuditDataState],[AuditDMLAction],[AuditUser],[AuditDateTime],[UpdateColumns],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[s_action_type]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[s_action_type](
	[id_action_type] [tinyint] NOT NULL,
	[description] [varchar](40) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK_s_action_type] PRIMARY KEY CLUSTERED 
(
	[id_action_type] 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
CREATE NONCLUSTERED INDEX [IX_s_action_type_desc] ON [dbo].[s_action_type] 
(
	[id_action_type] ASC,
	[description] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'view', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'insert', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'update', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'delete', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'proc', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'scalar_func', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'tabular_func', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
INSERT [dbo].[s_action_type] ([id_action_type], [description], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'custom_file', N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'PPM', CAST(0x0000A77800A6FC4C AS DateTime), N'0')
/****** Object:  Table [dbo].[s_m_log_type]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[s_m_log_type](
	[log_type_id] [tinyint] NOT NULL,
	[icon] [varchar](20) NULL,
	[description] [varchar](20) NULL,
 CONSTRAINT [PK_s_m_log_type] PRIMARY KEY CLUSTERED 
(
	[log_type_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]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[s_m_log_type] ([log_type_id], [icon], [description]) VALUES (1, NULL, N'Request')
INSERT [dbo].[s_m_log_type] ([log_type_id], [icon], [description]) VALUES (2, NULL, N'Response')
/****** Object:  Table [dbo].[m_document]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_document](
	[document_id] [int] IDENTITY(1,1) NOT NULL,
	[document_code] [varchar](8) NULL,
	[description] [varchar](200) NOT NULL,
	[remarks] [varchar](255) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_docume__9666E8AC2CFD9AD7] PRIMARY KEY CLUSTERED 
(
	[document_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_document] ON
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'D00001', N'Kartu Tanda Penduduk', NULL, N'KHU', CAST(0x0000A6EE00000000 AS DateTime), N'KHU', CAST(0x0000A6EE00000000 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'D00002', N'Kartu Keluarga', N'', N'KHU', CAST(0x0000A7AC00C0325A AS DateTime), N'KHU', CAST(0x0000A7AC00C0325A AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'D00003', N'Bukti Transfer Premi', N'', N'KHU', CAST(0x0000A7AC00C05AE4 AS DateTime), N'KHU', CAST(0x0000A7AC00EBEE50 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'D00004', N'NPWP', N'', N'KHU', CAST(0x0000A7AC00DD5653 AS DateTime), N'KHU', CAST(0x0000A7AC00EC0565 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, N'D00005', N'Paspor', N'Pasport jiwa WNA', N'FMJ', CAST(0x0000A7B800BD1596 AS DateTime), N'FMJ', CAST(0x0000A7B800BD1596 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (329, N'D00006', N'Fotokopi Identitas Diri Pemegang Polis', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (330, N'D00007', N'Surat Pengajuan Asuransi Jiwa (SPAJ) (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (331, N'D00008', N'Bukti Pembayaran SPAJ (BP SPAJ) (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (332, N'D00009', N'Fotokopi Bukti Setoran/Transfer', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (333, N'D00010', N'Form Pendaftaran Agen (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (335, N'D00011', N'Fotokopi Akte Lahir', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (336, N'D00012', N'Fotokopi Kartu Keluarga', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (337, N'D00013', N'KCTT (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (338, N'D00014', N'Fotokopi SIUPP', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (339, N'D00015', N'Surat Keterangan Perusahaan (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (340, N'D00016', N'Proposal (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (341, N'D00017', N'Form PBR (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (343, N'D00018', N'Form Konfirmasi Manfaat  Jatuh Tempo (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (344, N'D00019', N'Form Pengajuan Pinjaman Polis (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (345, N'D00020', N'Form Pengajuan Pembatalan Polis/Nilai Tunai (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (346, N'D00021', N'Form Pengajuan Perubahan Polis (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (347, N'D00022', N'Form Data Kesehatan Tertanggung (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (348, N'D00023', N'Form Pengajuan Pembayaran Manfaat Asuransi (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (350, N'D00024', N'Slip Penarikan Dana Investasi/Nilai Tunai (Asli) ', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (351, N'D00025', N'Slip Pembelian/Penambahan Premi (Top Up) (Asli) ', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (352, N'D00026', N'Fotokopi Identitas Diri Tertanggung', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (353, N'D00027', N'Surat Konfirmasi Perpanjangan (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (354, N'D00028', N'Polis (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (355, N'D00029', N'Fotokopi Identitas Diri Penerima Manfaat', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (356, N'D00030', N'Surat Kuasa (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (357, N'D00031', N'Akad Kredit (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (359, N'D00032', N'Peraturan Asuransi Tambahan Flexi Hospital (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (360, N'D00033', N'Biaya Perubahan', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (361, N'D00034', N'Biaya Top Up', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (362, N'D00035', N'Premi', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (363, N'D00036', N'Bunga Premi Tertunggak', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (364, N'D00037', N'Kwitansi Pembayaran Perawatan Rumah Sakit (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (366, N'D00038', N'Fotocopy Rincian Biaya Perawatan, Obat / Lab', N'', N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'BDA', CAST(0x0000A81800EB42E5 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (368, N'D00039', N'Fotocopy Hasil Laboratorium', N'', N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'BDA', CAST(0x0000A81800EB5BDE AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (369, N'D00040', N'Fotokopi Legalisir Hasil Laboratorium', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (370, N'D00041', N'Surat Permohonan Transfer (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (371, N'D00042', N'Fotokopi Legalisir Surat Laporan dari Kepolisian', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (372, N'D00043', N'Surat Kronologis Bermaterai (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (373, N'D00044', N'Surat Keterangan Dokter (Cacat dari PT ELI) (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (375, N'D00045', N'Foto Seluruh Badan dan Lokasi Cacat', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (382, N'D00046', N'Surat Keterangan Ahli Waris (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (385, N'D00047', N'Fotokopi  Legalisir Identitas Diri Ahli Waris', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (386, N'D00048', N'Fotokopi  Legalisir Identitas Diri Tertanggung', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'ASP', CAST(0x0000A80E00B22ADC AS DateTime), N'1')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (387, N'D00049', N'Fotokopi  Legalisir Identitas Diri Pemegang Polis', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (388, N'D00050', N'Fotokopi  Legalisir Kartu Keluarga Ahli Waris', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (389, N'D00051', N'Fotokopi  Legalisir Kartu Keluarga Tertanggung', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (390, N'D00052', N'Fotokopi  Legalisir Kartu Keluarga Pemegang Polis', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (391, N'D00053', N'Surat Kuasa Ahli Waris Bermaterai (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (392, N'D00054', N'Fotokopi Akte Pendirian', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (393, N'D00055', N'Fotokopi Akte Perubahan Terakhir', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (394, N'D00056', N'Surat Kuasa Autodebet Kartu Kredit', N'', N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'EPO', CAST(0x0000A82500A9064E AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (395, N'D00057', N'Surat Kuasa Pendebetan Rekening', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (396, N'D00058', N'Surat Pencabutan Autodebet Kartu Kredit', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (397, N'D00059', N'Surat Pernyataan Pendebetan Rekening', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (398, N'D00060', N'Fotokopi Kartu ATM', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (399, N'D00061', N'Fotokopi Buku Tabungan Halaman Depan', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (400, N'D00062', N'Fotokopi Kartu Kredit yang Masih Berlaku', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (402, N'D00063', N'Data Perubahan Pemegang Polis', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (403, N'D00064', N'Proposal Ilustrasi', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (404, N'D00065', N'Fotokopi Bukti Setoran Tunai', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (405, N'D00066', N'Fotokopi Bukti Transfer', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (406, N'D00067', N'Fotokopi Bukti Autodebet Rekening', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (407, N'D00068', N'Fotokopi Bukti Autodebet Kartu Kredit BCA', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (408, N'D00069', N'Fotokopi Bukti Autodebet Kartu Kredit Bank Mandiri', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (409, N'D00070', N'Fotokopi Bukti Autodebet Kartu Kredit CIMB Niaga', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (410, N'D00071', N'Fotokopi Bukti Autodebet Kartu Kredit BNI', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (411, N'D00072', N'Surat Perjanjian Kerjasama Pendaftaran Agen (Asli)', NULL, N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'FMJ', CAST(0x0000A7FD00E0FDDA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (413, N'D00073', N'Dokumen Lainnya', NULL, N'FMJ', CAST(0x0000A7FD00000000 AS DateTime), N'FMJ', CAST(0x0000A7FD00000000 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (414, N'D00074', N'Form Perawatan Medis (Dari PT ELI / Fotokopi Medical Pribadi)', N'', N'ASP', CAST(0x0000A80E00ADC946 AS DateTime), N'BDA', CAST(0x0000A81800E9D0C7 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (415, N'D00075', N'Fotokopi Identitas Diri Penerima Manfaat', N'', N'ASP', CAST(0x0000A80E00AE1351 AS DateTime), N'ASP', CAST(0x0000A80E00AE4855 AS DateTime), N'1')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (416, N'D00076', N'Surat Keterangan Dokter (Meninggal dari PT ELI) (Asli)', N'', N'ASP', CAST(0x0000A80E00B04043 AS DateTime), N'ASP', CAST(0x0000A80E00B04043 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (417, N'D00077', N'Fotokopi  Legalisir Surat Kematian Dari Kelurahan/Kecamatan', N'', N'ASP', CAST(0x0000A80E00B0BC6A AS DateTime), N'ASP', CAST(0x0000A80E00B0BC6A AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (418, N'D00078', N'Fotokopi  Legalisir Surat Keterangan Pemeriksaan Mayat Dari RS/Dr', N'', N'ASP', CAST(0x0000A80E00B0F793 AS DateTime), N'ASP', CAST(0x0000A80E00B0F793 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (419, N'D00079', N'Fotokopi  Legalisir Identitas Diri Tertanggung', N'', N'ASP', CAST(0x0000A80E00B174BC AS DateTime), N'ASP', CAST(0x0000A80E00B174BC AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (420, N'D00080', N'Fotokopi  Legalisir Identitas Diri Pemegang Polis', N'', N'ASP', CAST(0x0000A80E00B17DB5 AS DateTime), N'EPO', CAST(0x0000A81200A09C75 AS DateTime), N'1')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (421, N'D00081', N'Fotokopi Identitas Diri Pemegang Polis', N'', N'ASP', CAST(0x0000A80E00B21976 AS DateTime), N'ASP', CAST(0x0000A80E00B28295 AS DateTime), N'1')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (422, N'D00082', N'Fotokopi Legalisir Kwitansi Pembayaran Perawatan Rumah Sakit', N'', N'ASP', CAST(0x0000A80E00B9318E AS DateTime), N'ASP', CAST(0x0000A80E00BA7A1D AS DateTime), N'1')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (423, N'D00083', N'Fotokopi Kwitansi Pembayaran Perawatan Rumah Sakit', N'', N'ASP', CAST(0x0000A80E00B98C19 AS DateTime), N'BDA', CAST(0x0000A81800EA9126 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (424, N'D00084', N'Fotokopi Legalisir Kwitansi Pembayaran Perawatan Rumah Sakit', N'', N'ASP', CAST(0x0000A80E00B9DD8A AS DateTime), N'ASP', CAST(0x0000A80E00BA8526 AS DateTime), N'1')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (425, N'D00085', N'Fotokopi Legalisir Kwitansi Pembayaran Perawatan Rumah Sakit', N'', N'ASP', CAST(0x0000A80E00BA13E3 AS DateTime), N'ASP', CAST(0x0000A80E00BA71F7 AS DateTime), N'1')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (426, N'D00086', N'Fotokopi Legalisir Rincian Biaya Perawatan, Obat dan Lab', N'', N'ASP', CAST(0x0000A80E00BAD39E AS DateTime), N'ASP', CAST(0x0000A80E00BAD39E AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (427, N'D00087', N'Medical Report', N'Medical Report (New Business dan Fotokopi Medical Pribadi)', N'EPO', CAST(0x0000A80E00BB828E AS DateTime), N'EPO', CAST(0x0000A80E00BB828E AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (428, N'D00088', N'Kwitansi Pembayaran Dokter Sebelum Perawatan (Asli)', N'', N'ASP', CAST(0x0000A80E00BC1E55 AS DateTime), N'ASP', CAST(0x0000A80E00BC1E55 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (429, N'D00089', N'Kwitansi Pembayaran Dokter Setelah Perawatan (Asli)', N'', N'ASP', CAST(0x0000A80E00BC2B4E AS DateTime), N'ASP', CAST(0x0000A80E00BC2B4E AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (430, N'D00090', N'Kwitansi Obat/Apotik Berikut Copy Resep Sebelum Perawatan (Asli)', N'', N'ASP', CAST(0x0000A80E00BC32AA AS DateTime), N'ASP', CAST(0x0000A80E00BC32AA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (431, N'D00091', N'Kwitansi Obat/Apotik Berikut Copy Resep Setelah Perawatan (Asli)', N'', N'ASP', CAST(0x0000A80E00BC3A10 AS DateTime), N'ASP', CAST(0x0000A80E00BC3A10 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (432, N'D00092', N'Peraturan Asuransi Tambahan Flexi Medical Care (Asli)', N'Peraturan Asuransi Tambahan Flexi Medical Care (Asli)', N'EPO', CAST(0x0000A80E00BC3F51 AS DateTime), N'EPO', CAST(0x0000A80E00BC3F51 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (433, N'D00093', N'Kwitansi Laboratorium Berikut Copy Resep Sebelum Perawatan (Asli)', N'', N'ASP', CAST(0x0000A80E00BC41EA AS DateTime), N'ASP', CAST(0x0000A80E00BC41EA AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (434, N'D00094', N'Kwitansi Laboratorium Berikut Copy Resep Setelah Perawatan (Asli)', N'', N'ASP', CAST(0x0000A80E00BC4A20 AS DateTime), N'ASP', CAST(0x0000A80E00BC4A20 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (435, N'D00095', N'Form Pernyataan Pencabutan Kuasa Pendeban Rekening BCA/CIMB Niaga/BNI 46/Mandiri', N'', N'EPO', CAST(0x0000A80E00E3C4D2 AS DateTime), N'EPO', CAST(0x0000A82500B844DE AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (436, N'D00096', N'Form Transaksi', N'', N'WHI', CAST(0x0000A81500A21F74 AS DateTime), N'WHI', CAST(0x0000A81500A21F74 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (437, N'D00097', N'Fotokopi KTP Pemegang Polis', N'', N'EPO', CAST(0x0000A82500A8E496 AS DateTime), N'EPO', CAST(0x0000A82500A8E496 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (438, N'D00098', N'Fotokopi Passport', N'', N'EPO', CAST(0x0000A82500A98813 AS DateTime), N'EPO', CAST(0x0000A82500A98813 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (439, N'D00099', N'Fotokopi SIM', N'', N'EPO', CAST(0x0000A82500A9973C AS DateTime), N'EPO', CAST(0x0000A82500A9973C AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (440, N'D00100', N'Fotokopi KTP Pemegang Kartu Kredit (Jika Pemegang Kartu Berbeda dengan Pemegang Polis)', N'', N'EPO', CAST(0x0000A82500AA25EA AS DateTime), N'EPO', CAST(0x0000A82500AA25EA AS DateTime), N'0')
GO
print 'Processed 100 total records'
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (441, N'D00101', N'Fotokopi Buku Nikah', N'', N'EPO', CAST(0x0000A82500ACF841 AS DateTime), N'EPO', CAST(0x0000A82500ACF841 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (442, N'D00102', N'Surat Kuasa Autodebet Rekening BCA/CIMB Niaga', N'', N'EPO', CAST(0x0000A82500B041F1 AS DateTime), N'EPO', CAST(0x0000A82500B041F1 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (443, N'D00103', N'Fotokopi KTP Pemegang Rekening (JIka Pemegang Kartu Berbeda dengan Pemegang Polis)', N'', N'EPO', CAST(0x0000A82500B07AF2 AS DateTime), N'EPO', CAST(0x0000A82500B07AF2 AS DateTime), N'0')
INSERT [dbo].[m_document] ([document_id], [document_code], [description], [remarks], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (444, N'D00104', N'Surat Kuasa Autodebet BNI 46/Mandiri', N'', N'EPO', CAST(0x0000A82500B5B96A AS DateTime), N'EPO', CAST(0x0000A82500B5B96A AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_document] OFF
/****** Object:  Table [dbo].[s_error_code]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[s_error_code](
	[error_code] [smallint] NOT NULL,
	[error_description] [varchar](100) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_s_error_code] ON [dbo].[s_error_code] 
(
	[error_code] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_s_error_code_desc] ON [dbo].[s_error_code] 
(
	[error_code] ASC,
	[error_description] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (0, N'No Error')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (100, N'Invalid username or password, please try again')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (101, N'Session Expired. Please relogin.')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (102, N'Session Already Exist.')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (103, N'Invalid Signature.')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (200, N'OK')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (201, N'Missing Condition Field.')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (202, N'Unknown Condition Field.')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (403, N'Forbidden')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (404, N'Data not found')
INSERT [dbo].[s_error_code] ([error_code], [error_description]) VALUES (422, N'Unprocessable Entity')
/****** Object:  Table [dbo].[s_action_list]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[s_action_list](
	[action_id] [int] IDENTITY(1,1) NOT NULL,
	[action_name] [varchar](60) NULL,
	[action_type] [int] NOT NULL,
	[condition_field] [varchar](max) NULL,
	[result_object] [varchar](100) NULL,
	[result_field] [varchar](max) NULL,
	[default_order] [varchar](30) NULL,
	[max_result_row] [smallint] NULL,
	[datasource] [varchar](30) NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK_s_action_list] PRIMARY KEY CLUSTERED 
(
	[action_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_s_action_list_act_name] UNIQUE NONCLUSTERED 
(
	[action_name] 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
CREATE NONCLUSTERED INDEX [IX_s_action_list_act_type] ON [dbo].[s_action_list] 
(
	[action_type] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_s_action_list_id_name_type] ON [dbo].[s_action_list] 
(
	[action_id] ASC,
	[action_name] ASC,
	[action_type] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[s_action_list] ON
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'currency', 1, N'currency_id, currency_code, description, status_id', N'm_currency', N'currency_id, currency_code, description, status_id', NULL, NULL, N'default', N'PPM', CAST(0x0000A77C00AE6744 AS DateTime), N'PPM', CAST(0x0000A77C00AE6744 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'update_currency', 3, N'currency_id, currency_code, description, status_id', N'm_currency', N'currency_id, currency_code, description, status_id', NULL, NULL, N'default', N'WHI', CAST(0x0000A78200000000 AS DateTime), N'WHI', CAST(0x0000A78200000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'insert_currency', 2, N'currency_id, currency_code, description, status_id', N'm_currency', N'currency_id, currency_code, description, status_id', NULL, NULL, N'default', N'WHI', CAST(0x0000A78200000000 AS DateTime), N'WHI', CAST(0x0000A78200000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'list_branch', 1, N'branch_id, branch_code, description, address, city_id, province_id, postal_code, phone_number_1, phone_number_2, user_pic, status_id, is_delete', N'm_branch', N'branch_id, branch_code, description, address, city_id, province_id, postal_code, phone_number_1, phone_number_2, user_pic, status_id, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'list_province', 1, N'province_id, province_code, province_name, is_delete', N'm_province', N'province_id, province_code, province_name, is_delete', N'province_name', NULL, N'default', N'WHI', CAST(0x0000A78400000000 AS DateTime), N'WHI', CAST(0x0000A78400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, N'insert_branch', 2, N'branch_id, branch_code, description, address, city_id, province_id, postal_code, phone_number_1, phone_number_2, user_pic, status_id, is_delete', N'm_branch', N'branch_id, branch_code, description, address, city_id, province_id, postal_code, phone_number_1, phone_number_2, user_pic, status_id, is_delete', NULL, NULL, N'default', N'WHI', CAST(0x0000A78400000000 AS DateTime), N'WHI', CAST(0x0000A78400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'list_city', 1, N'city_id, city_code, province_id, city_name, is_delete', N'm_city', N'city_id, city_code, province_id, city_name, is_delete', N'city_name', NULL, N'default', N'WHI', CAST(0x0000A78400000000 AS DateTime), N'WHI', CAST(0x0000A78400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'update_branch', 3, N'branch_id, branch_code, description, address, city_id, province_id, postal_code, phone_number_1, phone_number_2, user_pic, status_id, is_delete', N'm_branch', N'branch_id, branch_code, description, address, city_id, province_id, postal_code, phone_number_1, phone_number_2, user_pic, status_id, is_delete', NULL, NULL, N'default', N'WHI', CAST(0x0000A78A00000000 AS DateTime), N'WHI', CAST(0x0000A78A00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'delete_branch', 4, N'branch_id', N'm_branch', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A78B00000000 AS DateTime), N'WHI', CAST(0x0000A78B00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'list_workflow_template', 1, N'workflow_template_id, workflow_template_code, description, remarks, status_id, is_delete', N'm_workflow_template', N'workflow_template_id, workflow_template_code, description, remarks, status_id, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'insert_workflow_template', 2, N'workflow_template_id, workflow_template_code, description, remarks, status_id, is_delete', N'm_workflow_template', N'workflow_template_id, workflow_template_code, description, remarks, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'delete_workflow_template', 4, N'workflow_template_id', N'm_workflow_template', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'update_workflow_template', 3, N'workflow_template_id, workflow_template_code, description, remarks, status_id, is_delete', N'm_workflow_template', N'workflow_template_id, workflow_template_code, description, remarks, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'KHU', CAST(0x0000A78B00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'list_level_organization', 1, N'level_type_id,level_type_code, description, head_description, seq_number, status_id, is_delete', N'm_level_type', N'level_type_id, level_type_code, description, head_description, seq_number, status_id, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, N'insert_level_organization', 2, N'level_type_code, description, head_description, seq_number, status_id, is_delete', N'm_level_type', N'level_type_code, description, head_description, seq_number, status_id, is_delete', NULL, NULL, N'default', N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, N'update_level_organization', 3, N'level_type_id, level_type_code, description, head_description, seq_number, status_id, is_delete', N'm_level_type', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, N'delete_level_organization', 4, N'level_type_id, level_type_code, description, head_description, seq_number, status_id, is_delete', N'm_level_type', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, N'list_organization', 1, N'organization_id, organization_code, description, level_type_id, organization_id_parent, status_id, is_delete, status_code, status_desc, parent_desc, parent_code, level_type_code, level_desc, head_description, seq_number,username,user_fullname,has_child,parent_level', N'v_organization', N'organization_id, organization_code, description, level_type_id, organization_id_parent, status_id, is_delete, status_code, status_desc, parent_desc, parent_code, level_type_code, level_desc, head_description, seq_number,username,user_fullname,has_child,parent_level', N'description', NULL, N'default', N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, N'list_higher_organization', 7, N'level_id', N'get_higher_organization', N'organization_id, organization_code, description, organization_id_parent, level_type_id, seq_number', N'seq_number', NULL, N'default', N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, N'insert_organization', 2, NULL, N'm_organization', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, N'list_document', 1, N'document_id, document_code, description, remarks, is_delete', N'm_document', N'document_id, document_code, description, remarks, is_delete', N'document_code', NULL, N'default', N'KHU', CAST(0x0000A79000000000 AS DateTime), N'KHU', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, N'insert_document', 2, N'document_id, document_code, description, remarks, is_delete', N'm_document', N'document_id, document_code, description, remarks, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A79000000000 AS DateTime), N'KHU', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, N'update_organization', 3, N'organization_id, organization_code, description, level_type_id, organization_id_parent, status_id, is_delete, status_code, status_desc, parent_desc, parent_code, level_type_code, level_desc, head_description, seq_number', N'm_organization', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A79000000000 AS DateTime), N'WHI', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, N'delete_organization', 4, N'organization_id, organization_code, description, level_type_id, organization_id_parent, status_id, is_delete, status_code, status_desc, parent_desc, parent_code, level_type_code, level_desc, head_description, seq_number', N'm_organization', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A79000000000 AS DateTime), N'WHI', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, N'list_group_menu', 1, N'group_menu_id, group_menu_code, description, status_id, is_delete', N'm_group_menu', N'group_menu_id, group_menu_code, description, status_id, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A79000000000 AS DateTime), N'WHI', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, N'insert_group_menu', 2, NULL, N'm_group_menu', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A79000000000 AS DateTime), N'WHI', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, N'update_group_menu', 3, N'group_menu_id, group_menu_code, description, status_id, is_delete', N'm_group_menu', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A79000000000 AS DateTime), N'WHI', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, N'delete_group_menu', 4, N'group_menu_id, group_menu_code, description, status_id, is_delete', N'm_group_menu', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A79000000000 AS DateTime), N'WHI', CAST(0x0000A79000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, N'list_group_menu_member', 1, N'menu_id, menu_desc, menu_category_id, url, level, menu_id_parent, created_by, created_date, modified_by, modified_date, group_menu_id, group_menu_code, group_desc', N'v_group_menu', N'menu_id, menu_desc, menu_category_id, url, level, menu_id_parent, created_by, created_date, modified_by, modified_date, group_menu_id, group_menu_code, group_desc', N'menu_desc', NULL, N'default', N'WHI', CAST(0x0000A79300000000 AS DateTime), N'WHI', CAST(0x0000A79300000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, N'list_menu_category', 1, N'menu_category_id, description, is_delete', N'm_menu_category', N'menu_category_id, description, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A79400000000 AS DateTime), N'WHI', CAST(0x0000A79400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, N'list_menu', 1, N'menu_id, menu_category_id, url, description, level, menu_id_parent, created_by, created_date, modified_by, modified_date, is_delete,icon_class', N'm_menu', N'menu_id, menu_category_id, url, description, level, menu_id_parent, created_by, created_date, modified_by, modified_date, is_delete,icon_class', N'description', NULL, N'default', N'WHI', CAST(0x0000A79800000000 AS DateTime), N'WHI', CAST(0x0000A79800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, N'insert_group_menu_mapping', 2, NULL, N'm_group_menu_mapping', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A79800000000 AS DateTime), N'WHI', CAST(0x0000A79800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, N'list_menu_by_category_exclude_group_menu', 7, N'group_menu_id, menu_category_id', N'get_menu_by_category_excl_group', N'menu_id, menu_category_id, url, description, level, menu_id_parent, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A79800000000 AS DateTime), N'WHI', CAST(0x0000A78E00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, N'delete_group_menu_member', 4, N'group_menu_mapping_id', N'm_group_menu_mapping', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A79800000000 AS DateTime), N'WHI', CAST(0x0000A7A600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, N'list_user', 1, N'user_id, username, user_fullname, branch_id, created_by, created_date, modified_by, modified_date, branch_code, description, status_id, organization', N'v_user', N'user_id, username, user_fullname, branch_id, created_by, created_date, modified_by, modified_date, branch_code, description, status_id, organization', N'user_fullname', NULL, N'default', N'WHI', CAST(0x0000A78B00000000 AS DateTime), N'WHI', CAST(0x0000A78B00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, N'insert_user', 2, N'user_id, username, user_fullname, branch_id, created_by, created_date, modified_by, modified_date', N'm_user', N'user_id, username, user_fullname, branch_id, created_by, created_date, modified_by, modified_date', NULL, NULL, N'default', N'WHI', CAST(0x0000A7A900000000 AS DateTime), N'WHI', CAST(0x0000A7A900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, N'delete_document', 4, N'document_id, document_code, description, remarks, is_delete', N'm_document', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, N'update_document', 3, N'document_id, document_code, description, remarks, is_delete', N'm_document', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'KHU', CAST(0x0000A7AC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, N'list_policy', 1, N'policy_no, policy_holder, dob, product, period_start, period_end, status', N'temp_polis', N'policy_no, policy_holder, dob, product, period_start, period_end, status', NULL, NULL, N'default', N'PPM', CAST(0x0000A7AC00000000 AS DateTime), N'PPM', CAST(0x0000A7AC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (68, N'list_transaction_type', 1, N'transaction_type_id, transaction_type_code, transaction_category_id, transaction_type_desc, transaction_type_remarks, transaction_category_code, transaction_category_desc, is_delete', N'v_m_transaction_type', N'transaction_type_id, transaction_type_code, transaction_category_id, transaction_type_desc, transaction_type_remarks, transaction_type_footnote_receipt_form, transaction_category_code, transaction_category_desc, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (73, N'list_transaction_category', 1, N'transaction_category_id, transaction_category_code, description, is_delete', N'm_transaction_category', N'transaction_category_id, transaction_category_code, description, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (74, N'insert_transaction_type', 2, N'transaction_type_id, transaction_type_code, transaction_category_id, description, remarks, footnote_receipt_form, is_delete', N'm_transaction_type', N'transaction_type_id, transaction_type_code, transaction_category_id, description, remarks, footnote_receipt_form, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (75, N'update_user', 3, N'user_id, username, user_fullname, branch_id', N'm_user', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7AD00000000 AS DateTime), N'WHI', CAST(0x0000A7AD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (78, N'delete_transaction_type', 4, N'transaction_type_id, transaction_type_code, transaction_category_id, description, remarks, is_delete', N'm_transaction_type', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (81, N'update_transaction_type', 3, N'transaction_type_id, transaction_type_code, transaction_category_id, description, remarks, footnote_receipt_form, is_delete', N'm_transaction_type', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'KHU', CAST(0x0000A7AD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (84, N'list_eform', 1, N'eform_id, eform_code, transaction_type_id, transaction_type_desc, transaction_category_desc, is_need_surat_kuasa, remarks, status_id, is_delete', N'v_m_e_form', N'eform_id, eform_code, transaction_type_id, transaction_type_desc, transaction_category_desc, is_need_surat_kuasa, remarks, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A7AE00000000 AS DateTime), N'KHU', CAST(0x0000A7AE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (85, N'insert_user_organization', 2, NULL, N'm_user_organization', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7AE00000000 AS DateTime), N'WHI', CAST(0x0000A7AE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (86, N'list_user_organization', 1, N'user_organization_id, username, user_fullname, organization_name, user_id_organization, effective_date, organization_id, level_type_id, level_description, status_id, created_by, modified_by, modified_date, is_delete', N'v_user_organization', N'user_organization_id, username, user_fullname, organization_name, user_id_organization, effective_date, organization_id, level_type_id, level_description, status_id, created_by, modified_by, modified_date, is_delete', N'effective_date', NULL, N'default', N'WHI', CAST(0x0000A7AE00000000 AS DateTime), N'WHI', CAST(0x0000A7AE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (88, N'delete_eform', 4, N'eform_id, eform_code, transaction_type_id, is_need_surat_kuasa, remarks, status_id, is_delete', N'm_eform', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7AF00000000 AS DateTime), N'KHU', CAST(0x0000A7AF00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (89, N'insert_eform', 2, NULL, N'm_eform', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B000000000 AS DateTime), N'KHU', CAST(0x0000A7B000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (91, N'update_user_organization', 3, N'user_organization_id, user_id_organization, effective_date, organization_id, status_id, created_by, created_date, modified_by, modified_date, is_delete', N'm_user_organization', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7B500000000 AS DateTime), N'WHI', CAST(0x0000A7B500000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (93, N'delete_user_organization', 4, N'user_organization_id, user_id_organization, effective_date, organization_id, status_id, created_by, created_date, modified_by, modified_date, is_delete', N'm_user_organization', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7B600000000 AS DateTime), N'WHI', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (96, N'update_eform', 3, N'eform_id, eform_code, transaction_type_id, is_need_surat_kuasa, remarks, status_id, is_delete', N'm_eform', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (97, N'list_form_template', 1, N'transaction_form_template_id,description,is_delete', N'm_transaction_form_template', N'transaction_form_template_id, description, filename, is_delete', N'description', NULL, N'default', N'PPM', CAST(0x0000A7B700000000 AS DateTime), N'PPM', CAST(0x0000A7B700000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (98, N'list_approval_matrix', 1, N'approv_matrix_id, approv_matrix_code, description, remarks, status_id, is_delete', N'm_approv_matrix', N'approv_matrix_id, approv_matrix_code, description, remarks, status_id, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (99, N'insert_approval_matrix', 2, NULL, N'm_approv_matrix', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (101, N'delete_approval_matrix', 4, N'approv_matrix_id, approv_matrix_code, description, remarks, status_id, is_delete', N'm_approv_matrix', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (102, N'update_approval_matrix', 3, N'approv_matrix_id, approv_matrix_code, description, remarks, status_id, is_delete', N'm_approv_matrix', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (103, N'list_pic', 1, N'group_pic_id, group_pic_code, description, remarks, is_delete', N'm_group_pic', N'group_pic_id, group_pic_code, description, remarks, is_delete', N'group_pic_code', NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (104, N'insert_pic', 2, NULL, N'm_group_pic', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (105, N'update_pic', 3, N'group_pic_id, group_pic_code, description, remarks, is_delete', N'm_group_pic', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (106, N'delete_pic', 4, N'group_pic_id, group_pic_code, description, remarks, is_delete', N'm_group_pic', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'KHU', CAST(0x0000A7B600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (107, N'list_eform_document', 1, N'eform_document_id, eform_id, document_id, seq_number, status_id, is_delete', N'v_m_eform_document', N'eform_document_id, eform_id, document_id, document_code, description, minimum_files, maximum_files, seq_number, status_id', N'seq_number', 0, N'default', N'PPM', CAST(0x0000A7B900000000 AS DateTime), N'PPM', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (109, N'list_workflow_template_stage', 1, N'workflow_template_stage_id, workflow_template_id, workflow_template_desc, description, is_stage_approval, approv_matrix_id, approv_matrix_desc, pic_is_requester, group_pic_id, user_workflow_id, pic_desc, can_edit_information, can_upload_document, can_delete_document, seq_number', N'v_m_workflow_template_stage', N'workflow_template_stage_id, workflow_template_id, workflow_template_desc, description, is_stage_approval, approv_matrix_id, approv_matrix_desc, pic_is_requester, group_pic_id, user_workflow_id, pic_desc, can_edit_information, can_upload_document, can_delete_document, seq_number', N'seq_number', NULL, N'default', N'KHU', CAST(0x0000A7B900000000 AS DateTime), N'KHU', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (110, N'insert_workflow_template_stage', 2, NULL, N'm_workflow_template_stage', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7B900000000 AS DateTime), N'KHU', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (111, N'insert_approval_matrix_detail', 2, NULL, N'm_approv_matrix_detail', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (114, N'list_approv_matrix_detail', 1, N'approv_matrix_detail_id, approv_matrix_id, maximum_value, level_type_id, level_type_desc,currency_id,currency_code,currency_description', N'v_m_approv_matrix_detail', N'approv_matrix_detail_id, approv_matrix_id, maximum_value, level_type_id, level_type_desc,currency_id,currency_code,currency_description', N'maximum_value', NULL, N'default', N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (119, N'delete_approv_matrix_detail', 4, N'approv_matrix_detail_id, approv_matrix_id, maximum_value, level_type_id, is_delete', N'm_approv_matrix_detail', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (120, N'update_approv_matrix_detail', 3, N'approv_matrix_detail_id, approv_matrix_id, maximum_value, level_type_id, is_delete', N'm_approv_matrix_detail', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'KHU', CAST(0x0000A7BA00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (121, N'list_eform_workflow', 1, N'eform_workflow_id, eform_id, workflow_template_id, workflow_template_code, description, remarks, effective_date, status_id', N'v_m_eform_workflow', N'eform_workflow_id, eform_id, workflow_template_id, workflow_template_code, description, remarks, source_transaction_id, transaction_source, effective_date, status_id, created_by, created_date, modified_by, modified_date', N'effective_date', 0, N'default', N'PPM', CAST(0x0000A7BC00000000 AS DateTime), N'PPM', CAST(0x0000A7BC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (122, N'insert_pic_detail', 2, NULL, N'm_group_pic_detail', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7BC00000000 AS DateTime), N'KHU', CAST(0x0000A7BC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (123, N'insert_eform_workflow', 2, N'eform_workflow_id, eform_id, workflow_template_id, workflow_template_id, effective_date, status_id, created_by, created_date, modified_by, modified_date, is_delete', N'm_eform_workflow', N'eform_workflow_id', NULL, 0, N'default', N'PPM', CAST(0x0000A7BD00865F38 AS DateTime), N'PPM', CAST(0x0000A7BD00865F38 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (124, N'update_eform_workflow', 3, N'eform_workflow_id, eform_id, workflow_template_id, workflow_template_id, effective_date, status_id, created_by, created_date, modified_by, modified_date, is_delete', N'm_eform_workflow', N'workflow_template_id, effective_date', NULL, 0, N'default', N'PPM', CAST(0x0000A7BD00865F38 AS DateTime), N'PPM', CAST(0x0000A7BD00865F38 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (125, N'list_group_menu_to_add', 7, N'group_menu_id,group_menu_code,description,created_by,created_date,modified_by,modified_date,is_delete', N'get_group_menu_to_add', N'group_menu_id,group_menu_code,description,created_by,created_date,modified_by,modified_date,is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A7BD00000000 AS DateTime), N'WHI', CAST(0x0000A7BD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (126, N'list_pic_detail', 1, N'group_pic_detail_id, group_pic_id, branch_id, branch_desc, transaction_type_id, transaction_desc, user_id_group_pic_detail, user_fullname, is_delete', N'v_m_group_pic_detail', N'group_pic_detail_id, group_pic_id, branch_id, branch_desc, transaction_type_id, transaction_desc, user_id_group_pic_detail, user_fullname, is_delete', N'user_fullname', NULL, N'default', N'KHU', CAST(0x0000A7BD00000000 AS DateTime), N'KHU', CAST(0x0000A7BD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (127, N'list_group_menu_member_user', 7, N'menu_id,group_menu_id,menu_desc,group_desc,menu_id_2,group_menu_id_2,menu_desc_2,group_desc_2,user_menu_id,is_delete,is_exclude,user_id', N'get_group_menu_member_user', N'menu_id,group_menu_id,menu_desc,group_desc,menu_id_2,group_menu_id_2,menu_desc_2,group_desc_2,user_menu_id,is_delete,is_exclude,user_id', N'menu_desc', NULL, N'default', N'WHI', CAST(0x0000A7BD00000000 AS DateTime), N'WHI', CAST(0x0000A7BD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (128, N'insert_user_group_menu_mapping', 2, N'id,user_id,group_menu_id,created_by,created_date,modified_by,modified_date,is_delete', N'm_user_group_menu_mapping', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7BD00000000 AS DateTime), N'WHI', CAST(0x0000A7BD00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (129, N'insert_user_menu_mapping', 2, N'id,user_id,menu_id,is_exclude,created_by,created_date,modified_by,modified_date,is_delete', N'm_user_menu_mapping', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7BD00000000 AS DateTime), N'WHI', CAST(0x0000A7BE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (130, N'update_pic_detail', 3, N'group_pic_detail_id, group_pic_id, source_app_id, branch_id, transaction_type_id, user_id_group_pic_detail, is_delete', N'm_group_pic_detail', N'group_pic_detail_id, group_pic_id, source_app_id, branch_id, transaction_type_id, user_id_group_pic_detail, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A7BE00000000 AS DateTime), N'KHU', CAST(0x0000A7BE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (131, N'list_user_menu_per_user_all', 7, N'menu_id,menu_category_id,url,menu_desc,menu_id_parent,cat_desc,user_id,menuid,catdesc,menudesc,is_exclude,mapping_id', N'get_user_menu_all', N'menu_id,menu_category_id,url,menu_desc,menu_id_parent,cat_desc,user_id,menuid,catdesc,menudesc,is_exclude,mapping_id', N'menu_desc,menudesc', NULL, N'default', N'WHI', CAST(0x0000A7C200000000 AS DateTime), N'WHI', CAST(0x0000A7C200000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (132, N'list_user_group_menu', 1, N'id,user_id,group_menu_id,created_by,created_date,modified_by,modified_date,is_delete,description', N'v_user_group_menu', N'id,user_id,group_menu_id,created_by,created_date,modified_by,modified_date,is_delete,description', N'description', NULL, N'default', N'WHI', CAST(0x0000A7C300000000 AS DateTime), N'WHI', CAST(0x0000A7C300000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (133, N'delete_user_group_menu', 5, N'user_id,group_menu_id,created_by', N'RemoveUserGroupMenu', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7C300000000 AS DateTime), N'WHI', CAST(0x0000A7C300000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (134, N'update_user_menu_mapping', 5, N'id,user_id,menu_id,is_exclude,created_by,created_date,modified_by,modified_date,is_delete', N'IncludeExcludeUserMenu', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7C400000000 AS DateTime), N'WHI', CAST(0x0000A7C400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (135, N'list_menu_for_add', 7, N'menu_id,menu_category_id,url,description,level,menu_id_parent,created_by,created_date,modified_by,modified_date,is_delete,category_desc,parent_desc', N'get_menu_for_add_no_category', N'menu_id,menu_category_id,url,description,level,menu_id_parent,created_by,created_date,modified_by,modified_date,is_delete,category_desc,parent_desc', N'description', NULL, N'default', N'WHI', CAST(0x0000A7C800000000 AS DateTime), N'WHI', CAST(0x0000A7C800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (136, N'search_policy', 1, N'policy_no, policy_holder, date_of_birth', N'EDITS.view_policy_information', N'policy_no, policy_holder, date_of_birth, plan, commencement_date, maturity_date, policy_status', N'policy_holder', 0, N'PL', N'PPM', CAST(0x0000A7C900000000 AS DateTime), N'PPM', CAST(0x0000A7C900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (142, N'delete_pic_detail', 4, N'group_pic_detail_id, group_pic_id, source_app_id, branch_id, transaction_type_id, user_id_group_pic_detail, is_delete', N'm_group_pic_detail', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7CC00000000 AS DateTime), N'KHU', CAST(0x0000A7CC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (143, N'search_policy_by_no', 5, N'policy_no', N'proc_get_policy_information_by_policy_number', NULL, NULL, NULL, N'PL', N'PPM', CAST(0x0000A7CC00000000 AS DateTime), N'PPM', CAST(0x0000A7CC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (144, N'search_policy_by_holder', 5, N'policy_holder_name, date_of_birth', N'proc_get_policy_information_by_policy_holder', NULL, NULL, NULL, N'PL', N'PPM', CAST(0x0000A7D100000000 AS DateTime), N'PPM', CAST(0x0000A7D100000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (145, N'delete_workflow_template_stage', 4, N'workflow_template_stage_id, workflow_template_id, description, is_stage_approval, approv_matrix_id, is_user_requester, group_pic_id, can_edit_information, can_upload_document, can_delete_document, seq_number, is_delete', N'm_workflow_template_stage', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7D100000000 AS DateTime), N'KHU', CAST(0x0000A7D100000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (147, N'insert_transaction', 2, N'transaction_id,transaction_type_id,register_number,transaction_date,source_app_id,policy_id_reference,policy_holder_reference,product_name_reference,currency_id_reference,is_policy_holder,customer,address,mobile_phone,email_address,signature_url,photo_url,reference_number,currency_id,transaction_value,is_notify_document_completion,notification_date,workflow_template_stage_id,user_id,branch_id,status_id,created_by,created_date,is_delete', N't_transaction', N'transaction_id,transaction_type_id,register_number,transaction_date,source_app_id,policy_id_reference,policy_holder_reference,product_name_reference,currency_id_reference,is_policy_holder,customer,address,mobile_phone,email_address,signature_url,photo_url,reference_number,currency_id,transaction_value,is_notify_document_completion,notification_date,workflow_template_stage_id,user_id,branch_id,status_id,created_by,created_date,is_delete', NULL, NULL, N'default', N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (148, N'update_eform_document', 3, N'eform_document_id,eform_id,document_id,minimum_files,maximum_files,seq_number,status_id,is_delete', N'm_eform_document', N'eform_document_id,eform_id,document_id,minimum_files,maximum_files,seq_number,status_id,is_delete', N'', 0, N'default', N'PPM', CAST(0x0000A7D600000000 AS DateTime), N'PPM', CAST(0x0000A7D600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (149, N'insert_eform_document', 2, N'eform_id,document_id,minimum_files,maximum_files,seq_number,status_id,is_delete', N'm_eform_document', N'eform_document_id', N'', 0, N'default', N'PPM', CAST(0x0000A7D600000000 AS DateTime), N'PPM', CAST(0x0000A7D600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (152, N'list_user_menu_per_user_all_not_excluded', 7, N'menu_id,menu_category_id,url,menu_desc,menu_id_parent,cat_desc,user_id,menuid,catdesc,menudesc,is_exclude,mapping_id,menuidparent,icon_class,menuurl,iconclass', N'get_user_menu_all_not_excluded', N'menu_id,menu_category_id,url,menu_desc,menu_id_parent,cat_desc,user_id,menuid,catdesc,menudesc,is_exclude,mapping_id,menuidparent,icon_class,menuurl,iconclass', NULL, NULL, N'default', N'WHI', CAST(0x0000A7D900000000 AS DateTime), N'WHI', CAST(0x0000A7D900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (153, N'insert_user_menu_mapping_sp', 5, N'menu_id,user_id,created_by', N'AddUserMenuMapping', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7DA00000000 AS DateTime), N'WHI', CAST(0x0000A7DA00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (154, N'list_eform_form', 1, N'eform_id, eform_form_template_id, effective_date, status_id, transaction_form_template_id, description, filename', N'v_m_eform_form', N'eform_id, eform_form_template_id, effective_date, status_id, transaction_form_template_id, description, filename', N'effective_date', NULL, N'default', N'PPM', CAST(0x0000A7DE00000000 AS DateTime), N'PPM', CAST(0x0000A7DE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (156, N'insert_user_group_menu_mapping_sp', 5, N'group_menu_id,user_id,created_by', N'AddUserGroupMenuMapping', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7DE00000000 AS DateTime), N'WHI', CAST(0x0000A7DE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (157, N'insert_eform_form', 2, N'eform_id, transaction_form_template_id, effective_date, status_id, is_delete', N'm_eform_form_template', N'eform_form_template_id', NULL, NULL, N'default', N'PPM', CAST(0x0000A7DE00000000 AS DateTime), N'PPM', CAST(0x0000A7DE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (158, N'update_workflow_template_stage', 3, N'workflow_template_stage_id, workflow_template_id, description, is_stage_approval, approv_matrix_id, pic_is_requester, group_pic_id, user_workflow_id, can_edit_information, can_upload_document, can_delete_document, seq_number, is_delete', N'm_workflow_template_stage', N'workflow_template_stage_id, workflow_template_id, description, is_stage_approval, approv_matrix_id, pic_is_requester, group_pic_id, user_workflow_id, can_edit_information, can_upload_document, can_delete_document, seq_number, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A7DE00000000 AS DateTime), N'KHU', CAST(0x0000A7D900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (159, N'update_eform_form', 3, N'eform_form_template_id, eform_id, transaction_form_template_id, effective_date, status_id, is_delete', N'm_eform_form_template', N'eform_form_template_id, eform_id, transaction_form_template_id, effective_date, status_id, is_delete', NULL, NULL, N'default', N'PPM', CAST(0x0000A7DE00000000 AS DateTime), N'PPM', CAST(0x0000A7DE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (160, N'list_transaction_status', 1, N'transaction_status_id, description, is_delete', N'm_transaction_status', N'transaction_status_id, description, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
GO
print 'Processed 100 total records'
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (161, N'list_reason_category', 1, N'reason_category_id, reason_category_code, description, status_id, is_delete', N'm_reason_category', N'reason_category_id, reason_category_code, description, status_id, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (162, N'insert_workflow_template_action', 2, NULL, N'm_workflow_template_action', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'KHU', CAST(0x0000A7DF00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (163, N'list_workflow_template_action', 1, N'workflow_template_action_id, workflow_template_stage_id, workflow_template_stage_desc, description, is_final_action, workflow_template_id, workflow_template_desc, destination_stage_id, destination_stage_desc, is_send_notif_to_requester, is_send_notif_to_next_pic, is_notif_document_completion, is_check_mandatory_document, is_remarks_mandatory, is_fill_reference_number, is_check_transaction_status_core, code_transaction_status, is_need_reason, reason_category_id, transaction_status_id, is_delete', N'v_m_workflow_template_action', N'workflow_template_action_id, workflow_template_stage_id, workflow_template_stage_desc, description, is_final_action, workflow_template_id, workflow_template_desc, destination_stage_id, destination_stage_desc, is_send_notif_to_requester, is_send_notif_to_next_pic, is_notif_document_completion, is_check_mandatory_document, is_remarks_mandatory, is_fill_reference_number, is_check_transaction_status_core, code_transaction_status, is_need_reason, reason_category_id, transaction_status_id, is_delete,reason_desc', N'description', NULL, N'default', N'KHU', CAST(0x0000A7E000000000 AS DateTime), N'KHU', CAST(0x0000A7E000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (165, N'delete_workflow_template_action', 4, N'workflow_template_action_id, workflow_template_stage_id, description, is_final_action, workflow_template_id, is_send_notif_to_requester, is_send_notif_to_next_pic, is_notif_document_completion, is_check_mandatory_document, is_fill_reference_number, is_need_reason, reason_category_id, transaction_status_id, is_delete', N'm_workflow_template_action', NULL, NULL, NULL, N'default', N'KHU', CAST(0x0000A7E000000000 AS DateTime), N'KHU', CAST(0x0000A7E000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (167, N'insert_transaction_sp', 5, N'transaction_type_id,policy_id_reference,policy_holder_reference,product_name_reference,currency_id_reference,currency_code,is_policy_holder,customer,address,mobile_phone,email_address,user_id,branch_id,status_id,source_transaction_id', N'AddTransactionWrapper', N'trans_id,trans_reg', NULL, NULL, N'default', N'WHI', CAST(0x0000A7E000000000 AS DateTime), N'WHI', CAST(0x0000A7E000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (170, N'update_workflow_template_action', 3, N'workflow_template_action_id, workflow_template_stage_id, description, is_final_action, workflow_template_id, is_send_notif_to_requester, is_send_notif_to_next_pic, is_notif_document_completion, is_check_mandatory_document, is_remarks_mandatory, is_fill_reference_number, is_check_transaction_status_core, code_transaction_status, is_need_reason, reason_id, transaction_status_id, is_delete', N'm_workflow_template_action', N'workflow_template_action_id, workflow_template_stage_id, description, is_final_action, workflow_template_id, is_send_notif_to_requester, is_send_notif_to_next_pic, is_notif_document_completion, is_check_mandatory_document, is_remarks_mandatory, is_fill_reference_number, is_check_transaction_status_core, code_transaction_status, is_need_reason, reason_id, transaction_status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A7E000000000 AS DateTime), N'KHU', CAST(0x0000A7E000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (171, N'list_transaction', 1, N'transaction_id,transaction_type_id,register_number,transaction_date,source_app_id,policy_id_reference,policy_holder_reference,product_name_reference,currency_id_reference,is_policy_holder,customer,address,mobile_phone,email_address,signature_url,photo_url,reference_number,currency_id,currency_code,transaction_value,is_notify_document_completion,notification_date,workflow_template_stage_id,user_id,branch_id,status_id,created_by,created_date,modified_by,modified_date,is_delete', N't_transaction', N'transaction_id,transaction_type_id,register_number,transaction_date,source_app_id,policy_id_reference,policy_holder_reference,product_name_reference,currency_id_reference,is_policy_holder,customer,address,mobile_phone,email_address,signature_url,photo_url,reference_number,currency_id,currency_code,transaction_value,is_notify_document_completion,notification_date,workflow_template_stage_id,user_id,branch_id,status_id,created_by,created_date,modified_by,modified_date,is_delete', N'created_date', NULL, N'default', N'WHI', CAST(0x0000A75000000000 AS DateTime), N'WHI', CAST(0x0000A75000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (172, N'list_view_file_by_type', 7, N'eform_id,effective_date,status_id,transaction_form_template_id,description,filename,created_by,created_date,modified_by,modified_date,is_delete', N'get_view_file_by_trans_type', N'eform_id,effective_date,status_id,transaction_form_template_id,description,filename,created_by,created_date,modified_by,modified_date,is_delete', NULL, NULL, N'default', N'WHI', CAST(0x0000A76E00000000 AS DateTime), N'WHI', CAST(0x0000A76E00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (178, N'list_transaction_v', 1, N'transaction_id,transaction_type_id,register_number,transaction_date,policy_id_reference,policy_holder_reference,product_name_reference,currency_id_reference,is_policy_holder,customer,address,mobile_phone,email_address,signature_url,photo_url,reference_number,transaction_value,is_notify_document_completion,notification_date,workflow_template_stage_id,user_id,branch_id,status_id,created_by,created_date,type_desc,stage_desc,branch_desc,user_userfullname,is_delete,status_desc', N'v_get_transaction_all', N'transaction_id, transaction_type_id, register_number, transaction_date, source_app_id, policy_id_reference, policy_holder_reference, product_name_reference, currency_id_reference, is_policy_holder, customer, address, mobile_phone, email_address, signature_url, photo_url, reference_number, currency_id, currency_code, transaction_value, is_notify_document_completion, notification_date, workflow_template_stage_id, user_id, branch_id, status_id, created_by, created_date, modified_by, modified_date, is_delete, type_desc, stage_desc, branch_desc, user_username, user_userfullname, status_desc, document_valid, last_action_id, can_edit_information, can_upload_document, can_delete_document,source_transaction_id', N'created_date', NULL, N'default', N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (179, N'list_reason', 1, N'reason_id, reason_category_id, description, status_id, is_delete', N'm_reason', N'reason_id, reason_category_id, description, status_id, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (183, N'list_transaction_category_register', 1, N'transaction_type_id, transaction_type_code, transaction_type_desc, transaction_type_remarks, transaction_category_id, eform_workflow_id, transaction_category_code, transaction_category_desc, is_delete', N'v_m_transaction_type', N'transaction_type_id, transaction_type_code, transaction_type_desc, transaction_type_remarks, transaction_category_id, eform_workflow_id, transaction_category_code, transaction_category_desc, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (186, N'update_t_transaction', 3, N'transaction_id, transaction_type_id, register_number, transaction_date, source_app_id, policy_id_reference, policy_holder_reference, product_name_reference, currency_id_reference, is_policy_holder, customer, address, mobile_phone, email_address, signature_url, photo_url, reference_number, currency_id, currency_code, transaction_value, is_notify_document_completion, notification_date, workflow_template_stage_id, user_id, branch_id, status_id, is_delete', N't_transaction', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7EC00000000 AS DateTime), N'WHI', CAST(0x0000A7EC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (187, N'list_transaction_document', 1, N'transaction_id, document_id, document_code, description, remarks, eform_document_id, eform_id, minimum_files, maximum_files, seq_number, status_id', N'v_m_transaction_document', N'transaction_id, document_id, document_code, description, remarks, eform_document_id, eform_id, minimum_files, maximum_files, seq_number, status_id, jumlah_file', N'seq_number', NULL, N'default', N'PPM', CAST(0x0000A7EC00000000 AS DateTime), N'PPM', CAST(0x0000A7EC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (189, N'insert_document_upload', 5, N'transaction_id, document_type_id, document_name, document_url, hashcode_ori, hashcode, upload_date, session_id', N'proc_insert_document', N'message', NULL, NULL, N'default', N'PPM', CAST(0x0000A7ED00000000 AS DateTime), N'PPM', CAST(0x0000A7ED00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (190, N'insert_transaction_form', 2, N'transaction_form_id, transaction_id, register_number, transaction_sub_type, currency, money_loans, term, identity_date, amount, source_of_fund, gross_income, gross_income_year, is_settlement, settlement_name, policy_no, is_transfer_bank, in_currency, beneficiary_name, bank_name, branch, account_no, transfer_amount, remarks, created_by, created_date, modified_by, modified_date, is_delete', N't_transaction_form', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7ED00000000 AS DateTime), N'WHI', CAST(0x0000A7ED00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (191, N'list_transaction_document_files', 1, N'transaction_document_id, transaction_document_file_id, transaction_id, document_type_id, token, final_hashcode, final_document_index, final_document_name, document_name, document_url, hashcode_ori, hashcode', N'v_m_transaction_document_files', N'transaction_document_id,transaction_document_file_id,transaction_id,document_type_id,token,final_hashcode,final_document_index,final_document_name,document_name,document_url,hashcode_ori,hashcode,upload_by,upload_date,upload_date_str', NULL, NULL, N'default', N'PPM', CAST(0x0000A7ED00000000 AS DateTime), N'PPM', CAST(0x0000A7ED00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (192, N'is_document_complete', 6, N'transaction_id', N'func_is_document_complete', NULL, NULL, NULL, N'default', N'PPM', CAST(0x0000A7EE00000000 AS DateTime), N'PPM', CAST(0x0000A7EE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (193, N'list_os_documnet_transaction', 1, N'transaction_task_id, transaction_id, process_sequence, user_id, register_number, policy_id_reference, policy_holder_reference, branch_desc, type_desc, stage_desc, status_id, status_description, is_delete', N'v_t_transaction_task', N'transaction_task_id, transaction_id, process_sequence, user_id, register_number, policy_id_reference, policy_holder_reference, branch_desc, type_desc, stage_desc, status_id, status_description, is_delete', N'register_number', NULL, N'default', N'KHU', CAST(0x0000A7EE00000000 AS DateTime), N'KHU', CAST(0x0000A7EE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (194, N'list_transaction_process', 1, N'transaction_history_process_id, transaction_id, process_date, user_id, workflow_template_action_id, reason_id, remarks, created_by, created_date, modified_by, modified_date, is_delete', N't_transaction_history_process', N'transaction_history_process_id, transaction_id, process_date, user_id, workflow_template_action_id, reason_id, remarks, created_by, created_date, modified_by, modified_date, is_delete', NULL, NULL, N'default', N'WHI', CAST(0x0000A7EE00000000 AS DateTime), N'WHI', CAST(0x0000A7EE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (195, N'get_latest_transaction', 7, N'transaction_history_process_id, transaction_id, process_date, user_id, workflow_template_action_id, reason_id, remarks, created_by, created_date, modified_by, modified_date, is_delete', N'get_latest_transaction_process', N'transaction_history_process_id, transaction_id, process_date, user_id, workflow_template_action_id, reason_id, remarks, created_by, created_date, modified_by, modified_date, is_delete', N'created_date', NULL, N'default', N'WHI', CAST(0x0000A7EE00000000 AS DateTime), N'WHI', CAST(0x0000A7EE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (198, N'submit_transaction', 5, N'transaction_id, workflow_template_action_id, reason_id, reference_number, remarks, user_id', N'proc_submit_transaction', N'message', NULL, NULL, N'default', N'PPM', CAST(0x0000A7EE0131B464 AS DateTime), N'PPM', CAST(0x0000A7EE0131B464 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (199, N'list_transaction_history_process', 1, N'transaction_history_process_id, transaction_id, register_number, transaction_date, policy_id_reference, policy_holder_reference, status_desc,stage_desc,type_desc,process_date, user_id, user_fullname, workflow_template_action_id, workflow_action_desc, reason_id, reason_desc, remarks, is_delete', N'v_t_transaction_history_process', N'transaction_history_process_id, transaction_id, register_number, transaction_date, policy_id_reference, policy_holder_reference, status_desc,stage_desc,type_desc,process_date, user_id, user_fullname, workflow_template_action_id, workflow_action_desc, reason_id, reason_desc, remarks, is_delete,action_description', N'process_date', NULL, N'default', N'KHU', CAST(0x0000A7EE00000000 AS DateTime), N'KHU', CAST(0x0000A7EE00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (200, N'list_reason_by_action', 7, N'action_id', N'get_reason_by_action', N'reason_id, reason_category_id, description, status_id, created_by, created_date, modified_by, modified_date, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A7EF00000000 AS DateTime), N'WHI', CAST(0x0000A7EF00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (201, N'update_release_transaction', 5, N'transaction_id, user_id, remarks', N'proc_update_os_transaction', N'message', NULL, NULL, N'default', N'KHU', CAST(0x0000A7EF00000000 AS DateTime), N'KHU', CAST(0x0000A7EF00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (202, N'list_reinstatement_type', 1, N'm_reinstatement_type_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'm_reinstatement_type', N'm_reinstatement_type_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A7F400000000 AS DateTime), N'WHI', CAST(0x0000A7F400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (203, N'update_transaction_form', 3, N'transaction_form_id, transaction_id, register_number, transaction_sub_type, currency, money_loans, term, identity_date, amount, source_of_fund, gross_income, gross_income_year, is_settlement, settlement_name, policy_no, is_transfer_bank, in_currency, beneficiary_name, bank_name, branch, account_no, transfer_amount, remarks, created_by, created_date, modified_by, modified_date, is_delete', N't_transaction_form', NULL, NULL, NULL, N'default', N'WHI', CAST(0x0000A7F400000000 AS DateTime), N'WHI', CAST(0x0000A7F400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (204, N'list_transaction_form', 1, N'transaction_form_id, transaction_id, register_number, transaction_sub_type, currency, money_loans, term, identity_date, amount, submission_date, source_of_fund_id, gross_income_id, gross_income_year_id, is_settlement, settlement_name, policy_no, is_transfer_bank, in_currency, beneficiary_name, bank_name, branch, account_no, transfer_amount, remarks, reinstatement_type, m_alteration_type_id, event_date, settlement_policy_no, is_cancel_from_inception, is_surrender,is_delete', N't_transaction_form', N'transaction_form_id, transaction_id, register_number, transaction_sub_type, currency, money_loans, term, identity_date, amount, submission_date, source_of_fund_id, gross_income_id, gross_income_year_id, is_settlement, settlement_name, policy_no, is_transfer_bank, in_currency, beneficiary_name, bank_name, branch, account_no, transfer_amount, remarks, reinstatement_type, m_alteration_type_id, event_date, settlement_policy_no, is_cancel_from_inception, is_surrender,is_delete', N'register_number', NULL, N'default', N'WHI', CAST(0x0000A7F400000000 AS DateTime), N'WHI', CAST(0x0000A7F400000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (206, N'list_alteration_type', 1, N'id, description, is_technical, created_by, created_date, modified_by, modified_date, is_delete', N'm_alteration_type', N'id, description, is_technical, created_by, created_date, modified_by, modified_date, is_delete', N'description', NULL, N'default', N'WHI', CAST(0x0000A7FC00000000 AS DateTime), N'WHI', CAST(0x0000A7FC00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (212, N'list_policy_v', 1, N'policy_no, policy_holder, date_of_birth, insured_name, service_unit_code, service_unit, branch_code, branch, currency, product_category, [plan], premium_method, premium_mode, premium_due_date, installment_premium, policy_status, commencement_date, maturity_date, agent_code, agent_name, agent_status, correspondence_address, city_code, postal_code, policy_holder_telephone_number, policy_holder_mobile_number, policy_holder_email, account_number, beneficiary_name, bank_name, bank_branch', N'view_policy_information', N'policy_no, policy_holder, date_of_birth, insured_name, service_unit_code, service_unit, branch_code, branch, currency, product_category, [plan], premium_method, premium_mode, premium_due_date, installment_premium, policy_status, commencement_date, maturity_date, agent_code, agent_name, agent_status, correspondence_address, city_code, postal_code, policy_holder_telephone_number, policy_holder_mobile_number, policy_holder_email, account_number, beneficiary_name, bank_name, bank_branch', N'policy_no', NULL, N'PL', N'WHI', CAST(0x0000A80000000000 AS DateTime), N'WHI', CAST(0x0000A80000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (213, N'update_document_file', 3, N'transaction_document_file_id, transaction_document_id, document_name, document_url, hashcode_ori, hashcode, upload_by, upload_date, created_by, created_date, modified_by, modified_date, is_delete', N't_transaction_document_file', N'transaction_document_file_id, transaction_document_id, document_name, document_url, hashcode_ori, hashcode, upload_by, upload_date, created_by, created_date, modified_by, modified_date, is_delete', NULL, NULL, N'default', N'PPM', CAST(0x0000A8000104173D AS DateTime), N'PPM', CAST(0x0000A8000104173D AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (214, N'list_source_of_funds', 1, N'source_of_funds_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'm_source_of_funds', N'source_of_funds_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'source_of_funds_id', NULL, N'default', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (215, N'list_gross_income', 1, N'gross_income_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'm_gross_income', N'gross_income_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'gross_income_id', NULL, N'default', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (216, N'list_gross_income_year', 1, N'gross_income_year_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'm_gross_income_year', N'gross_income_year_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'gross_income_year_id', NULL, N'default', N'KHU', CAST(0x0000A80200000000 AS DateTime), N'KHU', CAST(0x0000A80200000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (217, N'list_currency', 1, N'currency_id, currency_code, description, status_id, created_by, created_date, modified_by, modified_date, is_delete', N'm_currency', N'currency_id, currency_code, description, status_id, created_by, created_date, modified_by, modified_date, is_delete', N'currency_id', NULL, N'default', N'KHU', CAST(0x0000A80300000000 AS DateTime), N'KHU', CAST(0x0000A80300000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (218, N'list_receipt_form', 1, N'transaction_id', N'v_t_receipt_form', N'transaction_id, elise, elise_address, city_name, province_name, tanggal, no_registrasi, jenis_transaksi, policy_id_reference, policy_holder_reference, footnote_receipt_form', NULL, NULL, N'default', N'PPM', CAST(0x0000A80801179D27 AS DateTime), N'PPM', CAST(0x0000A80801179D27 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (220, N'insert_reason_category', 2, N'reason_category_id, reason_category_code, description, status_id, is_delete', N'm_reason_category', N'reason_category_id, reason_category_code, description, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (223, N'update_reason_category', 3, N'reason_category_id, reason_category_code, description, status_id, is_delete', N'm_reason_category', N'reason_category_id, reason_category_code, description, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (224, N'insert_reason', 2, N'reason_id, reason_category_id, description, status_id, is_delete', N'm_reason', N'reason_id, reason_category_id, description, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (227, N'update_reason', 3, N'reason_id, reason_category_id, description, status_id, is_delete', N'm_reason', N'reason_id, reason_category_id, description, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (228, N'set_document_received', 5, N'transaction_id, document_type_id, receive_doc_check, user_id', N'proc_document_received', N'message', NULL, NULL, N'default', N'PPM', CAST(0x0000A80F00B7B45E AS DateTime), N'PPM', CAST(0x0000A80F00B7B45E AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (229, N'update_transaction_task', 3, N'transaction_task_id, transaction_id, process_sequence, user_id, status_id, is_delete', N't_transaction_task', N'transaction_task_id, transaction_id, process_sequence, user_id, status_id, is_delete', NULL, NULL, N'default', N'KHU', CAST(0x0000A81600000000 AS DateTime), N'KHU', CAST(0x0000A81600000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (231, N'submit_delegate_transaction', 5, N'transaction_task_id, username, user_id, remarks', N'proc_delegate_transaction', N'message', NULL, NULL, N'default', N'KHU', CAST(0x0000A81700000000 AS DateTime), N'KHU', CAST(0x0000A81700000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (232, N'list_sit', 1, N'No, Module, Date_Raised, Issue_Descriptions, Raised_By, PIC, Priority, Type, Status, Resolution, Target_Date, Closed_Date, Comment', N'x_dev_sit', N'No, Module, Date_Raised, Issue_Descriptions, Raised_By, PIC, Priority, Type, Status, Resolution, Target_Date, Closed_Date, Comment', N'No', NULL, N'default', N'PPM', CAST(0x0000A81700F22B64 AS DateTime), N'PPM', CAST(0x0000A81700F22B64 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (233, N'submit_takeover_transaction', 5, N'transaction_task_id, username', N'proc_takeover_transaction', N'message', NULL, NULL, N'default', N'KHU', CAST(0x0000A81800000000 AS DateTime), N'KHU', CAST(0x0000A81800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (235, N'list_transaction_category_register_non_walk_in', 1, N'transaction_type_id, transaction_type_code, transaction_type_desc, transaction_type_remarks, transaction_category_id, eform_workflow_id, transaction_category_code, transaction_category_desc, is_delete', N'v_m_transaction_type_2', N'transaction_type_id, transaction_type_code, transaction_type_desc, transaction_type_remarks, transaction_category_id, eform_workflow_id, transaction_category_code, transaction_category_desc, is_delete', N'description', NULL, N'default', N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (236, N'insert_sit', 2, N'No, Module, Date_Raised, Issue_Descriptions, Raised_By, PIC, Priority, Type, Status, Resolution, Target_Date, Closed_Date, Comment', N'x_dev_sit', N'No, Module, Date_Raised, Issue_Descriptions, Raised_By, PIC, Priority, Type, Status, Resolution, Target_Date, Closed_Date, Comment', NULL, NULL, N'default', N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'KHU', CAST(0x0000A7E800000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (238, N'update_sit', 3, N'No, Module, Date_Raised, Issue_Descriptions, Raised_By, PIC, Priority, Type, Status, Resolution, Target_Date, Closed_Date, Comment', N'x_dev_sit', N'No, Module, Date_Raised, Issue_Descriptions, Raised_By, PIC, Priority, Type, Status, Resolution, Target_Date, Closed_Date, Comment', NULL, NULL, N'default', N'KHU', CAST(0x0000A81900000000 AS DateTime), N'KHU', CAST(0x0000A81900000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (239, N'source_transaction', 1, N'source_transaction_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'm_source_transaction', N'source_transaction_id, description, created_by, created_date, modified_by, modified_date, is_delete', N'description', NULL, N'default', N'PPM', CAST(0x0000A81C00000000 AS DateTime), N'PPM', CAST(0x0000A81C00000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (240, N'get_alteration_information', 5, N'registration_no', N'EDITS.proc_get_alteration_information', NULL, NULL, NULL, N'PL', N'PPM', CAST(0x0000A82000000000 AS DateTime), N'PPM', CAST(0x0000A82000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (241, N'get_claim_information', 5, N'claim_no', N'EDITS.proc_get_claim_information', NULL, NULL, NULL, N'PL', N'PPM', CAST(0x0000A82000000000 AS DateTime), N'PPM', CAST(0x0000A82000000000 AS DateTime), N'0')
INSERT [dbo].[s_action_list] ([action_id], [action_name], [action_type], [condition_field], [result_object], [result_field], [default_order], [max_result_row], [datasource], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (242, N'get_new_business_information', 5, N'proposal_no', N'EDITS.proc_get_new_business_information', NULL, NULL, NULL, N'PL', N'PPM', CAST(0x0000A82000000000 AS DateTime), N'PPM', CAST(0x0000A82000000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[s_action_list] OFF
/****** Object:  Table [dbo].[m_transaction_form_template]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_transaction_form_template](
	[transaction_form_template_id] [smallint] IDENTITY(1,1) NOT NULL,
	[description] [varchar](150) NOT NULL,
	[filename] [varchar](200) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK_m_transaction_form_template] PRIMARY KEY CLUSTERED 
(
	[transaction_form_template_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_transaction_form_template] ON
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'Claim', N'_claim', N'PPM', CAST(0x0000A7B700000000 AS DateTime), N'WHI', CAST(0x0000A7B700000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'Reinstatement', N'_reinstatement', N'PPM', CAST(0x0000A7B800000000 AS DateTime), N'WHI', CAST(0x0000A7B800000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'Change Premium Method', N'_change_premium_method', N'WHI', CAST(0x0000A7E400000000 AS DateTime), N'WHI', CAST(0x0000A7E400000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, N'Policy Alteration Technical', N'_policy_alteration_technical', N'WHI', CAST(0x0000A80200000000 AS DateTime), N'WHI', CAST(0x0000A80200000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'Policy Alteration Non Technical', N'_policy_alteration_non_technical', N'WHI', CAST(0x0000A80200000000 AS DateTime), N'WHI', CAST(0x0000A80200000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, N'Cancel from Inception/Surrender', N'_cancel_from_inception_surrender', N'WHI', CAST(0x0000A80200000000 AS DateTime), N'WHI', CAST(0x0000A80200000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'Benefit Withdrawn/Maturity', N'_benefit_withdrawn_or_maturity', N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'Withdrawal Fund', N'_withdrawal_fund', N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'Change Single Top Up', N'_change_single_top_up', N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'KHU', CAST(0x0000A80E00000000 AS DateTime), N'0')
INSERT [dbo].[m_transaction_form_template] ([transaction_form_template_id], [description], [filename], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'Policy Loan', N'_policy_loan', N'WHI', CAST(0x0000A80E00000000 AS DateTime), N'WHI', CAST(0x0000A80E00000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_transaction_form_template] OFF
/****** Object:  Trigger [s_action_list_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_action_list_Update]      
ON [dbo].[s_action_list]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([action_id]) THEN '[action_id]-' ELSE '' END + 
CASE WHEN UPDATE([action_name]) THEN '[action_name]-' ELSE '' END + 
CASE WHEN UPDATE([action_type]) THEN '[action_type]-' ELSE '' END + 
CASE WHEN UPDATE([condition_field]) THEN '[condition_field]-' ELSE '' END + 
CASE WHEN UPDATE([result_object]) THEN '[result_object]-' ELSE '' END + 
CASE WHEN UPDATE([result_field]) THEN '[result_field]-' ELSE '' END + 
CASE WHEN UPDATE([default_order]) THEN '[default_order]-' ELSE '' END + 
CASE WHEN UPDATE([max_result_row]) THEN '[max_result_row]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_s_action_list]
([action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[action_id]) as [action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_s_action_list]
([action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[action_id]) as [action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [s_action_list_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_action_list_Insert] 
ON [dbo].[s_action_list]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_s_action_list]
([action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[action_id]) as [action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [s_action_list_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_action_list_Delete]    
ON [dbo].[s_action_list]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_s_action_list]
([action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[action_id]) as [action_id],[action_name],[action_type],[condition_field],[result_object],[result_field],[default_order],[max_result_row],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_transaction_form_template_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_form_template_Update]      
ON [dbo].[m_transaction_form_template]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_form_template_id]) THEN '[transaction_form_template_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([filename]) THEN '[filename]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_transaction_form_template]
([transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(smallint,[transaction_form_template_id]) as [transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_transaction_form_template]
([transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(smallint,[transaction_form_template_id]) as [transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_transaction_form_template_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_form_template_Insert] 
ON [dbo].[m_transaction_form_template]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_transaction_form_template]
([transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(smallint,[transaction_form_template_id]) as [transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_transaction_form_template_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_form_template_Delete]    
ON [dbo].[m_transaction_form_template]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_transaction_form_template]
([transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(smallint,[transaction_form_template_id]) as [transaction_form_template_id],[description],[filename],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [s_error_code_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_error_code_Update]      
ON [dbo].[s_error_code]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([error_code]) THEN '[error_code]-' ELSE '' END + 
CASE WHEN UPDATE([error_description]) THEN '[error_description]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_s_error_code]
([error_code],[error_description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [error_code],[error_description],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_s_error_code]
([error_code],[error_description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [error_code],[error_description],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [s_error_code_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_error_code_Insert] 
ON [dbo].[s_error_code]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_s_error_code]
([error_code],[error_description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [error_code],[error_description],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [s_error_code_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_error_code_Delete]    
ON [dbo].[s_error_code]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_s_error_code]
([error_code],[error_description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [error_code],[error_description],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_group_pic_Update]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_pic_Update]      
ON [dbo].[m_group_pic]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([group_pic_id]) THEN '[group_pic_id]-' ELSE '' END + 
CASE WHEN UPDATE([group_pic_code]) THEN '[group_pic_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_group_pic]
([group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_pic_id]) as [group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_group_pic]
([group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_pic_id]) as [group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_group_pic_Insert]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_pic_Insert] 
ON [dbo].[m_group_pic]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_group_pic]
([group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_pic_id]) as [group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_group_pic_Delete]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_pic_Delete]    
ON [dbo].[m_group_pic]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_group_pic]
([group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_pic_id]) as [group_pic_id],[group_pic_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [CreateDocCode]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[CreateDocCode] ON [dbo].[m_document]
	FOR INSERT 
AS 

BEGIN

	SET NOCOUNT ON;

	DECLARE @rownums VARCHAR(5);
	DECLARE @doc_code VARCHAR(8);

    SET @rownums = (
		SELECT CAST((COUNT(document_id)) AS VARCHAR) 
		FROM m_document
	);

	SET @doc_code = (SELECT 'D' + STUFF('00000', 5 - LEN(@rownums) + 1, LEN(@rownums), @rownums));

	UPDATE m_document
	SET document_code = @doc_code
	WHERE document_id IN (
		SELECT document_id 
		FROM inserted
	);

END
GO
/****** Object:  Trigger [m_status_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_status_Update]      
ON [dbo].[m_status]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([status_code]) THEN '[status_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_status]
([status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[status_id]) as [status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_status]
([status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[status_id]) as [status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_status_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_status_Insert] 
ON [dbo].[m_status]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_status]
([status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[status_id]) as [status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_status_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_status_Delete]    
ON [dbo].[m_status]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_status]
([status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[status_id]) as [status_id],[status_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_source_app_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_source_app_Update]      
ON [dbo].[m_source_app]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([source_app_id]) THEN '[source_app_id]-' ELSE '' END + 
CASE WHEN UPDATE([source_app_code]) THEN '[source_app_code]-' ELSE '' END + 
CASE WHEN UPDATE([source_app_name]) THEN '[source_app_name]-' ELSE '' END + 
CASE WHEN UPDATE([source_main_url]) THEN '[source_main_url]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_source_app]
([source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[source_app_id]) as [source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_source_app]
([source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[source_app_id]) as [source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_source_app_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_source_app_Insert] 
ON [dbo].[m_source_app]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_source_app]
([source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[source_app_id]) as [source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_source_app_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_source_app_Delete]    
ON [dbo].[m_source_app]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_source_app]
([source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[source_app_id]) as [source_app_id],[source_app_code],[source_app_name],[source_main_url],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [s_m_log_type_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_m_log_type_Update]      
ON [dbo].[s_m_log_type]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([log_type_id]) THEN '[log_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([icon]) THEN '[icon]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_s_m_log_type]
([log_type_id],[icon],[description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [log_type_id],[icon],[description],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_s_m_log_type]
([log_type_id],[icon],[description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [log_type_id],[icon],[description],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [s_m_log_type_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_m_log_type_Insert] 
ON [dbo].[s_m_log_type]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_s_m_log_type]
([log_type_id],[icon],[description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [log_type_id],[icon],[description],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [s_m_log_type_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_m_log_type_Delete]    
ON [dbo].[s_m_log_type]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_s_m_log_type]
([log_type_id],[icon],[description],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [log_type_id],[icon],[description],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [s_action_type_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_action_type_Update]      
ON [dbo].[s_action_type]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([id_action_type]) THEN '[id_action_type]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_s_action_type]
([id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_s_action_type]
([id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [s_action_type_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_action_type_Insert] 
ON [dbo].[s_action_type]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_s_action_type]
([id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [s_action_type_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[s_action_type_Delete]    
ON [dbo].[s_action_type]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_s_action_type]
([id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT [id_action_type],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [TTransactionFormTriggerUpdate]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE TRIGGER [dbo].[TTransactionFormTriggerUpdate] 
   ON  [dbo].[t_transaction_form]
   AFTER UPDATE
AS 
BEGIN

	SET NOCOUNT ON;

	INSERT INTO t_transaction_form_log (
		transaction_form_id, 
		transaction_id, 
		register_number, 
		transaction_sub_type, 
		currency, 
		money_loans, 
		term, 
		installment_date,
		identity_date, 
		amount,
		submission_date, 
		source_of_fund_id, 
		gross_income_id, 
		gross_income_year_id, 
		is_settlement, 
		settlement_name, 
		policy_no, 
		is_transfer_bank, 
		in_currency, 
		beneficiary_name, 
		bank_name, 
		branch, 
		account_no, 
		transfer_amount, 
		remarks, 
		reinstatement_type,
		m_alteration_type_id,
		event_date,
		settlement_policy_no,
		is_cancel_from_inception,
		is_surrender,
		created_by, 
		created_date
	)
	SELECT
		transaction_form_id, 
		transaction_id, 
		register_number, 
		transaction_sub_type, 
		currency, 
		money_loans, 
		term, 
		installment_date,
		identity_date, 
		amount,
		submission_date, 
		source_of_fund_id, 
		gross_income_id, 
		gross_income_year_id, 
		is_settlement, 
		settlement_name, 
		policy_no, 
		is_transfer_bank, 
		in_currency, 
		beneficiary_name, 
		bank_name, 
		branch, 
		account_no, 
		transfer_amount, 
		remarks,
		reinstatement_type,
		m_alteration_type_id, 
		event_date,
		settlement_policy_no,
		is_cancel_from_inception,
		is_surrender,
		modified_by, 
		modified_date
	FROM
	inserted

END
GO
/****** Object:  Trigger [TTransactionFormTrigger]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE TRIGGER [dbo].[TTransactionFormTrigger] 
   ON  [dbo].[t_transaction_form]
   AFTER INSERT
AS 
BEGIN

	SET NOCOUNT ON;

	INSERT INTO t_transaction_form_log (
		transaction_form_id, 
		transaction_id, 
		register_number, 
		transaction_sub_type, 
		currency, 
		money_loans, 
		term, 
		installment_date,
		identity_date, 
		amount,
		submission_date,
		source_of_fund_id, 
		gross_income_id, 
		gross_income_year_id, 
		is_settlement, 
		settlement_name, 
		policy_no, 
		is_transfer_bank, 
		in_currency, 
		beneficiary_name, 
		bank_name, 
		branch, 
		account_no, 
		transfer_amount, 
		remarks, 
		reinstatement_type,
		m_alteration_type_id,
		event_date,
		settlement_policy_no,
		is_cancel_from_inception,
		is_surrender,
		created_by, 
		created_date
	)
	SELECT
		transaction_form_id, 
		transaction_id, 
		register_number, 
		transaction_sub_type, 
		currency, 
		money_loans, 
		term, 
		installment_date,
		identity_date, 
		amount,
		submission_date, 
		source_of_fund_id, 
		gross_income_id, 
		gross_income_year_id, 
		is_settlement, 
		settlement_name, 
		policy_no, 
		is_transfer_bank, 
		in_currency, 
		beneficiary_name, 
		bank_name, 
		branch, 
		account_no, 
		transfer_amount, 
		remarks, 
		reinstatement_type,
		m_alteration_type_id,
		event_date,
		settlement_policy_no,
		is_cancel_from_inception,
		is_surrender,
		created_by, 
		created_date
	FROM
	inserted

END
GO
/****** Object:  Trigger [m_transaction_category_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_category_Update]      
ON [dbo].[m_transaction_category]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_category_id]) THEN '[transaction_category_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_category_code]) THEN '[transaction_category_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_transaction_category]
([transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_category_id]) as [transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_transaction_category]
([transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_category_id]) as [transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_transaction_category_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_category_Insert] 
ON [dbo].[m_transaction_category]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_transaction_category]
([transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_category_id]) as [transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_transaction_category_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_category_Delete]    
ON [dbo].[m_transaction_category]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_transaction_category]
([transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_category_id]) as [transaction_category_id],[transaction_category_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [t_transaction_form_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_form_Insert] 
ON [dbo].[t_transaction_form]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_t_transaction_form]
([transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_form_id]) as [transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [t_transaction_form_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_form_Delete]    
ON [dbo].[t_transaction_form]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_t_transaction_form]
([transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_form_id]) as [transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [t_transaction_form_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[t_transaction_form_Update]      
ON [dbo].[t_transaction_form]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_form_id]) THEN '[transaction_form_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_id]) THEN '[transaction_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_sub_type]) THEN '[transaction_sub_type]-' ELSE '' END + 
CASE WHEN UPDATE([currency]) THEN '[currency]-' ELSE '' END + 
CASE WHEN UPDATE([money_loans]) THEN '[money_loans]-' ELSE '' END + 
CASE WHEN UPDATE([term]) THEN '[term]-' ELSE '' END + 
CASE WHEN UPDATE([identity_date]) THEN '[identity_date]-' ELSE '' END + 
CASE WHEN UPDATE([amount]) THEN '[amount]-' ELSE '' END + 
CASE WHEN UPDATE([submission_date]) THEN '[submission_date]-' ELSE '' END + 
CASE WHEN UPDATE([source_of_fund_id]) THEN '[source_of_fund_id]-' ELSE '' END + 
CASE WHEN UPDATE([gross_income_id]) THEN '[gross_income_id]-' ELSE '' END + 
CASE WHEN UPDATE([gross_income_year_id]) THEN '[gross_income_year_id]-' ELSE '' END + 
CASE WHEN UPDATE([is_settlement]) THEN '[is_settlement]-' ELSE '' END + 
CASE WHEN UPDATE([settlement_name]) THEN '[settlement_name]-' ELSE '' END + 
CASE WHEN UPDATE([policy_no]) THEN '[policy_no]-' ELSE '' END + 
CASE WHEN UPDATE([is_transfer_bank]) THEN '[is_transfer_bank]-' ELSE '' END + 
CASE WHEN UPDATE([in_currency]) THEN '[in_currency]-' ELSE '' END + 
CASE WHEN UPDATE([beneficiary_name]) THEN '[beneficiary_name]-' ELSE '' END + 
CASE WHEN UPDATE([bank_name]) THEN '[bank_name]-' ELSE '' END + 
CASE WHEN UPDATE([branch]) THEN '[branch]-' ELSE '' END + 
CASE WHEN UPDATE([account_no]) THEN '[account_no]-' ELSE '' END + 
CASE WHEN UPDATE([transfer_amount]) THEN '[transfer_amount]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_t_transaction_form]
([transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_form_id]) as [transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_t_transaction_form]
([transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[transaction_form_id]) as [transaction_form_id],[transaction_id],[transaction_sub_type],[currency],[money_loans],[term],[identity_date],[amount],[submission_date],[source_of_fund_id],[gross_income_id],[gross_income_year_id],[is_settlement],[settlement_name],[policy_no],[is_transfer_bank],[in_currency],[beneficiary_name],[bank_name],[branch],[account_no],[transfer_amount],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_component_type_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_component_type_Update]      
ON [dbo].[m_component_type]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([component_type_id]) THEN '[component_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([component_type_code]) THEN '[component_type_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_component_type]
([component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[component_type_id]) as [component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_component_type]
([component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[component_type_id]) as [component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_component_type_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_component_type_Insert] 
ON [dbo].[m_component_type]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_component_type]
([component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[component_type_id]) as [component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_component_type_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_component_type_Delete]    
ON [dbo].[m_component_type]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_component_type]
([component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[component_type_id]) as [component_type_id],[component_type_code],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_document_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_document_Update]      
ON [dbo].[m_document]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([document_id]) THEN '[document_id]-' ELSE '' END + 
CASE WHEN UPDATE([document_code]) THEN '[document_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_document]
([document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_id]) as [document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_document]
([document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_id]) as [document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_document_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_document_Insert] 
ON [dbo].[m_document]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_document]
([document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_id]) as [document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_document_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_document_Delete]    
ON [dbo].[m_document]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_document]
([document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_id]) as [document_id],[document_code],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[m_data_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_data_type](
	[data_type_id] [int] IDENTITY(1,1) NOT NULL,
	[data_type_code] [varchar](50) NOT NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [varchar](1) NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_data_t__676247A246BD6CDA] PRIMARY KEY CLUSTERED 
(
	[data_type_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_city]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_city](
	[city_id] [int] IDENTITY(1,1) NOT NULL,
	[city_code] [char](6) NULL,
	[province_id] [int] NOT NULL,
	[city_name] [varchar](160) NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_city__031491A8629A9179] PRIMARY KEY CLUSTERED 
(
	[city_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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_m_city_name] ON [dbo].[m_city] 
(
	[city_name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_city_prov_id] ON [dbo].[m_city] 
(
	[province_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_city] ON
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, NULL, 1, N'Kabupaten Administrasi Kepulauan Seribu', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, NULL, 1, N'Kota Administrasi Jakarta Barat', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, NULL, 1, N'Kota Administrasi Jakarta Pusat', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, NULL, 1, N'Kota Administrasi Jakarta Selatan', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, NULL, 1, N'Kota Administrasi Jakarta Timur', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, NULL, 1, N'Kota Administrasi Jakarta Utara', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, NULL, 2, N'Kabupaten Badung', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, NULL, 2, N'Kabupaten Bangli', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, NULL, 2, N'Kabupaten Buleleng', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, NULL, 2, N'Kabupaten Gianyar', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, NULL, 2, N'Kabupaten Jembrana', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, NULL, 2, N'Kabupaten Karangasem', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, NULL, 2, N'Kabupaten Klungkung', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, NULL, 2, N'Kabupaten Tabanan', N'WHI', CAST(0x0000A78300000000 AS DateTime), N'WHI', CAST(0x0000A78300000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65951, N'000001', 3, N'Kabupaten Gianyar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65952, N'000002', 3, N'Kabupaten Bangli', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65953, N'000003', 3, N'Kabupaten Buleleng', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65954, N'000004', 3, N'Kabupaten Tabanan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65955, N'000005', 3, N'Kabupaten Karangasem', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65956, N'000006', 3, N'Kabupaten Badung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65957, N'000007', 3, N'Kabupaten Jembrana', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65958, N'000008', 3, N'Kabupaten Klungkung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65959, N'000009', 3, N'Kota Denpasar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65960, N'000010', 4, N'Kabupaten Bangka Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65961, N'000011', 4, N'Kabupaten Bangka Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65962, N'000012', 4, N'Kabupaten Belitung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65963, N'000013', 4, N'Kota Pangkal Pinang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65964, N'000014', 4, N'Kabupaten Bangka Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65965, N'000015', 4, N'Kabupaten Bangka', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65966, N'000016', 4, N'Kabupaten Belitung Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65967, N'000017', 5, N'Kabupaten Lebak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65968, N'000018', 5, N'Kabupaten Serang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65969, N'000019', 5, N'Kota Serang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65970, N'000020', 5, N'Kabupaten Tangerang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65971, N'000021', 5, N'Kota Tangerang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65972, N'000022', 5, N'Kabupaten Pandeglang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65973, N'000023', 5, N'Kota Tangerang Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65974, N'000024', 5, N'Kota Cilegon', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65975, N'000025', 6, N'Kabupaten Seluma', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65976, N'000026', 6, N'Kabupaten Bengkulu Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65977, N'000027', 6, N'Kota Bengkulu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65978, N'000028', 6, N'Kabupaten Muko Muko', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65979, N'000029', 6, N'Kabupaten Rejang Lebong', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65980, N'000030', 6, N'Kabupaten Kaur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65981, N'000031', 6, N'Kabupaten Bengkulu Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65982, N'000032', 6, N'Kabupaten Kepahiang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65983, N'000033', 6, N'Kabupaten Lebong', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65984, N'000034', 6, N'Kabupaten Bengkulu Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65985, N'000035', 7, N'Kabupaten Gunung Kidul', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65986, N'000036', 7, N'Kota Yogyakarta', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65987, N'000037', 7, N'Kabupaten Kulon Progo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65988, N'000038', 7, N'Kabupaten Sleman', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65989, N'000039', 7, N'Kabupaten Bantul', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65990, N'000040', 8, N'Kota Jakarta Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65991, N'000041', 8, N'Kota Jakarta Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65992, N'000042', 8, N'Kota Jakarta Pusat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65993, N'000043', 8, N'Kota Jakarta Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65994, N'000044', 8, N'Kota Jakarta Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65995, N'000045', 8, N'Kabupaten Kepulauan Seribu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65996, N'000046', 9, N'Kabupaten Boalemo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65997, N'000047', 9, N'Kabupaten Pohuwato', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65998, N'000048', 9, N'Kabupaten Gorontalo Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65999, N'000049', 9, N'Kabupaten Gorontalo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66000, N'000050', 9, N'Kabupaten Bone Bolango', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66001, N'000051', 9, N'Kota Gorontalo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66002, N'000052', 10, N'Kabupaten Tebo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66003, N'000053', 10, N'Kabupaten Tanjung Jabung Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66004, N'000054', 10, N'Kabupaten Merangin', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66005, N'000055', 10, N'Kota Jambi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66006, N'000056', 10, N'Kabupaten Bungo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66007, N'000057', 10, N'Kota Sungaipenuh', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66008, N'000058', 10, N'Kabupaten Muaro Jambi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66009, N'000059', 10, N'Kabupaten Kerinci', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66010, N'000060', 10, N'Kabupaten Sarolangun', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66011, N'000061', 10, N'Kabupaten Tanjung Jabung Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66012, N'000062', 10, N'Kabupaten Batang Hari', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66013, N'000063', 11, N'Kabupaten Indramayu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66014, N'000064', 11, N'Kabupaten Cirebon', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66015, N'000065', 11, N'Kabupaten Cianjur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66016, N'000066', 11, N'Kabupaten Sukabumi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66017, N'000067', 11, N'Kota Sukabumi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66018, N'000068', 11, N'Kabupaten Purwakarta', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66019, N'000069', 11, N'Kabupaten Garut', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66020, N'000070', 11, N'Kabupaten Sumedang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66021, N'000071', 11, N'Kota Bandung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66022, N'000072', 11, N'Kabupaten Karawang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66023, N'000073', 11, N'Kabupaten Bogor', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66024, N'000074', 11, N'Kota Tasikmalaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66025, N'000075', 11, N'Kabupaten Bekasi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66026, N'000076', 11, N'Kabupaten Tasikmalaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66027, N'000077', 11, N'Kota Depok', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66028, N'000078', 11, N'Kabupaten Subang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66029, N'000079', 11, N'Kota Bogor', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66030, N'000080', 11, N'Kabupaten Ciamis', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66031, N'000081', 11, N'Kabupaten Majalengka', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66032, N'000082', 11, N'Kabupaten Kuningan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66033, N'000083', 11, N'Kabupaten Bandung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66034, N'000084', 11, N'Kabupaten Bandung Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66035, N'000085', 11, N'Kabupaten Pangandaran', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66036, N'000086', 11, N'Kota Bekasi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
GO
print 'Processed 100 total records'
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66037, N'000087', 11, N'Kota Banjar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66038, N'000088', 11, N'Kota Cirebon', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66039, N'000089', 11, N'Kota Cimahi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66040, N'000090', 12, N'Kabupaten Wonogiri', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66041, N'000091', 12, N'Kabupaten Batang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66042, N'000092', 12, N'Kabupaten Wonosobo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66043, N'000093', 12, N'Kabupaten Boyolali', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66044, N'000094', 12, N'Kabupaten Klaten', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66045, N'000095', 12, N'Kabupaten Demak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66046, N'000096', 12, N'Kabupaten Pekalongan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66047, N'000097', 12, N'Kabupaten Temanggung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66048, N'000098', 12, N'Kabupaten Grobogan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66049, N'000099', 12, N'Kabupaten Pati', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66050, N'000100', 12, N'Kabupaten Magelang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66051, N'000101', 12, N'Kabupaten Sukoharjo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66052, N'000102', 12, N'Kabupaten Kendal', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66053, N'000103', 12, N'Kabupaten Jepara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66054, N'000104', 12, N'Kabupaten Pemalang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66055, N'000105', 12, N'Kabupaten Tegal', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66056, N'000106', 12, N'Kabupaten Banyumas', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66057, N'000107', 12, N'Kabupaten Banjarnegara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66058, N'000108', 12, N'Kabupaten Brebes', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66059, N'000109', 12, N'Kabupaten Cilacap', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66060, N'000110', 12, N'Kabupaten Semarang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66061, N'000111', 12, N'Kabupaten Kudus', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66062, N'000112', 12, N'Kabupaten Blora', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66063, N'000113', 12, N'Kota Semarang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66064, N'000114', 12, N'Kota Salatiga', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66065, N'000115', 12, N'Kota Tegal', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66066, N'000116', 12, N'Kabupaten Karanganyar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66067, N'000117', 12, N'Kabupaten Sragen', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66068, N'000118', 12, N'Kabupaten Rembang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66069, N'000119', 12, N'Kabupaten Kebumen', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66070, N'000120', 12, N'Kota Surakarta', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66071, N'000121', 12, N'Kabupaten Purbalingga', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66072, N'000122', 12, N'Kabupaten Purworejo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66073, N'000123', 12, N'Kota Pekalongan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66074, N'000124', 12, N'Kota Magelang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66075, N'000125', 13, N'Kabupaten Bangkalan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66076, N'000126', 13, N'Kabupaten Banyuwangi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66077, N'000127', 13, N'Kota Batu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66078, N'000128', 13, N'Kota Blitar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66079, N'000129', 13, N'Kabupaten Blitar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66080, N'000130', 13, N'Kabupaten Bojonegoro', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66081, N'000131', 13, N'Kabupaten Bondowoso', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66082, N'000132', 13, N'Kabupaten Gresik', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66083, N'000133', 13, N'Kabupaten Jember', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66084, N'000134', 13, N'Kabupaten Jombang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66085, N'000135', 13, N'Kota Kediri', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66086, N'000136', 13, N'Kabupaten Kediri', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66087, N'000137', 13, N'Kabupaten Lamongan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66088, N'000138', 13, N'Kabupaten Lumajang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66089, N'000139', 13, N'Kota Madiun', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66090, N'000140', 13, N'Kabupaten Madiun', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66091, N'000141', 13, N'Kabupaten Magetan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66092, N'000142', 13, N'Kota Malang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66093, N'000143', 13, N'Kabupaten Malang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66094, N'000144', 13, N'Kota Mojokerto', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66095, N'000145', 13, N'Kabupaten Mojokerto', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66096, N'000146', 13, N'Kabupaten Nganjuk', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66097, N'000147', 13, N'Kabupaten Ngawi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66098, N'000148', 13, N'Kabupaten Pacitan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66099, N'000149', 13, N'Kabupaten Pamekasan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66100, N'000150', 13, N'Kota Pasuruan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66101, N'000151', 13, N'Kabupaten Pasuruan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66102, N'000152', 13, N'Kabupaten Ponorogo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66103, N'000153', 13, N'Kota Probolinggo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66104, N'000154', 13, N'Kabupaten Probolinggo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66105, N'000155', 13, N'Kabupaten Sampang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66106, N'000156', 13, N'Kabupaten Sidoarjo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66107, N'000157', 13, N'Kabupaten Situbondo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66108, N'000158', 13, N'Kabupaten Sumenep', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66109, N'000159', 13, N'Kota Surabaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66110, N'000160', 13, N'Kabupaten Trenggalek', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66111, N'000161', 13, N'Kabupaten Tuban', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66112, N'000162', 13, N'Kabupaten Tulungagung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66113, N'000163', 14, N'Kabupaten Bengkayang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66114, N'000164', 14, N'Kabupaten Kapuas Hulu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66115, N'000165', 14, N'Kabupaten Kayong Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66116, N'000166', 14, N'Kabupaten Ketapang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66117, N'000167', 14, N'Kabupaten Kubu Raya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66118, N'000168', 14, N'Kabupaten Landak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66119, N'000169', 14, N'Kabupaten Melawi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66120, N'000170', 14, N'Kabupaten Mempawah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66121, N'000171', 14, N'Kota Pontianak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66122, N'000172', 14, N'Kabupaten Sambas', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66123, N'000173', 14, N'Kabupaten Sanggau', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66124, N'000174', 14, N'Kabupaten Sekadau', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66125, N'000175', 14, N'Kota Singkawang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66126, N'000176', 14, N'Kabupaten Sintang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66127, N'000177', 15, N'Kabupaten Balangan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66128, N'000178', 15, N'Kabupaten Banjar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66129, N'000179', 15, N'Kota Banjarbaru', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66130, N'000180', 15, N'Kota Banjarmasin', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66131, N'000181', 15, N'Kabupaten Barito Kuala', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66132, N'000182', 15, N'Kabupaten Hulu Sungai Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66133, N'000183', 15, N'Kabupaten Hulu Sungai Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66134, N'000184', 15, N'Kabupaten Hulu Sungai Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66135, N'000185', 15, N'Kabupaten Kotabaru', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66136, N'000186', 15, N'Kabupaten Tabalong', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66137, N'000187', 15, N'Kabupaten Tanah Bumbu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
GO
print 'Processed 200 total records'
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66138, N'000188', 15, N'Kabupaten Tanah Laut', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66139, N'000189', 15, N'Kabupaten Tapin', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66140, N'000190', 16, N'Kabupaten Barito Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66141, N'000191', 16, N'Kabupaten Barito Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66142, N'000192', 16, N'Kabupaten Barito Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66143, N'000193', 16, N'Kabupaten Gunung Mas', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66144, N'000194', 16, N'Kabupaten Kapuas', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66145, N'000195', 16, N'Kabupaten Katingan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66146, N'000196', 16, N'Kabupaten Kotawaringin Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66147, N'000197', 16, N'Kabupaten Kotawaringin Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66148, N'000198', 16, N'Kabupaten Lamandau', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66149, N'000199', 16, N'Kabupaten Murung Raya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66150, N'000200', 16, N'Kota Palangka Raya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66151, N'000201', 16, N'Kabupaten Pulang Pisau', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66152, N'000202', 16, N'Kabupaten Seruyan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66153, N'000203', 16, N'Kabupaten Sukamara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66154, N'000204', 17, N'Kota Balikpapan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66155, N'000205', 17, N'Kabupaten Berau', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66156, N'000206', 17, N'Kota Bontang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66157, N'000207', 17, N'Kabupaten Kutai Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66158, N'000208', 17, N'Kabupaten Kutai Kartanegara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66159, N'000209', 17, N'Kabupaten Kutai Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66160, N'000210', 17, N'Kabupaten Mahakam Ulu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66161, N'000211', 17, N'Kabupaten Paser', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66162, N'000212', 17, N'Kabupaten Penajam Paser Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66163, N'000213', 17, N'Kota Samarinda', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66164, N'000214', 18, N'Kabupaten Bulungan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66165, N'000215', 18, N'Kabupaten Malinau', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66166, N'000216', 18, N'Kabupaten Nunukan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66167, N'000217', 18, N'Kabupaten Tana Tidung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66168, N'000218', 18, N'Kota Tarakan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66169, N'000219', 19, N'Kota Batam', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66170, N'000220', 19, N'Kabupaten Bintan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66171, N'000221', 19, N'Kabupaten Karimun', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66172, N'000222', 19, N'Kabupaten Kepulauan Anambas', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66173, N'000223', 19, N'Kabupaten Lingga', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66174, N'000224', 19, N'Kabupaten Natuna', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66175, N'000225', 19, N'Kota Tanjung Pinang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66176, N'000226', 20, N'Kota Bandar Lampung', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66177, N'000227', 20, N'Kabupaten Lampung Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66178, N'000228', 20, N'Kabupaten Lampung Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66179, N'000229', 20, N'Kabupaten Lampung Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66180, N'000230', 20, N'Kabupaten Lampung Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66181, N'000231', 20, N'Kabupaten Lampung Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66182, N'000232', 20, N'Kabupaten Mesuji', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66183, N'000233', 20, N'Kota Metro', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66184, N'000234', 20, N'Kabupaten Pesawaran', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66185, N'000235', 20, N'Kabupaten Pesisir Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66186, N'000236', 20, N'Kabupaten Pringsewu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66187, N'000237', 20, N'Kabupaten Tanggamus', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66188, N'000238', 20, N'Kabupaten Tulang Bawang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66189, N'000239', 20, N'Kabupaten Tulang Bawang Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66190, N'000240', 20, N'Kabupaten Way Kanan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66191, N'000241', 21, N'Kota Ambon', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66192, N'000242', 21, N'Kabupaten Buru', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66193, N'000243', 21, N'Kabupaten Buru Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66194, N'000244', 21, N'Kabupaten Kepulauan Aru', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66195, N'000245', 21, N'Kabupaten Maluku Barat Daya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66196, N'000246', 21, N'Kabupaten Maluku Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66197, N'000247', 21, N'Kabupaten Maluku Tenggara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66198, N'000248', 21, N'Kabupaten Maluku Tenggara Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66199, N'000249', 21, N'Kabupaten Seram Bagian Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66200, N'000250', 21, N'Kabupaten Seram Bagian Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66201, N'000251', 21, N'Kota Tual', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66202, N'000252', 22, N'Kabupaten Halmahera Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66203, N'000253', 22, N'Kabupaten Halmahera Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66204, N'000254', 22, N'Kabupaten Halmahera Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66205, N'000255', 22, N'Kabupaten Halmahera Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66206, N'000256', 22, N'Kabupaten Halmahera Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66207, N'000257', 22, N'Kabupaten Kepulauan Sula', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66208, N'000258', 22, N'Kabupaten Pulau Morotai', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66209, N'000259', 22, N'Kabupaten Pulau Taliabu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66210, N'000260', 22, N'Kota Ternate', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66211, N'000261', 22, N'Kota Tidore Kepulauan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66212, N'000262', 23, N'Kabupaten Aceh Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66213, N'000263', 23, N'Kabupaten Aceh Barat Daya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66214, N'000264', 23, N'Kabupaten Aceh Besar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66215, N'000265', 23, N'Kabupaten Aceh Jaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66216, N'000266', 23, N'Kabupaten Aceh Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66217, N'000267', 23, N'Kabupaten Aceh Singkil', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66218, N'000268', 23, N'Kabupaten Aceh Tamiang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66219, N'000269', 23, N'Kabupaten Aceh Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66220, N'000270', 23, N'Kabupaten Aceh Tenggara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66221, N'000271', 23, N'Kabupaten Aceh Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66222, N'000272', 23, N'Kabupaten Aceh Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66223, N'000273', 23, N'Kota Banda Aceh', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66224, N'000274', 23, N'Kabupaten Bener Meriah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66225, N'000275', 23, N'Kabupaten Bireuen', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66226, N'000276', 23, N'Kabupaten Gayo Lues', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66227, N'000277', 23, N'Kota Lhokseumawe', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66228, N'000278', 23, N'Kabupaten Nagan Raya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66229, N'000279', 23, N'Kabupaten Pidie', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66230, N'000280', 23, N'Kabupaten Pidie Jaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66231, N'000281', 23, N'Kota Sabang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66232, N'000282', 23, N'Kabupaten Simeulue', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66233, N'000283', 23, N'Kota Subulussalam', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66234, N'000284', 24, N'Kota Bima', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66235, N'000285', 24, N'Kabupaten Bima', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66236, N'000286', 24, N'Kabupaten Dompu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66237, N'000287', 24, N'Kabupaten Lombok Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66238, N'000288', 24, N'Kabupaten Lombok Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
GO
print 'Processed 300 total records'
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66239, N'000289', 24, N'Kabupaten Lombok Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66240, N'000290', 24, N'Kabupaten Lombok Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66241, N'000291', 24, N'Kota Mataram', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66242, N'000292', 24, N'Kabupaten Sumbawa', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66243, N'000293', 24, N'Kabupaten Sumbawa Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66244, N'000294', 25, N'Kabupaten Alor', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66245, N'000295', 25, N'Kabupaten Belu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66246, N'000296', 25, N'Kabupaten Ende', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66247, N'000297', 25, N'Kabupaten  Ende', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66248, N'000298', 25, N'Kabupaten  Flores Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66249, N'000299', 25, N'Kabupaten Flores Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66250, N'000300', 25, N'Kota Kupang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66251, N'000301', 25, N'Kabupaten Kupang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66252, N'000302', 25, N'Kabupaten Lembata', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66253, N'000303', 25, N'Kabupaten Malaka', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66254, N'000304', 25, N'Kabupaten Manggarai', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66255, N'000305', 25, N'Kabupaten Manggarai Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66256, N'000306', 25, N'Kabupaten Manggarai Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66257, N'000307', 25, N'Kabupaten Nagekeo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66258, N'000308', 25, N'Kabupaten Ngada', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66259, N'000309', 25, N'Kabupaten Rote Ndao', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66260, N'000310', 25, N'Kabupaten Sabu Raijua', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66261, N'000311', 25, N'Kabupaten Sikka', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66262, N'000312', 25, N'Kabupaten Sumba Barat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66263, N'000313', 25, N'Kabupaten Sumba Barat Daya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66264, N'000314', 25, N'Kabupaten Sumba Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66265, N'000315', 25, N'Kabupaten Sumba Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66266, N'000316', 25, N'Kabupaten Timor Tengah Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66267, N'000317', 25, N'Kabupaten Timor Tengah Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66268, N'000318', 26, N'Kabupaten Asmat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66269, N'000319', 26, N'Kabupaten Biak Numfor', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66270, N'000320', 26, N'Kabupaten Boven Digoel', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66271, N'000321', 26, N'Kabupaten Deiyai', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66272, N'000322', 26, N'Kabupaten Dogiyai', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66273, N'000323', 26, N'Kabupaten Intan Jaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66274, N'000324', 26, N'Kota Jayapura', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66275, N'000325', 26, N'Kabupaten Jayapura', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66276, N'000326', 26, N'Kabupaten Jayawijaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66277, N'000327', 26, N'Kabupaten Keerom', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66278, N'000328', 26, N'Kabupaten Kepulauan Yapen', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66279, N'000329', 26, N'Kabupaten Lanny Jaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66280, N'000330', 26, N'Kabupaten Mamberamo Raya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66281, N'000331', 26, N'Kabupaten Mamberamo Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66282, N'000332', 26, N'Kabupaten Mappi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66283, N'000333', 26, N'Kabupaten Merauke', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66284, N'000334', 26, N'Kabupaten Mimika', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66285, N'000335', 26, N'Kabupaten Nabire', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66286, N'000336', 26, N'Kabupaten Nduga', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66287, N'000337', 26, N'Kabupaten Paniai', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66288, N'000338', 26, N'Kabupaten Pegunungan Bintang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66289, N'000339', 26, N'Kabupaten Puncak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66290, N'000340', 26, N'Kabupaten Puncak Jaya', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66291, N'000341', 26, N'Kabupaten Sarmi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66292, N'000342', 26, N'Kabupaten Supiori', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66293, N'000343', 26, N'Kabupaten Tolikara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66294, N'000344', 26, N'Kabupaten Waropen', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66295, N'000345', 26, N'Kabupaten Yahukimo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66296, N'000346', 26, N'Kabupaten Yalimo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66297, N'000347', 27, N'Kabupaten Fakfak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66298, N'000348', 27, N'Kabupaten Kaimana', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66299, N'000349', 27, N'Kabupaten Manokwari', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66300, N'000350', 27, N'Kabupaten Manokwari Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66301, N'000351', 27, N'Kabupaten Maybrat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66302, N'000352', 27, N'Kabupaten Pegunungan Arfak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66303, N'000353', 27, N'Kabupaten Raja Ampat', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66304, N'000354', 27, N'Kota Sorong', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66305, N'000355', 27, N'Kabupaten Sorong', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66306, N'000356', 27, N'Kabupaten Sorong Selatan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66307, N'000357', 27, N'Kabupaten Tambrauw', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66308, N'000358', 27, N'Kabupaten Teluk Bintuni', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66309, N'000359', 27, N'Kabupaten Teluk Wondama', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66310, N'000360', 28, N'Kabupaten Bengkalis', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66311, N'000361', 28, N'Kota Dumai', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66312, N'000362', 28, N'Kabupaten Indragiri Hilir', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66313, N'000363', 28, N'Kabupaten Indragiri Hulu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66314, N'000364', 28, N'Kabupaten Kampar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66315, N'000365', 28, N'Kabupaten Kepulauan Meranti', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66316, N'000366', 28, N'Kabupaten Kuantan Singingi', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66317, N'000367', 28, N'Kota Pekanbaru', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66318, N'000368', 28, N'Kabupaten Pelalawan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66319, N'000369', 28, N'Kabupaten Rokan Hilir', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66320, N'000370', 28, N'Kabupaten Rokan Hulu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66321, N'000371', 28, N'Kabupaten Siak', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66322, N'000372', 29, N'Kabupaten Majene', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66323, N'000373', 29, N'Kabupaten Mamasa', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66324, N'000374', 29, N'Kabupaten Mamuju', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66325, N'000375', 29, N'Kabupaten Mamuju Tengah', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66326, N'000376', 29, N'Kabupaten Mamuju Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66327, N'000377', 29, N'Kabupaten Polewali Mandar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66328, N'000378', 30, N'Kabupaten Bantaeng', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66329, N'000379', 30, N'Kabupaten Barru', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66330, N'000380', 30, N'Kabupaten Bone', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66331, N'000381', 30, N'Kabupaten Bulukumba', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66332, N'000382', 30, N'Kabupaten Enrekang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66333, N'000383', 30, N'Kabupaten Gowa', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66334, N'000384', 30, N'Kabupaten Jeneponto', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66335, N'000385', 30, N'Kabupaten Kepulauan Selayar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66336, N'000386', 30, N'Kabupaten Luwu', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66337, N'000387', 30, N'Kabupaten Luwu Timur', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66338, N'000388', 30, N'Kabupaten Luwu Utara', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66339, N'000389', 30, N'Kota Makassar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
GO
print 'Processed 400 total records'
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66340, N'000390', 30, N'Kabupaten Maros', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66341, N'000391', 30, N'Kota Palopo', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66342, N'000392', 30, N'Kabupaten Pangkajene Kepulauan', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66343, N'000393', 30, N'Kota Parepare', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66344, N'000394', 30, N'Kabupaten Pinrang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66345, N'000395', 30, N'Kabupaten Sidenreng Rappang', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66346, N'000396', 30, N'Kabupaten Sinjai', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66347, N'000397', 30, N'Kabupaten Soppeng', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
INSERT [dbo].[m_city] ([city_id], [city_code], [province_id], [city_name], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66348, N'000398', 30, N'Kabupaten Takalar', N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'FMJ', CAST(0x0000A7B900000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_city] OFF
/****** Object:  Table [dbo].[m_level_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_level_type](
	[level_type_id] [int] IDENTITY(1,1) NOT NULL,
	[level_type_code] [varchar](8) NOT NULL,
	[description] [varchar](60) NOT NULL,
	[head_description] [varchar](60) NOT NULL,
	[seq_number] [numeric](18, 0) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_level___2E3CBFDC71DCD509] PRIMARY KEY CLUSTERED 
(
	[level_type_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]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_m_level_type] ON [dbo].[m_level_type] 
(
	[level_type_code] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_m_level_type_1] ON [dbo].[m_level_type] 
(
	[seq_number] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_level_type] ON
INSERT [dbo].[m_level_type] ([level_type_id], [level_type_code], [description], [head_description], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'DIR', N'Directorate', N'Directorate', CAST(1 AS Numeric(18, 0)), 5, N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'FMJ', CAST(0x0000A7FD01038D6A AS DateTime), N'0')
INSERT [dbo].[m_level_type] ([level_type_id], [level_type_code], [description], [head_description], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'DIV', N'Division', N'Division Head', CAST(2 AS Numeric(18, 0)), 5, N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'FMJ', CAST(0x0000A7B900EDD50A AS DateTime), N'0')
INSERT [dbo].[m_level_type] ([level_type_id], [level_type_code], [description], [head_description], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'DEP', N'Department', N'Department Head', CAST(3 AS Numeric(18, 0)), 5, N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'WHI', CAST(0x0000A78C00000000 AS DateTime), N'0')
INSERT [dbo].[m_level_type] ([level_type_id], [level_type_code], [description], [head_description], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'SUB', N'Sub Department', N'Sub Department Head', CAST(4 AS Numeric(18, 0)), 5, N'WHI', CAST(0x0000A78C0114CD44 AS DateTime), N'FMJ', CAST(0x0000A7FD0103EE55 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_level_type] OFF
/****** Object:  Table [dbo].[m_group_pic_detail]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_group_pic_detail](
	[group_pic_detail_id] [bigint] IDENTITY(1,1) NOT NULL,
	[group_pic_id] [int] NOT NULL,
	[source_app_id] [int] NULL,
	[branch_id] [varchar](5) NOT NULL,
	[transaction_type_id] [varchar](5) NOT NULL,
	[user_id_group_pic_detail] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_group___5A68E5336DD739FB] PRIMARY KEY CLUSTERED 
(
	[group_pic_detail_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_group_pic_detail] ON
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, 14, NULL, N'*', N'*', 7, N'BDA', CAST(0x0000A80800FD67ED AS DateTime), N'FMJ', CAST(0x0000A808011ADD85 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, 14, NULL, N'1', N'18', 7, N'BDA', CAST(0x0000A80800FD9127 AS DateTime), N'FMJ', CAST(0x0000A808011ADD4E AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, 14, NULL, N'*', N'*', 7, N'FMJ', CAST(0x0000A80800FE1245 AS DateTime), N'FMJ', CAST(0x0000A80A00F43A04 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, 14, NULL, N'1', N'18', 21, N'FMJ', CAST(0x0000A80800FE2EB5 AS DateTime), N'ASP', CAST(0x0000A81200FE1A68 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, 14, NULL, N'12', N'45', 21, N'FMJ', CAST(0x0000A80800FF1644 AS DateTime), N'FMJ', CAST(0x0000A80800FF1644 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, 16, NULL, N'*', N'43', 34, N'EPO', CAST(0x0000A80A00AD92D3 AS DateTime), N'EPO', CAST(0x0000A80A00C27597 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, 14, NULL, N'1', N'*', 22, N'EPO', CAST(0x0000A80A00AE416A AS DateTime), N'FMJ', CAST(0x0000A80A00F439D0 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, 14, NULL, N'30', N'*', 25, N'EPO', CAST(0x0000A80A00AE575E AS DateTime), N'ASP', CAST(0x0000A80B009C6BD1 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, 17, NULL, N'*', N'18', 32, N'EPO', CAST(0x0000A80A00AE8148 AS DateTime), N'EPO', CAST(0x0000A80A00AE8148 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, 18, NULL, N'*', N'18', 26, N'EPO', CAST(0x0000A80A00AE94B8 AS DateTime), N'EPO', CAST(0x0000A80A00AEA1D3 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, 19, NULL, N'*', N'43', 30, N'EPO', CAST(0x0000A80A00AEC275 AS DateTime), N'EPO', CAST(0x0000A80A00C286CF AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, 14, NULL, N'*', N'18', 31, N'EPO', CAST(0x0000A80A00C24B38 AS DateTime), N'BDA', CAST(0x0000A80A011231D4 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, 15, NULL, N'*', N'*', 18, N'EPO', CAST(0x0000A80A00C36802 AS DateTime), N'EPO', CAST(0x0000A80A00C36802 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, 14, NULL, N'30', N'50', 31, N'EPO', CAST(0x0000A80A00C39A1D AS DateTime), N'BDA', CAST(0x0000A80A011223C6 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, 14, NULL, N'30', N'*', 24, N'EPO', CAST(0x0000A80A00C3BAE0 AS DateTime), N'EPO', CAST(0x0000A80A00C3BAE0 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, 14, NULL, N'*', N'*', 19, N'EPO', CAST(0x0000A80A00C3CC5A AS DateTime), N'ASP', CAST(0x0000A81501041CEA AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, 17, NULL, N'*', N'*', 7, N'FMJ', CAST(0x0000A80A00F3191D AS DateTime), N'ASP', CAST(0x0000A81200FDDB60 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, 17, NULL, N'*', N'47', 22, N'FMJ', CAST(0x0000A80A00F3297F AS DateTime), N'FMJ', CAST(0x0000A80A00F3297F AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, 17, NULL, N'*', N'18', 2, N'FMJ', CAST(0x0000A80A00F34283 AS DateTime), N'ASP', CAST(0x0000A81200FDDB45 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, 14, NULL, N'*', N'9', 31, N'ASP', CAST(0x0000A80A011760CF AS DateTime), N'ASP', CAST(0x0000A80A011760CF AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, 14, NULL, N'*', N'*', 24, N'ASP', CAST(0x0000A80A0117E54F AS DateTime), N'EPO', CAST(0x0000A80B01016346 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, 20, NULL, N'30', N'*', 25, N'ASP', CAST(0x0000A80B009C4AB3 AS DateTime), N'ASP', CAST(0x0000A81200FFAB04 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, 15, NULL, N'*', N'*', 27, N'BDA', CAST(0x0000A80B00EA16BC AS DateTime), N'BDA', CAST(0x0000A80B00EA16BC AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, 21, NULL, N'*', N'30', 52, N'EPO', CAST(0x0000A81200FB7003 AS DateTime), N'ASP', CAST(0x0000A81C00ADDC17 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, 21, NULL, N'*', N'29', 52, N'EPO', CAST(0x0000A81200FB8BE1 AS DateTime), N'ASP', CAST(0x0000A81C00ADDBF9 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, 21, NULL, N'*', N'22', 52, N'EPO', CAST(0x0000A81200FB9864 AS DateTime), N'ASP', CAST(0x0000A81C00ADDB2C AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, 21, NULL, N'*', N'21', 52, N'EPO', CAST(0x0000A81200FBA42E AS DateTime), N'ASP', CAST(0x0000A81C00ADDB10 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, 21, NULL, N'*', N'30', 50, N'EPO', CAST(0x0000A81200FBB9B8 AS DateTime), N'EPO', CAST(0x0000A81200FBB9B8 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, 21, NULL, N'*', N'29', 50, N'EPO', CAST(0x0000A81200FBC485 AS DateTime), N'EPO', CAST(0x0000A81200FBC485 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, 21, NULL, N'*', N'22', 50, N'EPO', CAST(0x0000A81200FBCCB6 AS DateTime), N'EPO', CAST(0x0000A81200FBCCB6 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, 21, NULL, N'*', N'21', 50, N'EPO', CAST(0x0000A81200FBD350 AS DateTime), N'EPO', CAST(0x0000A81200FBD350 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, 22, NULL, N'*', N'30', 49, N'EPO', CAST(0x0000A81200FBE4FB AS DateTime), N'EPO', CAST(0x0000A81200FBE4FB AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, 22, NULL, N'*', N'29', 49, N'EPO', CAST(0x0000A81200FBEE6E AS DateTime), N'EPO', CAST(0x0000A81200FBEE6E AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, 22, NULL, N'*', N'22', 49, N'EPO', CAST(0x0000A81200FBF54E AS DateTime), N'EPO', CAST(0x0000A81200FBF54E AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, 22, NULL, N'*', N'21', 49, N'EPO', CAST(0x0000A81200FBFDAA AS DateTime), N'EPO', CAST(0x0000A81200FBFDAA AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, 22, NULL, N'*', N'30', 51, N'EPO', CAST(0x0000A81200FC05F4 AS DateTime), N'EPO', CAST(0x0000A81200FC05F4 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, 22, NULL, N'*', N'29', 51, N'EPO', CAST(0x0000A81200FC0C9B AS DateTime), N'EPO', CAST(0x0000A81200FC0C9B AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, 22, NULL, N'*', N'22', 51, N'EPO', CAST(0x0000A81200FC1362 AS DateTime), N'EPO', CAST(0x0000A81200FC1362 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, 22, NULL, N'*', N'21', 51, N'EPO', CAST(0x0000A81200FC19A5 AS DateTime), N'EPO', CAST(0x0000A81200FC19A5 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (56, 18, NULL, N'*', N'27', 26, N'EPO', CAST(0x0000A81200FC424B AS DateTime), N'EPO', CAST(0x0000A81200FC424B AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (57, 16, NULL, N'*', N'6', 34, N'EPO', CAST(0x0000A81200FC5A53 AS DateTime), N'EPO', CAST(0x0000A81200FD2D84 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (58, 16, NULL, N'*', N'10', 34, N'EPO', CAST(0x0000A81200FC6249 AS DateTime), N'EPO', CAST(0x0000A81200FD3556 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (59, 16, NULL, N'*', N'14', 34, N'EPO', CAST(0x0000A81200FC6967 AS DateTime), N'EPO', CAST(0x0000A81200FD3D76 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (60, 16, NULL, N'*', N'25', 34, N'EPO', CAST(0x0000A81200FC70AC AS DateTime), N'EPO', CAST(0x0000A81200FD4B68 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (61, 16, NULL, N'*', N'26', 34, N'EPO', CAST(0x0000A81200FC7818 AS DateTime), N'EPO', CAST(0x0000A81200FD52C5 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (62, 16, NULL, N'*', N'52', 34, N'EPO', CAST(0x0000A81200FC7F1E AS DateTime), N'EPO', CAST(0x0000A81200FD5A43 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (63, 16, NULL, N'*', N'55', 34, N'EPO', CAST(0x0000A81200FC8583 AS DateTime), N'EPO', CAST(0x0000A81200FD5FFF AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (64, 19, NULL, N'*', N'6', 30, N'EPO', CAST(0x0000A81200FD90C5 AS DateTime), N'EPO', CAST(0x0000A81200FD90C5 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65, 17, NULL, N'*', N'27', 32, N'ASP', CAST(0x0000A81200FDC287 AS DateTime), N'ASP', CAST(0x0000A81200FDC287 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66, 19, NULL, N'*', N'10', 30, N'EPO', CAST(0x0000A81200FE0766 AS DateTime), N'EPO', CAST(0x0000A81200FE0766 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (67, 19, NULL, N'*', N'14', 30, N'EPO', CAST(0x0000A81200FE18D7 AS DateTime), N'EPO', CAST(0x0000A81200FE18D7 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (68, 19, NULL, N'*', N'25', 30, N'EPO', CAST(0x0000A81200FE1FD6 AS DateTime), N'EPO', CAST(0x0000A81200FE1FD6 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (69, 19, NULL, N'*', N'26', 30, N'EPO', CAST(0x0000A81200FE26D1 AS DateTime), N'EPO', CAST(0x0000A81200FE26D1 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (70, 19, NULL, N'*', N'52', 30, N'EPO', CAST(0x0000A81200FE2DDB AS DateTime), N'EPO', CAST(0x0000A81200FE2DDB AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (71, 19, NULL, N'*', N'55', 30, N'EPO', CAST(0x0000A81200FE358C AS DateTime), N'EPO', CAST(0x0000A81200FE358C AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (72, 19, NULL, N'*', N'6', 53, N'EPO', CAST(0x0000A81200FE3FCE AS DateTime), N'EPO', CAST(0x0000A81200FE3FCE AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (73, 19, NULL, N'*', N'10', 53, N'EPO', CAST(0x0000A81200FE48FE AS DateTime), N'EPO', CAST(0x0000A81200FE48FE AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (74, 19, NULL, N'*', N'14', 53, N'EPO', CAST(0x0000A81200FE6306 AS DateTime), N'EPO', CAST(0x0000A81200FE6306 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (75, 19, NULL, N'*', N'25', 53, N'EPO', CAST(0x0000A81200FE6F26 AS DateTime), N'EPO', CAST(0x0000A81200FE6F26 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (76, 20, NULL, N'30', N'51', 24, N'ASP', CAST(0x0000A81200FE7291 AS DateTime), N'ASP', CAST(0x0000A81200FF638E AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (77, 19, NULL, N'*', N'26', 53, N'EPO', CAST(0x0000A81200FE8624 AS DateTime), N'EPO', CAST(0x0000A81200FE8624 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (78, 20, NULL, N'30', N'51', 25, N'ASP', CAST(0x0000A81200FE92B4 AS DateTime), N'ASP', CAST(0x0000A81200FF9E00 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (79, 19, NULL, N'*', N'52', 53, N'EPO', CAST(0x0000A81200FEA185 AS DateTime), N'EPO', CAST(0x0000A81200FEA185 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (80, 19, NULL, N'*', N'55', 53, N'EPO', CAST(0x0000A81200FEAAAD AS DateTime), N'EPO', CAST(0x0000A81200FEAAAD AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (81, 20, NULL, N'30', N'56', 25, N'ASP', CAST(0x0000A81200FEAEDF AS DateTime), N'ASP', CAST(0x0000A81200FF96A2 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (82, 20, NULL, N'*', N'*', 24, N'ASP', CAST(0x0000A81200FEB81E AS DateTime), N'ASP', CAST(0x0000A81200FFAAEB AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (83, 17, NULL, N'*', N'54', 32, N'EPO', CAST(0x0000A81200FF1192 AS DateTime), N'EPO', CAST(0x0000A81200FF1192 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (84, 20, NULL, N'30', N'24', 24, N'ASP', CAST(0x0000A81200FF1867 AS DateTime), N'ASP', CAST(0x0000A81200FF7EDC AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (85, 20, NULL, N'30', N'24', 25, N'ASP', CAST(0x0000A81200FF2C29 AS DateTime), N'ASP', CAST(0x0000A81200FF7672 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (86, 18, NULL, N'*', N'54', 26, N'EPO', CAST(0x0000A81200FF37CE AS DateTime), N'EPO', CAST(0x0000A81200FF37CE AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (87, 20, NULL, N'30', N'56', 24, N'ASP', CAST(0x0000A81200FF48C6 AS DateTime), N'ASP', CAST(0x0000A81200FF6DF0 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (88, 23, NULL, N'*', N'*', 52, N'ASP', CAST(0x0000A81500E20B65 AS DateTime), N'ASP', CAST(0x0000A81500E20B65 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (89, 20, NULL, N'30', N'51', 56, N'ASP', CAST(0x0000A81500EBB0D5 AS DateTime), N'ASP', CAST(0x0000A81500EBB0D5 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (90, 20, NULL, N'*', N'56', 24, N'ASP', CAST(0x0000A81500EBBD2D AS DateTime), N'ASP', CAST(0x0000A81500EBBD2D AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (91, 14, NULL, N'*', N'16', 57, N'ASP', CAST(0x0000A81500FEC486 AS DateTime), N'ASP', CAST(0x0000A81500FEC486 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (92, 14, NULL, N'*', N'12', 57, N'ASP', CAST(0x0000A81500FFA904 AS DateTime), N'ASP', CAST(0x0000A81500FFA904 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (93, 14, NULL, N'*', N'*', 59, N'ASP', CAST(0x0000A81500FFB2B4 AS DateTime), N'ASP', CAST(0x0000A81500FFB2B4 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (94, 14, NULL, N'*', N'*', 58, N'ASP', CAST(0x0000A81500FFBCF8 AS DateTime), N'ASP', CAST(0x0000A81500FFBCF8 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (95, 24, NULL, N'*', N'6', 30, N'ASP', CAST(0x0000A81600F8C652 AS DateTime), N'ASP', CAST(0x0000A81600F92514 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (96, 24, NULL, N'*', N'10', 30, N'ASP', CAST(0x0000A81600F91C02 AS DateTime), N'ASP', CAST(0x0000A81600F91C02 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (97, 24, NULL, N'*', N'14', 30, N'ASP', CAST(0x0000A81600F93EE7 AS DateTime), N'ASP', CAST(0x0000A81600F93EE7 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (98, 24, NULL, N'*', N'25', 30, N'ASP', CAST(0x0000A81600F94A32 AS DateTime), N'ASP', CAST(0x0000A81600F94A32 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (99, 24, NULL, N'*', N'26', 30, N'ASP', CAST(0x0000A81600F9536E AS DateTime), N'ASP', CAST(0x0000A81600F9536E AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (100, 14, NULL, N'*', N'*', 60, N'ASP', CAST(0x0000A81600F9FB17 AS DateTime), N'ASP', CAST(0x0000A81600F9FB17 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (101, 16, NULL, N'*', N'*', 60, N'ASP', CAST(0x0000A81600FA3749 AS DateTime), N'ASP', CAST(0x0000A81600FA3749 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (102, 25, NULL, N'*', N'*', 61, N'ASP', CAST(0x0000A81900AB02CC AS DateTime), N'ASP', CAST(0x0000A81900AB02CC AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (103, 16, NULL, N'*', N'10', 62, N'ASP', CAST(0x0000A81900AEB89C AS DateTime), N'ASP', CAST(0x0000A81900BB0480 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (104, 16, NULL, N'*', N'14', 62, N'ASP', CAST(0x0000A81900AEC08F AS DateTime), N'ASP', CAST(0x0000A81900BB049D AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (105, 16, NULL, N'*', N'25', 62, N'ASP', CAST(0x0000A81900AECA4B AS DateTime), N'ASP', CAST(0x0000A81900BB04B9 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (106, 16, NULL, N'*', N'26', 62, N'ASP', CAST(0x0000A81900AED1C4 AS DateTime), N'ASP', CAST(0x0000A81900BB04D3 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (107, 16, NULL, N'*', N'52', 62, N'ASP', CAST(0x0000A81900AEDB63 AS DateTime), N'ASP', CAST(0x0000A81900BB04EF AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (108, 16, NULL, N'*', N'55', 62, N'ASP', CAST(0x0000A81900AEE312 AS DateTime), N'ASP', CAST(0x0000A81900BB0523 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (109, 16, NULL, N'*', N'6', 62, N'ASP', CAST(0x0000A81900AF3D27 AS DateTime), N'ASP', CAST(0x0000A81900BB0509 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (110, 26, NULL, N'*', N'*', 62, N'ASP', CAST(0x0000A81900B0AC6C AS DateTime), N'ASP', CAST(0x0000A81900B0AC6C AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (111, 16, NULL, N'*', N'*', 63, N'ASP', CAST(0x0000A81900B85142 AS DateTime), N'ASP', CAST(0x0000A81900B873A0 AS DateTime), N'1')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (112, 16, NULL, N'*', N'6', 63, N'ASP', CAST(0x0000A81900B87ECA AS DateTime), N'ASP', CAST(0x0000A81900B87ECA AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (113, 16, NULL, N'*', N'10', 63, N'ASP', CAST(0x0000A81900B88742 AS DateTime), N'ASP', CAST(0x0000A81900B88742 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (114, 16, NULL, N'*', N'14', 63, N'ASP', CAST(0x0000A81900B89010 AS DateTime), N'ASP', CAST(0x0000A81900B89010 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (115, 16, NULL, N'*', N'25', 63, N'ASP', CAST(0x0000A81900B896BA AS DateTime), N'ASP', CAST(0x0000A81900B896BA AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (116, 16, NULL, N'*', N'26', 63, N'ASP', CAST(0x0000A81900B89EC2 AS DateTime), N'ASP', CAST(0x0000A81900B89EC2 AS DateTime), N'0')
GO
print 'Processed 100 total records'
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (117, 16, NULL, N'*', N'52', 63, N'ASP', CAST(0x0000A81900B8A689 AS DateTime), N'ASP', CAST(0x0000A81900B8A689 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (118, 16, NULL, N'*', N'55', 63, N'ASP', CAST(0x0000A81900B8ADF9 AS DateTime), N'ASP', CAST(0x0000A81900B8ADF9 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (119, 28, NULL, N'*', N'6', 53, N'EPO', CAST(0x0000A81E00B5D705 AS DateTime), N'EPO', CAST(0x0000A81E00B5D705 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (120, 28, NULL, N'*', N'10', 53, N'EPO', CAST(0x0000A81E00B5E8CB AS DateTime), N'EPO', CAST(0x0000A81E00B5E8CB AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (121, 28, NULL, N'*', N'14', 53, N'EPO', CAST(0x0000A81E00B5F633 AS DateTime), N'EPO', CAST(0x0000A81E00B5F633 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (122, 28, NULL, N'*', N'25', 53, N'EPO', CAST(0x0000A81E00B6008B AS DateTime), N'EPO', CAST(0x0000A81E00B6008B AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (123, 28, NULL, N'*', N'26', 53, N'EPO', CAST(0x0000A81E00B60A2E AS DateTime), N'EPO', CAST(0x0000A81E00B60A2E AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (124, 28, NULL, N'*', N'52', 53, N'EPO', CAST(0x0000A81E00B61140 AS DateTime), N'EPO', CAST(0x0000A81E00B61140 AS DateTime), N'0')
INSERT [dbo].[m_group_pic_detail] ([group_pic_detail_id], [group_pic_id], [source_app_id], [branch_id], [transaction_type_id], [user_id_group_pic_detail], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (125, 28, NULL, N'*', N'55', 53, N'EPO', CAST(0x0000A81E00B61976 AS DateTime), N'EPO', CAST(0x0000A81E00B61976 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_group_pic_detail] OFF
/****** Object:  Table [dbo].[m_document_type]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_document_type](
	[document_type_id] [int] IDENTITY(1,1) NOT NULL,
	[document_type_code] [varchar](50) NOT NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [varchar](1) NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_docume__69F7C2B15046D714] PRIMARY KEY CLUSTERED 
(
	[document_type_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[m_group_menu]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_group_menu](
	[group_menu_id] [int] IDENTITY(1,1) NOT NULL,
	[group_menu_code] [varchar](6) NULL,
	[description] [varchar](255) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_group___771EF6A619EAC663] PRIMARY KEY CLUSTERED 
(
	[group_menu_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_m_group_menu_menu_code] UNIQUE NONCLUSTERED 
(
	[group_menu_code] 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
CREATE NONCLUSTERED INDEX [IX_m_group_menu_desc] ON [dbo].[m_group_menu] 
(
	[description] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_group_menu] ON
INSERT [dbo].[m_group_menu] ([group_menu_id], [group_menu_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'GM0001', N'Administration', 5, N'WHI', CAST(0x0000A79000000000 AS DateTime), N'KHU', CAST(0x0000A7C400A24F19 AS DateTime), N'0')
INSERT [dbo].[m_group_menu] ([group_menu_id], [group_menu_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'GM0002', N'Customer Service', 2, N'WHI', CAST(0x0000A790011771D9 AS DateTime), N'WHI', CAST(0x0000A7A600FF7963 AS DateTime), N'1')
INSERT [dbo].[m_group_menu] ([group_menu_id], [group_menu_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'GM0003', N'Underwriting', 5, N'WHI', CAST(0x0000A7900117D86C AS DateTime), N'EPO', CAST(0x0000A80A00A304FA AS DateTime), N'0')
INSERT [dbo].[m_group_menu] ([group_menu_id], [group_menu_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'GM0004', N'Underwriting', 2, N'WHI', CAST(0x0000A7900117FBD6 AS DateTime), N'WHI', CAST(0x0000A790013333B6 AS DateTime), N'1')
INSERT [dbo].[m_group_menu] ([group_menu_id], [group_menu_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, N'GM0005', N'Customer Care', 5, N'FMJ', CAST(0x0000A7B800BE084E AS DateTime), N'FMJ', CAST(0x0000A7B800BE084E AS DateTime), N'0')
INSERT [dbo].[m_group_menu] ([group_menu_id], [group_menu_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'GM0006', N'Elise', 5, N'FMJ', CAST(0x0000A7B900F2C960 AS DateTime), N'EPO', CAST(0x0000A80A00A2EDA7 AS DateTime), N'0')
INSERT [dbo].[m_group_menu] ([group_menu_id], [group_menu_code], [description], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'GM0007', N'Claim', 5, N'EPO', CAST(0x0000A80A00A2F92B AS DateTime), N'EPO', CAST(0x0000A80A00A2F92B AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_group_menu] OFF
/****** Object:  Trigger [m_province_Update]    Script Date: 11/10/2017 16:09:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_province_Update]      
ON [dbo].[m_province]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([province_id]) THEN '[province_id]-' ELSE '' END + 
CASE WHEN UPDATE([province_code]) THEN '[province_code]-' ELSE '' END + 
CASE WHEN UPDATE([province_name]) THEN '[province_name]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_province]
([province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[province_id]) as [province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_province]
([province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[province_id]) as [province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_province_Insert]    Script Date: 11/10/2017 16:09:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_province_Insert] 
ON [dbo].[m_province]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_province]
([province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[province_id]) as [province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_province_Delete]    Script Date: 11/10/2017 16:09:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_province_Delete]    
ON [dbo].[m_province]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_province]
([province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[province_id]) as [province_id],[province_code],[province_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[m_menu]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_menu](
	[menu_id] [int] IDENTITY(1,1) NOT NULL,
	[menu_category_id] [int] NOT NULL,
	[url] [varchar](400) NULL,
	[description] [varchar](255) NOT NULL,
	[level] [int] NOT NULL,
	[menu_id_parent] [int] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[icon_class] [varchar](50) NULL,
	[is_delete] [char](1) NULL,
 CONSTRAINT [PK__m_menu__4CA0FADC550B8C31] PRIMARY KEY CLUSTERED 
(
	[menu_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_menu] ON
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (1, 3, NULL, N'Master', 1, NULL, N'WHI', CAST(0x0000A79100000000 AS DateTime), N'WHI', CAST(0x0000A79100000000 AS DateTime), N'fa-database', N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (2, 1, N'branch/manage', N'Branch', 2, 1, N'WHI', CAST(0x0000A79100000000 AS DateTime), N'WHI', CAST(0x0000A79100000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (3, 1, NULL, N'Organization', 2, 1, N'WHI', CAST(0x0000A79100000000 AS DateTime), N'WHI', CAST(0x0000A79100000000 AS DateTime), N'fa-users', N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (5, 1, N'level_organization/manage', N'Level', 3, 3, N'WHI', CAST(0x0000A79100000000 AS DateTime), N'FMJ', CAST(0x0000A7DA00906849 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (6, 1, N'organization/manage', N'Organization', 3, 3, N'WHI', CAST(0x0000A79100000000 AS DateTime), N'WHI', CAST(0x0000A79100000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (7, 1, N'group_menu/manage', N'Group Menu', 2, 1, N'WHI', CAST(0x0000A79100000000 AS DateTime), N'WHI', CAST(0x0000A79100000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (8, 1, N'user/manage', N'User', 2, 3, N'WHI', CAST(0x0000A7CA00000000 AS DateTime), N'WHI', CAST(0x0000A7CA00000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (9, 1, NULL, N'Transaction', 1, NULL, N'WHI', CAST(0x0000A7CB00000000 AS DateTime), N'WHI', CAST(0x0000A7CB00000000 AS DateTime), N'fa-tasks', N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (10, 1, N'transaction/register', N'Walk in Transaction', 2, 9, N'WHI', CAST(0x0000A7CB00000000 AS DateTime), N'WHI', CAST(0x0000A7CB00000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (11, 1, N'setting', N'Setting', 1, NULL, N'WHI', CAST(0x0000A7CB00000000 AS DateTime), N'WHI', CAST(0x0000A7CB00000000 AS DateTime), N'fa-database', N'1')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (15, 1, N'pic/manage', N'PIC', 3, 3, N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'WHI', CAST(0x0000A7D600000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (16, 1, N'document/manage', N'Document', 2, 1, N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'WHI', CAST(0x0000A7D600000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (17, 1, N'transaction_type/manage', N'Transaction Type', 2, 1, N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'WHI', CAST(0x0000A7D600000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (18, 1, N'approval_matrix/manage', N'Approval Matrix', 2, 1, N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'WHI', CAST(0x0000A7D600000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (19, 1, N'eform/manage', N'E-Form', 2, 1, N'WHI', CAST(0x0000A7D600000000 AS DateTime), N'WHI', CAST(0x0000A7D600000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (20, 1, N'workflow_template/manage', N'Workflow Template', 2, 1, N'KHU', CAST(0x0000A7E400000000 AS DateTime), N'KHU', CAST(0x0000A7E400000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (21, 1, N'workflow_template/manage', N'Workflow Template', 2, 1, N'FMJ', CAST(0x0000A7D600000000 AS DateTime), N'FMJ', CAST(0x0000A7D600000000 AS DateTime), NULL, N'1')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (22, 1, N'Policy', N'Policy Inquiry', 2, 9, N'KHU', CAST(0x0000A7EE00000000 AS DateTime), N'KHU', CAST(0x0000A7EE00000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (23, 1, N'os_document_transaction/manage', N'O/S Transaction', 2, 9, N'KHU', CAST(0x0000A7EE00000000 AS DateTime), N'KHU', CAST(0x0000A7EE00000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (24, 1, N'reason/manage', N'Reason', 2, 1, N'KHU', CAST(0x0000A80F00000000 AS DateTime), N'KHU', CAST(0x0000A80F00000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (25, 1, N'transaction/register_non_walk_in', N'Non Walk in Transaction', 2, 9, N'WHI', CAST(0x0000A81700000000 AS DateTime), N'WHI', CAST(0x0000A81700000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (26, 1, N'os_document_employee', N'Document Employee', 2, 28, N'KHU', CAST(0x0000A81800000000 AS DateTime), N'KHU', CAST(0x0000A81800000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (27, 1, N'os_document_staff', N'Documnet Staff', 2, 28, N'KHU', CAST(0x0000A81800000000 AS DateTime), N'KHU', CAST(0x0000A81800000000 AS DateTime), NULL, N'0')
INSERT [dbo].[m_menu] ([menu_id], [menu_category_id], [url], [description], [level], [menu_id_parent], [created_by], [created_date], [modified_by], [modified_date], [icon_class], [is_delete]) VALUES (28, 1, NULL, N'Monitoring Outstanding ', 1, NULL, N'KHU', CAST(0x0000A82000000000 AS DateTime), N'KHU', CAST(0x0000A82000000000 AS DateTime), N'fa-table', N'0')
SET IDENTITY_INSERT [dbo].[m_menu] OFF
/****** Object:  Table [dbo].[m_approv_matrix]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_approv_matrix](
	[approv_matrix_id] [int] IDENTITY(1,1) NOT NULL,
	[approv_matrix_code] [char](8) NULL,
	[description] [varchar](225) NOT NULL,
	[remarks] [varchar](225) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_approv__9B24A9281308BEAA] PRIMARY KEY CLUSTERED 
(
	[approv_matrix_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_approv_matrix] ON
INSERT [dbo].[m_approv_matrix] ([approv_matrix_id], [approv_matrix_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'AM170001', N'Matriks Approval 1', N'', 2, N'PPM', CAST(0x0000A80300DC7EF3 AS DateTime), N'PPM', CAST(0x0000A80300DC7EF3 AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix] ([approv_matrix_id], [approv_matrix_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, N'AM170002', N'Matrix Approval Claim', N'Matrix Approval Claim', 5, N'ASP', CAST(0x0000A80300E07EFC AS DateTime), N'ASP', CAST(0x0000A80300E1647C AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix] ([approv_matrix_id], [approv_matrix_code], [description], [remarks], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'AM170003', N'Matrix Approval Customer Care', N'', 5, N'FMJ', CAST(0x0000A8080100C2BC AS DateTime), N'ASP', CAST(0x0000A80A00A4F1AB AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_approv_matrix] OFF
/****** Object:  Trigger [m_menu_category_Update]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_menu_category_Update]      
ON [dbo].[m_menu_category]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([menu_category_id]) THEN '[menu_category_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_menu_category]
([menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_category_id]) as [menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_menu_category]
([menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_category_id]) as [menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_menu_category_Insert]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_menu_category_Insert] 
ON [dbo].[m_menu_category]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_menu_category]
([menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_category_id]) as [menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_menu_category_Delete]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_menu_category_Delete]    
ON [dbo].[m_menu_category]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_menu_category]
([menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_category_id]) as [menu_category_id],[description],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_workflow_template_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_Insert] 
ON [dbo].[m_workflow_template]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_workflow_template]
([workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[workflow_template_id]) as [workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_workflow_template_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_Delete]    
ON [dbo].[m_workflow_template]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_workflow_template]
([workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[workflow_template_id]) as [workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_workflow_template_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_Update]      
ON [dbo].[m_workflow_template]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([workflow_template_id]) THEN '[workflow_template_id]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_code]) THEN '[workflow_template_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_workflow_template]
([workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[workflow_template_id]) as [workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_workflow_template]
([workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[workflow_template_id]) as [workflow_template_id],[workflow_template_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_approv_matrix_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_approv_matrix_Delete]    
ON [dbo].[m_approv_matrix]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_approv_matrix]
([approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[approv_matrix_id]) as [approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_approv_matrix_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_approv_matrix_Update]      
ON [dbo].[m_approv_matrix]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([approv_matrix_id]) THEN '[approv_matrix_id]-' ELSE '' END + 
CASE WHEN UPDATE([approv_matrix_code]) THEN '[approv_matrix_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_approv_matrix]
([approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[approv_matrix_id]) as [approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_approv_matrix]
([approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[approv_matrix_id]) as [approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_approv_matrix_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_approv_matrix_Insert] 
ON [dbo].[m_approv_matrix]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_approv_matrix]
([approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[approv_matrix_id]) as [approv_matrix_id],[approv_matrix_code],[description],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [CreateAppMatCode]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[CreateAppMatCode] ON [dbo].[m_approv_matrix]
	FOR INSERT 
AS 

BEGIN

	SET NOCOUNT ON;

	DECLARE @rownums VARCHAR(5);
	DECLARE @mat_code VARCHAR(8);
	DECLARE	@ps_yy VARCHAR(2);

	select @ps_yy = CONVERT(VARCHAR(2), GETDATE(), 12)

    SET @rownums = (
		SELECT CAST((COUNT(approv_matrix_id)) AS VARCHAR) 
		FROM m_approv_matrix
	);

	SET @mat_code = (SELECT 'AM' + @ps_yy + STUFF('00000', 4 - LEN(@rownums) + 1, LEN(@rownums), @rownums));

	UPDATE m_approv_matrix
	SET approv_matrix_code = @mat_code
	WHERE approv_matrix_id IN (
		SELECT approv_matrix_id 
		FROM inserted
	);

END
GO
/****** Object:  Trigger [m_menu_Update]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_menu_Update]      
ON [dbo].[m_menu]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([menu_id]) THEN '[menu_id]-' ELSE '' END + 
CASE WHEN UPDATE([menu_category_id]) THEN '[menu_category_id]-' ELSE '' END + 
CASE WHEN UPDATE([url]) THEN '[url]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([level]) THEN '[level]-' ELSE '' END + 
CASE WHEN UPDATE([menu_id_parent]) THEN '[menu_id_parent]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_menu]
([menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_id]) as [menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_menu]
([menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_id]) as [menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_menu_Insert]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_menu_Insert] 
ON [dbo].[m_menu]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_menu]
([menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_id]) as [menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_menu_Delete]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_menu_Delete]    
ON [dbo].[m_menu]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_menu]
([menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[menu_id]) as [menu_id],[menu_category_id],[url],[description],[level],[menu_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [CreateTransTypeCode]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[CreateTransTypeCode] ON [dbo].[m_transaction_type]
	FOR INSERT 
AS 

BEGIN

	SET NOCOUNT ON;

	DECLARE @rownums VARCHAR(5);
	DECLARE @code VARCHAR(8);

    SET @rownums = (
		SELECT CAST((COUNT(transaction_type_id)) AS VARCHAR) 
		FROM m_transaction_type
	);

	SET @code = (SELECT 'T' + STUFF('000000', 6 - LEN(@rownums) + 1, LEN(@rownums), @rownums));

	UPDATE m_transaction_type
	SET transaction_type_code = @code
	WHERE transaction_type_id IN (
		SELECT transaction_type_id 
		FROM inserted
	);

END
GO
/****** Object:  Trigger [m_currency_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_currency_Update]      
ON [dbo].[m_currency]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([currency_id]) THEN '[currency_id]-' ELSE '' END + 
CASE WHEN UPDATE([currency_code]) THEN '[currency_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_currency]
([currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[currency_id]) as [currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_currency]
([currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[currency_id]) as [currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_currency_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_currency_Insert] 
ON [dbo].[m_currency]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_currency]
([currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[currency_id]) as [currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_currency_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_currency_Delete]    
ON [dbo].[m_currency]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_currency]
([currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[currency_id]) as [currency_id],[currency_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_transaction_type_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_type_Update]      
ON [dbo].[m_transaction_type]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([transaction_type_id]) THEN '[transaction_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_type_code]) THEN '[transaction_type_code]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_category_id]) THEN '[transaction_category_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_transaction_type]
([transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_type_id]) as [transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_transaction_type]
([transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_type_id]) as [transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_transaction_type_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_type_Insert] 
ON [dbo].[m_transaction_type]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_transaction_type]
([transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_type_id]) as [transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_transaction_type_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_transaction_type_Delete]    
ON [dbo].[m_transaction_type]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_transaction_type]
([transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[transaction_type_id]) as [transaction_type_id],[transaction_type_code],[transaction_category_id],[description],[remarks],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[m_user_menu]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_user_menu](
	[user_menu_id] [int] IDENTITY(1,1) NOT NULL,
	[user_menu] [varchar](8) NOT NULL,
	[is_group_menu] [char](1) NOT NULL,
	[group_menu_id] [int] NOT NULL,
	[is_include] [char](1) NOT NULL,
	[is_exclude] [char](1) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_user_m__A3560C0C1EAF7B80] PRIMARY KEY CLUSTERED 
(
	[user_menu_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [m_document_type_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_document_type_Update]      
ON [dbo].[m_document_type]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([document_type_id]) THEN '[document_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([document_type_code]) THEN '[document_type_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_document_type]
([document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_type_id]) as [document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_document_type]
([document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_type_id]) as [document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_document_type_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_document_type_Insert] 
ON [dbo].[m_document_type]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_document_type]
([document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_type_id]) as [document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_document_type_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_document_type_Delete]    
ON [dbo].[m_document_type]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_document_type]
([document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[document_type_id]) as [document_type_id],[document_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_data_type_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_data_type_Update]      
ON [dbo].[m_data_type]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([data_type_id]) THEN '[data_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([data_type_code]) THEN '[data_type_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_data_type]
([data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[data_type_id]) as [data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_data_type]
([data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[data_type_id]) as [data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_data_type_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_data_type_Insert] 
ON [dbo].[m_data_type]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_data_type]
([data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[data_type_id]) as [data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_data_type_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_data_type_Delete]    
ON [dbo].[m_data_type]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_data_type]
([data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[data_type_id]) as [data_type_id],[data_type_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_user_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_Delete]    
ON [dbo].[m_user]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_user]
([user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_id]) as [user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_user_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_Insert] 
ON [dbo].[m_user]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_user]
([user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_id]) as [user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_user_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_Update]      
ON [dbo].[m_user]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([user_id]) THEN '[user_id]-' ELSE '' END + 
CASE WHEN UPDATE([username]) THEN '[username]-' ELSE '' END + 
CASE WHEN UPDATE([user_fullname]) THEN '[user_fullname]-' ELSE '' END + 
CASE WHEN UPDATE([branch_id]) THEN '[branch_id]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_user]
([user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_id]) as [user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_user]
([user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_id]) as [user_id],[username],[user_fullname],[branch_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Table [dbo].[m_group_menu_mapping]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_group_menu_mapping](
	[group_menu_mapping_id] [int] IDENTITY(1,1) NOT NULL,
	[group_menu_id] [int] NOT NULL,
	[menu_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_group___7A5E481A58DC1D15] PRIMARY KEY CLUSTERED 
(
	[group_menu_mapping_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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_m_group_menu_mapping] ON [dbo].[m_group_menu_mapping] 
(
	[group_menu_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_group_menu_mapping_1] ON [dbo].[m_group_menu_mapping] 
(
	[menu_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_group_menu_mapping_2] ON [dbo].[m_group_menu_mapping] 
(
	[status_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_group_menu_mapping] ON
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, 4, 2, 5, N'WHI', CAST(0x0000A79300000000 AS DateTime), N'WHI', CAST(0x0000A79300000000 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, 4, 3, 5, N'WHI', CAST(0x0000A79300000000 AS DateTime), N'WHI', CAST(0x0000A7A6010A751E AS DateTime), N'1')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, 4, 7, 5, N'WHI', CAST(0x0000A7A600E4483B AS DateTime), N'WHI', CAST(0x0000A7A600E4483B AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, 4, 5, 5, N'WHI', CAST(0x0000A7A600E471D9 AS DateTime), N'WHI', CAST(0x0000A7A6010A6DD6 AS DateTime), N'1')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, 4, 5, 5, N'WHI', CAST(0x0000A7A6010A8EB2 AS DateTime), N'WHI', CAST(0x0000A7A6010A8EB2 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, 4, 3, 5, N'PPM', CAST(0x0000A7AF011077F1 AS DateTime), N'PPM', CAST(0x0000A7AF011077F1 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, 6, 7, 5, N'FMJ', CAST(0x0000A7B800BE3D4F AS DateTime), N'FMJ', CAST(0x0000A7B800BE3D4F AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, 6, 6, 5, N'FMJ', CAST(0x0000A7B800BE3D61 AS DateTime), N'FMJ', CAST(0x0000A7B800BE5A53 AS DateTime), N'1')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, 6, 1, 5, N'FMJ', CAST(0x0000A7B800BE4683 AS DateTime), N'FMJ', CAST(0x0000A7B800BE5778 AS DateTime), N'1')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, 9, 5, 5, N'FMJ', CAST(0x0000A7B900F2EC94 AS DateTime), N'FMJ', CAST(0x0000A7B900F2EC94 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, 9, 6, 5, N'FMJ', CAST(0x0000A7B900F2ECAB AS DateTime), N'FMJ', CAST(0x0000A7B900F2ECAB AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, 9, 2, 5, N'FMJ', CAST(0x0000A7B900F354F6 AS DateTime), N'FMJ', CAST(0x0000A7B900F354F6 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, 9, 7, 5, N'FMJ', CAST(0x0000A7C200DF2EA5 AS DateTime), N'FMJ', CAST(0x0000A7C200DF6080 AS DateTime), N'1')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, 4, 20, 5, N'KHU', CAST(0x0000A7E400000000 AS DateTime), N'KHU', CAST(0x0000A7E400000000 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, 4, 26, 5, N'KHU', CAST(0x0000A81800000000 AS DateTime), N'KHU', CAST(0x0000A81800000000 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, 4, 27, 5, N'KHU', CAST(0x0000A81800000000 AS DateTime), N'KHU', CAST(0x0000A81800000000 AS DateTime), N'0')
INSERT [dbo].[m_group_menu_mapping] ([group_menu_mapping_id], [group_menu_id], [menu_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, 4, 28, 5, N'KHU', CAST(0x0000A82000000000 AS DateTime), N'KHU', CAST(0x0000A82000000000 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_group_menu_mapping] OFF
/****** Object:  Table [dbo].[m_user_menu_mapping]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_user_menu_mapping](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[user_id] [varchar](3) NOT NULL,
	[menu_id] [int] NOT NULL,
	[is_exclude] [tinyint] NOT NULL,
	[created_by] [varchar](3) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](3) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [tinyint] NOT NULL,
 CONSTRAINT [PK_m_user_menu_mapping] 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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_m_user_menu_mapping] ON [dbo].[m_user_menu_mapping] 
(
	[user_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_user_menu_mapping] ON
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'JWT', 1, 0, N'WHI', CAST(0x0000A7DE00FBD026 AS DateTime), N'WHI', CAST(0x0000A7DE010D6038 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'JWT', 3, 0, N'WHI', CAST(0x0000A7DE00FBD026 AS DateTime), N'WHI', CAST(0x0000A7DE010D6035 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'JWT', 5, 0, N'WHI', CAST(0x0000A7DE010D55E9 AS DateTime), N'WHI', CAST(0x0000A7DE010D6034 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'WHI', 15, 0, N'WHI', CAST(0x0000A7DE0118EA81 AS DateTime), N'WHI', CAST(0x0000A7DE0118EA81 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'WHI', 3, 0, N'WHI', CAST(0x0000A7DE0118EA81 AS DateTime), N'WHI', CAST(0x0000A7DE0118EA81 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, N'WHI', 1, 0, N'WHI', CAST(0x0000A7DE0118EA81 AS DateTime), N'KHU', CAST(0x0000A7E600A053C9 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'WHI', 8, 0, N'WHI', CAST(0x0000A7DE0118EAA0 AS DateTime), N'WHI', CAST(0x0000A7DE0118EAA0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, N'FMJ', 3, 0, N'WHI', CAST(0x0000A7DF00AC4780 AS DateTime), N'WHI', CAST(0x0000A7DF00AC8DB6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'FMJ', 1, 0, N'WHI', CAST(0x0000A7DF00AC4780 AS DateTime), N'WHI', CAST(0x0000A7DF00AC8DB6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'FMJ', 2, 0, N'WHI', CAST(0x0000A7DF00AC47B5 AS DateTime), N'WHI', CAST(0x0000A7DF00AC8811 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'FMJ', 5, 0, N'WHI', CAST(0x0000A7DF00AC47CA AS DateTime), N'WHI', CAST(0x0000A7DF00AC8BB5 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'FMJ', 6, 0, N'WHI', CAST(0x0000A7DF00AC47DE AS DateTime), N'WHI', CAST(0x0000A7DF00AC8DB6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, N'FMJ', 18, 0, N'WHI', CAST(0x0000A7DF00ACD372 AS DateTime), N'WHI', CAST(0x0000A7DF00ACD372 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'FMJ', 16, 0, N'WHI', CAST(0x0000A7DF00ACD3A3 AS DateTime), N'WHI', CAST(0x0000A7DF00ACD3A3 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, N'FMJ', 19, 0, N'WHI', CAST(0x0000A7DF00ACD3BA AS DateTime), N'WHI', CAST(0x0000A7DF00ACD3BA AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'FMJ', 7, 0, N'WHI', CAST(0x0000A7DF00ACD3DB AS DateTime), N'WHI', CAST(0x0000A7DF00ACD3DB AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, N'FMJ', 15, 0, N'WHI', CAST(0x0000A7DF00ACD3FD AS DateTime), N'WHI', CAST(0x0000A7DF00ACD3FD AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, N'FMJ', 10, 0, N'WHI', CAST(0x0000A7DF00ACD41D AS DateTime), N'WHI', CAST(0x0000A7DF00ACD41D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'FMJ', 9, 0, N'WHI', CAST(0x0000A7DF00ACD421 AS DateTime), N'WHI', CAST(0x0000A7DF00ACD421 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'FMJ', 11, 0, N'WHI', CAST(0x0000A7DF00ACD43F AS DateTime), N'WHI', CAST(0x0000A7DF00ACD43F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, N'FMJ', 17, 0, N'WHI', CAST(0x0000A7DF00ACD477 AS DateTime), N'WHI', CAST(0x0000A7DF00ACD477 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, N'FMJ', 8, 0, N'WHI', CAST(0x0000A7DF00ACD48C AS DateTime), N'WHI', CAST(0x0000A7DF00ACD48C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, N'KHU', 18, 0, N'KHU', CAST(0x0000A7DF0114B684 AS DateTime), N'BDA', CAST(0x0000A80200E2C1DF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, N'KHU', 1, 0, N'KHU', CAST(0x0000A7DF0114B691 AS DateTime), N'BDA', CAST(0x0000A80200E2C47F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, N'PPM', 18, 0, N'KHU', CAST(0x0000A7DF0115215C AS DateTime), N'KHU', CAST(0x0000A7DF0115215C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, N'PPM', 1, 0, N'KHU', CAST(0x0000A7DF0115215C AS DateTime), N'KHU', CAST(0x0000A7DF0115215C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, N'PPM', 16, 0, N'KHU', CAST(0x0000A7DF0115217E AS DateTime), N'KHU', CAST(0x0000A7DF0115217E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, N'PPM', 19, 0, N'KHU', CAST(0x0000A7DF01152199 AS DateTime), N'KHU', CAST(0x0000A7DF01152199 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, N'PPM', 6, 0, N'KHU', CAST(0x0000A7DF011521CF AS DateTime), N'KHU', CAST(0x0000A7DF011521CF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, N'PPM', 3, 0, N'KHU', CAST(0x0000A7DF011521CF AS DateTime), N'KHU', CAST(0x0000A7DF011521CF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, N'PPM', 15, 0, N'KHU', CAST(0x0000A7DF011521EC AS DateTime), N'KHU', CAST(0x0000A7DF011521EC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, N'PPM', 10, 0, N'KHU', CAST(0x0000A7DF0115220F AS DateTime), N'KHU', CAST(0x0000A7DF0115220F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, N'PPM', 9, 0, N'KHU', CAST(0x0000A7DF01152210 AS DateTime), N'KHU', CAST(0x0000A7DF01152210 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, N'PPM', 11, 0, N'KHU', CAST(0x0000A7DF0115223E AS DateTime), N'KHU', CAST(0x0000A7DF0115223E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, N'PPM', 17, 0, N'KHU', CAST(0x0000A7DF0115227C AS DateTime), N'KHU', CAST(0x0000A7DF0115227C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, N'PPM', 8, 0, N'KHU', CAST(0x0000A7DF01152A03 AS DateTime), N'KHU', CAST(0x0000A7DF01152A03 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, N'KHU', 2, 1, N'KHU', CAST(0x0000A7DF011580E3 AS DateTime), N'BDA', CAST(0x0000A80200E1E3A6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, N'KHU', 16, 0, N'KHU', CAST(0x0000A7DF01158101 AS DateTime), N'BDA', CAST(0x0000A80200E2C47F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, N'KHU', 19, 1, N'KHU', CAST(0x0000A7DF0115811D AS DateTime), N'BDA', CAST(0x0000A80200E1E7CE AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, N'KHU', 7, 1, N'KHU', CAST(0x0000A7DF0115813B AS DateTime), N'BDA', CAST(0x0000A80200E1EADF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, N'KHU', 5, 1, N'KHU', CAST(0x0000A7DF01158157 AS DateTime), N'BDA', CAST(0x0000A80200E1ED85 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, N'KHU', 3, 1, N'KHU', CAST(0x0000A7DF01158157 AS DateTime), N'BDA', CAST(0x0000A80200E1F215 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, N'KHU', 6, 1, N'KHU', CAST(0x0000A7DF0115817B AS DateTime), N'BDA', CAST(0x0000A80200E1F35E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, N'KHU', 15, 1, N'KHU', CAST(0x0000A7DF011581B5 AS DateTime), N'BDA', CAST(0x0000A80200E1F811 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, N'KHU', 10, 1, N'KHU', CAST(0x0000A7DF011581DB AS DateTime), N'BDA', CAST(0x0000A80200E1FABD AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, N'KHU', 9, 1, N'KHU', CAST(0x0000A7DF011581DC AS DateTime), N'BDA', CAST(0x0000A80200E1FCCF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, N'KHU', 11, 1, N'KHU', CAST(0x0000A7DF0115820E AS DateTime), N'BDA', CAST(0x0000A80200E1FBC4 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, N'KHU', 17, 1, N'KHU', CAST(0x0000A7DF01158261 AS DateTime), N'BDA', CAST(0x0000A80200E1FDCC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, N'KHU', 8, 1, N'KHU', CAST(0x0000A7DF0115827C AS DateTime), N'BDA', CAST(0x0000A80200E1FFD7 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, N'KHU', 20, 1, N'KHU', CAST(0x0000A7E400DCBB9E AS DateTime), N'BDA', CAST(0x0000A80200E200EA AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (56, N'FMJ', 20, 0, N'KHU', CAST(0x0000A7E400DCEE9C AS DateTime), N'KHU', CAST(0x0000A7E400DCEE9C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (57, N'BDA', 19, 0, N'WHI', CAST(0x0000A7E401061019 AS DateTime), N'WHI', CAST(0x0000A7E401061019 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (58, N'BDA', 1, 0, N'WHI', CAST(0x0000A7E401061019 AS DateTime), N'KHU', CAST(0x0000A7EE00BA3D13 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (59, N'BDA', 20, 0, N'WHI', CAST(0x0000A7E40106106C AS DateTime), N'KHU', CAST(0x0000A7EE00BA3CCC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (60, N'BDA', 3, 0, N'WHI', CAST(0x0000A7E4010B866D AS DateTime), N'WHI', CAST(0x0000A7E4010B866D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (61, N'BDA', 2, 0, N'WHI', CAST(0x0000A7E4010BA050 AS DateTime), N'WHI', CAST(0x0000A7E4010BA592 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (62, N'BDA', 15, 0, N'WHI', CAST(0x0000A7E4010BE7E0 AS DateTime), N'WHI', CAST(0x0000A7E4010BE7E0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (63, N'KHU', 22, 1, N'KHU', CAST(0x0000A7EE008E5D3C AS DateTime), N'BDA', CAST(0x0000A80200E1F9B0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (64, N'KHU', 21, 0, N'KHU', CAST(0x0000A7EE008E6489 AS DateTime), N'KHU', CAST(0x0000A7EE008E6489 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65, N'PPM', 22, 0, N'KHU', CAST(0x0000A7EE008E7D3A AS DateTime), N'KHU', CAST(0x0000A7EE008E7D3A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66, N'PPM', 21, 0, N'KHU', CAST(0x0000A7EE008E7D61 AS DateTime), N'KHU', CAST(0x0000A7EE008E7D61 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (67, N'FMJ', 22, 0, N'KHU', CAST(0x0000A7EE008EA04C AS DateTime), N'KHU', CAST(0x0000A7EE008EA04C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (68, N'FMJ', 21, 0, N'KHU', CAST(0x0000A7EE008EA06A AS DateTime), N'KHU', CAST(0x0000A7EE008EA06A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (69, N'BDA', 23, 0, N'KHU', CAST(0x0000A7EE00BC27FF AS DateTime), N'KHU', CAST(0x0000A7EE00BC27FF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (70, N'BDA', 9, 0, N'KHU', CAST(0x0000A7EE00BC2807 AS DateTime), N'BDA', CAST(0x0000A808008B1AB6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (71, N'KHU', 23, 0, N'KHU', CAST(0x0000A7EE00BC3CD6 AS DateTime), N'KHU', CAST(0x0000A7EE00BC3CD6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (72, N'WHI', 23, 0, N'KHU', CAST(0x0000A7EE00BC5AA5 AS DateTime), N'KHU', CAST(0x0000A7EE00BC5AA5 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (73, N'WHI', 9, 0, N'KHU', CAST(0x0000A7EE00BC5AA5 AS DateTime), N'KHU', CAST(0x0000A7EE00BC5AA5 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (74, N'WHI', 18, 0, N'WHI', CAST(0x0000A7EF00A2C15E AS DateTime), N'WHI', CAST(0x0000A7EF00A2C15E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (75, N'WHI', 2, 0, N'WHI', CAST(0x0000A7EF00A2C2F5 AS DateTime), N'WHI', CAST(0x0000A7EF00A2C2F5 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (76, N'WHI', 16, 0, N'WHI', CAST(0x0000A7EF00A2C331 AS DateTime), N'WHI', CAST(0x0000A7EF00A2C331 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (77, N'WHI', 19, 0, N'WHI', CAST(0x0000A7EF00A2C368 AS DateTime), N'WHI', CAST(0x0000A7EF00A2C368 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (78, N'WHI', 7, 0, N'WHI', CAST(0x0000A7EF00A2C4C0 AS DateTime), N'WHI', CAST(0x0000A7EF00A2C4C0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (79, N'WHI', 5, 0, N'WHI', CAST(0x0000A7EF00A2C4F0 AS DateTime), N'WHI', CAST(0x0000A7EF00A2C4F0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (80, N'WHI', 6, 0, N'WHI', CAST(0x0000A7EF00A2C51F AS DateTime), N'WHI', CAST(0x0000A7EF00A2C51F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (81, N'WHI', 22, 0, N'WHI', CAST(0x0000A7EF00A2C54E AS DateTime), N'WHI', CAST(0x0000A7EF00A2C54E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (82, N'WHI', 10, 0, N'WHI', CAST(0x0000A7EF00A2C57A AS DateTime), N'WHI', CAST(0x0000A7EF00A2C57A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (83, N'WHI', 11, 0, N'WHI', CAST(0x0000A7EF00A2C5AF AS DateTime), N'WHI', CAST(0x0000A7EF00A2C5AF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (84, N'WHI', 17, 0, N'WHI', CAST(0x0000A7EF00A2C5DC AS DateTime), N'WHI', CAST(0x0000A7EF00A2C5DC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (85, N'WHI', 20, 0, N'WHI', CAST(0x0000A7EF00A2C75D AS DateTime), N'WHI', CAST(0x0000A7EF00A2C75D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (86, N'FMJ', 23, 0, N'FMJ', CAST(0x0000A7EF00BA7498 AS DateTime), N'FMJ', CAST(0x0000A7EF00BA7498 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (87, N'BDA', 18, 0, N'FMJ', CAST(0x0000A80000C1E156 AS DateTime), N'FMJ', CAST(0x0000A80000C1E156 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (88, N'BDA', 16, 0, N'FMJ', CAST(0x0000A80000C1E170 AS DateTime), N'FMJ', CAST(0x0000A80000C1E170 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (89, N'BDA', 6, 0, N'FMJ', CAST(0x0000A80000C1E188 AS DateTime), N'FMJ', CAST(0x0000A80000C1E188 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (90, N'BDA', 22, 0, N'FMJ', CAST(0x0000A80000C1E1A0 AS DateTime), N'BDA', CAST(0x0000A808008B1AB5 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (91, N'BDA', 10, 0, N'FMJ', CAST(0x0000A80000C1E1B7 AS DateTime), N'FMJ', CAST(0x0000A80000C1E1B7 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (92, N'BDA', 17, 0, N'FMJ', CAST(0x0000A80000C1E1D0 AS DateTime), N'FMJ', CAST(0x0000A80000C1E1D0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (93, N'BDA', 11, 0, N'FMJ', CAST(0x0000A80000C1E1E6 AS DateTime), N'FMJ', CAST(0x0000A80000C1E1E6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (94, N'BDA', 8, 0, N'FMJ', CAST(0x0000A80000C1E1FE AS DateTime), N'FMJ', CAST(0x0000A80000C1E1FE AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (95, N'ASP', 1, 0, N'KHU', CAST(0x0000A80100FC4F03 AS DateTime), N'KHU', CAST(0x0000A80100FC7A92 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (96, N'ASP', 3, 0, N'KHU', CAST(0x0000A80100FC4F05 AS DateTime), N'KHU', CAST(0x0000A80100FC4F05 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (97, N'ASP', 18, 0, N'KHU', CAST(0x0000A80100FC5F02 AS DateTime), N'KHU', CAST(0x0000A80100FC7A92 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (98, N'ASP', 16, 0, N'KHU', CAST(0x0000A80100FC5F1E AS DateTime), N'KHU', CAST(0x0000A80100FC5F1E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (99, N'ASP', 19, 0, N'KHU', CAST(0x0000A80100FC5F37 AS DateTime), N'KHU', CAST(0x0000A80100FC5F37 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (100, N'ASP', 23, 0, N'KHU', CAST(0x0000A80100FC5F4F AS DateTime), N'KHU', CAST(0x0000A80100FC5F4F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (101, N'ASP', 9, 0, N'KHU', CAST(0x0000A80100FC5F4F AS DateTime), N'KHU', CAST(0x0000A80100FC5F4F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (102, N'ASP', 6, 0, N'KHU', CAST(0x0000A80100FC5F67 AS DateTime), N'KHU', CAST(0x0000A80100FC5F67 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (103, N'ASP', 15, 0, N'KHU', CAST(0x0000A80100FC5F7D AS DateTime), N'KHU', CAST(0x0000A80100FC5F7D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (104, N'ASP', 22, 0, N'KHU', CAST(0x0000A80100FC5FB0 AS DateTime), N'KHU', CAST(0x0000A80100FC5FB0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (105, N'ASP', 10, 0, N'KHU', CAST(0x0000A80100FC5FC9 AS DateTime), N'KHU', CAST(0x0000A80100FC5FC9 AS DateTime), 0)
GO
print 'Processed 100 total records'
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (106, N'ASP', 11, 0, N'KHU', CAST(0x0000A80100FC5FDF AS DateTime), N'KHU', CAST(0x0000A80100FC5FDF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (107, N'ASP', 17, 0, N'KHU', CAST(0x0000A80100FC660B AS DateTime), N'KHU', CAST(0x0000A80100FC660B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (108, N'ASP', 8, 0, N'KHU', CAST(0x0000A80100FC6622 AS DateTime), N'KHU', CAST(0x0000A80100FC6622 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (109, N'EPO', 1, 0, N'ASP', CAST(0x0000A80100FD3B0A AS DateTime), N'ASP', CAST(0x0000A80300E5925A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (110, N'EPO', 3, 0, N'ASP', CAST(0x0000A80100FD3B0A AS DateTime), N'ASP', CAST(0x0000A80200E67A61 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (111, N'EPO', 2, 0, N'ASP', CAST(0x0000A80100FD3B30 AS DateTime), N'ASP', CAST(0x0000A80200E677E1 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (112, N'EPO', 7, 0, N'ASP', CAST(0x0000A80100FD3B4D AS DateTime), N'ASP', CAST(0x0000A80200E678FC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (113, N'EPO', 5, 0, N'ASP', CAST(0x0000A80100FD3B68 AS DateTime), N'ASP', CAST(0x0000A80200E67A61 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (114, N'EPO', 3, 0, N'ASP', CAST(0x0000A80100FD3B84 AS DateTime), N'ASP', CAST(0x0000A80200E67A61 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (115, N'EPO', 20, 0, N'ASP', CAST(0x0000A80100FD3B9C AS DateTime), N'ASP', CAST(0x0000A80300E5925A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (116, N'EPO', 18, 0, N'ASP', CAST(0x0000A80200E63A57 AS DateTime), N'ASP', CAST(0x0000A80200E66791 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (117, N'EPO', 16, 0, N'ASP', CAST(0x0000A80200E63A72 AS DateTime), N'ASP', CAST(0x0000A80200E6662D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (118, N'EPO', 19, 0, N'ASP', CAST(0x0000A80200E63A8C AS DateTime), N'ASP', CAST(0x0000A80200E6647B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (119, N'EPO', 23, 0, N'ASP', CAST(0x0000A80200E63AA6 AS DateTime), N'ASP', CAST(0x0000A80200E662B8 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (120, N'EPO', 9, 0, N'ASP', CAST(0x0000A80200E63AA7 AS DateTime), N'ASP', CAST(0x0000A80200E662B8 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (121, N'EPO', 6, 0, N'ASP', CAST(0x0000A80200E63ABF AS DateTime), N'ASP', CAST(0x0000A80200E66039 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (122, N'EPO', 15, 0, N'ASP', CAST(0x0000A80200E63AD7 AS DateTime), N'ASP', CAST(0x0000A80200E63AD7 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (123, N'EPO', 22, 0, N'ASP', CAST(0x0000A80200E63AF3 AS DateTime), N'ASP', CAST(0x0000A80200E63AF3 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (124, N'EPO', 11, 0, N'ASP', CAST(0x0000A80200E63B0D AS DateTime), N'ASP', CAST(0x0000A80200E63B0D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (125, N'EPO', 10, 0, N'ASP', CAST(0x0000A80200E63B26 AS DateTime), N'ASP', CAST(0x0000A80200E63B26 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (126, N'EPO', 17, 0, N'ASP', CAST(0x0000A80200E646FB AS DateTime), N'ASP', CAST(0x0000A80200E646FB AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (127, N'EPO', 8, 0, N'ASP', CAST(0x0000A80200E64714 AS DateTime), N'ASP', CAST(0x0000A80200E64714 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (128, N'PPM', 23, 0, N'PPM', CAST(0x0000A807010FD436 AS DateTime), N'PPM', CAST(0x0000A807010FD436 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (129, N'ASY', 3, 1, N'EPO', CAST(0x0000A80A00A33411 AS DateTime), N'EPO', CAST(0x0000A80A010DA0E9 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (130, N'ASY', 1, 1, N'EPO', CAST(0x0000A80A00A33411 AS DateTime), N'EPO', CAST(0x0000A80A010D9F9D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (131, N'ABU', 3, 1, N'EPO', CAST(0x0000A80A00A36381 AS DateTime), N'EPO', CAST(0x0000A80A010AAFD3 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (132, N'ABU', 1, 1, N'EPO', CAST(0x0000A80A00A36381 AS DateTime), N'EPO', CAST(0x0000A80A010AAE74 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (133, N'NRF', 3, 1, N'EPO', CAST(0x0000A80A00A3A2AD AS DateTime), N'EPO', CAST(0x0000A80B01031D63 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (134, N'NRF', 1, 1, N'EPO', CAST(0x0000A80A00A3A2AD AS DateTime), N'EPO', CAST(0x0000A80B01031BEE AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (135, N'YPE', 22, 0, N'EPO', CAST(0x0000A80A00A437B4 AS DateTime), N'EPO', CAST(0x0000A80A00A437B4 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (136, N'YPE', 9, 0, N'EPO', CAST(0x0000A80A00A437B4 AS DateTime), N'EPO', CAST(0x0000A80A00A437B4 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (137, N'YPE', 10, 1, N'EPO', CAST(0x0000A80A00A437CE AS DateTime), N'EPO', CAST(0x0000A81600FBEB86 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (138, N'YPE', 23, 0, N'EPO', CAST(0x0000A80A00A437EA AS DateTime), N'EPO', CAST(0x0000A80A00A437EA AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (139, N'LDE', 23, 0, N'EPO', CAST(0x0000A80A00A48A81 AS DateTime), N'EPO', CAST(0x0000A80A00A48A81 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (140, N'LDE', 9, 0, N'EPO', CAST(0x0000A80A00A48A81 AS DateTime), N'EPO', CAST(0x0000A80A00A48A81 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (141, N'LDE', 22, 0, N'EPO', CAST(0x0000A80A00A48A99 AS DateTime), N'EPO', CAST(0x0000A80A00A48A99 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (142, N'MNH', 1, 1, N'EPO', CAST(0x0000A80A00A4B501 AS DateTime), N'EPO', CAST(0x0000A80A00A4C26F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (143, N'MNH', 7, 1, N'EPO', CAST(0x0000A80A00A4BCA0 AS DateTime), N'EPO', CAST(0x0000A80A00A4BCA0 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (144, N'MNH', 22, 0, N'EPO', CAST(0x0000A80A00A4D608 AS DateTime), N'EPO', CAST(0x0000A80A00A4D608 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (145, N'MNH', 9, 0, N'EPO', CAST(0x0000A80A00A4D609 AS DateTime), N'EPO', CAST(0x0000A80A00A4D609 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (146, N'MNH', 23, 0, N'EPO', CAST(0x0000A80A00A4D61E AS DateTime), N'EPO', CAST(0x0000A80A00A4D61E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (147, N'RRH', 23, 0, N'EPO', CAST(0x0000A80A00A55673 AS DateTime), N'EPO', CAST(0x0000A80A00A55673 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (148, N'RRH', 9, 0, N'EPO', CAST(0x0000A80A00A55674 AS DateTime), N'EPO', CAST(0x0000A80A00A55674 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (149, N'RRH', 22, 0, N'EPO', CAST(0x0000A80A00A5568D AS DateTime), N'EPO', CAST(0x0000A80A00A5568D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (150, N'ROK', 23, 0, N'EPO', CAST(0x0000A80A00A5969D AS DateTime), N'EPO', CAST(0x0000A80A00A5969D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (151, N'ROK', 9, 0, N'EPO', CAST(0x0000A80A00A5969D AS DateTime), N'EPO', CAST(0x0000A80A00A5969D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (152, N'ROK', 22, 0, N'EPO', CAST(0x0000A80A00A596B9 AS DateTime), N'EPO', CAST(0x0000A80A00A596B9 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (153, N'AFI', 23, 0, N'EPO', CAST(0x0000A80A00AD7E39 AS DateTime), N'EPO', CAST(0x0000A80A00AD7E39 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (154, N'AFI', 9, 0, N'EPO', CAST(0x0000A80A00AD7E39 AS DateTime), N'EPO', CAST(0x0000A80A00AD7E39 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (155, N'AFI', 22, 0, N'EPO', CAST(0x0000A80A00AD7E50 AS DateTime), N'EPO', CAST(0x0000A80A00AD7E50 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (156, N'ABU', 2, 1, N'EPO', CAST(0x0000A80A010AB116 AS DateTime), N'EPO', CAST(0x0000A80A010AB116 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (157, N'ABU', 5, 1, N'EPO', CAST(0x0000A80A010AB27E AS DateTime), N'EPO', CAST(0x0000A80A010AB27E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (158, N'ABU', 6, 1, N'EPO', CAST(0x0000A80A010AB3BA AS DateTime), N'EPO', CAST(0x0000A80A010AB3BA AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (159, N'ABU', 23, 0, N'EPO', CAST(0x0000A80A010AC358 AS DateTime), N'EPO', CAST(0x0000A80A010AC358 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (160, N'ABU', 9, 0, N'EPO', CAST(0x0000A80A010AC359 AS DateTime), N'EPO', CAST(0x0000A80A010AC359 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (161, N'ABU', 10, 0, N'EPO', CAST(0x0000A80A010AC373 AS DateTime), N'EPO', CAST(0x0000A80A010AC373 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (162, N'ABU', 22, 0, N'EPO', CAST(0x0000A80A010AC38B AS DateTime), N'EPO', CAST(0x0000A80A010AC38B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (163, N'ASY', 2, 1, N'EPO', CAST(0x0000A80A010DA1EF AS DateTime), N'EPO', CAST(0x0000A80A010DA1EF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (164, N'ASY', 6, 1, N'EPO', CAST(0x0000A80A010DA37B AS DateTime), N'EPO', CAST(0x0000A80A010DA37B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (165, N'ASY', 5, 1, N'EPO', CAST(0x0000A80A010DA4E1 AS DateTime), N'EPO', CAST(0x0000A80A010DA4E1 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (166, N'ASY', 22, 0, N'EPO', CAST(0x0000A80A010DAEF7 AS DateTime), N'EPO', CAST(0x0000A80A010DAEF7 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (167, N'ASY', 9, 0, N'EPO', CAST(0x0000A80A010DAEF7 AS DateTime), N'EPO', CAST(0x0000A80A010DAEF7 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (168, N'ASY', 10, 1, N'EPO', CAST(0x0000A80A010DAF0E AS DateTime), N'ASP', CAST(0x0000A80E00F2704E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (169, N'ASY', 23, 0, N'EPO', CAST(0x0000A80A010DAF25 AS DateTime), N'EPO', CAST(0x0000A80A010DAF25 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (170, N'HDW', 18, 0, N'ASP', CAST(0x0000A80A010E3B8A AS DateTime), N'ASP', CAST(0x0000A80A010E3B8A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (171, N'HDW', 1, 0, N'ASP', CAST(0x0000A80A010E3B8A AS DateTime), N'ASP', CAST(0x0000A80A010E3B8A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (172, N'HDW', 2, 0, N'ASP', CAST(0x0000A80A010E3BA6 AS DateTime), N'ASP', CAST(0x0000A80A010E3BA6 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (173, N'HDW', 16, 0, N'ASP', CAST(0x0000A80A010E3BC1 AS DateTime), N'ASP', CAST(0x0000A80A010E3BC1 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (174, N'HDW', 19, 0, N'ASP', CAST(0x0000A80A010E3BD9 AS DateTime), N'ASP', CAST(0x0000A80A010E3BD9 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (175, N'HDW', 23, 0, N'ASP', CAST(0x0000A80A010E3C07 AS DateTime), N'ASP', CAST(0x0000A80A010E3C07 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (176, N'HDW', 9, 0, N'ASP', CAST(0x0000A80A010E3C07 AS DateTime), N'ASP', CAST(0x0000A80A010E3C07 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (177, N'HDW', 22, 0, N'ASP', CAST(0x0000A80A010E3C1F AS DateTime), N'ASP', CAST(0x0000A80A010E3C1F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (178, N'HDW', 10, 0, N'ASP', CAST(0x0000A80A010E3C36 AS DateTime), N'ASP', CAST(0x0000A80A010E3C36 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (179, N'HDW', 17, 0, N'ASP', CAST(0x0000A80A010E3C6C AS DateTime), N'ASP', CAST(0x0000A80A010E3C6C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (180, N'IGU', 3, 0, N'ASP', CAST(0x0000A80A010F4107 AS DateTime), N'ASP', CAST(0x0000A80A010F4107 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (181, N'IGU', 1, 0, N'ASP', CAST(0x0000A80A010F4107 AS DateTime), N'ASP', CAST(0x0000A80A010F4107 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (182, N'IGU', 2, 1, N'ASP', CAST(0x0000A80A010F4137 AS DateTime), N'ASP', CAST(0x0000A80A010F4137 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (183, N'IGU', 5, 1, N'ASP', CAST(0x0000A80A010F4152 AS DateTime), N'ASP', CAST(0x0000A80A010F4152 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (184, N'IGU', 6, 1, N'ASP', CAST(0x0000A80A010F4169 AS DateTime), N'ASP', CAST(0x0000A80A010F4169 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (185, N'NRF', 16, 1, N'ASP', CAST(0x0000A80A01150E0D AS DateTime), N'EPO', CAST(0x0000A80B0103186D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (186, N'NRF', 19, 1, N'ASP', CAST(0x0000A80A01150E28 AS DateTime), N'EPO', CAST(0x0000A80B01031A0E AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (187, N'NRF', 23, 0, N'ASP', CAST(0x0000A80A01150E42 AS DateTime), N'ASP', CAST(0x0000A80A01150E42 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (188, N'NRF', 9, 0, N'ASP', CAST(0x0000A80A01150E42 AS DateTime), N'EPO', CAST(0x0000A81500EC9B9A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (189, N'NRF', 22, 0, N'ASP', CAST(0x0000A80A01150E5C AS DateTime), N'EPO', CAST(0x0000A81500EC9B9A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (190, N'NRF', 10, 0, N'ASP', CAST(0x0000A80A01150E74 AS DateTime), N'EPO', CAST(0x0000A80B01031FFC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (191, N'NRF', 17, 1, N'ASP', CAST(0x0000A80A01150EA8 AS DateTime), N'EPO', CAST(0x0000A80B010323CD AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (192, N'MSA', 23, 0, N'ASP', CAST(0x0000A80B00F1FB5B AS DateTime), N'ASP', CAST(0x0000A80B00F1FB5B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (193, N'MSA', 9, 0, N'ASP', CAST(0x0000A80B00F1FB5B AS DateTime), N'ASP', CAST(0x0000A80B00F1FB5B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (194, N'MSA', 22, 0, N'ASP', CAST(0x0000A80B00F1FB75 AS DateTime), N'ASP', CAST(0x0000A80B00F1FB75 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (195, N'NRF', 2, 1, N'EPO', CAST(0x0000A80B01032531 AS DateTime), N'ASP', CAST(0x0000A81500EC45B2 AS DateTime), 1)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (196, N'NRF', 5, 1, N'EPO', CAST(0x0000A80B01033554 AS DateTime), N'ASP', CAST(0x0000A81500EC45B2 AS DateTime), 1)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (197, N'NRF', 6, 1, N'EPO', CAST(0x0000A80B01033699 AS DateTime), N'ASP', CAST(0x0000A81500EC45B2 AS DateTime), 1)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (198, N'KHU', 24, 0, N'KHU', CAST(0x0000A80F00000000 AS DateTime), N'KHU', CAST(0x0000A80F00000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (199, N'EPO', 24, 0, N'KHU', CAST(0x0000A80F00000000 AS DateTime), N'KHU', CAST(0x0000A80F00000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (200, N'ASP', 24, 0, N'KHU', CAST(0x0000A80F00000000 AS DateTime), N'KHU', CAST(0x0000A80F00000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (201, N'SAN', 23, 0, N'EPO', CAST(0x0000A815009D0365 AS DateTime), N'EPO', CAST(0x0000A815009D0365 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (202, N'SAN', 9, 0, N'EPO', CAST(0x0000A815009D0369 AS DateTime), N'EPO', CAST(0x0000A815009D0369 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (203, N'SAN', 22, 0, N'EPO', CAST(0x0000A815009D0380 AS DateTime), N'EPO', CAST(0x0000A815009D0380 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (204, N'FMJ', 24, 0, N'FMJ', CAST(0x0000A81500A461F2 AS DateTime), N'FMJ', CAST(0x0000A81500A461F2 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (205, N'FSH', 22, 0, N'EPO', CAST(0x0000A81500E634A8 AS DateTime), N'EPO', CAST(0x0000A81500E634A8 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (206, N'FSH', 9, 0, N'EPO', CAST(0x0000A81500E634A8 AS DateTime), N'EPO', CAST(0x0000A81500E634A8 AS DateTime), 0)
GO
print 'Processed 200 total records'
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (207, N'FSH', 23, 0, N'EPO', CAST(0x0000A81500E634C1 AS DateTime), N'EPO', CAST(0x0000A81500E634C1 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (208, N'KAT', 23, 0, N'EPO', CAST(0x0000A81500E67192 AS DateTime), N'EPO', CAST(0x0000A81500E67192 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (209, N'KAT', 9, 0, N'EPO', CAST(0x0000A81500E67192 AS DateTime), N'EPO', CAST(0x0000A81500E67192 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (210, N'KAT', 22, 0, N'EPO', CAST(0x0000A81500E671A9 AS DateTime), N'EPO', CAST(0x0000A81500E671A9 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (211, N'BSU', 23, 0, N'EPO', CAST(0x0000A81500E6A83B AS DateTime), N'EPO', CAST(0x0000A81500E6A83B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (212, N'BSU', 9, 0, N'EPO', CAST(0x0000A81500E6A83B AS DateTime), N'EPO', CAST(0x0000A81500E6A83B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (213, N'BSU', 22, 0, N'EPO', CAST(0x0000A81500E6A858 AS DateTime), N'EPO', CAST(0x0000A81500E6A858 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (214, N'RSP', 23, 0, N'EPO', CAST(0x0000A81500E74734 AS DateTime), N'EPO', CAST(0x0000A81500E74734 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (215, N'RSP', 9, 0, N'EPO', CAST(0x0000A81500E74735 AS DateTime), N'EPO', CAST(0x0000A81500E74735 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (216, N'RSP', 22, 0, N'EPO', CAST(0x0000A81500E7474F AS DateTime), N'EPO', CAST(0x0000A81500E7474F AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (217, N'DIS', 22, 0, N'ASP', CAST(0x0000A81500EA2BEE AS DateTime), N'ASP', CAST(0x0000A81500EA2BEE AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (218, N'DIS', 9, 0, N'ASP', CAST(0x0000A81500EA2BEF AS DateTime), N'ASP', CAST(0x0000A81500EA2BEF AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (219, N'NDE', 23, 0, N'ASP', CAST(0x0000A81500EB025D AS DateTime), N'ASP', CAST(0x0000A81500EB025D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (220, N'NDE', 9, 0, N'ASP', CAST(0x0000A81500EB025D AS DateTime), N'ASP', CAST(0x0000A81500EB025D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (221, N'NDE', 22, 0, N'ASP', CAST(0x0000A81500EB027A AS DateTime), N'ASP', CAST(0x0000A81500EB027A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (222, N'NIR', 23, 0, N'ASP', CAST(0x0000A8150103E951 AS DateTime), N'ASP', CAST(0x0000A8150103E951 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (223, N'NIR', 9, 0, N'ASP', CAST(0x0000A8150103E951 AS DateTime), N'ASP', CAST(0x0000A8150103E951 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (224, N'NIR', 22, 0, N'ASP', CAST(0x0000A8150103E968 AS DateTime), N'ASP', CAST(0x0000A8150103E968 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (225, N'MAP', 23, 0, N'ASP', CAST(0x0000A81501073745 AS DateTime), N'ASP', CAST(0x0000A81501073745 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (226, N'MAP', 9, 0, N'ASP', CAST(0x0000A81501073745 AS DateTime), N'ASP', CAST(0x0000A81501073745 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (227, N'MAP', 17, 0, N'ASP', CAST(0x0000A8150107375D AS DateTime), N'ASP', CAST(0x0000A8150107375D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (228, N'MAP', 1, 0, N'ASP', CAST(0x0000A8150107375D AS DateTime), N'ASP', CAST(0x0000A8150107375D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (229, N'NHN', 22, 0, N'ASP', CAST(0x0000A81501079C7B AS DateTime), N'ASP', CAST(0x0000A81501079C7B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (230, N'NHN', 9, 0, N'ASP', CAST(0x0000A81501079C7B AS DateTime), N'ASP', CAST(0x0000A81501079C7B AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (231, N'NHN', 23, 0, N'ASP', CAST(0x0000A81501079C96 AS DateTime), N'ASP', CAST(0x0000A81501079C96 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (232, N'DAW', 23, 0, N'ASP', CAST(0x0000A81600F9EACC AS DateTime), N'ASP', CAST(0x0000A81600F9EACC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (233, N'DAW', 9, 0, N'ASP', CAST(0x0000A81600F9EACC AS DateTime), N'ASP', CAST(0x0000A81600F9EACC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (234, N'DAW', 22, 0, N'ASP', CAST(0x0000A81600F9EB05 AS DateTime), N'ASP', CAST(0x0000A81600F9EB05 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (235, N'WHI', 25, 0, N'WHI', CAST(0x0000A81700FFE387 AS DateTime), N'WHI', CAST(0x0000A81700FFE387 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (236, N'WHI', 26, 0, N'WHI', CAST(0x0000A81800000000 AS DateTime), N'WHI', CAST(0x0000A81800000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (237, N'EPO', 26, 0, N'WHI', CAST(0x0000A81800000000 AS DateTime), N'WHI', CAST(0x0000A81800000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (238, N'AAU', 9, 0, N'ASP', CAST(0x0000A81900A66FFC AS DateTime), N'ASP', CAST(0x0000A81900A66FFC AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (239, N'AAU', 23, 0, N'ASP', CAST(0x0000A81900A6701C AS DateTime), N'ASP', CAST(0x0000A81900A6701C AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (240, N'DSO', 23, 0, N'ASP', CAST(0x0000A81900AE8222 AS DateTime), N'ASP', CAST(0x0000A81900AE8222 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (241, N'DSO', 9, 0, N'ASP', CAST(0x0000A81900AE8223 AS DateTime), N'ASP', CAST(0x0000A81900AE8223 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (242, N'DSO', 22, 0, N'ASP', CAST(0x0000A81900AE823A AS DateTime), N'ASP', CAST(0x0000A81900AE823A AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (243, N'INU', 23, 0, N'ASP', CAST(0x0000A81900B83919 AS DateTime), N'ASP', CAST(0x0000A81900B83919 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (244, N'INU', 9, 0, N'ASP', CAST(0x0000A81900B83919 AS DateTime), N'ASP', CAST(0x0000A81900B83919 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (245, N'INU', 22, 0, N'ASP', CAST(0x0000A81900B83932 AS DateTime), N'ASP', CAST(0x0000A81900B83932 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (246, N'FMJ', 26, 0, N'FMJ', CAST(0x0000A81C00AFB6A3 AS DateTime), N'FMJ', CAST(0x0000A81C00AFB6A3 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (247, N'FMJ', 25, 0, N'FMJ', CAST(0x0000A81F0108D809 AS DateTime), N'FMJ', CAST(0x0000A81F0108D809 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (248, N'FMJ', 27, 0, N'FMJ', CAST(0x0000A81F0108D822 AS DateTime), N'FMJ', CAST(0x0000A81F0108D822 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (249, N'BDA', 25, 0, N'BDA', CAST(0x0000A82000863A89 AS DateTime), N'BDA', CAST(0x0000A82000863A89 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (250, N'BDA', 24, 0, N'BDA', CAST(0x0000A82000863F87 AS DateTime), N'BDA', CAST(0x0000A82000863F87 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (251, N'BDA', 28, 0, N'KHU', CAST(0x0000A82000000000 AS DateTime), N'KHU', CAST(0x0000A82000000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (252, N'WHI', 28, 0, N'KHU', CAST(0x0000A82000000000 AS DateTime), N'KHU', CAST(0x0000A82000000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (253, N'FMJ', 28, 0, N'KHU', CAST(0x0000A82000000000 AS DateTime), N'KHU', CAST(0x0000A82000000000 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (254, N'EPO', 25, 0, N'EPO', CAST(0x0000A82000E85036 AS DateTime), N'EPO', CAST(0x0000A82000E85036 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (255, N'ASP', 25, 0, N'EPO', CAST(0x0000A82000E868D5 AS DateTime), N'EPO', CAST(0x0000A82000E868D5 AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (256, N'ABU', 25, 0, N'ASP', CAST(0x0000A82000EB349D AS DateTime), N'ASP', CAST(0x0000A82000EB349D AS DateTime), 0)
INSERT [dbo].[m_user_menu_mapping] ([id], [user_id], [menu_id], [is_exclude], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (257, N'WHI', 24, 0, N'WHI', CAST(0x0000A82500AAD948 AS DateTime), N'WHI', CAST(0x0000A82500AAD948 AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[m_user_menu_mapping] OFF
/****** Object:  Table [dbo].[m_approv_matrix_detail]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_approv_matrix_detail](
	[approv_matrix_detail_id] [bigint] IDENTITY(1,1) NOT NULL,
	[approv_matrix_id] [int] NOT NULL,
	[maximum_value] [decimal](12, 2) NOT NULL,
	[level_type_id] [int] NOT NULL,
	[currency_id] [int] NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_approv__193C3FDE17CD73C7] PRIMARY KEY CLUSTERED 
(
	[approv_matrix_detail_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_approv_matrix_detail] ON
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, 13, CAST(50000000.00 AS Decimal(12, 2)), 6, NULL, N'ASP', CAST(0x0000A80300E11F85 AS DateTime), N'ASP', CAST(0x0000A80300E11F85 AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, 13, CAST(100000000.00 AS Decimal(12, 2)), 3, NULL, N'ASP', CAST(0x0000A80300E13134 AS DateTime), N'ASP', CAST(0x0000A80300E13134 AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, 13, CAST(500000000.00 AS Decimal(12, 2)), 2, NULL, N'ASP', CAST(0x0000A80300E141B8 AS DateTime), N'ASP', CAST(0x0000A80300E141B8 AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, 13, CAST(999999999.00 AS Decimal(12, 2)), 1, NULL, N'ASP', CAST(0x0000A80300E15FE6 AS DateTime), N'ASP', CAST(0x0000A80300E15FE6 AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, 12, CAST(1000000.00 AS Decimal(12, 2)), 1, 1, N'PPM', CAST(0x0000A80300E3E76D AS DateTime), N'PPM', CAST(0x0000A80300EBD92E AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, 14, CAST(1000000.00 AS Decimal(12, 2)), 3, 1, N'FMJ', CAST(0x0000A8080100DB47 AS DateTime), N'FMJ', CAST(0x0000A8080100DB47 AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, 14, CAST(10000000.00 AS Decimal(12, 2)), 2, 1, N'FMJ', CAST(0x0000A8080100E7C3 AS DateTime), N'FMJ', CAST(0x0000A8080100E7C3 AS DateTime), N'0')
INSERT [dbo].[m_approv_matrix_detail] ([approv_matrix_detail_id], [approv_matrix_id], [maximum_value], [level_type_id], [currency_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, 14, CAST(1000000000.00 AS Decimal(12, 2)), 1, 1, N'FMJ', CAST(0x0000A8080100F421 AS DateTime), N'FMJ', CAST(0x0000A8080100F421 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_approv_matrix_detail] OFF
/****** Object:  Trigger [m_workflow_template_stage_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_stage_Update]      
ON [dbo].[m_workflow_template_stage]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([workflow_template_stage_id]) THEN '[workflow_template_stage_id]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_id]) THEN '[workflow_template_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([is_stage_approval]) THEN '[is_stage_approval]-' ELSE '' END + 
CASE WHEN UPDATE([approv_matrix_id]) THEN '[approv_matrix_id]-' ELSE '' END + 
CASE WHEN UPDATE([pic_is_requester]) THEN '[pic_is_requester]-' ELSE '' END + 
CASE WHEN UPDATE([group_pic_id]) THEN '[group_pic_id]-' ELSE '' END + 
CASE WHEN UPDATE([user_workflow_id]) THEN '[user_workflow_id]-' ELSE '' END + 
CASE WHEN UPDATE([can_edit_information]) THEN '[can_edit_information]-' ELSE '' END + 
CASE WHEN UPDATE([can_upload_document]) THEN '[can_upload_document]-' ELSE '' END + 
CASE WHEN UPDATE([can_delete_document]) THEN '[can_delete_document]-' ELSE '' END + 
CASE WHEN UPDATE([seq_number]) THEN '[seq_number]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_workflow_template_stage]
([workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_stage_id]) as [workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_workflow_template_stage]
([workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_stage_id]) as [workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_workflow_template_stage_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_stage_Insert] 
ON [dbo].[m_workflow_template_stage]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_workflow_template_stage]
([workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_stage_id]) as [workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_workflow_template_stage_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_stage_Delete]    
ON [dbo].[m_workflow_template_stage]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_workflow_template_stage]
([workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_stage_id]) as [workflow_template_stage_id],[workflow_template_id],[description],[is_stage_approval],[approv_matrix_id],[pic_is_requester],[group_pic_id],[user_workflow_id],[can_edit_information],[can_upload_document],[can_delete_document],[seq_number],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_level_type_Update]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_level_type_Update]      
ON [dbo].[m_level_type]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([level_type_id]) THEN '[level_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([level_type_code]) THEN '[level_type_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([head_description]) THEN '[head_description]-' ELSE '' END + 
CASE WHEN UPDATE([seq_number]) THEN '[seq_number]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_level_type]
([level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[level_type_id]) as [level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_level_type]
([level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[level_type_id]) as [level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_level_type_Insert]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_level_type_Insert] 
ON [dbo].[m_level_type]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_level_type]
([level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[level_type_id]) as [level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_level_type_Delete]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_level_type_Delete]    
ON [dbo].[m_level_type]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_level_type]
([level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[level_type_id]) as [level_type_id],[level_type_code],[description],[head_description],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_group_menu_Insert]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_menu_Insert] 
ON [dbo].[m_group_menu]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_group_menu]
([group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_id]) as [group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_group_menu_Delete]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_menu_Delete]    
ON [dbo].[m_group_menu]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_group_menu]
([group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_id]) as [group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [create_gm_code]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[create_gm_code] 
   ON [dbo].[m_group_menu]
   FOR INSERT
AS 
BEGIN

	SET NOCOUNT ON;

	DECLARE @rownums VARCHAR(4);
	DECLARE @gmcode VARCHAR(6);

    SET @rownums = (
		SELECT CAST((COUNT(group_menu_id)) AS VARCHAR) 
		FROM m_group_menu
	);

	SET @gmcode = (SELECT 'GM' + STUFF('0000', 4 - LEN(@rownums) + 1, LEN(@rownums), @rownums));

	UPDATE m_group_menu
	SET group_menu_code = @gmcode
	WHERE group_menu_id IN (
		SELECT group_menu_id 
		FROM inserted
	);

END
GO
/****** Object:  Table [dbo].[m_workflow_template_action]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_workflow_template_action](
	[workflow_template_action_id] [bigint] IDENTITY(1,1) NOT NULL,
	[workflow_template_stage_id] [bigint] NULL,
	[description] [varchar](255) NOT NULL,
	[is_final_action] [char](1) NOT NULL,
	[workflow_template_id] [int] NULL,
	[destination_stage_id] [int] NULL,
	[is_send_notif_to_requester] [char](1) NOT NULL,
	[is_send_notif_to_next_pic] [char](1) NOT NULL,
	[is_notif_document_completion] [char](1) NOT NULL,
	[is_check_mandatory_document] [char](1) NOT NULL,
	[is_remarks_mandatory] [char](1) NULL,
	[is_fill_reference_number] [char](1) NOT NULL,
	[is_check_transaction_status_core] [char](1) NULL,
	[code_transaction_status] [varchar](50) NULL,
	[is_need_reason] [char](1) NOT NULL,
	[reason_category_id] [int] NULL,
	[transaction_status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_workfl__D25E975224334AAC] PRIMARY KEY CLUSTERED 
(
	[workflow_template_action_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_workflow_template_action] ON
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, 28, N'Create New Transaction', N'0', NULL, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'WHI', CAST(0x0000A7ED00000000 AS DateTime), N'WHI', CAST(0x0000A7ED00000000 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, 28, N'Need Revision', N'0', 40, 30, N'0', N'0', N'0', N'1', N'0', N'0', N'0', NULL, N'1', 6, 2, N'KHU', CAST(0x0000A7EE010657C1 AS DateTime), N'ASP', CAST(0x0000A80A00927078 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, 28, N'Send to Approver', N'0', 40, 30, N'0', N'0', N'0', N'1', N'0', N'0', N'0', NULL, N'1', 4, 2, N'KHU', CAST(0x0000A7EE0106F1F7 AS DateTime), N'ASP', CAST(0x0000A80A00927374 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, 27, N'Need Revision', N'0', 40, 28, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'KHU', CAST(0x0000A7EE010D81E0 AS DateTime), N'FMJ', CAST(0x0000A80A00F080EF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, 23, N'Cancel Dokument', N'0', 40, 23, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 1, N'KHU', CAST(0x0000A7EE010DD8F7 AS DateTime), N'KHU', CAST(0x0000A7EE010E4D6F AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, 23, N'Submit', N'0', 40, 27, N'0', N'0', N'0', N'1', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'KHU', CAST(0x0000A7EE010E1CBB AS DateTime), N'ASP', CAST(0x0000A80900FD6935 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, 27, N'Submit to Head Office', N'0', 40, 29, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'PPM', CAST(0x0000A7EE0117E8E0 AS DateTime), N'FMJ', CAST(0x0000A80A00F50323 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, 23, N'Cancel Register', N'1', 40, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 5, N'FMJ', CAST(0x0000A7FD00F2BB85 AS DateTime), N'WHI', CAST(0x0000A80F0103D96A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, 29, N'Need Revision', N'0', 40, 28, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 4, 2, N'FMJ', CAST(0x0000A7FD00F4D901 AS DateTime), N'BDA', CAST(0x0000A80B00F43729 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, 29, N'Transaction Process', N'0', 40, 30, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'FMJ', CAST(0x0000A7FD00F4F4CA AS DateTime), N'ASP', CAST(0x0000A80A00940481 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, 30, N'Submit to Head Underwriting', N'0', 40, 67, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'FMJ', CAST(0x0000A7FD00F55344 AS DateTime), N'ASP', CAST(0x0000A815010F5758 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, 30, N'Cancel Transaction', N'1', 40, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'FMJ', CAST(0x0000A7FD00F570AB AS DateTime), N'ASP', CAST(0x0000A80A00953CCF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, 31, N'Submit to Head Elise', N'0', 42, 32, N'0', N'1', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A80200C4DB11 AS DateTime), N'BDA', CAST(0x0000A8080101E80C AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, 31, N'Cancel Register', N'1', 42, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'BDA', CAST(0x0000A80200C56F22 AS DateTime), N'BDA', CAST(0x0000A80200C56F22 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, 32, N'Submit to Head Office', N'0', 42, 35, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A80200C5AD69 AS DateTime), N'ASP', CAST(0x0000A809009786E2 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, 32, N'Need Revision', N'0', 42, 33, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'BDA', CAST(0x0000A80200C5F9E5 AS DateTime), N'ASP', CAST(0x0000A80E00EC04C4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, 33, N'Checking by Head Elise', N'0', 42, 32, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A80200C61D8E AS DateTime), N'ASP', CAST(0x0000A81500B2A4E5 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, 33, N'Cancel Register', N'1', 42, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'BDA', CAST(0x0000A80200C648F6 AS DateTime), N'BDA', CAST(0x0000A80200C648F6 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, 34, N'Need Revision', N'0', 42, 33, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'BDA', CAST(0x0000A80200C67EAC AS DateTime), N'BDA', CAST(0x0000A80200C67EAC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, 34, N'Process Transaction', N'0', 42, 35, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A80200DB6E9B AS DateTime), N'BDA', CAST(0x0000A80200DB6E9B AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, 35, N'Sent to Approver', N'0', 42, 36, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A80200DBD96A AS DateTime), N'EPO', CAST(0x0000A81D009370C8 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, 36, N'Need Revision', N'0', 42, 35, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'BDA', CAST(0x0000A80200DC243B AS DateTime), N'BDA', CAST(0x0000A80200DC243B AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, 36, N'Approve', N'1', 42, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'BDA', CAST(0x0000A80200DC75DC AS DateTime), N'BDA', CAST(0x0000A80200DC75DC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, 35, N'Cancel Transaction', N'1', 42, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'BDA', CAST(0x0000A80200DC998D AS DateTime), N'BDA', CAST(0x0000A80200DCA123 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, 37, N'Cancel Registration', N'1', 43, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 5, N'ASP', CAST(0x0000A80300DC3C8A AS DateTime), N'BDA', CAST(0x0000A81600C0BBA6 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, 37, N'Submit to Head Elise', N'0', 43, 38, N'0', N'1', N'0', N'1', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80300EFFBEC AS DateTime), N'ASP', CAST(0x0000A81600AACDC1 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, 38, N'Need Revision', N'0', 43, 39, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80300F140D4 AS DateTime), N'ASP', CAST(0x0000A81500AB4720 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, 38, N'Submit to Claim', N'0', 43, 41, N'0', N'1', N'0', N'0', N'1', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80300F16CCA AS DateTime), N'ASP', CAST(0x0000A82400E5D53C AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, 39, N'Cancel Registration', N'1', 43, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 5, N'ASP', CAST(0x0000A80300F2139F AS DateTime), N'BDA', CAST(0x0000A81600C0D43A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, 37, N'DRAFT', N'0', 43, 37, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 1, N'ASP', CAST(0x0000A80800AA9B14 AS DateTime), N'ASP', CAST(0x0000A81600AA26F2 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, 35, N'Need Revison', N'0', 42, 33, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A80900996AF2 AS DateTime), N'EPO', CAST(0x0000A81D00936337 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, 40, N'Need Revison', N'0', 43, 40, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80900A29C2D AS DateTime), N'ASP', CAST(0x0000A81600FBFA30 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, 40, N'Submit to Claim', N'0', 43, 41, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80900A2F355 AS DateTime), N'ASP', CAST(0x0000A80900A2F355 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, 41, N'Need Revision', N'0', 43, 39, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A80900A41AA6 AS DateTime), N'ASP', CAST(0x0000A80900A41AA6 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, 41, N'Submit to Head Claim', N'0', 43, 42, N'1', N'0', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80900A449A0 AS DateTime), N'ASP', CAST(0x0000A80900A623CA AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, 42, N'Approve', N'1', 43, NULL, N'1', N'0', N'0', N'0', N'1', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A80900A4E589 AS DateTime), N'RSP', CAST(0x0000A82500C0B003 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, 42, N'Need Revision', N'0', 43, 39, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80900A4FDC9 AS DateTime), N'ASP', CAST(0x0000A8160100CC4B AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, 23, N'Submit to Head Elise', N'0', 40, 27, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80900FBBD11 AS DateTime), N'ASP', CAST(0x0000A82000EEE510 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, 28, N'Cancel', N'1', 40, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 5, N'ASP', CAST(0x0000A80A00935F8F AS DateTime), N'ASP', CAST(0x0000A81500B3CBAC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, 28, N'Submit to Head ELISE', N'0', 40, 27, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80A00938466 AS DateTime), N'ASP', CAST(0x0000A80A00939BB7 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (56, 67, N'Underwriter Approve', N'0', 40, 68, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80A009580FF AS DateTime), N'ASP', CAST(0x0000A80A009580FF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (57, 67, N'Underwriter Pending', N'0', 40, 67, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 14, 2, N'ASP', CAST(0x0000A80A0095A940 AS DateTime), N'ASP', CAST(0x0000A82000B17C69 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (58, 67, N'Underwriter Decline', N'0', 40, 71, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 3, N'ASP', CAST(0x0000A80A0098195E AS DateTime), N'ASP', CAST(0x0000A82000F7FC1D AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (59, 68, N'Approve', N'1', 40, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A80A00987D6B AS DateTime), N'ASP', CAST(0x0000A80A00987D6B AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (60, 68, N'Need Revision', N'0', 40, 28, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A80A009893A2 AS DateTime), N'ASP', CAST(0x0000A80A0098AC5E AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (61, 69, N'sasasaa', N'0', 40, 28, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A80A00A19A81 AS DateTime), N'ASP', CAST(0x0000A80A00A19A81 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (62, 70, N'Send to Underwriting', N'0', 40, 30, N'1', N'0', N'0', N'1', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80A011BB58F AS DateTime), N'ASP', CAST(0x0000A81500B4CA5E AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (63, 71, N'Decline', N'0', 40, 67, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80B00FC9A31 AS DateTime), N'MNH', CAST(0x0000A82000F8E292 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (64, 72, N'Cancel Registration', N'1', 44, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 5, N'ASP', CAST(0x0000A80E00A137AD AS DateTime), N'ASP', CAST(0x0000A81800A74CF4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65, 72, N'Submit to Head Elise', N'0', 44, 73, N'0', N'1', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80E00A2863E AS DateTime), N'NRF', CAST(0x0000A81500EEE2B7 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66, 74, N'Need Revision', N'0', 44, 72, N'1', N'0', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80E00A316C8 AS DateTime), N'ASP', CAST(0x0000A80E00EB6E26 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (67, 74, N'Submit to Head Elise', N'0', 44, 74, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80E00A337A9 AS DateTime), N'PPM', CAST(0x0000A82300A8563F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (68, 75, N'Approve', N'1', 44, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A80E00A349EE AS DateTime), N'ASP', CAST(0x0000A80E00A349EE AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (69, 75, N'Need Revision', N'0', 44, 74, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A80E00A368BC AS DateTime), N'ASP', CAST(0x0000A80E00EBC88F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (70, 73, N'Need Revision', N'0', 44, 74, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A80E00A48902 AS DateTime), N'ASP', CAST(0x0000A81500FA22BB AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (71, 73, N'Validation', N'1', 44, NULL, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A80E00A4AB85 AS DateTime), N'ASP', CAST(0x0000A81500FD64E9 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (73, 74, N'Cancel Registration', N'1', 44, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A80E00EBA6E2 AS DateTime), N'ASP', CAST(0x0000A80E00EBA6E2 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (74, 77, N'Cancel Registration', N'1', 46, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A810009DE283 AS DateTime), N'ASP', CAST(0x0000A810009DE283 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (75, 77, N'Submit to Head Elise', N'0', 46, 78, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A810009DFAAB AS DateTime), N'ASP', CAST(0x0000A81500A631E4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (76, 78, N'Need Revision', N'0', 46, 79, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A810009E2220 AS DateTime), N'ASP', CAST(0x0000A81500AA2DB2 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (77, 78, N'Submit to Head Office', N'0', 46, 113, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A810009E723A AS DateTime), N'EPO', CAST(0x0000A82500C05B22 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (78, 79, N'Submit to Head Elise', N'0', 46, 78, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A810009E938A AS DateTime), N'ASP', CAST(0x0000A81500B02F17 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (79, 80, N'Need Revision', N'0', 46, 79, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A810009EC6C7 AS DateTime), N'ASP', CAST(0x0000A810009FF02F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (80, 80, N'Sent to Approver Include Reference No.', N'0', 46, 81, N'0', N'1', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A810009EE194 AS DateTime), N'EPO', CAST(0x0000A81E00A7E0FA AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (81, 81, N'Approve Document', N'1', 46, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A810009EFEC7 AS DateTime), N'ASP', CAST(0x0000A81C00AE565B AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (82, 81, N'Need Revision', N'0', 46, 79, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A810009F2BB2 AS DateTime), N'ASP', CAST(0x0000A810009F2BB2 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (83, 79, N'Cancel Register', N'1', 46, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A810009F9980 AS DateTime), N'ASP', CAST(0x0000A810009F9980 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (84, 80, N'Cancel Transaction', N'1', 46, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81000A09BBC AS DateTime), N'ASP', CAST(0x0000A81000A09BBC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (86, 82, N'Cancel Registration', N'1', 48, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 4, N'ASP', CAST(0x0000A81000B0F08A AS DateTime), N'ASP', CAST(0x0000A81000B0F08A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (87, 82, N'Sumbit to Head Underwriting', N'0', 48, 83, N'0', N'1', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81000B11CBF AS DateTime), N'ASP', CAST(0x0000A81000B125C7 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (88, 83, N'Need Revision', N'0', 48, 84, N'1', N'0', N'0', N'0', N'0', N'1', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81000B1461F AS DateTime), N'ASP', CAST(0x0000A81000B1461F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (89, 83, N'Submit to Customer Care', N'0', 48, 85, N'1', N'0', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81000B16F9E AS DateTime), N'ASP', CAST(0x0000A81000B18151 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (90, 84, N'Need Revision', N'0', 48, 82, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 3, N'ASP', CAST(0x0000A81000B1B3BD AS DateTime), N'ASP', CAST(0x0000A81000B1B3BD AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (91, 85, N'Need Revision', N'0', 48, 84, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81000B1DC75 AS DateTime), N'ASP', CAST(0x0000A81000B1DC75 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (92, 85, N'Sent to Approver', N'0', 48, 86, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81000B1F03E AS DateTime), N'ASP', CAST(0x0000A81500ADA554 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (93, 86, N'Approve', N'1', 48, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A81000B20048 AS DateTime), N'ASP', CAST(0x0000A81000B20048 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (94, 86, N'Need Revision', N'0', 48, 84, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81000B21C11 AS DateTime), N'ASP', CAST(0x0000A81000B21C11 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (96, 85, N'Cancel Registration', N'1', 48, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81000B7B663 AS DateTime), N'ASP', CAST(0x0000A81000B7B663 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (97, 89, N'Cancel Register', N'1', 49, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A8100101BF33 AS DateTime), N'ASP', CAST(0x0000A8100101BF33 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (98, 89, N'Submit to Head Elise', N'0', 49, 90, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A8100107A6A7 AS DateTime), N'ASP', CAST(0x0000A81500B1B254 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (99, 87, N'Cancel', N'1', 47, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'EPO', CAST(0x0000A810010CAA61 AS DateTime), N'EPO', CAST(0x0000A810010CAA61 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (100, 87, N'Submit to Head Elise', N'0', 47, 88, N'0', N'1', N'0', N'1', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A810010CD6B0 AS DateTime), N'ASP', CAST(0x0000A81500A831DB AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (101, 88, N'Need Revision', N'0', 47, 94, N'0', N'1', N'0', N'1', N'0', N'0', N'0', NULL, N'1', 6, 2, N'EPO', CAST(0x0000A810010D048E AS DateTime), N'ASP', CAST(0x0000A81500AA8205 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (102, 90, N'Need Revision', N'0', 49, 91, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A810010F99D0 AS DateTime), N'ASP', CAST(0x0000A81500AC8D19 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (103, 88, N'Submit to Head Office', N'0', 47, 95, N'0', N'1', N'0', N'1', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A810010FD1D2 AS DateTime), N'EPO', CAST(0x0000A810010FD1D2 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (104, 90, N'Submit to Head Office', N'0', 49, 92, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A810010FDA56 AS DateTime), N'ASP', CAST(0x0000A81500B1F689 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (105, 94, N'Cancel Registration', N'1', 47, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'EPO', CAST(0x0000A810010FFA2C AS DateTime), N'ASP', CAST(0x0000A81500A892C0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (106, 94, N'Submit to Head Elise', N'0', 47, 94, N'0', N'1', N'0', N'1', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81001101969 AS DateTime), N'ASP', CAST(0x0000A81500B0F705 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (107, 92, N'Cancel Transaction', N'1', 49, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81001102DFB AS DateTime), N'ASP', CAST(0x0000A81001102DFB AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (108, 92, N'Sent to Approver', N'0', 49, 93, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81001104B1F AS DateTime), N'ASP', CAST(0x0000A810011057D3 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (109, 95, N'Send to Approver', N'0', 47, 96, N'0', N'1', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A810011052D1 AS DateTime), N'ASP', CAST(0x0000A81500A910DC AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (110, 95, N'Need Revision', N'0', 47, 94, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'EPO', CAST(0x0000A8100110718C AS DateTime), N'ASP', CAST(0x0000A81500AAA799 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (111, 92, N'Need Revision', N'0', 49, 91, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81001107F49 AS DateTime), N'ASP', CAST(0x0000A8100110B32A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (112, 95, N'Cancel', N'1', 47, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'EPO', CAST(0x0000A810011086BD AS DateTime), N'ASP', CAST(0x0000A81500B115F6 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (113, 96, N'Cancel', N'1', 47, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', NULL, 5, N'EPO', CAST(0x0000A8100110AB34 AS DateTime), N'EPO', CAST(0x0000A8100110AB34 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (114, 96, N'Need Revision', N'0', 47, 94, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'EPO', CAST(0x0000A8100110F27D AS DateTime), N'ASP', CAST(0x0000A81500A8B812 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (115, 96, N'Approve', N'1', 47, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'EPO', CAST(0x0000A810011121C8 AS DateTime), N'EPO', CAST(0x0000A810011121C8 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (116, 91, N'Cancel Regsistration', N'1', 49, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81001116B3F AS DateTime), N'ASP', CAST(0x0000A81001116B3F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (117, 91, N'Submit to Head Office', N'0', 49, 92, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81001117F9B AS DateTime), N'ASP', CAST(0x0000A81500ACB407 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (118, 97, N'Cancel Registration', N'1', 51, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81100B4DAD1 AS DateTime), N'ASP', CAST(0x0000A81100B4DAD1 AS DateTime), N'0')
GO
print 'Processed 100 total records'
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (119, 97, N'Submit to Head Elise', N'0', 51, 98, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81100B4F302 AS DateTime), N'ASP', CAST(0x0000A81100B5001A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (120, 98, N'Need Revision', N'0', 51, 97, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81100B52008 AS DateTime), N'ASP', CAST(0x0000A81100B52008 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (121, 98, N'Submit to Customer Care', N'0', 51, 107, N'0', N'0', N'0', N'1', N'1', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81100B5459B AS DateTime), N'ASP', CAST(0x0000A82400E52D23 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (122, 99, N'Cancel Registration', N'1', 51, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81100B5CFC9 AS DateTime), N'ASP', CAST(0x0000A81100B5F41D AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (123, 99, N'Submit to Head Elise', N'0', 51, 98, N'1', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81100B5ECA7 AS DateTime), N'ASP', CAST(0x0000A81200F9C7A0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (124, 100, N'Need Revision', N'0', 51, 99, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 5, N'ASP', CAST(0x0000A81100B63209 AS DateTime), N'ASP', CAST(0x0000A81100B63209 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (126, 100, N'Sent to Approver', N'0', 51, 101, N'1', N'1', N'0', N'0', N'0', N'1', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81100B648AC AS DateTime), N'ASP', CAST(0x0000A81100B65340 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (127, 101, N'Approve', N'1', 51, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A81100B66F48 AS DateTime), N'ASP', CAST(0x0000A81100B66F48 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (128, 101, N'Cancel Registration', N'1', 51, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81100B68582 AS DateTime), N'ASP', CAST(0x0000A81500B3017E AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (129, 101, N'Need Revision', N'0', 51, 99, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81100B69EDD AS DateTime), N'ASP', CAST(0x0000A81100B6A719 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (130, 102, N'Cancel Registration', N'1', 50, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 5, N'ASP', CAST(0x0000A81100B769C0 AS DateTime), N'ASP', CAST(0x0000A81100B769C0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (131, 102, N'Submit to Head Elise', N'0', 50, 103, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81100B79707 AS DateTime), N'ASP', CAST(0x0000A81500B32470 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (138, 72, N'Test 1', N'0', 44, 74, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 3, N'WHI', CAST(0x0000A81100E51764 AS DateTime), N'ASP', CAST(0x0000A81500A10F17 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (139, 106, N'Approve', N'1', 50, NULL, N'1', N'0', N'0', N'0', N'1', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A81100EC92F0 AS DateTime), N'ASP', CAST(0x0000A825009D4B4E AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (140, 106, N'Cancel Registration', N'1', 50, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81100ECA865 AS DateTime), N'ASP', CAST(0x0000A81100ECA865 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (141, 106, N'Need Revision', N'0', 50, 104, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81100ECBC90 AS DateTime), N'ASP', CAST(0x0000A81100ECCFE5 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (142, 105, N'Need Revision', N'0', 50, 104, N'1', N'0', N'0', N'0', N'0', N'1', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81100ECF5CE AS DateTime), N'ASP', CAST(0x0000A81100ECF5CE AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (143, 71, N'Need Revision', N'0', 40, 27, N'1', N'0', N'0', N'0', N'0', N'1', N'0', NULL, N'1', NULL, 5, N'ASP', CAST(0x0000A81100EF785F AS DateTime), N'ASP', CAST(0x0000A81500B4FF04 AS DateTime), N'1')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (144, 39, N'Submit to Head Elise', N'0', 43, 38, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A811010116EA AS DateTime), N'ASP', CAST(0x0000A81500B162AD AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (145, 107, N'Need Revision', N'0', 51, 99, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81200F775CF AS DateTime), N'EPO', CAST(0x0000A81200F775CF AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (146, 107, N'Submit to Claim', N'0', 51, 100, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81200F885DD AS DateTime), N'ASP', CAST(0x0000A81200FA1734 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (147, 103, N'Submit to Customer Care', N'0', 50, 108, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81200FA7FB0 AS DateTime), N'ASP', CAST(0x0000A815008C29F4 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (148, 103, N'Need Revision', N'0', 50, 102, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81200FAA14A AS DateTime), N'ASP', CAST(0x0000A81200FAA14A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (149, 104, N'Cancel Registration', N'1', 50, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81200FB7105 AS DateTime), N'ASP', CAST(0x0000A81200FB7105 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (150, 104, N'Submit to Claim', N'0', 50, 105, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81200FB8DF1 AS DateTime), N'ASP', CAST(0x0000A81200FB949C AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (151, 105, N'Sent to Approver', N'0', 50, 106, N'0', N'1', N'0', N'0', N'1', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81200FBB260 AS DateTime), N'AFI', CAST(0x0000A82500BF418C AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (152, 108, N'Need Revision', N'0', 50, 104, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A815008BE278 AS DateTime), N'ASP', CAST(0x0000A81500B355EA AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (153, 108, N'Submit to Claim', N'0', 50, 105, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A815008BF440 AS DateTime), N'ASP', CAST(0x0000A815008C07A0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (154, 93, N'Approve', N'1', 49, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A81500ACFDD8 AS DateTime), N'ASP', CAST(0x0000A81500ACFDD8 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (155, 93, N'Need Revision', N'0', 49, 91, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 6, 2, N'ASP', CAST(0x0000A81500AD14EB AS DateTime), N'ASP', CAST(0x0000A81500AD14EB AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (156, 41, N'Cancel', N'1', 43, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81500B19599 AS DateTime), N'ASP', CAST(0x0000A81500B19599 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (157, 84, N'Submit to Head Underwriting', N'0', 48, 83, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81500B24D91 AS DateTime), N'ASP', CAST(0x0000A81500B24D91 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (158, 100, N'Cancel', N'1', 51, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 5, 5, N'ASP', CAST(0x0000A81500B2F8BB AS DateTime), N'ASP', CAST(0x0000A81500B2F8BB AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (159, 70, N'Submit to Customer Care', N'0', 40, 29, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 14, 3, N'ASP', CAST(0x0000A81500B4BF3A AS DateTime), N'ASP', CAST(0x0000A81500B4BF3A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (160, 109, N'Transaction Reject', N'1', 40, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 4, 3, N'ASP', CAST(0x0000A8160094321F AS DateTime), N'ASP', CAST(0x0000A8160094321F AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (161, 110, N'Need Revision', N'0', 43, 39, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81600FB1E52 AS DateTime), N'ASP', CAST(0x0000A81600FB1E52 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (162, 110, N'Submit to Head Claim', N'0', 43, 42, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81600FB38A0 AS DateTime), N'ASP', CAST(0x0000A81600FB38A0 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (163, 42, N'Approval Director', N'0', 43, 112, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A81800E574CF AS DateTime), N'ASP', CAST(0x0000A81900B16F10 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (164, 41, N'Medical Advise', N'0', 43, 111, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A81800E5E71A AS DateTime), N'EPO', CAST(0x0000A81E00A1EE12 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (165, 41, N'Need Dispensation Form', N'0', 43, 39, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'BDA', CAST(0x0000A81800E6305E AS DateTime), N'BDA', CAST(0x0000A81800E6305E AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (166, 111, N'Submit to Claim', N'0', 43, 41, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A81900AB84F2 AS DateTime), N'ASP', CAST(0x0000A81900AB84F2 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (167, 112, N'Approve', N'1', 43, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 4, N'ASP', CAST(0x0000A81900B0E617 AS DateTime), N'ASP', CAST(0x0000A81900B0E617 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (168, 80, N'Send to Approver Exclude Reference No.', N'0', 46, 81, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 15, 2, N'EPO', CAST(0x0000A81D0091CBC2 AS DateTime), N'EPO', CAST(0x0000A81E00A7C7B3 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (169, 114, N'Transaction Process', N'0', 43, 41, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81E00A3103A AS DateTime), N'EPO', CAST(0x0000A81E00A3103A AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (170, 115, N'Submit Reject Document', N'1', 43, NULL, N'1', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 4, 3, N'EPO', CAST(0x0000A81E00A425C6 AS DateTime), N'EPO', CAST(0x0000A81E00A425C6 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (171, 42, N'Reject', N'0', 43, 115, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 4, 3, N'EPO', CAST(0x0000A81E00A467C9 AS DateTime), N'EPO', CAST(0x0000A81E00A467C9 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (172, 112, N'Reject', N'0', 43, 115, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'1', 4, 3, N'EPO', CAST(0x0000A81E00A48DED AS DateTime), N'EPO', CAST(0x0000A81E00A48DED AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (173, 113, N'Send to Bank', N'0', 46, 116, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81E00A6DEA1 AS DateTime), N'EPO', CAST(0x0000A81E00A6DEA1 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (174, 113, N'Need Revision', N'0', 46, 79, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81E00A711E9 AS DateTime), N'EPO', CAST(0x0000A81E00A711E9 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (175, 116, N'Transaction Process', N'0', 46, 80, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81E00A764B7 AS DateTime), N'EPO', CAST(0x0000A81E00A764B7 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (176, 116, N'Need Revision', N'0', 46, 79, N'0', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'EPO', CAST(0x0000A81E00A77393 AS DateTime), N'EPO', CAST(0x0000A81E00A77393 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (177, 67, N'Extra Mortality', N'0', 40, 68, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A82000E706E9 AS DateTime), N'ASP', CAST(0x0000A82000E706E9 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (178, 68, N'Extra Mortality', N'1', 40, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A82000E7378B AS DateTime), N'ASP', CAST(0x0000A82000E7378B AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (179, 117, N'Sent to Customer', N'0', 40, 29, N'1', N'1', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 2, N'ASP', CAST(0x0000A82700AFEAF7 AS DateTime), N'ASP', CAST(0x0000A82700AFEAF7 AS DateTime), N'0')
INSERT [dbo].[m_workflow_template_action] ([workflow_template_action_id], [workflow_template_stage_id], [description], [is_final_action], [workflow_template_id], [destination_stage_id], [is_send_notif_to_requester], [is_send_notif_to_next_pic], [is_notif_document_completion], [is_check_mandatory_document], [is_remarks_mandatory], [is_fill_reference_number], [is_check_transaction_status_core], [code_transaction_status], [is_need_reason], [reason_category_id], [transaction_status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (180, 117, N'Cancel EM ', N'1', 40, NULL, N'0', N'0', N'0', N'0', N'0', N'0', N'0', NULL, N'0', NULL, 5, N'ASP', CAST(0x0000A82700B0028E AS DateTime), N'ASP', CAST(0x0000A82700B0028E AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_workflow_template_action] OFF
/****** Object:  Trigger [m_city_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_city_Update]      
ON [dbo].[m_city]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([city_id]) THEN '[city_id]-' ELSE '' END + 
CASE WHEN UPDATE([city_code]) THEN '[city_code]-' ELSE '' END + 
CASE WHEN UPDATE([province_id]) THEN '[province_id]-' ELSE '' END + 
CASE WHEN UPDATE([city_name]) THEN '[city_name]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_city]
([city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[city_id]) as [city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_city]
([city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[city_id]) as [city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_city_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_city_Insert] 
ON [dbo].[m_city]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_city]
([city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[city_id]) as [city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_city_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_city_Delete]    
ON [dbo].[m_city]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_city]
([city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[city_id]) as [city_id],[city_code],[province_id],[city_name],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_group_pic_detail_Update]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_pic_detail_Update]      
ON [dbo].[m_group_pic_detail]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([group_pic_detail_id]) THEN '[group_pic_detail_id]-' ELSE '' END + 
CASE WHEN UPDATE([group_pic_id]) THEN '[group_pic_id]-' ELSE '' END + 
CASE WHEN UPDATE([source_app_id]) THEN '[source_app_id]-' ELSE '' END + 
CASE WHEN UPDATE([branch_id]) THEN '[branch_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_type_id]) THEN '[transaction_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([user_id_group_pic_detail]) THEN '[user_id_group_pic_detail]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_group_pic_detail]
([group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[group_pic_detail_id]) as [group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_group_pic_detail]
([group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[group_pic_detail_id]) as [group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_group_pic_detail_Insert]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_pic_detail_Insert] 
ON [dbo].[m_group_pic_detail]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_group_pic_detail]
([group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[group_pic_detail_id]) as [group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_group_pic_detail_Delete]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_pic_detail_Delete]    
ON [dbo].[m_group_pic_detail]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_group_pic_detail]
([group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[group_pic_detail_id]) as [group_pic_detail_id],[group_pic_id],[source_app_id],[branch_id],[transaction_type_id],[user_id_group_pic_detail],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[m_branch]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_branch](
	[branch_id] [int] IDENTITY(1,1) NOT NULL,
	[branch_code] [varchar](8) NOT NULL,
	[description] [varchar](150) NOT NULL,
	[address] [varchar](255) NULL,
	[city_id] [int] NOT NULL,
	[province_id] [int] NOT NULL,
	[postal_code] [varchar](10) NULL,
	[phone_number_1] [varchar](30) NULL,
	[phone_number_2] [varchar](30) NULL,
	[user_pic] [varchar](8) NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK_m_branch] PRIMARY KEY CLUSTERED 
(
	[branch_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]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_m_branch] ON [dbo].[m_branch] 
(
	[description] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_branch_1] ON [dbo].[m_branch] 
(
	[branch_code] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_branch_2] ON [dbo].[m_branch] 
(
	[city_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_m_branch_3] ON [dbo].[m_branch] 
(
	[province_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[m_branch] ON
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'HO', N'Head Office', N'Sahid Sudirman Center, 20th Floor
Jl. Jend. Sudirman No. 86

', 4, 1, N'10220', N'(62-21) 8086 8000', NULL, NULL, 5, N'WHI', CAST(0x0000A78300000000 AS DateTime), N'PPM', CAST(0x0000A81F01291B1E AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (2, N'DEN', N'Kantor Pelayanan Denpasar', N'Jl. Raya Puputan No. 81 Renon', 65959, 3, N'80235', NULL, NULL, NULL, 5, N'WHI', CAST(0x0000A78300000000 AS DateTime), N'EPO', CAST(0x0000A81000BDBF2A AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'BAN', N'Kantor Pelayanan Bandung', N'Graha Equity Life, Jl. Ir.H. Juanda (Dago) No.130C', 66033, 11, N'40135', NULL, NULL, NULL, 5, N'WHI', CAST(0x0000A78600EE9ECE AS DateTime), N'EPO', CAST(0x0000A81000BD9A8D AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, N'CRB', N'Kantor Pelayanan Cirebon', N'Graha Equity Life, Jl. Wahidin Sudirohusodo No. 36', 66014, 11, N'90210', NULL, NULL, NULL, 5, N'WHI', CAST(0x0000A7EF00D1B78E AS DateTime), N'EPO', CAST(0x0000A81000BDA980 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, N'TAS', N'Kantor Pelayanan Tasikmalaya', N'Ruko Tasik Indah Plaza Kav. 31 
Jl. KHZ. Mustofa No.345', 66026, 11, N'46121', NULL, NULL, NULL, 5, N'FMJ', CAST(0x0000A7FD00000000 AS DateTime), N'EPO', CAST(0x0000A82700AA3030 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, N'SUB', N'Kantor Pelayanan Surabaya', N'Jl. Kartini No. 49', 66109, 13, N'60264', NULL, NULL, NULL, 5, N'FMJ', CAST(0x0000A7FD00E8806D AS DateTime), N'EPO', CAST(0x0000A81000BDD2CA AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, N'JDB', N'Kantor Pelayanan Jabodetabek', N'Sahid Sudirman Center, 20th Floor Jl. Jend. Sudirman No. 86 ', 65992, 8, N'10220', NULL, NULL, NULL, 5, N'ASP', CAST(0x0000A80A009AE2E4 AS DateTime), N'EPO', CAST(0x0000A827009CDF7F AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, N'LAM', N'Kantor Pelayanan Lampung', N'Jl. Jend Sudirman No. 58C Tg. Karang', 66176, 20, N'35118', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A1E9FA AS DateTime), N'EPO', CAST(0x0000A82700A1E9FA AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, N'PUR', N'Kantor Pelayanan Purwokerto', N'Komp. Ruko Satria Plaza Blok A-B No.3 
Jl. Jend. Sudirman Purwokerto', 66056, 12, N'53114', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A2D6AA AS DateTime), N'EPO', CAST(0x0000A82700AA17DF AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, N'YOG', N'Kantor Pelayanan Yogyakarta', N'Ruko Casa Grande No. 22 Jl. Ringroad Utara, Maguwoharjo Depok, Sleman', 65986, 7, N'', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A550B5 AS DateTime), N'EPO', CAST(0x0000A82700A550B5 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, N'MAL', N'Kantor Pelayanan Malang', N'Komp. Pertokoan Suryani Indah Blok B-4 Jl. Ade Irma Suryani No. 9-11', 66093, 13, N'65177', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A5BDAC AS DateTime), N'EPO', CAST(0x0000A82700A5BDAC AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, N'TEG', N'Kantor Pelayanan Tegal', N'Komplek Nirmala Estate Jl. Yos Sudarso Ruko No. 6', 66055, 12, N'52121', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A62A63 AS DateTime), N'EPO', CAST(0x0000A82700A62A63 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (36, N'SMG', N'Kantor Pelayanan Semarang', N'Rukan Pemuda Mas Blok A kav. A-9 Jl. Pemuda No. 150', 66063, 12, N'50132', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A6842F AS DateTime), N'EPO', CAST(0x0000A82700A6842F AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (37, N'SLO', N'Kantor Pelayanan Solo', N'Ruko Adisucipto Blok H Manahan, Solo', 66070, 12, N'50132', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A6E490 AS DateTime), N'EPO', CAST(0x0000A82700A6E490 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (38, N'KDS', N'Kantor Pelayanan Kudus', N'Jl. A. Yani No. 125 Ruko Kereta Api Blok B-5', 66061, 12, N'59347', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A7A1F3 AS DateTime), N'EPO', CAST(0x0000A82700A7A1F3 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (39, N'MGL', N'Kantor Pelayanan Magelang', N'Komp. Metro Square Blok C-3 
Jl. Mayjen Bambang Soegeng, Mertoyudan', 66050, 12, N'56172', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A7DF96 AS DateTime), N'EPO', CAST(0x0000A82700AA0A9D AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (40, N'KDR', N'Kantor Pelayanan Kediri', N'Hayam Wuruk Trade Centre Blok F No. 1', 66086, 13, N'', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A8922A AS DateTime), N'EPO', CAST(0x0000A82700A8922A AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (41, N'TLA', N'Kantor Pelayanan Tulung Agung', N'Panglima Sudirman Trade Center Blok A No. 6 
Jl. Hasanudin, Kedungwaru', 66112, 13, N'66224', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A8E3F6 AS DateTime), N'EPO', CAST(0x0000A82700AA1EF0 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (42, N'JBR', N'Kantor Pelayanan Jember', N'Gajah Mada Square Jl. Gajah Mada Blok A-5 No. 301', 66083, 13, N'68133', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A9434F AS DateTime), N'EPO', CAST(0x0000A82700A9434F AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (43, N'BJR', N'Kantor Pelayanan Banjarmasin', N'Jl. Ahmad Yani KM 1,5 Ruko No. 83B', 66130, 15, N'70233', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A996E4 AS DateTime), N'EPO', CAST(0x0000A82700A996E4 AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (44, N'BTM', N'Kantor Pelayanan Batam', N'Jl. Jend. Sudirman Komp. Palm Spring 
Batam Trade Center Blok D2 No. 11', 66169, 19, N'', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700A9EF6C AS DateTime), N'EPO', CAST(0x0000A82700A9EF6C AS DateTime), N'0')
INSERT [dbo].[m_branch] ([branch_id], [branch_code], [description], [address], [city_id], [province_id], [postal_code], [phone_number_1], [phone_number_2], [user_pic], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (45, N'MKS', N'Kantor Pelayanan Makassar', N'Jl. Dr. Sam Ratulangi No. 83', 66339, 30, N'90132', NULL, NULL, NULL, 5, N'EPO', CAST(0x0000A82700B96589 AS DateTime), N'EPO', CAST(0x0000A82700B96589 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_branch] OFF
/****** Object:  Trigger [m_group_menu_Update]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_menu_Update]      
ON [dbo].[m_group_menu]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([group_menu_id]) THEN '[group_menu_id]-' ELSE '' END + 
CASE WHEN UPDATE([group_menu_code]) THEN '[group_menu_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_group_menu]
([group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_id]) as [group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_group_menu]
([group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_id]) as [group_menu_id],[group_menu_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Table [dbo].[m_organization]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_organization](
	[organization_id] [int] IDENTITY(1,1) NOT NULL,
	[organization_code] [varchar](8) NULL,
	[description] [varchar](60) NOT NULL,
	[level_type_id] [int] NOT NULL,
	[user_id_head] [varchar](8) NULL,
	[organization_id_parent] [int] NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_organi__C0B2F4327C5A637C] PRIMARY KEY CLUSTERED 
(
	[organization_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_organization] ON
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (1, N'ORG00001', N'Operation Directorate', 1, N'DSO', NULL, 5, N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'ASP', CAST(0x0000A81900B0793C AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (3, N'ORG00002', N'Information Technology', 2, NULL, 1, 5, N'WHI', CAST(0x0000A78D00000000 AS DateTime), N'BDA', CAST(0x0000A81200E8AFBD AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (4, N'ORG00003', N'Finance Directorate', 1, NULL, NULL, 5, N'WHI', CAST(0x0000A78D01394601 AS DateTime), N'EPO', CAST(0x0000A81E00B77E92 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (5, N'ORG00004', N'Application Development', 3, N'FMJ', 3, 5, N'WHI', CAST(0x0000A78D013A34E3 AS DateTime), N'BDA', CAST(0x0000A80800FD3207 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (6, N'ORG00005', N'Finance and Accounting Division', 2, NULL, 4, 5, N'WHI', CAST(0x0000A79000C10F7A AS DateTime), N'WHI', CAST(0x0000A79000C10F7A AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (7, N'ORG00006', N'Finance Department', 3, NULL, 6, 2, N'WHI', CAST(0x0000A79000C518E5 AS DateTime), N'WHI', CAST(0x0000A79000CA28C4 AS DateTime), N'1')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (8, N'ORG00007', N'Accounting Department', 3, NULL, 6, 2, N'WHI', CAST(0x0000A79000E6A2DF AS DateTime), N'FMJ', CAST(0x0000A7FD01019E06 AS DateTime), N'1')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, N'ORG00008', N'Network and Hardware', 3, NULL, 3, 5, N'WHI', CAST(0x0000A79000E96700 AS DateTime), N'WHI', CAST(0x0000A79000E96700 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, N'ORG00009', N'Marketing Communication', 1, NULL, NULL, 2, N'FMJ', CAST(0x0000A7B800BFB3DD AS DateTime), N'FMJ', CAST(0x0000A7B800BFF3B0 AS DateTime), N'1')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, N'ORG00010', N'Unit Link Department', 2, NULL, 4, 2, N'FMJ', CAST(0x0000A7B900EF5490 AS DateTime), N'FMJ', CAST(0x0000A7FD0101BE01 AS DateTime), N'1')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, N'ORG00011', N'Service Quality', 3, N'FMJ', 1, 5, N'WHI', CAST(0x0000A7D80103E334 AS DateTime), N'WHI', CAST(0x0000A7D8010E0BDF AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, N'ORG00012', N'Elise Cirebon', 6, N'WHI', 15, 5, N'WHI', CAST(0x0000A7EF00D3A8FB AS DateTime), N'EPO', CAST(0x0000A80A00A0FE2E AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, N'ORG00013', N'Branch Corporate Services', 6, N'HDW', 15, 5, N'FMJ', CAST(0x0000A7FD0102DCAA AS DateTime), N'FMJ', CAST(0x0000A7FD010420CA AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, N'ORG00014', N'Customer Care', 3, N'HDW', 1, 5, N'FMJ', CAST(0x0000A7FD01035F9B AS DateTime), N'BDA', CAST(0x0000A81200E89E5D AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, N'ORG00015', N'Elise Jabodetabek', 6, N'SAN', 15, 5, N'EPO', CAST(0x0000A80A009F6790 AS DateTime), N'EPO', CAST(0x0000A82600F4C85A AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, N'ORG00016', N'Underwriting Department', 3, N'MNH', 1, 5, N'EPO', CAST(0x0000A80A00A08B19 AS DateTime), N'EPO', CAST(0x0000A80A00A19E38 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, N'ORG00017', N'Claim Division', 2, NULL, 1, 5, N'EPO', CAST(0x0000A80A00A24660 AS DateTime), N'EPO', CAST(0x0000A80A00A24660 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, N'ORG00018', N'Claim Individu Department', 3, N'RSP', 18, 5, N'EPO', CAST(0x0000A80A00A26B07 AS DateTime), N'ASP', CAST(0x0000A81600FB6D46 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, N'ORG00019', N'Individual Collection', 3, N'BSU', 6, 5, N'EPO', CAST(0x0000A81200FB4D33 AS DateTime), N'EPO', CAST(0x0000A81500E5E6B1 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, N'ORG00020', N'Claim Individu Head', 6, N'IHA', 18, 5, N'ASP', CAST(0x0000A81600FB93BD AS DateTime), N'ASP', CAST(0x0000A81600FB93BD AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, N'ORG00021', N'Compliance Directorate', 1, NULL, NULL, 5, N'EPO', CAST(0x0000A81E00B742D2 AS DateTime), N'EPO', CAST(0x0000A81E00B742D2 AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, N'ORG00022', N'Compliance Division', 2, N'EBO', 22, 5, N'EPO', CAST(0x0000A81E00B7595B AS DateTime), N'EPO', CAST(0x0000A81E00B7595B AS DateTime), N'0')
INSERT [dbo].[m_organization] ([organization_id], [organization_code], [description], [level_type_id], [user_id_head], [organization_id_parent], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, N'ORG00023', N'Internal Audit', 3, NULL, 23, 5, N'EPO', CAST(0x0000A81E00B7B5D4 AS DateTime), N'EPO', CAST(0x0000A81E00B7B5D4 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_organization] OFF
/****** Object:  Trigger [TrigCreateReasonCategory]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[TrigCreateReasonCategory] ON [dbo].[m_reason_category]
	FOR INSERT 
AS 

BEGIN

	SET NOCOUNT ON;

	DECLARE @rownums VARCHAR(5);
	DECLARE @code VARCHAR(8);

    SET @rownums = (
		SELECT CAST((COUNT(reason_category_id)) AS VARCHAR) 
		FROM m_reason_category
	);

	SET @code = (SELECT 'R' + STUFF('0000', 4 - LEN(@rownums) + 1, LEN(@rownums), @rownums));

	UPDATE m_reason_category
	SET reason_category_code = @code
	WHERE reason_category_id IN (
		SELECT reason_category_id 
		FROM inserted
	);

END
GO
/****** Object:  Trigger [m_reason_category_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_reason_category_Update]      
ON [dbo].[m_reason_category]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([reason_category_id]) THEN '[reason_category_id]-' ELSE '' END + 
CASE WHEN UPDATE([reason_category_code]) THEN '[reason_category_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_reason_category]
([reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_category_id]) as [reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_reason_category]
([reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_category_id]) as [reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_reason_category_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_reason_category_Insert] 
ON [dbo].[m_reason_category]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_reason_category]
([reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_category_id]) as [reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_reason_category_Delete]    Script Date: 11/10/2017 16:09:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_reason_category_Delete]    
ON [dbo].[m_reason_category]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_reason_category]
([reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_category_id]) as [reason_category_id],[reason_category_code],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_workflow_template_action_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_action_Update]      
ON [dbo].[m_workflow_template_action]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([workflow_template_action_id]) THEN '[workflow_template_action_id]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_stage_id]) THEN '[workflow_template_stage_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([is_final_action]) THEN '[is_final_action]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_id]) THEN '[workflow_template_id]-' ELSE '' END + 
CASE WHEN UPDATE([destination_stage_id]) THEN '[destination_stage_id]-' ELSE '' END + 
CASE WHEN UPDATE([is_send_notif_to_requester]) THEN '[is_send_notif_to_requester]-' ELSE '' END + 
CASE WHEN UPDATE([is_send_notif_to_next_pic]) THEN '[is_send_notif_to_next_pic]-' ELSE '' END + 
CASE WHEN UPDATE([is_notif_document_completion]) THEN '[is_notif_document_completion]-' ELSE '' END + 
CASE WHEN UPDATE([is_check_mandatory_document]) THEN '[is_check_mandatory_document]-' ELSE '' END + 
CASE WHEN UPDATE([is_remarks_mandatory]) THEN '[is_remarks_mandatory]-' ELSE '' END + 
CASE WHEN UPDATE([is_fill_reference_number]) THEN '[is_fill_reference_number]-' ELSE '' END + 
CASE WHEN UPDATE([is_check_transaction_status_core]) THEN '[is_check_transaction_status_core]-' ELSE '' END + 
CASE WHEN UPDATE([code_transaction_status]) THEN '[code_transaction_status]-' ELSE '' END + 
CASE WHEN UPDATE([is_need_reason]) THEN '[is_need_reason]-' ELSE '' END + 
CASE WHEN UPDATE([reason_category_id]) THEN '[reason_category_id]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_status_id]) THEN '[transaction_status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_workflow_template_action]
([workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_action_id]) as [workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_workflow_template_action]
([workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_action_id]) as [workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_workflow_template_action_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_action_Insert] 
ON [dbo].[m_workflow_template_action]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_workflow_template_action]
([workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_action_id]) as [workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_workflow_template_action_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_workflow_template_action_Delete]    
ON [dbo].[m_workflow_template_action]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_workflow_template_action]
([workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[workflow_template_action_id]) as [workflow_template_action_id],[workflow_template_stage_id],[description],[is_final_action],[workflow_template_id],[destination_stage_id],[is_send_notif_to_requester],[is_send_notif_to_next_pic],[is_notif_document_completion],[is_check_mandatory_document],[is_remarks_mandatory],[is_fill_reference_number],[is_check_transaction_status_core],[code_transaction_status],[is_need_reason],[reason_category_id],[transaction_status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [CreateOrgCode]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[CreateOrgCode] ON [dbo].[m_organization]
	FOR INSERT 
AS 

BEGIN

	SET NOCOUNT ON;

	DECLARE @rownums VARCHAR(5);
	DECLARE @orgcode VARCHAR(8);

    SET @rownums = (
		SELECT CAST((COUNT(organization_id)) AS VARCHAR) 
		FROM m_organization
	);

	SET @orgcode = (SELECT 'ORG' + STUFF('00000', 5 - LEN(@rownums) + 1, LEN(@rownums), @rownums));

	UPDATE m_organization
	SET organization_code = @orgcode
	WHERE organization_id IN (
		SELECT organization_id 
		FROM inserted
	);

END
GO
/****** Object:  Trigger [m_organization_Update]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_organization_Update]      
ON [dbo].[m_organization]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([organization_id]) THEN '[organization_id]-' ELSE '' END + 
CASE WHEN UPDATE([organization_code]) THEN '[organization_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([level_type_id]) THEN '[level_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([user_id_head]) THEN '[user_id_head]-' ELSE '' END + 
CASE WHEN UPDATE([organization_id_parent]) THEN '[organization_id_parent]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_organization]
([organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[organization_id]) as [organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_organization]
([organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[organization_id]) as [organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_organization_Insert]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_organization_Insert] 
ON [dbo].[m_organization]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_organization]
([organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[organization_id]) as [organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_organization_Delete]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_organization_Delete]    
ON [dbo].[m_organization]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_organization]
([organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[organization_id]) as [organization_id],[organization_code],[description],[level_type_id],[user_id_head],[organization_id_parent],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_branch_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_branch_Update]      
ON [dbo].[m_branch]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([branch_id]) THEN '[branch_id]-' ELSE '' END + 
CASE WHEN UPDATE([branch_code]) THEN '[branch_code]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([address]) THEN '[address]-' ELSE '' END + 
CASE WHEN UPDATE([city_id]) THEN '[city_id]-' ELSE '' END + 
CASE WHEN UPDATE([province_id]) THEN '[province_id]-' ELSE '' END + 
CASE WHEN UPDATE([postal_code]) THEN '[postal_code]-' ELSE '' END + 
CASE WHEN UPDATE([phone_number_1]) THEN '[phone_number_1]-' ELSE '' END + 
CASE WHEN UPDATE([phone_number_2]) THEN '[phone_number_2]-' ELSE '' END + 
CASE WHEN UPDATE([user_pic]) THEN '[user_pic]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_branch]
([branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[branch_id]) as [branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_branch]
([branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[branch_id]) as [branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_branch_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_branch_Insert] 
ON [dbo].[m_branch]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_branch]
([branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[branch_id]) as [branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_branch_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_branch_Delete]    
ON [dbo].[m_branch]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_branch]
([branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[branch_id]) as [branch_id],[branch_code],[description],[address],[city_id],[province_id],[postal_code],[phone_number_1],[phone_number_2],[user_pic],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_group_menu_mapping_Update]    Script Date: 11/10/2017 16:09:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_menu_mapping_Update]      
ON [dbo].[m_group_menu_mapping]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([group_menu_mapping_id]) THEN '[group_menu_mapping_id]-' ELSE '' END + 
CASE WHEN UPDATE([group_menu_id]) THEN '[group_menu_id]-' ELSE '' END + 
CASE WHEN UPDATE([menu_id]) THEN '[menu_id]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_group_menu_mapping]
([group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_mapping_id]) as [group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_group_menu_mapping]
([group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_mapping_id]) as [group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_group_menu_mapping_Insert]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_menu_mapping_Insert] 
ON [dbo].[m_group_menu_mapping]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_group_menu_mapping]
([group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_mapping_id]) as [group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_group_menu_mapping_Delete]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_group_menu_mapping_Delete]    
ON [dbo].[m_group_menu_mapping]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_group_menu_mapping]
([group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[group_menu_mapping_id]) as [group_menu_mapping_id],[group_menu_id],[menu_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_reason_Update]    Script Date: 11/10/2017 16:09:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_reason_Update]      
ON [dbo].[m_reason]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([reason_id]) THEN '[reason_id]-' ELSE '' END + 
CASE WHEN UPDATE([reason_category_id]) THEN '[reason_category_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_reason]
([reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_id]) as [reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_reason]
([reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_id]) as [reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_reason_Insert]    Script Date: 11/10/2017 16:09:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_reason_Insert] 
ON [dbo].[m_reason]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_reason]
([reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_id]) as [reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_reason_Delete]    Script Date: 11/10/2017 16:09:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_reason_Delete]    
ON [dbo].[m_reason]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_reason]
([reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[reason_id]) as [reason_id],[reason_category_id],[description],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [trig_m_form]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by Pribadi Pamungkas. 2017-07-14
-- last modified by Pribadi Pamungkas. 2017-11-03
CREATE TRIGGER [dbo].[trig_m_form] 
   ON  [dbo].[m_eform]
   INSTEAD OF INSERT
AS 
BEGIN
	
	SET NOCOUNT ON; -- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.
	
	DECLARE @transaction_type_id INT
	
	SELECT
	  @transaction_type_id = transaction_type_id
	FROM INSERTED
	
	DECLARE 
    @last_eform_code VARCHAR(8),
    @new_eform_code VARCHAR(8)
  --SELECT
	 -- @last_eform_code = MAX(eform_code)
  --FROM
	 -- dbo.m_eform
  --WHERE
  --  transaction_type_id = @transaction_type_id
	SELECT
		@last_eform_code = MAX(me.eform_code)
	FROM
		dbo.m_eform AS me INNER JOIN
		dbo.m_transaction_type AS mtt ON me.transaction_type_id = mtt.transaction_type_id INNER JOIN
		(
			SELECT
				mtt.transaction_type_id,
				mtc.transaction_category_id,
				mtc.transaction_category_code
			FROM
				dbo.m_transaction_type AS mtt INNER JOIN
				dbo.m_transaction_category AS mtc ON mtc.transaction_category_id = mtt.transaction_category_id
		) AS cat ON mtt.transaction_category_id = cat.transaction_category_id
	WHERE
		cat.transaction_type_id = @transaction_type_id

  IF @last_eform_code IS NULL
    BEGIN
      SELECT
    	  @last_eform_code = 'F' + mtc.transaction_category_code + '00000'
      FROM
    	  m_transaction_type AS mtt INNER JOIN 
    	  m_transaction_category mtc ON mtc.transaction_category_id = mtt.transaction_category_id
      WHERE
        mtt.transaction_type_id = @transaction_type_id
    END

  SET @new_eform_code = LEFT(@last_eform_code,3) + RIGHT('00000' + CAST(CAST(RIGHT(COALESCE(@last_eform_code,'0'),5) AS INTEGER) + 1 AS VARCHAR(5)),5)

  INSERT INTO [dbo].[m_eform]
           ([eform_code]
           ,[transaction_type_id]
           ,[is_need_surat_kuasa]
           ,[remarks]
           ,[status_id]
           ,[created_by]
           ,[created_date]
           ,[modified_by]
           ,[modified_date]
           ,[is_delete])
    SELECT @new_eform_code
          ,[transaction_type_id]
          ,[is_need_surat_kuasa]
          ,[remarks]
          ,[status_id]
          ,[created_by]
          ,[created_date]
          ,[modified_by]
          ,[modified_date]
          ,[is_delete]
      FROM INSERTED

END
GO
/****** Object:  Trigger [m_eform_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_Update]      
ON [dbo].[m_eform]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([eform_id]) THEN '[eform_id]-' ELSE '' END + 
CASE WHEN UPDATE([eform_code]) THEN '[eform_code]-' ELSE '' END + 
CASE WHEN UPDATE([transaction_type_id]) THEN '[transaction_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([is_need_surat_kuasa]) THEN '[is_need_surat_kuasa]-' ELSE '' END + 
CASE WHEN UPDATE([remarks]) THEN '[remarks]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END 
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_eform]
([eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_id]) as [eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_eform]
([eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_id]) as [eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_eform_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_Insert] 
ON [dbo].[m_eform]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_eform]
([eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_id]) as [eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_eform_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_Delete]    
ON [dbo].[m_eform]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_eform]
([eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_id]) as [eform_id],[eform_code],[transaction_type_id],[is_need_surat_kuasa],[remarks],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[m_eform_form_template]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_eform_form_template](
	[eform_form_template_id] [int] IDENTITY(1,1) NOT NULL,
	[eform_id] [int] NULL,
	[transaction_form_template_id] [smallint] NULL,
	[effective_date] [date] NULL,
	[status_id] [int] NULL,
	[created_by] [varchar](8) NULL,
	[created_date] [datetime] NULL,
	[modified_by] [varchar](8) NULL,
	[modified_date] [datetime] NULL,
	[is_delete] [char](1) NULL,
 CONSTRAINT [PK_m_eform_form_template] PRIMARY KEY CLUSTERED 
(
	[eform_form_template_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_eform_form_template] ON
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (9, 24, 2, CAST(0x5E3D0B00 AS Date), 5, N'BDA', CAST(0x0000A80300D8EEE6 AS DateTime), N'BDA', CAST(0x0000A80300D8EEE6 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (10, 25, 1, CAST(0x643D0B00 AS Date), 5, N'BDA', CAST(0x0000A809009D82EB AS DateTime), N'BDA', CAST(0x0000A809009D82EB AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (11, 27, 15, CAST(0x643D0B00 AS Date), 5, N'EPO', CAST(0x0000A80A00C06450 AS DateTime), N'ASP', CAST(0x0000A81500FFE5D0 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (12, 26, 12, CAST(0x693D0B00 AS Date), 2, N'EPO', CAST(0x0000A80E009BAABB AS DateTime), N'ASP', CAST(0x0000A80E009BC2F1 AS DateTime), N'1')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (13, 26, 12, CAST(0x693D0B00 AS Date), 5, N'ASP', CAST(0x0000A80E009BBF35 AS DateTime), N'ASP', CAST(0x0000A80E009BBF35 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (14, 31, 1, CAST(0x693D0B00 AS Date), 5, N'ASP', CAST(0x0000A80E00AD6229 AS DateTime), N'ASP', CAST(0x0000A80E00AD6229 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (15, 32, 17, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00AEE34F AS DateTime), N'EPO', CAST(0x0000A80E00AEE34F AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (16, 33, 1, CAST(0x693D0B00 AS Date), 5, N'ASP', CAST(0x0000A80E00AF0B51 AS DateTime), N'ASP', CAST(0x0000A80E00AF0B51 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (17, 34, 14, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00AF77B2 AS DateTime), N'EPO', CAST(0x0000A80E00AF77B2 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (18, 35, 13, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00B1C088 AS DateTime), N'EPO', CAST(0x0000A80E00B1C088 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (19, 36, 16, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00B4C3D8 AS DateTime), N'EPO', CAST(0x0000A80E00B4C3D8 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (20, 37, 1, CAST(0x693D0B00 AS Date), 5, N'ASP', CAST(0x0000A80E00B4F763 AS DateTime), N'ASP', CAST(0x0000A80E00B4F763 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (21, 38, 11, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00B8FD69 AS DateTime), N'EPO', CAST(0x0000A80E00B8FD69 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (22, 39, 1, CAST(0x693D0B00 AS Date), 5, N'ASP', CAST(0x0000A80E00BB52AD AS DateTime), N'ASP', CAST(0x0000A80E00BB52AD AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (23, 40, 10, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00E05651 AS DateTime), N'EPO', CAST(0x0000A80E00E05651 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (24, 41, 10, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00E107AA AS DateTime), N'EPO', CAST(0x0000A80E00E107AA AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (25, 42, 10, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00E236A6 AS DateTime), N'EPO', CAST(0x0000A80E00E236A6 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (26, 43, 10, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00E30400 AS DateTime), N'EPO', CAST(0x0000A80E00E30400 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (27, 44, 12, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E00E50E90 AS DateTime), N'EPO', CAST(0x0000A80E00E50E90 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (28, 45, 1, CAST(0x693D0B00 AS Date), 5, N'ASP', CAST(0x0000A80E00E5746D AS DateTime), N'ASP', CAST(0x0000A80E00E5746D AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (29, 46, 10, CAST(0x693D0B00 AS Date), 5, N'ASP', CAST(0x0000A80E00F01CF1 AS DateTime), N'EPO', CAST(0x0000A8100093EA36 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (30, 47, 1, CAST(0x683D0B00 AS Date), 5, N'EPO', CAST(0x0000A80E011565A0 AS DateTime), N'ASP', CAST(0x0000A81F00BDD081 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (31, 48, 10, CAST(0x6B3D0B00 AS Date), 5, N'EPO', CAST(0x0000A81000AD02D6 AS DateTime), N'EPO', CAST(0x0000A81000AD02D6 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (32, 49, 10, CAST(0x6B3D0B00 AS Date), 5, N'EPO', CAST(0x0000A81000AE02F7 AS DateTime), N'EPO', CAST(0x0000A81000AE02F7 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (33, 50, 10, CAST(0x6D3D0B00 AS Date), 5, N'EPO', CAST(0x0000A812009EAD0E AS DateTime), N'EPO', CAST(0x0000A812009EAD0E AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (34, 51, 1, CAST(0x6D3D0B00 AS Date), 5, N'EPO', CAST(0x0000A81200A48000 AS DateTime), N'EPO', CAST(0x0000A81200A48000 AS DateTime), N'0')
INSERT [dbo].[m_eform_form_template] ([eform_form_template_id], [eform_id], [transaction_form_template_id], [effective_date], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (35, 55, 10, CAST(0x803D0B00 AS Date), 5, N'EPO', CAST(0x0000A82500B49781 AS DateTime), N'EPO', CAST(0x0000A82500B49781 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_eform_form_template] OFF
/****** Object:  Table [dbo].[m_eform_document]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_eform_document](
	[eform_document_id] [int] IDENTITY(1,1) NOT NULL,
	[eform_id] [int] NOT NULL,
	[document_id] [int] NOT NULL,
	[minimum_files] [numeric](18, 0) NOT NULL,
	[maximum_files] [numeric](18, 0) NOT NULL,
	[seq_number] [numeric](18, 0) NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_eform___BF27DE2600EA0E6F] PRIMARY KEY CLUSTERED 
(
	[eform_document_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_eform_document] ON
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, 24, 352, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'WHI', CAST(0x0000A8040104A359 AS DateTime), N'EPO', CAST(0x0000A81200EED29B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, 24, 387, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'BDA', CAST(0x0000A8080106197B AS DateTime), N'EPO', CAST(0x0000A81200EE6DFD AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, 24, 347, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'BDA', CAST(0x0000A808010630C7 AS DateTime), N'EPO', CAST(0x0000A81200EEAFF1 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, 25, 348, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 5, N'BDA', CAST(0x0000A809009F3343 AS DateTime), N'BDA', CAST(0x0000A809009F3343 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, 25, 364, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 5, N'BDA', CAST(0x0000A809009F505F AS DateTime), N'BDA', CAST(0x0000A809009F505F AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, 25, 368, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 5, N'BDA', CAST(0x0000A809009F6478 AS DateTime), N'BDA', CAST(0x0000A809009F6478 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, 26, 1, CAST(1 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80A00C12273 AS DateTime), N'EPO', CAST(0x0000A80A00C13938 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, 27, 329, CAST(1 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80B010E325D AS DateTime), N'ASP', CAST(0x0000A80B010E325D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, 27, 396, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80B010E4A72 AS DateTime), N'ASP', CAST(0x0000A80B010E4A72 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (56, 27, 360, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80B010E5989 AS DateTime), N'ASP', CAST(0x0000A80B010E5989 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (57, 27, 362, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80B010E6837 AS DateTime), N'ASP', CAST(0x0000A80B010E6837 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (58, 27, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80B010E78DD AS DateTime), N'ASP', CAST(0x0000A80B010E78DD AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (59, 30, 387, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E0099A62E AS DateTime), N'ASP', CAST(0x0000A80E0099A62E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (60, 31, 329, CAST(1 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00ADA1F2 AS DateTime), N'ASP', CAST(0x0000A80E00ADA1F2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (61, 32, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00ADADFB AS DateTime), N'EPO', CAST(0x0000A80E00B00500 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (62, 32, 354, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00ADB9C8 AS DateTime), N'EPO', CAST(0x0000A80E00B02252 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (63, 32, 357, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00ADCBD2 AS DateTime), N'EPO', CAST(0x0000A80E00B027B8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (64, 32, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00ADE28B AS DateTime), N'EPO', CAST(0x0000A80E00B032AB AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65, 31, 414, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00ADEAEE AS DateTime), N'EPO', CAST(0x0000A81800F9A168 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66, 32, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00ADF5F7 AS DateTime), N'EPO', CAST(0x0000A80E00B0388C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (67, 32, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE077A AS DateTime), N'EPO', CAST(0x0000A80E00B03E5E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (68, 32, 339, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE1AFE AS DateTime), N'EPO', CAST(0x0000A80E00B0432A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (69, 32, 352, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE29A5 AS DateTime), N'EPO', CAST(0x0000A80E00B04794 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (70, 31, 355, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AE2FE7 AS DateTime), N'ASP', CAST(0x0000A80E00AECA8E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (71, 32, 355, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE3F3F AS DateTime), N'EPO', CAST(0x0000A80E00B04CC8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (72, 31, 364, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AE666A AS DateTime), N'EPO', CAST(0x0000A81800F99B55 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (73, 32, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE6740 AS DateTime), N'EPO', CAST(0x0000A80E00B05258 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (74, 32, 360, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE728A AS DateTime), N'EPO', CAST(0x0000A80E00B05703 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (75, 32, 362, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE7E58 AS DateTime), N'EPO', CAST(0x0000A80E00B05BA0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (76, 32, 370, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AE8DF3 AS DateTime), N'EPO', CAST(0x0000A80E00B060B1 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (77, 31, 366, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AE9363 AS DateTime), N'ASP', CAST(0x0000A80E00AECF8D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (78, 31, 370, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AEA3CB AS DateTime), N'BDA', CAST(0x0000A81800ECBB1E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (79, 32, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AEAE3F AS DateTime), N'EPO', CAST(0x0000A80E00B0661A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (80, 31, 372, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AEBA75 AS DateTime), N'ASP', CAST(0x0000A80E00AED826 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (81, 32, 393, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AEBF83 AS DateTime), N'EPO', CAST(0x0000A80E00B06C4A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (82, 32, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(16 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AEC742 AS DateTime), N'EPO', CAST(0x0000A80E00B07214 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (83, 33, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AF587F AS DateTime), N'ASP', CAST(0x0000A80E00B24553 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (84, 33, 336, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AF775E AS DateTime), N'ASP', CAST(0x0000A80E00AF775E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (85, 33, 352, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AFB104 AS DateTime), N'ASP', CAST(0x0000A80E00AFB558 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (86, 33, 354, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AFC929 AS DateTime), N'ASP', CAST(0x0000A80E00AFC929 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (87, 34, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AFDB83 AS DateTime), N'EPO', CAST(0x0000A80E00AFDB83 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (88, 33, 355, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00AFE30E AS DateTime), N'ASP', CAST(0x0000A80E00AFE30E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (89, 34, 343, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00AFEF7C AS DateTime), N'EPO', CAST(0x0000A80E00AFEF7C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (90, 33, 361, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 6, N'ASP', CAST(0x0000A80E00AFF618 AS DateTime), N'ASP', CAST(0x0000A82600B23C6F AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (91, 33, 370, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B00CC4 AS DateTime), N'ASP', CAST(0x0000A80E00B01291 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (92, 33, 416, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B05FB2 AS DateTime), N'ASP', CAST(0x0000A80E00B05FB2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (93, 33, 382, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B0727B AS DateTime), N'ASP', CAST(0x0000A80E00B076EF AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (94, 34, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B08D5C AS DateTime), N'EPO', CAST(0x0000A80E00B08D5C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (95, 34, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B0A122 AS DateTime), N'EPO', CAST(0x0000A80E00B0A122 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (96, 34, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B0AE6D AS DateTime), N'EPO', CAST(0x0000A80E00B0AE6D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (97, 34, 339, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B0BE4E AS DateTime), N'EPO', CAST(0x0000A80E00B0BE4E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (98, 33, 417, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B0D6E5 AS DateTime), N'ASP', CAST(0x0000A80E00B0D6E5 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (99, 34, 355, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B0E168 AS DateTime), N'EPO', CAST(0x0000A80E00B0E168 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (100, 33, 418, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B117E5 AS DateTime), N'ASP', CAST(0x0000A80E00B117E5 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (101, 34, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B1211C AS DateTime), N'EPO', CAST(0x0000A80E00B1211C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (102, 34, 370, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B13405 AS DateTime), N'EPO', CAST(0x0000A80E00B13405 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (103, 33, 385, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B13EB7 AS DateTime), N'ASP', CAST(0x0000A80E00B13EB7 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (104, 34, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B1483D AS DateTime), N'EPO', CAST(0x0000A80E00B1483D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (105, 34, 393, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B15B0B AS DateTime), N'EPO', CAST(0x0000A80E00B15B0B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (106, 34, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B1658D AS DateTime), N'EPO', CAST(0x0000A80E00B1658D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (107, 35, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B1DF43 AS DateTime), N'EPO', CAST(0x0000A80E00B1DF43 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (108, 35, 354, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B1FE2A AS DateTime), N'EPO', CAST(0x0000A80E00B1FE2A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (109, 35, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B20BA0 AS DateTime), N'EPO', CAST(0x0000A80E00B20BA0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (110, 35, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B218B7 AS DateTime), N'EPO', CAST(0x0000A80E00B218B7 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (111, 36, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B35617 AS DateTime), N'EPO', CAST(0x0000A80E00B35617 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (112, 33, 419, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B39008 AS DateTime), N'ASP', CAST(0x0000A80E00B39008 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (113, 33, 387, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B3A4A5 AS DateTime), N'ASP', CAST(0x0000A80E00B3D06D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (114, 35, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B3B402 AS DateTime), N'EPO', CAST(0x0000A80E00B3B402 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (115, 33, 388, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B3C61E AS DateTime), N'ASP', CAST(0x0000A80E00B3C61E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (116, 35, 339, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B3C78B AS DateTime), N'EPO', CAST(0x0000A80E00B3C78B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (117, 35, 352, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B3F56E AS DateTime), N'EPO', CAST(0x0000A80E00B3F56E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (118, 35, 355, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B4137D AS DateTime), N'EPO', CAST(0x0000A80E00B4137D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (119, 33, 389, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(16 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B41A4F AS DateTime), N'ASP', CAST(0x0000A80E00B41A4F AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (120, 35, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B422AD AS DateTime), N'EPO', CAST(0x0000A80E00B422AD AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (121, 35, 370, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B43218 AS DateTime), N'EPO', CAST(0x0000A80E00B43218 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (122, 35, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B44B38 AS DateTime), N'EPO', CAST(0x0000A80E00B44B38 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (123, 35, 393, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B45BDD AS DateTime), N'EPO', CAST(0x0000A80E00B45BDD AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (124, 35, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B46993 AS DateTime), N'EPO', CAST(0x0000A80E00B46993 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (125, 33, 390, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(17 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B476D0 AS DateTime), N'ASP', CAST(0x0000A80E00B476D0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (126, 33, 391, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(18 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B49438 AS DateTime), N'ASP', CAST(0x0000A80E00B49438 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (127, 36, 332, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B4E6F1 AS DateTime), N'EPO', CAST(0x0000A80E00B4E6F1 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (128, 36, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B4FD23 AS DateTime), N'EPO', CAST(0x0000A80E00B4FD23 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (129, 36, 393, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B50C52 AS DateTime), N'EPO', CAST(0x0000A80E00B50C52 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (130, 36, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B51676 AS DateTime), N'EPO', CAST(0x0000A80E00B51676 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (131, 37, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B51BF5 AS DateTime), N'ASP', CAST(0x0000A80E00B51BF5 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (132, 37, 414, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B54748 AS DateTime), N'ASP', CAST(0x0000A80E00B54748 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (133, 37, 355, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00B90E84 AS DateTime), N'ASP', CAST(0x0000A80E00B90E84 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (134, 38, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B94978 AS DateTime), N'EPO', CAST(0x0000A80E00B94978 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (135, 38, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B959A8 AS DateTime), N'EPO', CAST(0x0000A80E00B959A8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (136, 38, 360, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00B9F1BA AS DateTime), N'EPO', CAST(0x0000A80E00B9F1BA AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (137, 38, 362, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BAB28C AS DateTime), N'EPO', CAST(0x0000A80E00BAB28C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (138, 37, 423, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BAB7D4 AS DateTime), N'ASP', CAST(0x0000A80E00BAB7D4 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (139, 37, 426, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BAF700 AS DateTime), N'ASP', CAST(0x0000A80E00BAF700 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (140, 37, 369, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BB10AE AS DateTime), N'ASP', CAST(0x0000A80E00BB10AE AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (141, 37, 370, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BB2594 AS DateTime), N'ASP', CAST(0x0000A80E00BB2594 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (142, 39, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BB6A98 AS DateTime), N'EPO', CAST(0x0000A81200E8A64A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (143, 39, 414, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BB7BB7 AS DateTime), N'ASP', CAST(0x0000A80E00BB7BB7 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (144, 39, 355, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BB8F49 AS DateTime), N'ASP', CAST(0x0000A80E00BB8F49 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (145, 39, 364, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BBA9A3 AS DateTime), N'ASP', CAST(0x0000A80E00BBA9A3 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (146, 38, 427, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BBB024 AS DateTime), N'EPO', CAST(0x0000A80E00BBB024 AS DateTime), N'0')
GO
print 'Processed 100 total records'
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (147, 39, 366, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BBBE4B AS DateTime), N'ASP', CAST(0x0000A80E00BBBE4B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (148, 38, 359, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BBC11E AS DateTime), N'EPO', CAST(0x0000A80E00BC0CAF AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (149, 39, 368, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BBCF2C AS DateTime), N'ASP', CAST(0x0000A80E00BBCF2C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (150, 39, 370, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 6, N'ASP', CAST(0x0000A80E00BBE3FD AS DateTime), N'BDA', CAST(0x0000A81800EDDA61 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (151, 38, 432, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BC598C AS DateTime), N'EPO', CAST(0x0000A80E00BC598C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (152, 38, 347, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BC8281 AS DateTime), N'EPO', CAST(0x0000A80E00BC8281 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (153, 38, 368, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BC9371 AS DateTime), N'EPO', CAST(0x0000A80E00BC9371 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (154, 38, 369, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BCBAA9 AS DateTime), N'EPO', CAST(0x0000A80E00BCBAA9 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (155, 38, 403, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BCD377 AS DateTime), N'EPO', CAST(0x0000A80E00BCD377 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (156, 39, 428, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BD83A4 AS DateTime), N'ASP', CAST(0x0000A80E00BDC222 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (157, 39, 429, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BDD358 AS DateTime), N'ASP', CAST(0x0000A80E00BDEBD8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (158, 38, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BE1479 AS DateTime), N'EPO', CAST(0x0000A80E00BE1479 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (159, 39, 433, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00BE3252 AS DateTime), N'ASP', CAST(0x0000A80E00E50BD2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (160, 38, 339, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BF2C0A AS DateTime), N'EPO', CAST(0x0000A80E00BF2C0A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (161, 38, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BF4087 AS DateTime), N'EPO', CAST(0x0000A80E00BF4087 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (162, 38, 393, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BF51A6 AS DateTime), N'EPO', CAST(0x0000A80E00BF51A6 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (163, 38, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(16 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00BF66E3 AS DateTime), N'EPO', CAST(0x0000A80E00BF66E3 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (164, 40, 437, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E07819 AS DateTime), N'EPO', CAST(0x0000A82500A9D5ED AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (165, 40, 394, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E08F9A AS DateTime), N'EPO', CAST(0x0000A80E00E08F9A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (166, 40, 400, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E0A5C7 AS DateTime), N'EPO', CAST(0x0000A80E00E0A5C7 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (167, 40, 440, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E0B079 AS DateTime), N'EPO', CAST(0x0000A82500AD31D8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (168, 40, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E0C37F AS DateTime), N'EPO', CAST(0x0000A82500AD3EF0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (169, 40, 441, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E0CF6F AS DateTime), N'EPO', CAST(0x0000A82500AD59C8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (170, 41, 437, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E15497 AS DateTime), N'EPO', CAST(0x0000A82500B2F464 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (171, 41, 442, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E164E2 AS DateTime), N'EPO', CAST(0x0000A82500B30749 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (172, 41, 397, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E17B42 AS DateTime), N'EPO', CAST(0x0000A82500B315E0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (173, 41, 399, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E19AE2 AS DateTime), N'EPO', CAST(0x0000A80E00E19AE2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (174, 41, 443, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E1ABC0 AS DateTime), N'EPO', CAST(0x0000A82500B32A26 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (175, 41, 398, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E1BF1F AS DateTime), N'EPO', CAST(0x0000A82500B33856 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (176, 41, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E1C9F6 AS DateTime), N'EPO', CAST(0x0000A82500B3442C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (177, 42, 437, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E25510 AS DateTime), N'EPO', CAST(0x0000A82500AA7C17 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (178, 42, 396, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E26984 AS DateTime), N'EPO', CAST(0x0000A82500B74A0F AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (179, 42, 400, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E27E26 AS DateTime), N'EPO', CAST(0x0000A82500B7571E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (180, 42, 440, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E292E5 AS DateTime), N'EPO', CAST(0x0000A82500ACBB8B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (181, 42, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 2, N'EPO', CAST(0x0000A80E00E2A803 AS DateTime), N'EPO', CAST(0x0000A82500B77E1B AS DateTime), N'1')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (182, 43, 437, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E32461 AS DateTime), N'EPO', CAST(0x0000A82500AFAB6A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (183, 43, 442, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 2, N'EPO', CAST(0x0000A80E00E3334E AS DateTime), N'EPO', CAST(0x0000A82500B970CC AS DateTime), N'1')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (184, 43, 435, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E34A7F AS DateTime), N'EPO', CAST(0x0000A82500B98B52 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (185, 43, 399, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E3E306 AS DateTime), N'EPO', CAST(0x0000A82500B8B67E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (186, 43, 443, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E3F642 AS DateTime), N'EPO', CAST(0x0000A82500B9A0C2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (187, 43, 398, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E409F9 AS DateTime), N'EPO', CAST(0x0000A82500B9AAB0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (188, 43, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E414E2 AS DateTime), N'EPO', CAST(0x0000A80E00E414E2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (189, 39, 434, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E4228A AS DateTime), N'ASP', CAST(0x0000A80E00E4228A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (190, 39, 430, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E4457B AS DateTime), N'ASP', CAST(0x0000A80E00E53944 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (191, 39, 431, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E4E542 AS DateTime), N'ASP', CAST(0x0000A80E00E52CE9 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (192, 44, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E52EBC AS DateTime), N'EPO', CAST(0x0000A80E00E52EBC AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (193, 44, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E53D96 AS DateTime), N'EPO', CAST(0x0000A80E00E53D96 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (194, 44, 360, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E54E98 AS DateTime), N'EPO', CAST(0x0000A80E00E54E98 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (195, 44, 362, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E55A7A AS DateTime), N'EPO', CAST(0x0000A80E00E55A7A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (196, 44, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E00E56575 AS DateTime), N'EPO', CAST(0x0000A80E00E56575 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (197, 45, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E59782 AS DateTime), N'ASP', CAST(0x0000A80E00E59782 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (198, 45, 355, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E5AB23 AS DateTime), N'ASP', CAST(0x0000A80E00E5AB23 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (199, 45, 369, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E5D290 AS DateTime), N'ASP', CAST(0x0000A80E00E5D290 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (200, 45, 370, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E5E6A5 AS DateTime), N'ASP', CAST(0x0000A80E00E5E6A5 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (201, 45, 373, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E5FB7C AS DateTime), N'ASP', CAST(0x0000A80E00E5FB7C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (202, 45, 375, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'ASP', CAST(0x0000A80E00E6204A AS DateTime), N'ASP', CAST(0x0000A80E00E6204A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (203, 46, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 6, N'ASP', CAST(0x0000A80E00F00F69 AS DateTime), N'BDA', CAST(0x0000A81E00A67C68 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (204, 47, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A80E0115A5A0 AS DateTime), N'ASP', CAST(0x0000A81F00BDE016 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (205, 48, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81000AD3F27 AS DateTime), N'EPO', CAST(0x0000A81000AD3F27 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (206, 48, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81000AD5B63 AS DateTime), N'EPO', CAST(0x0000A81000AD5B63 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (207, 48, 360, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81000AD6685 AS DateTime), N'EPO', CAST(0x0000A81000AD6685 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (208, 48, 362, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81000AD7681 AS DateTime), N'EPO', CAST(0x0000A81000AD7681 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (209, 48, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81000AD7EA7 AS DateTime), N'EPO', CAST(0x0000A81000AD7EA7 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (210, 49, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81000ADE4FA AS DateTime), N'EPO', CAST(0x0000A81000ADED87 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (211, 50, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A812009EE5C3 AS DateTime), N'EPO', CAST(0x0000A812009EE5C3 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (212, 47, 336, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A812009F31A8 AS DateTime), N'ASP', CAST(0x0000A81F00BDE87D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (213, 47, 352, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A812009F4748 AS DateTime), N'ASP', CAST(0x0000A81F00BDEE34 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (214, 47, 354, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A812009F5E0B AS DateTime), N'EPO', CAST(0x0000A812009F5E0B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (215, 47, 355, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A812009F7FE1 AS DateTime), N'EPO', CAST(0x0000A812009F7FE1 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (216, 47, 361, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A812009F8D0F AS DateTime), N'ASP', CAST(0x0000A81F00BDF3BC AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (217, 47, 370, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A812009FB5C8 AS DateTime), N'EPO', CAST(0x0000A812009FB5C8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (218, 47, 416, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A00AD2 AS DateTime), N'EPO', CAST(0x0000A81200A00AD2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (219, 47, 382, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A01CC8 AS DateTime), N'EPO', CAST(0x0000A81200A01CC8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (220, 47, 417, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A03C7E AS DateTime), N'EPO', CAST(0x0000A81200A03C7E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (221, 47, 418, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A04FE8 AS DateTime), N'EPO', CAST(0x0000A81200A04FE8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (222, 47, 385, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A0BE6D AS DateTime), N'EPO', CAST(0x0000A81200A0BE6D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (223, 47, 419, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A0D453 AS DateTime), N'EPO', CAST(0x0000A81200A0D453 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (224, 47, 387, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A0F0AD AS DateTime), N'EPO', CAST(0x0000A81200A0F0AD AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (225, 47, 388, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A103E6 AS DateTime), N'ASP', CAST(0x0000A81F00BE0FDC AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (226, 47, 389, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(16 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A1126F AS DateTime), N'EPO', CAST(0x0000A81200A1126F AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (227, 47, 390, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(17 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A1315D AS DateTime), N'ASP', CAST(0x0000A81F00BE1644 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (228, 47, 391, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(18 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A266FF AS DateTime), N'EPO', CAST(0x0000A81200A266FF AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (229, 47, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(19 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A276B3 AS DateTime), N'EPO', CAST(0x0000A81200A276B3 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (230, 47, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(20 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A28649 AS DateTime), N'EPO', CAST(0x0000A81200A2E502 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (231, 47, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(21 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A2974B AS DateTime), N'EPO', CAST(0x0000A81200A2EDD9 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (232, 47, 371, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(22 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A2AB67 AS DateTime), N'EPO', CAST(0x0000A81200A2F441 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (233, 47, 372, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(23 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A2B98E AS DateTime), N'EPO', CAST(0x0000A81200A2FA0B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (234, 47, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(24 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A2C3FC AS DateTime), N'EPO', CAST(0x0000A81200A2FFCC AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (235, 47, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(25 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A2CC3F AS DateTime), N'EPO', CAST(0x0000A81200A3058B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (236, 51, 329, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A4BE1C AS DateTime), N'EPO', CAST(0x0000A81200AF24C1 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (237, 51, 414, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A4D11B AS DateTime), N'EPO', CAST(0x0000A81200A4D11B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (238, 51, 355, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A4E904 AS DateTime), N'EPO', CAST(0x0000A81200A4E904 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (239, 51, 364, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A4FC7C AS DateTime), N'EPO', CAST(0x0000A81200A4FC7C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (240, 51, 366, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A5151E AS DateTime), N'EPO', CAST(0x0000A81200A5151E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (241, 51, 368, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A523C5 AS DateTime), N'EPO', CAST(0x0000A81200A523C5 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (242, 51, 370, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A53C2B AS DateTime), N'EPO', CAST(0x0000A81200A53C2B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (243, 51, 428, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200A55008 AS DateTime), N'EPO', CAST(0x0000A81200A55008 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (244, 51, 429, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AB2185 AS DateTime), N'EPO', CAST(0x0000A81200AB2185 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (245, 51, 430, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AB33D8 AS DateTime), N'EPO', CAST(0x0000A81200AB33D8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (246, 51, 431, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AB4AE1 AS DateTime), N'EPO', CAST(0x0000A81200AB4AE1 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (247, 51, 433, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AB6194 AS DateTime), N'EPO', CAST(0x0000A81200AC939B AS DateTime), N'0')
GO
print 'Processed 200 total records'
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (248, 51, 434, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AB78CD AS DateTime), N'EPO', CAST(0x0000A81200AC9A1E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (249, 51, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AF4CE0 AS DateTime), N'EPO', CAST(0x0000A81200AF4CE0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (250, 51, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AF6486 AS DateTime), N'EPO', CAST(0x0000A81200AF6486 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (251, 51, 371, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(16 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AF7BF0 AS DateTime), N'EPO', CAST(0x0000A81200AF7BF0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (252, 51, 372, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(17 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AF8D54 AS DateTime), N'EPO', CAST(0x0000A81200AF8D54 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (253, 51, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(18 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AF98C1 AS DateTime), N'EPO', CAST(0x0000A81200AF98C1 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (254, 51, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(19 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200AFA1D2 AS DateTime), N'EPO', CAST(0x0000A81200AFA1D2 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (255, 31, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200B0F150 AS DateTime), N'EPO', CAST(0x0000A81200B0F150 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (256, 31, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200B1001B AS DateTime), N'EPO', CAST(0x0000A81200B1001B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (257, 31, 368, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200B10F5C AS DateTime), N'EPO', CAST(0x0000A81200B10F5C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (258, 31, 371, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200B139A4 AS DateTime), N'EPO', CAST(0x0000A81200B139A4 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (259, 31, 375, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200B1639B AS DateTime), N'EPO', CAST(0x0000A81200B1639B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (260, 45, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E2E592 AS DateTime), N'EPO', CAST(0x0000A81200E2E592 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (261, 45, 354, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E2F93D AS DateTime), N'EPO', CAST(0x0000A81200E2F93D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (262, 45, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E30C5B AS DateTime), N'EPO', CAST(0x0000A81200E30C5B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (263, 45, 364, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E77DEE AS DateTime), N'EPO', CAST(0x0000A81200E77DEE AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (264, 45, 368, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E79E3B AS DateTime), N'EPO', CAST(0x0000A81200E79E3B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (265, 45, 371, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E7BA42 AS DateTime), N'EPO', CAST(0x0000A81200E7BA42 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (266, 45, 372, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E7CE61 AS DateTime), N'EPO', CAST(0x0000A81200E7CE61 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (267, 45, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E7DB14 AS DateTime), N'EPO', CAST(0x0000A81200E7E4FA AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (268, 45, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E7F02C AS DateTime), N'EPO', CAST(0x0000A81200E7F02C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (269, 39, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E8C058 AS DateTime), N'EPO', CAST(0x0000A81200E8C058 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (270, 39, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E8D2CB AS DateTime), N'EPO', CAST(0x0000A81200E8D2CB AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (271, 39, 371, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(16 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E8E57E AS DateTime), N'EPO', CAST(0x0000A81200E8E57E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (272, 39, 372, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(17 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E8F532 AS DateTime), N'EPO', CAST(0x0000A81200E8F532 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (273, 39, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(18 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E90102 AS DateTime), N'EPO', CAST(0x0000A81200E90102 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (274, 39, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(19 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E90A18 AS DateTime), N'EPO', CAST(0x0000A81200E90A18 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (275, 37, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E93AC5 AS DateTime), N'EPO', CAST(0x0000A81200E93AC5 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (276, 37, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E9465D AS DateTime), N'EPO', CAST(0x0000A81200E9465D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (277, 37, 371, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E957F4 AS DateTime), N'EPO', CAST(0x0000A81200E957F4 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (278, 37, 372, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E96A71 AS DateTime), N'EPO', CAST(0x0000A81200E96A71 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (279, 37, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E97471 AS DateTime), N'EPO', CAST(0x0000A81200E97471 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (280, 37, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E980DF AS DateTime), N'EPO', CAST(0x0000A81200E980DF AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (281, 33, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(19 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E9B1E9 AS DateTime), N'EPO', CAST(0x0000A81200E9B1E9 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (282, 33, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(20 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E9BD34 AS DateTime), N'EPO', CAST(0x0000A81200E9BD34 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (283, 33, 356, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(21 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E9C8C6 AS DateTime), N'EPO', CAST(0x0000A81200E9C8C6 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (284, 33, 371, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(22 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200E9F25D AS DateTime), N'EPO', CAST(0x0000A81200E9F25D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (285, 33, 372, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(23 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EA0019 AS DateTime), N'EPO', CAST(0x0000A81200EA0019 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (286, 33, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(24 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EA0D29 AS DateTime), N'EPO', CAST(0x0000A81200EA493A AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (287, 33, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(25 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EA6354 AS DateTime), N'EPO', CAST(0x0000A81200EA6354 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (288, 31, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EBFC4D AS DateTime), N'EPO', CAST(0x0000A81200EBFC4D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (289, 31, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EC0BF0 AS DateTime), N'EPO', CAST(0x0000A81200EC0BF0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (290, 46, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200ED2966 AS DateTime), N'EPO', CAST(0x0000A81200ED2966 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (291, 24, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EEE003 AS DateTime), N'EPO', CAST(0x0000A81200EEE003 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (292, 24, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EEED22 AS DateTime), N'EPO', CAST(0x0000A81200EEED22 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (293, 24, 338, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EEFEA8 AS DateTime), N'EPO', CAST(0x0000A81200EEFEA8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (294, 24, 339, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF149C AS DateTime), N'EPO', CAST(0x0000A81200EF149C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (295, 24, 340, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF2729 AS DateTime), N'EPO', CAST(0x0000A81200EF2729 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (296, 24, 341, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF344E AS DateTime), N'EPO', CAST(0x0000A81200EF344E AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (297, 24, 427, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF4A2C AS DateTime), N'EPO', CAST(0x0000A81200EF4A2C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (298, 24, 362, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF56FD AS DateTime), N'EPO', CAST(0x0000A81200EF56FD AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (299, 24, 363, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF62B9 AS DateTime), N'EPO', CAST(0x0000A81200EF62B9 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (300, 24, 368, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(13 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF7155 AS DateTime), N'EPO', CAST(0x0000A81200EF7155 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (301, 24, 392, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(14 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF7ED8 AS DateTime), N'EPO', CAST(0x0000A81200EF7ED8 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (302, 24, 393, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(15 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF8E2D AS DateTime), N'EPO', CAST(0x0000A81200EF8E2D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (303, 24, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(16 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A81200EF96DF AS DateTime), N'EPO', CAST(0x0000A81200EF96DF AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (304, 49, 387, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 2, N'PPM', CAST(0x0000A81D00E78618 AS DateTime), N'PPM', CAST(0x0000A81D00E78618 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (305, 49, 357, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 2, N'PPM', CAST(0x0000A81D00E7AAB5 AS DateTime), N'PPM', CAST(0x0000A81D00E7AAB5 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (306, 49, 331, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 2, N'PPM', CAST(0x0000A81D00E7C897 AS DateTime), N'PPM', CAST(0x0000A81D00E7C897 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (307, 34, 357, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(0 AS Numeric(18, 0)), 2, N'BDA', CAST(0x0000A82400A5C950 AS DateTime), N'BDA', CAST(0x0000A82400A5D41C AS DateTime), N'1')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (308, 40, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500AD6694 AS DateTime), N'EPO', CAST(0x0000A82500AD6694 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (309, 40, 439, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500AD74AF AS DateTime), N'EPO', CAST(0x0000A82500AD74AF AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (310, 40, 438, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500AD8485 AS DateTime), N'EPO', CAST(0x0000A82500AD8485 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (311, 40, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500AD8E2F AS DateTime), N'EPO', CAST(0x0000A82500AD8E2F AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (312, 42, 441, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 2, N'EPO', CAST(0x0000A82500AE9876 AS DateTime), N'EPO', CAST(0x0000A82500B7809D AS DateTime), N'1')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (313, 42, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 2, N'EPO', CAST(0x0000A82500AEA4B6 AS DateTime), N'EPO', CAST(0x0000A82500B782D3 AS DateTime), N'1')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (314, 42, 439, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 2, N'EPO', CAST(0x0000A82500AEEC32 AS DateTime), N'EPO', CAST(0x0000A82500B78539 AS DateTime), N'1')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (315, 42, 438, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 2, N'EPO', CAST(0x0000A82500AEF937 AS DateTime), N'EPO', CAST(0x0000A82500B7875F AS DateTime), N'1')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (316, 42, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500AF10BE AS DateTime), N'EPO', CAST(0x0000A82500B77850 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (317, 41, 441, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B359D0 AS DateTime), N'EPO', CAST(0x0000A82500B359D0 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (318, 41, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B36C58 AS DateTime), N'EPO', CAST(0x0000A82500B36C58 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (319, 41, 439, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B37CD6 AS DateTime), N'EPO', CAST(0x0000A82500B37CD6 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (320, 41, 438, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B38908 AS DateTime), N'EPO', CAST(0x0000A82500B38908 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (321, 41, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(12 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B396DB AS DateTime), N'EPO', CAST(0x0000A82500B396DB AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (322, 55, 437, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B4EC39 AS DateTime), N'EPO', CAST(0x0000A82500B4EC39 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (323, 55, 444, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(2 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B5E72C AS DateTime), N'EPO', CAST(0x0000A82500B5E72C AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (324, 55, 399, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(3 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B5F896 AS DateTime), N'EPO', CAST(0x0000A82500B5F896 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (325, 55, 398, CAST(1 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(4 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B61920 AS DateTime), N'EPO', CAST(0x0000A82500B61920 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (326, 55, 443, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(5 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B63196 AS DateTime), N'EPO', CAST(0x0000A82500B63196 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (327, 55, 336, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(6 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B64794 AS DateTime), N'EPO', CAST(0x0000A82500B64794 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (328, 55, 441, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(7 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B65668 AS DateTime), N'EPO', CAST(0x0000A82500B65668 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (329, 55, 335, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(8 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B663A6 AS DateTime), N'EPO', CAST(0x0000A82500B663A6 AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (330, 55, 439, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(9 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B6703B AS DateTime), N'EPO', CAST(0x0000A82500B6703B AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (331, 55, 438, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(10 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B67D9D AS DateTime), N'EPO', CAST(0x0000A82500B67D9D AS DateTime), N'0')
INSERT [dbo].[m_eform_document] ([eform_document_id], [eform_id], [document_id], [minimum_files], [maximum_files], [seq_number], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (332, 55, 413, CAST(0 AS Numeric(18, 0)), CAST(30 AS Numeric(18, 0)), CAST(11 AS Numeric(18, 0)), 5, N'EPO', CAST(0x0000A82500B688BC AS DateTime), N'EPO', CAST(0x0000A82500B688BC AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_eform_document] OFF
/****** Object:  Table [dbo].[m_eform_setting]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_eform_setting](
	[eform_setting_id] [bigint] IDENTITY(1,1) NOT NULL,
	[eform_id] [int] NOT NULL,
	[description] [varchar](50) NOT NULL,
	[effective_date] [date] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_eform___58575F1636870511] PRIMARY KEY CLUSTERED 
(
	[eform_setting_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [m_user_menu_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_menu_Insert] 
ON [dbo].[m_user_menu]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_user_menu]
([user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_menu_id]) as [user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_user_menu_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_menu_Delete]    
ON [dbo].[m_user_menu]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_user_menu]
([user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_menu_id]) as [user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_user_menu_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_menu_Update]      
ON [dbo].[m_user_menu]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([user_menu_id]) THEN '[user_menu_id]-' ELSE '' END + 
CASE WHEN UPDATE([user_menu]) THEN '[user_menu]-' ELSE '' END + 
CASE WHEN UPDATE([is_group_menu]) THEN '[is_group_menu]-' ELSE '' END + 
CASE WHEN UPDATE([group_menu_id]) THEN '[group_menu_id]-' ELSE '' END + 
CASE WHEN UPDATE([is_include]) THEN '[is_include]-' ELSE '' END + 
CASE WHEN UPDATE([is_exclude]) THEN '[is_exclude]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_user_menu]
([user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_menu_id]) as [user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_user_menu]
([user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[user_menu_id]) as [user_menu_id],[user_menu],[is_group_menu],[group_menu_id],[is_include],[is_exclude],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_approv_matrix_detail_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_approv_matrix_detail_Update]      
ON [dbo].[m_approv_matrix_detail]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([approv_matrix_detail_id]) THEN '[approv_matrix_detail_id]-' ELSE '' END + 
CASE WHEN UPDATE([approv_matrix_id]) THEN '[approv_matrix_id]-' ELSE '' END + 
CASE WHEN UPDATE([maximum_value]) THEN '[maximum_value]-' ELSE '' END + 
CASE WHEN UPDATE([level_type_id]) THEN '[level_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([currency_id]) THEN '[currency_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_approv_matrix_detail]
([approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[approv_matrix_detail_id]) as [approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_approv_matrix_detail]
([approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[approv_matrix_detail_id]) as [approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_approv_matrix_detail_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_approv_matrix_detail_Insert] 
ON [dbo].[m_approv_matrix_detail]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_approv_matrix_detail]
([approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[approv_matrix_detail_id]) as [approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_approv_matrix_detail_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_approv_matrix_detail_Delete]    
ON [dbo].[m_approv_matrix_detail]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_approv_matrix_detail]
([approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[approv_matrix_detail_id]) as [approv_matrix_detail_id],[approv_matrix_id],[maximum_value],[level_type_id],[currency_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [TTransactionTrigger]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[TTransactionTrigger]
   ON  [dbo].[t_transaction]
   AFTER INSERT
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	DECLARE @rownums VARCHAR(12);
	DECLARE @transno VARCHAR(9);
	DECLARE @transid BIGINT;
	DECLARE @typeid INT;
	DECLARE @userid VARCHAR(8);
	DECLARE @templatestageid BIGINT;
	DECLARE @templateactionid BIGINT;
	DECLARE @sourcetransactionid SMALLINT;
	DECLARE @eformworkflowid INT;

	SET @templateactionid = 16; 

	SET @rownums = (SELECT CAST((COUNT(transaction_id)) AS VARCHAR) 
					FROM t_transaction
					WHERE created_date BETWEEN 
					DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
					AND 
					DATEADD(DAY, 0, DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)));

	SET @transno = (SELECT RIGHT(CONVERT(VARCHAR(8), GETDATE(), 1),2) + CONVERT(VARCHAR(2), GETDATE(), 101) + STUFF('00000', 5 - LEN(@rownums) + 1, LEN(@rownums), @rownums));

	SELECT @transid = transaction_id, @typeid = transaction_type_id, @userid = user_id, @sourcetransactionid = source_transaction_id
	FROM inserted;

	
		
		SET @templatestageid = (
				SELECT TOP 1 w.workflow_template_stage_id
				FROM m_workflow_template_stage w
				WHERE workflow_template_id = (
					SELECT TOP 1
						mwt.workflow_template_id
						FROM
							dbo.m_eform AS me INNER JOIN
							dbo.m_eform_workflow AS mew ON me.eform_id = mew.eform_id INNER JOIN
							dbo.m_workflow_template AS mwt ON mew.workflow_template_id = mwt.workflow_template_id
						WHERE
							mew.effective_date <= CAST(GETDATE() AS DATE)
							AND me.is_delete = '0'
							AND mew.is_delete = '0'
							AND mwt.is_delete = '0'
							AND me.transaction_type_id = @typeid
							AND me.status_id = 5
							AND mew.status_id = 5
							AND mwt.status_id = 5
							AND mew.source_transaction_id = @sourcetransactionid
						ORDER BY
							mew.effective_date DESC
				)
				ORDER BY seq_number ASC
			);

	
		

	UPDATE t_transaction
	SET register_number = @transno,
		currency_id = (
			SELECT currency_id
			FROM m_currency
			WHERE currency_code = (
				SELECT currency_id_reference
				FROM inserted
			)
		),
		workflow_template_stage_id = @templatestageid,
		eform_workflow_id = @eformworkflowid
	WHERE transaction_id = @transid;


	INSERT INTO t_transaction_task
	(
		transaction_id,
		process_sequence,
		user_id,
		status_id,
		created_by,
		created_date,
		modified_by,
		modified_date,
		is_delete
	)
	VALUES (
		@transid,
		1,
		@userid,
		1,
		@userid,
		GETDATE(),
		@userid,
		GETDATE(),
		'0'
	);


	INSERT INTO t_transaction_history_process (
		transaction_id, 
		process_date, 
		user_id, 
		workflow_template_action_id, 
		reason_id, 
		remarks, 
		created_by, 
		created_date, 
		modified_by, 
		modified_date, 
		is_delete,
		action_description
	)
	VALUES (
		@transid,
		GETDATE(),
		@userid,
		@templateactionid,
		NULL,
		NULL,
		@userid,
		GETDATE(),
		@userid,
		GETDATE(),
		0,
		'Create New Transaction'
	);

	INSERT INTO t_transaction_history_workflow (
		transaction_id, 
		workflow_template_stage_id, 
		last_user, 
		last_submit_date, 
		created_by, 
		created_date, 
		modified_by, 
		modified_date, 
		is_delete
	)
	VALUES (
		@transid,
		@templatestageid,
		@userid,
		GETDATE(),
		@userid,
		GETDATE(),
		@userid,
		GETDATE(),
		0
	);

    INSERT INTO t_transaction_log
	(
		transaction_id,
		transaction_type_id,
		register_number,
		transaction_date,
		source_app_id,
		policy_id_reference,
		policy_holder_reference,	
		product_name_reference,	
		currency_id_reference,	
		is_policy_holder,	
		customer,	
		address,	
		mobile_phone,	
		email_address,	
		signature_url,	
		photo_url,	
		reference_number,	
		currency_id,
		currency_code,	
		transaction_value,	
		is_notify_document_completion,	
		notification_date,	
		workflow_template_stage_id,	
		user_id,	
		branch_id,	
		status_id,	
		created_by,	
		created_date,
		is_delete,
		signature_hashcode,
		photo_hashcode,
		source_transaction_id,
		eform_workflow_id
	) 
	SELECT 
	
		transaction_id,
		transaction_type_id,
		@transno,
		transaction_date,
		source_app_id,
		policy_id_reference,
		policy_holder_reference,	
		product_name_reference,	
		currency_id_reference,	
		is_policy_holder,	
		customer,	
		address,	
		mobile_phone,	
		email_address,	
		signature_url,	
		photo_url,	
		reference_number,	
		currency_id,
		currency_code,	
		transaction_value,	
		is_notify_document_completion,	
		notification_date,	
		workflow_template_stage_id,	
		user_id,	
		branch_id,	
		status_id,	
		created_by,	
		created_date,
		is_delete,
		signature_hashcode,
		photo_hashcode,
		source_transaction_id,
		eform_workflow_id
	
	FROM inserted


END
GO
/****** Object:  Table [dbo].[m_user_organization]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_user_organization](
	[user_organization_id] [bigint] IDENTITY(1,1) NOT NULL,
	[user_id_organization] [varchar](8) NOT NULL,
	[effective_date] [date] NOT NULL,
	[organization_id] [int] NOT NULL,
	[status_id] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_user_o__D949BB7C10615C29] PRIMARY KEY CLUSTERED 
(
	[user_organization_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]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[m_user_organization] ON
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (46, N'WHI', CAST(0x113D0B00 AS Date), 5, 6, N'WHI', CAST(0x0000A7B501433669 AS DateTime), N'WHI', CAST(0x0000A7B600E71A8A AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (47, N'WHI', CAST(0x153D0B00 AS Date), 9, 5, N'WHI', CAST(0x0000A7B5014346EB AS DateTime), N'WHI', CAST(0x0000A7B600ADD6FA AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (48, N'PPM', CAST(0x113D0B00 AS Date), 5, 5, N'WHI', CAST(0x0000A7B501436020 AS DateTime), N'WHI', CAST(0x0000A7B501436020 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (49, N'WHI', CAST(0x103D0B00 AS Date), 13, 6, N'WHI', CAST(0x0000A7B501439585 AS DateTime), N'WHI', CAST(0x0000A7B600E3DFA8 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (50, N'KHU', CAST(0x193D0B00 AS Date), 5, 5, N'WHI', CAST(0x0000A7B50143EBAA AS DateTime), N'WHI', CAST(0x0000A7B50143EBAA AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (51, N'FMJ', CAST(0x123D0B00 AS Date), 9, 5, N'WHI', CAST(0x0000A7B600A887F2 AS DateTime), N'WHI', CAST(0x0000A7B600AD79B9 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (52, N'KHU', CAST(0x123D0B00 AS Date), 5, 6, N'WHI', CAST(0x0000A7B600A8A81A AS DateTime), N'WHI', CAST(0x0000A7B600A8A81A AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (53, N'PPM', CAST(0x0F3D0B00 AS Date), 9, 6, N'WHI', CAST(0x0000A7B600A8C6DC AS DateTime), N'WHI', CAST(0x0000A7B600E72AAC AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (54, N'BDA', CAST(0x1C3D0B00 AS Date), 5, 6, N'WHI', CAST(0x0000A7BE00FC38B0 AS DateTime), N'WHI', CAST(0x0000A7BE00FC38B0 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (55, N'BDA', CAST(0x203D0B00 AS Date), 9, 5, N'WHI', CAST(0x0000A7BE00FC8AD0 AS DateTime), N'WHI', CAST(0x0000A7C300F37D4B AS DateTime), N'1')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (56, N'BDA', CAST(0x203D0B00 AS Date), 9, 5, N'WHI', CAST(0x0000A7BE00FC8C65 AS DateTime), N'WHI', CAST(0x0000A7BE00FC9FC9 AS DateTime), N'1')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (57, N'BDA', CAST(0x273D0B00 AS Date), 5, 6, N'WHI', CAST(0x0000A7BE00FCCB91 AS DateTime), N'WHI', CAST(0x0000A7BE00FCCB91 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (58, N'BDA', CAST(0x353D0B00 AS Date), 5, 5, N'WHI', CAST(0x0000A7BE00FE2F2B AS DateTime), N'WHI', CAST(0x0000A7BE00FE2F2B AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (59, N'JWT', CAST(0x1C3D0B00 AS Date), 5, 5, N'WHI', CAST(0x0000A7BE00FE6128 AS DateTime), N'WHI', CAST(0x0000A7BE00FE6128 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (60, N'FMJ', CAST(0x3D3D0B00 AS Date), 4, 5, N'FMJ', CAST(0x0000A7DA00F5DC79 AS DateTime), N'WHI', CAST(0x0000A7EF00D418D0 AS DateTime), N'1')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (61, N'EPO', CAST(0x5E3D0B00 AS Date), 14, 5, N'BDA', CAST(0x0000A80200E029C2 AS DateTime), N'BDA', CAST(0x0000A80200E029C2 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (62, N'ASY', CAST(0x663D0B00 AS Date), 16, 5, N'EPO', CAST(0x0000A80A00A2C641 AS DateTime), N'EPO', CAST(0x0000A80A00A2C641 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (63, N'ABU', CAST(0x663D0B00 AS Date), 16, 5, N'EPO', CAST(0x0000A80A00A35ABF AS DateTime), N'EPO', CAST(0x0000A80A00A35ABF AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (64, N'NRF', CAST(0x663D0B00 AS Date), 16, 5, N'EPO', CAST(0x0000A80A00A38E44 AS DateTime), N'EPO', CAST(0x0000A80A00A38E44 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (65, N'YPE', CAST(0x663D0B00 AS Date), 15, 5, N'EPO', CAST(0x0000A80A00A3B7FC AS DateTime), N'EPO', CAST(0x0000A80A00A3B7FC AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (66, N'LDE', CAST(0x663D0B00 AS Date), 15, 5, N'EPO', CAST(0x0000A80A00A464B0 AS DateTime), N'EPO', CAST(0x0000A80A00A464B0 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (67, N'MNH', CAST(0x663D0B00 AS Date), 17, 5, N'EPO', CAST(0x0000A80A00A4A848 AS DateTime), N'EPO', CAST(0x0000A80A00A4A848 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (68, N'RRH', CAST(0x663D0B00 AS Date), 17, 5, N'EPO', CAST(0x0000A80A00A548F2 AS DateTime), N'EPO', CAST(0x0000A80A00A548F2 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (69, N'ROK', CAST(0x663D0B00 AS Date), 15, 5, N'EPO', CAST(0x0000A80A00A57EB8 AS DateTime), N'EPO', CAST(0x0000A80A00A57EB8 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (70, N'AFI', CAST(0x663D0B00 AS Date), 19, 5, N'EPO', CAST(0x0000A80A00AD54DA AS DateTime), N'EPO', CAST(0x0000A80A00AD54DA AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (71, N'HDW', CAST(0x663D0B00 AS Date), 15, 5, N'ASP', CAST(0x0000A80A010E56CD AS DateTime), N'ASP', CAST(0x0000A80A010E56CD AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (72, N'MSA', CAST(0x673D0B00 AS Date), 15, 7, N'ASP', CAST(0x0000A80B00F1E723 AS DateTime), N'ASP', CAST(0x0000A80B00F1E723 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (73, N'SAN', CAST(0x703D0B00 AS Date), 16, 7, N'EPO', CAST(0x0000A815009CDE23 AS DateTime), N'EPO', CAST(0x0000A815009CDE23 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (74, N'FSH', CAST(0x703D0B00 AS Date), 20, 7, N'EPO', CAST(0x0000A81500E61596 AS DateTime), N'EPO', CAST(0x0000A81500E61596 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (75, N'KAT', CAST(0x703D0B00 AS Date), 20, 7, N'EPO', CAST(0x0000A81500E664C3 AS DateTime), N'EPO', CAST(0x0000A81500E664C3 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (76, N'BSU', CAST(0x703D0B00 AS Date), 20, 7, N'EPO', CAST(0x0000A81500E69A42 AS DateTime), N'EPO', CAST(0x0000A81500E69A42 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (77, N'RSP', CAST(0x703D0B00 AS Date), 19, 7, N'EPO', CAST(0x0000A81500E73A68 AS DateTime), N'EPO', CAST(0x0000A81500E73A68 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (78, N'NIR', CAST(0x703D0B00 AS Date), 15, 7, N'ASP', CAST(0x0000A8150103FE03 AS DateTime), N'ASP', CAST(0x0000A8150103FE03 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (79, N'MAP', CAST(0x703D0B00 AS Date), 15, 7, N'ASP', CAST(0x0000A815010749F2 AS DateTime), N'ASP', CAST(0x0000A815010749F2 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (80, N'NHN', CAST(0x703D0B00 AS Date), 15, 7, N'ASP', CAST(0x0000A81501077846 AS DateTime), N'ASP', CAST(0x0000A81501077846 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (81, N'DAW', CAST(0x713D0B00 AS Date), 15, 7, N'ASP', CAST(0x0000A81600F9BC2D AS DateTime), N'ASP', CAST(0x0000A81600F9BC2D AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (82, N'AAU', CAST(0x753D0B00 AS Date), 18, 7, N'ASP', CAST(0x0000A81900A6601A AS DateTime), N'ASP', CAST(0x0000A81900A6601A AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (83, N'DSO', CAST(0x753D0B00 AS Date), 1, 7, N'ASP', CAST(0x0000A81900AE6AC4 AS DateTime), N'ASP', CAST(0x0000A81900AE6AC4 AS DateTime), N'0')
INSERT [dbo].[m_user_organization] ([user_organization_id], [user_id_organization], [effective_date], [organization_id], [status_id], [created_by], [created_date], [modified_by], [modified_date], [is_delete]) VALUES (84, N'INU', CAST(0x753D0B00 AS Date), 18, 7, N'ASP', CAST(0x0000A81900B82A27 AS DateTime), N'ASP', CAST(0x0000A81900B82A27 AS DateTime), N'0')
SET IDENTITY_INSERT [dbo].[m_user_organization] OFF
/****** Object:  Trigger [m_eform_workflow_Update]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_workflow_Update]      
ON [dbo].[m_eform_workflow]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([eform_workflow_id]) THEN '[eform_workflow_id]-' ELSE '' END + 
CASE WHEN UPDATE([eform_id]) THEN '[eform_id]-' ELSE '' END + 
CASE WHEN UPDATE([workflow_template_id]) THEN '[workflow_template_id]-' ELSE '' END + 
CASE WHEN UPDATE([effective_date]) THEN '[effective_date]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_eform_workflow]
([eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_workflow_id]) as [eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_eform_workflow]
([eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_workflow_id]) as [eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_eform_workflow_Insert]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_workflow_Insert] 
ON [dbo].[m_eform_workflow]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_eform_workflow]
([eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_workflow_id]) as [eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_eform_workflow_Delete]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_workflow_Delete]    
ON [dbo].[m_eform_workflow]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_eform_workflow]
([eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_workflow_id]) as [eform_workflow_id],[eform_id],[workflow_template_id],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_eform_document_Update]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_document_Update]      
ON [dbo].[m_eform_document]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([eform_document_id]) THEN '[eform_document_id]-' ELSE '' END + 
CASE WHEN UPDATE([eform_id]) THEN '[eform_id]-' ELSE '' END + 
CASE WHEN UPDATE([document_id]) THEN '[document_id]-' ELSE '' END + 
CASE WHEN UPDATE([minimum_files]) THEN '[minimum_files]-' ELSE '' END + 
CASE WHEN UPDATE([maximum_files]) THEN '[maximum_files]-' ELSE '' END + 
CASE WHEN UPDATE([seq_number]) THEN '[seq_number]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_eform_document]
([eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_document_id]) as [eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_eform_document]
([eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_document_id]) as [eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_eform_document_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_document_Insert] 
ON [dbo].[m_eform_document]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_eform_document]
([eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_document_id]) as [eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_eform_document_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_document_Delete]    
ON [dbo].[m_eform_document]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_eform_document]
([eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_document_id]) as [eform_document_id],[eform_id],[document_id],[minimum_files],[maximum_files],[seq_number],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_eform_setting_Delete]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_setting_Delete]    
ON [dbo].[m_eform_setting]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_eform_setting]
([eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[eform_setting_id]) as [eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Trigger [m_eform_setting_Update]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_setting_Update]      
ON [dbo].[m_eform_setting]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([eform_setting_id]) THEN '[eform_setting_id]-' ELSE '' END + 
CASE WHEN UPDATE([eform_id]) THEN '[eform_id]-' ELSE '' END + 
CASE WHEN UPDATE([description]) THEN '[description]-' ELSE '' END + 
CASE WHEN UPDATE([effective_date]) THEN '[effective_date]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_eform_setting]
([eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[eform_setting_id]) as [eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_eform_setting]
([eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[eform_setting_id]) as [eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_eform_setting_Insert]    Script Date: 11/10/2017 16:09:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_setting_Insert] 
ON [dbo].[m_eform_setting]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_eform_setting]
([eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[eform_setting_id]) as [eform_setting_id],[eform_id],[description],[effective_date],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_user_organization_Update]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_organization_Update]      
ON [dbo].[m_user_organization]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([user_organization_id]) THEN '[user_organization_id]-' ELSE '' END + 
CASE WHEN UPDATE([user_id_organization]) THEN '[user_id_organization]-' ELSE '' END + 
CASE WHEN UPDATE([effective_date]) THEN '[effective_date]-' ELSE '' END + 
CASE WHEN UPDATE([organization_id]) THEN '[organization_id]-' ELSE '' END + 
CASE WHEN UPDATE([status_id]) THEN '[status_id]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_user_organization]
([user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[user_organization_id]) as [user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_user_organization]
([user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[user_organization_id]) as [user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_user_organization_Insert]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_organization_Insert] 
ON [dbo].[m_user_organization]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_user_organization]
([user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[user_organization_id]) as [user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_user_organization_Delete]    Script Date: 11/10/2017 16:09:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_user_organization_Delete]    
ON [dbo].[m_user_organization]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_user_organization]
([user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(bigint,[user_organization_id]) as [user_organization_id],[user_id_organization],[effective_date],[organization_id],[status_id],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Table [dbo].[m_eform_setting_detail]    Script Date: 11/10/2017 16:09:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[m_eform_setting_detail](
	[eform_setting_detail_id] [int] IDENTITY(1,1) NOT NULL,
	[eform_setting_id] [bigint] NOT NULL,
	[component_type_id] [bigint] NOT NULL,
	[label] [varchar](50) NULL,
	[row] [numeric](18, 0) NULL,
	[column_order] [numeric](18, 0) NULL,
	[width] [numeric](18, 0) NULL,
	[height] [numeric](18, 0) NULL,
	[data_type_id] [int] NULL,
	[source_data] [varchar](50) NULL,
	[saved_value] [varchar](50) NULL,
	[view_value] [varchar](50) NULL,
	[data_lenght] [varchar](50) NULL,
	[is_mandatory_field] [char](1) NOT NULL,
	[is_used_for_approval] [char](1) NOT NULL,
	[is_sub_question] [char](1) NOT NULL,
	[component_id_parent] [int] NOT NULL,
	[created_by] [varchar](8) NOT NULL,
	[created_date] [datetime] NOT NULL,
	[modified_by] [varchar](8) NOT NULL,
	[modified_date] [datetime] NOT NULL,
	[is_delete] [char](1) NOT NULL,
 CONSTRAINT [PK__m_eform___60D2785A7A3D10E0] PRIMARY KEY CLUSTERED 
(
	[eform_setting_detail_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]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Trigger [m_eform_setting_detail_Update]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_setting_detail_Update]      
ON [dbo].[m_eform_setting_detail]    
FOR UPDATE    
AS 
   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols =  CASE WHEN UPDATE([eform_setting_detail_id]) THEN '[eform_setting_detail_id]-' ELSE '' END + 
CASE WHEN UPDATE([eform_setting_id]) THEN '[eform_setting_id]-' ELSE '' END + 
CASE WHEN UPDATE([component_type_id]) THEN '[component_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([label]) THEN '[label]-' ELSE '' END + 
CASE WHEN UPDATE([row]) THEN '[row]-' ELSE '' END + 
CASE WHEN UPDATE([column_order]) THEN '[column_order]-' ELSE '' END + 
CASE WHEN UPDATE([width]) THEN '[width]-' ELSE '' END + 
CASE WHEN UPDATE([height]) THEN '[height]-' ELSE '' END + 
CASE WHEN UPDATE([data_type_id]) THEN '[data_type_id]-' ELSE '' END + 
CASE WHEN UPDATE([source_data]) THEN '[source_data]-' ELSE '' END + 
CASE WHEN UPDATE([saved_value]) THEN '[saved_value]-' ELSE '' END + 
CASE WHEN UPDATE([view_value]) THEN '[view_value]-' ELSE '' END + 
CASE WHEN UPDATE([data_lenght]) THEN '[data_lenght]-' ELSE '' END + 
CASE WHEN UPDATE([is_mandatory_field]) THEN '[is_mandatory_field]-' ELSE '' END + 
CASE WHEN UPDATE([is_used_for_approval]) THEN '[is_used_for_approval]-' ELSE '' END + 
CASE WHEN UPDATE([is_sub_question]) THEN '[is_sub_question]-' ELSE '' END + 
CASE WHEN UPDATE([component_id_parent]) THEN '[component_id_parent]-' ELSE '' END + 
CASE WHEN UPDATE([created_by]) THEN '[created_by]-' ELSE '' END + 
CASE WHEN UPDATE([created_date]) THEN '[created_date]-' ELSE '' END + 
CASE WHEN UPDATE([modified_by]) THEN '[modified_by]-' ELSE '' END + 
CASE WHEN UPDATE([modified_date]) THEN '[modified_date]-' ELSE '' END + 
CASE WHEN UPDATE([is_delete]) THEN '[is_delete]-' ELSE '' END  
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '' 
   BEGIN 
          INSERT INTO [dbo].[log_m_eform_setting_detail]
([eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_setting_detail_id]) as [eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO [dbo].[log_m_eform_setting_detail]
([eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_setting_detail_id]) as [eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Update',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END
GO
/****** Object:  Trigger [m_eform_setting_detail_Insert]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_setting_detail_Insert] 
ON [dbo].[m_eform_setting_detail]    
FOR INSERT    
AS    

 INSERT INTO [dbo].[log_m_eform_setting_detail]
([eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_setting_detail_id]) as [eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'New','Insert',SUSER_SNAME(),getdate(),''  FROM INSERTED
GO
/****** Object:  Trigger [m_eform_setting_detail_Delete]    Script Date: 11/10/2017 16:09:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[m_eform_setting_detail_Delete]    
ON [dbo].[m_eform_setting_detail]    
FOR DELETE    
AS   
  INSERT INTO [dbo].[log_m_eform_setting_detail]
([eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns)
SELECT CONVERT(int,[eform_setting_detail_id]) as [eform_setting_detail_id],[eform_setting_id],[component_type_id],[label],[row],[column_order],[width],[height],[data_type_id],[source_data],[saved_value],[view_value],[data_lenght],[is_mandatory_field],[is_used_for_approval],[is_sub_question],[component_id_parent],[created_by],[created_date],[modified_by],[modified_date],[is_delete],'Old','Delete',SUSER_SNAME(),getdate(),''  FROM DELETED
GO
/****** Object:  Default [DF__log_DDLEv__Event__7913E27D]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[log_DDLEvents] ADD  CONSTRAINT [DF__log_DDLEv__Event__7913E27D]  DEFAULT (getdate()) FOR [EventDate]
GO
/****** Object:  Default [DF_m_alteration_type_created_date]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_alteration_type] ADD  CONSTRAINT [DF_m_alteration_type_created_date]  DEFAULT (getdate()) FOR [created_date]
GO
/****** Object:  Default [DF_m_alteration_type_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_alteration_type] ADD  CONSTRAINT [DF_m_alteration_type_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_branch_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_branch] ADD  CONSTRAINT [DF_m_branch_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_currency_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_currency] ADD  CONSTRAINT [DF_m_currency_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_gross_income_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_gross_income] ADD  CONSTRAINT [DF_m_gross_income_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_gross_income_year_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_gross_income_year] ADD  CONSTRAINT [DF_m_gross_income_year_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_group_menu_created_date]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_menu] ADD  CONSTRAINT [DF_m_group_menu_created_date]  DEFAULT (getdate()) FOR [created_date]
GO
/****** Object:  Default [DF_m_group_menu_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_menu] ADD  CONSTRAINT [DF_m_group_menu_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_menu_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_menu] ADD  CONSTRAINT [DF_m_menu_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_menu_category_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_menu_category] ADD  CONSTRAINT [DF_m_menu_category_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_reinstatement_type_created_date]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_reinstatement_type] ADD  CONSTRAINT [DF_m_reinstatement_type_created_date]  DEFAULT (getdate()) FOR [created_date]
GO
/****** Object:  Default [DF_m_reinstatement_type_is_delete]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_reinstatement_type] ADD  CONSTRAINT [DF_m_reinstatement_type_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_source_of_funds_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_source_of_funds] ADD  CONSTRAINT [DF_m_source_of_funds_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_source_transaction_modified_date]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_source_transaction] ADD  CONSTRAINT [DF_m_source_transaction_modified_date]  DEFAULT (getdate()) FOR [modified_date]
GO
/****** Object:  Default [DF_m_source_transaction_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_source_transaction] ADD  CONSTRAINT [DF_m_source_transaction_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_status_created_date]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_status] ADD  CONSTRAINT [DF_m_status_created_date]  DEFAULT (getdate()) FOR [created_date]
GO
/****** Object:  Default [DF_m_transaction_form_template_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_transaction_form_template] ADD  CONSTRAINT [DF_m_transaction_form_template_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_transaction_task_status_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_transaction_task_status] ADD  CONSTRAINT [DF_m_transaction_task_status_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_user_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user] ADD  CONSTRAINT [DF_m_user_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_user_group_menu_mapping_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_group_menu_mapping] ADD  CONSTRAINT [DF_m_user_group_menu_mapping_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_user_menu_mapping_is_exclude]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_menu_mapping] ADD  CONSTRAINT [DF_m_user_menu_mapping_is_exclude]  DEFAULT ((0)) FOR [is_exclude]
GO
/****** Object:  Default [DF_m_user_menu_mapping_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_menu_mapping] ADD  CONSTRAINT [DF_m_user_menu_mapping_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_workflow_template_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template] ADD  CONSTRAINT [DF_m_workflow_template_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_m_workflow_template_stage_group_pic_id]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template_stage] ADD  CONSTRAINT [DF_m_workflow_template_stage_group_pic_id]  DEFAULT (NULL) FOR [group_pic_id]
GO
/****** Object:  Default [DF_m_workflow_template_stage_user_workflow_id]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template_stage] ADD  CONSTRAINT [DF_m_workflow_template_stage_user_workflow_id]  DEFAULT (NULL) FOR [user_workflow_id]
GO
/****** Object:  Default [DF_s_action_list_datasource]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[s_action_list] ADD  CONSTRAINT [DF_s_action_list_datasource]  DEFAULT ('default') FOR [datasource]
GO
/****** Object:  Default [DF_s_action_list_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[s_action_list] ADD  CONSTRAINT [DF_s_action_list_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_s_log_date]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[s_log] ADD  CONSTRAINT [DF_s_log_date]  DEFAULT (getdate()) FOR [date]
GO
/****** Object:  Default [DF_t_transaction_transaction_date]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction] ADD  CONSTRAINT [DF_t_transaction_transaction_date]  DEFAULT (getdate()) FOR [transaction_date]
GO
/****** Object:  Default [DF_t_transaction_source_app_id]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction] ADD  CONSTRAINT [DF_t_transaction_source_app_id]  DEFAULT ((1)) FOR [source_app_id]
GO
/****** Object:  Default [DF_t_transaction_is_policy_holder]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction] ADD  CONSTRAINT [DF_t_transaction_is_policy_holder]  DEFAULT ((1)) FOR [is_policy_holder]
GO
/****** Object:  Default [DF_t_transaction_is_notify_document_completion]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction] ADD  CONSTRAINT [DF_t_transaction_is_notify_document_completion]  DEFAULT ((1)) FOR [is_notify_document_completion]
GO
/****** Object:  Default [DF_t_transaction_source_transaction_id]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction] ADD  CONSTRAINT [DF_t_transaction_source_transaction_id]  DEFAULT ((1)) FOR [source_transaction_id]
GO
/****** Object:  Default [DF_t_transaction_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction] ADD  CONSTRAINT [DF_t_transaction_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_t_transaction_document_receive_doc_check]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_document] ADD  CONSTRAINT [DF_t_transaction_document_receive_doc_check]  DEFAULT ((0)) FOR [receive_doc_check]
GO
/****** Object:  Default [DF_t_transaction_form_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_form] ADD  CONSTRAINT [DF_t_transaction_form_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_t_transaction_form_log_created_date]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_form_log] ADD  CONSTRAINT [DF_t_transaction_form_log_created_date]  DEFAULT (getdate()) FOR [created_date]
GO
/****** Object:  Default [DF_t_transaction_form_log_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_form_log] ADD  CONSTRAINT [DF_t_transaction_form_log_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_t_transaction_history_process_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_history_process] ADD  CONSTRAINT [DF_t_transaction_history_process_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_t_transaction_history_workflow_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_history_workflow] ADD  CONSTRAINT [DF_t_transaction_history_workflow_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_t_transaction_log_source_transaction_id]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_log] ADD  CONSTRAINT [DF_t_transaction_log_source_transaction_id]  DEFAULT ((1)) FOR [source_transaction_id]
GO
/****** Object:  Default [DF_t_transaction_task_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_task] ADD  CONSTRAINT [DF_t_transaction_task_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  Default [DF_user_menu_access_is_exclude]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[user_menu_access] ADD  CONSTRAINT [DF_user_menu_access_is_exclude]  DEFAULT ((0)) FOR [is_exclude]
GO
/****** Object:  Default [DF_user_menu_access_created_date]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[user_menu_access] ADD  CONSTRAINT [DF_user_menu_access_created_date]  DEFAULT (getdate()) FOR [created_date]
GO
/****** Object:  Default [DF_user_menu_access_is_delete]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[user_menu_access] ADD  CONSTRAINT [DF_user_menu_access_is_delete]  DEFAULT ((0)) FOR [is_delete]
GO
/****** Object:  ForeignKey [FK_m_approv_matrix_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_approv_matrix]  WITH CHECK ADD  CONSTRAINT [FK_m_approv_matrix_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_approv_matrix] CHECK CONSTRAINT [FK_m_approv_matrix_status]
GO
/****** Object:  ForeignKey [FK_m_approv_matrix_detail_approv_matrix]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_approv_matrix_detail]  WITH CHECK ADD  CONSTRAINT [FK_m_approv_matrix_detail_approv_matrix] FOREIGN KEY([approv_matrix_id])
REFERENCES [dbo].[m_approv_matrix] ([approv_matrix_id])
GO
ALTER TABLE [dbo].[m_approv_matrix_detail] CHECK CONSTRAINT [FK_m_approv_matrix_detail_approv_matrix]
GO
/****** Object:  ForeignKey [FK_m_approv_matrix_detail_currency]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_approv_matrix_detail]  WITH CHECK ADD  CONSTRAINT [FK_m_approv_matrix_detail_currency] FOREIGN KEY([currency_id])
REFERENCES [dbo].[m_currency] ([currency_id])
GO
ALTER TABLE [dbo].[m_approv_matrix_detail] CHECK CONSTRAINT [FK_m_approv_matrix_detail_currency]
GO
/****** Object:  ForeignKey [FK_m_approv_matrix_detail_level_type]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_approv_matrix_detail]  WITH CHECK ADD  CONSTRAINT [FK_m_approv_matrix_detail_level_type] FOREIGN KEY([level_type_id])
REFERENCES [dbo].[m_level_type] ([level_type_id])
GO
ALTER TABLE [dbo].[m_approv_matrix_detail] CHECK CONSTRAINT [FK_m_approv_matrix_detail_level_type]
GO
/****** Object:  ForeignKey [FK_m_branch_city]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_branch]  WITH CHECK ADD  CONSTRAINT [FK_m_branch_city] FOREIGN KEY([city_id])
REFERENCES [dbo].[m_city] ([city_id])
GO
ALTER TABLE [dbo].[m_branch] CHECK CONSTRAINT [FK_m_branch_city]
GO
/****** Object:  ForeignKey [FK_m_branch_province]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_branch]  WITH CHECK ADD  CONSTRAINT [FK_m_branch_province] FOREIGN KEY([province_id])
REFERENCES [dbo].[m_province] ([province_id])
GO
ALTER TABLE [dbo].[m_branch] CHECK CONSTRAINT [FK_m_branch_province]
GO
/****** Object:  ForeignKey [FK_m_branch_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_branch]  WITH CHECK ADD  CONSTRAINT [FK_m_branch_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_branch] CHECK CONSTRAINT [FK_m_branch_status]
GO
/****** Object:  ForeignKey [FK_m_city_province]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_city]  WITH CHECK ADD  CONSTRAINT [FK_m_city_province] FOREIGN KEY([province_id])
REFERENCES [dbo].[m_province] ([province_id])
GO
ALTER TABLE [dbo].[m_city] CHECK CONSTRAINT [FK_m_city_province]
GO
/****** Object:  ForeignKey [FK_m_currency_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_currency]  WITH CHECK ADD  CONSTRAINT [FK_m_currency_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_currency] CHECK CONSTRAINT [FK_m_currency_status]
GO
/****** Object:  ForeignKey [FK_m_data_type_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_data_type]  WITH CHECK ADD  CONSTRAINT [FK_m_data_type_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_data_type] CHECK CONSTRAINT [FK_m_data_type_status]
GO
/****** Object:  ForeignKey [FK_m_document_type_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_document_type]  WITH CHECK ADD  CONSTRAINT [FK_m_document_type_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_document_type] CHECK CONSTRAINT [FK_m_document_type_status]
GO
/****** Object:  ForeignKey [FK_m_eform_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_eform] CHECK CONSTRAINT [FK_m_eform_status]
GO
/****** Object:  ForeignKey [FK_m_eform_transaction_type]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_transaction_type] FOREIGN KEY([transaction_type_id])
REFERENCES [dbo].[m_transaction_type] ([transaction_type_id])
GO
ALTER TABLE [dbo].[m_eform] CHECK CONSTRAINT [FK_m_eform_transaction_type]
GO
/****** Object:  ForeignKey [FK_m_eform_document_document]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_document]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_document_document] FOREIGN KEY([document_id])
REFERENCES [dbo].[m_document] ([document_id])
GO
ALTER TABLE [dbo].[m_eform_document] CHECK CONSTRAINT [FK_m_eform_document_document]
GO
/****** Object:  ForeignKey [FK_m_eform_document_eform]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_document]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_document_eform] FOREIGN KEY([eform_id])
REFERENCES [dbo].[m_eform] ([eform_id])
GO
ALTER TABLE [dbo].[m_eform_document] CHECK CONSTRAINT [FK_m_eform_document_eform]
GO
/****** Object:  ForeignKey [FK_m_eform_document_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_document]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_document_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_eform_document] CHECK CONSTRAINT [FK_m_eform_document_status]
GO
/****** Object:  ForeignKey [FK_m_eform_form_template_m_eform]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_form_template]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_form_template_m_eform] FOREIGN KEY([eform_id])
REFERENCES [dbo].[m_eform] ([eform_id])
GO
ALTER TABLE [dbo].[m_eform_form_template] CHECK CONSTRAINT [FK_m_eform_form_template_m_eform]
GO
/****** Object:  ForeignKey [FK_m_eform_form_template_m_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_form_template]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_form_template_m_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_eform_form_template] CHECK CONSTRAINT [FK_m_eform_form_template_m_status]
GO
/****** Object:  ForeignKey [FK_m_eform_form_template_m_transaction_form_template]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_form_template]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_form_template_m_transaction_form_template] FOREIGN KEY([transaction_form_template_id])
REFERENCES [dbo].[m_transaction_form_template] ([transaction_form_template_id])
GO
ALTER TABLE [dbo].[m_eform_form_template] CHECK CONSTRAINT [FK_m_eform_form_template_m_transaction_form_template]
GO
/****** Object:  ForeignKey [FK_m_eform_setting_eform]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_setting]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_setting_eform] FOREIGN KEY([eform_id])
REFERENCES [dbo].[m_eform] ([eform_id])
GO
ALTER TABLE [dbo].[m_eform_setting] CHECK CONSTRAINT [FK_m_eform_setting_eform]
GO
/****** Object:  ForeignKey [FK_m_eform_setting_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_setting]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_setting_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_eform_setting] CHECK CONSTRAINT [FK_m_eform_setting_status]
GO
/****** Object:  ForeignKey [FK_m_eform_setting_detail_component_type]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_setting_detail]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_setting_detail_component_type] FOREIGN KEY([component_type_id])
REFERENCES [dbo].[m_component_type] ([component_type_id])
GO
ALTER TABLE [dbo].[m_eform_setting_detail] CHECK CONSTRAINT [FK_m_eform_setting_detail_component_type]
GO
/****** Object:  ForeignKey [FK_m_eform_setting_detail_data_type]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_setting_detail]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_setting_detail_data_type] FOREIGN KEY([data_type_id])
REFERENCES [dbo].[m_data_type] ([data_type_id])
GO
ALTER TABLE [dbo].[m_eform_setting_detail] CHECK CONSTRAINT [FK_m_eform_setting_detail_data_type]
GO
/****** Object:  ForeignKey [FK_m_eform_setting_detail_eform_setting]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_setting_detail]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_setting_detail_eform_setting] FOREIGN KEY([eform_setting_id])
REFERENCES [dbo].[m_eform_setting] ([eform_setting_id])
GO
ALTER TABLE [dbo].[m_eform_setting_detail] CHECK CONSTRAINT [FK_m_eform_setting_detail_eform_setting]
GO
/****** Object:  ForeignKey [FK_m_eform_workflow_eform]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_workflow]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_workflow_eform] FOREIGN KEY([eform_id])
REFERENCES [dbo].[m_eform] ([eform_id])
GO
ALTER TABLE [dbo].[m_eform_workflow] CHECK CONSTRAINT [FK_m_eform_workflow_eform]
GO
/****** Object:  ForeignKey [FK_m_eform_workflow_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_workflow]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_workflow_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_eform_workflow] CHECK CONSTRAINT [FK_m_eform_workflow_status]
GO
/****** Object:  ForeignKey [FK_m_eform_workflow_workflow_template]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_eform_workflow]  WITH CHECK ADD  CONSTRAINT [FK_m_eform_workflow_workflow_template] FOREIGN KEY([workflow_template_id])
REFERENCES [dbo].[m_workflow_template] ([workflow_template_id])
GO
ALTER TABLE [dbo].[m_eform_workflow] CHECK CONSTRAINT [FK_m_eform_workflow_workflow_template]
GO
/****** Object:  ForeignKey [FK_m_group_menu_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_menu]  WITH CHECK ADD  CONSTRAINT [FK_m_group_menu_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_group_menu] CHECK CONSTRAINT [FK_m_group_menu_status]
GO
/****** Object:  ForeignKey [FK_m_group_menu_mapping_group_menu]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_menu_mapping]  WITH CHECK ADD  CONSTRAINT [FK_m_group_menu_mapping_group_menu] FOREIGN KEY([group_menu_id])
REFERENCES [dbo].[m_group_menu] ([group_menu_id])
GO
ALTER TABLE [dbo].[m_group_menu_mapping] CHECK CONSTRAINT [FK_m_group_menu_mapping_group_menu]
GO
/****** Object:  ForeignKey [FK_m_group_menu_mapping_menu]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_menu_mapping]  WITH CHECK ADD  CONSTRAINT [FK_m_group_menu_mapping_menu] FOREIGN KEY([menu_id])
REFERENCES [dbo].[m_menu] ([menu_id])
GO
ALTER TABLE [dbo].[m_group_menu_mapping] CHECK CONSTRAINT [FK_m_group_menu_mapping_menu]
GO
/****** Object:  ForeignKey [FK_m_group_menu_mapping_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_menu_mapping]  WITH CHECK ADD  CONSTRAINT [FK_m_group_menu_mapping_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_group_menu_mapping] CHECK CONSTRAINT [FK_m_group_menu_mapping_status]
GO
/****** Object:  ForeignKey [FK_m_group_pic_m_group_pic]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_pic]  WITH CHECK ADD  CONSTRAINT [FK_m_group_pic_m_group_pic] FOREIGN KEY([group_pic_id])
REFERENCES [dbo].[m_group_pic] ([group_pic_id])
GO
ALTER TABLE [dbo].[m_group_pic] CHECK CONSTRAINT [FK_m_group_pic_m_group_pic]
GO
/****** Object:  ForeignKey [FK_m_group_pic_detail_group_pic]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_group_pic_detail]  WITH CHECK ADD  CONSTRAINT [FK_m_group_pic_detail_group_pic] FOREIGN KEY([group_pic_id])
REFERENCES [dbo].[m_group_pic] ([group_pic_id])
GO
ALTER TABLE [dbo].[m_group_pic_detail] CHECK CONSTRAINT [FK_m_group_pic_detail_group_pic]
GO
/****** Object:  ForeignKey [FK_m_level_type_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_level_type]  WITH CHECK ADD  CONSTRAINT [FK_m_level_type_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_level_type] CHECK CONSTRAINT [FK_m_level_type_status]
GO
/****** Object:  ForeignKey [FK_m_menu_m_menu]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_menu]  WITH CHECK ADD  CONSTRAINT [FK_m_menu_m_menu] FOREIGN KEY([menu_id_parent])
REFERENCES [dbo].[m_menu] ([menu_id])
GO
ALTER TABLE [dbo].[m_menu] CHECK CONSTRAINT [FK_m_menu_m_menu]
GO
/****** Object:  ForeignKey [FK_m_menu_m_menu_category]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_menu]  WITH CHECK ADD  CONSTRAINT [FK_m_menu_m_menu_category] FOREIGN KEY([menu_category_id])
REFERENCES [dbo].[m_menu_category] ([menu_category_id])
GO
ALTER TABLE [dbo].[m_menu] CHECK CONSTRAINT [FK_m_menu_m_menu_category]
GO
/****** Object:  ForeignKey [FK_m_organization_level_type]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_organization]  WITH CHECK ADD  CONSTRAINT [FK_m_organization_level_type] FOREIGN KEY([level_type_id])
REFERENCES [dbo].[m_level_type] ([level_type_id])
GO
ALTER TABLE [dbo].[m_organization] CHECK CONSTRAINT [FK_m_organization_level_type]
GO
/****** Object:  ForeignKey [FK_m_organization_m_organization]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_organization]  WITH CHECK ADD  CONSTRAINT [FK_m_organization_m_organization] FOREIGN KEY([organization_id_parent])
REFERENCES [dbo].[m_organization] ([organization_id])
GO
ALTER TABLE [dbo].[m_organization] CHECK CONSTRAINT [FK_m_organization_m_organization]
GO
/****** Object:  ForeignKey [FK_m_organization_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_organization]  WITH CHECK ADD  CONSTRAINT [FK_m_organization_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_organization] CHECK CONSTRAINT [FK_m_organization_status]
GO
/****** Object:  ForeignKey [FK_m_reason_reason_category]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_reason]  WITH CHECK ADD  CONSTRAINT [FK_m_reason_reason_category] FOREIGN KEY([reason_category_id])
REFERENCES [dbo].[m_reason_category] ([reason_category_id])
GO
ALTER TABLE [dbo].[m_reason] CHECK CONSTRAINT [FK_m_reason_reason_category]
GO
/****** Object:  ForeignKey [FK_m_reason_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_reason]  WITH CHECK ADD  CONSTRAINT [FK_m_reason_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_reason] CHECK CONSTRAINT [FK_m_reason_status]
GO
/****** Object:  ForeignKey [FK_m_reason_category_status]    Script Date: 11/10/2017 16:09:29 ******/
ALTER TABLE [dbo].[m_reason_category]  WITH CHECK ADD  CONSTRAINT [FK_m_reason_category_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_reason_category] CHECK CONSTRAINT [FK_m_reason_category_status]
GO
/****** Object:  ForeignKey [FK_m_transaction_type_transaction_category]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_transaction_type]  WITH CHECK ADD  CONSTRAINT [FK_m_transaction_type_transaction_category] FOREIGN KEY([transaction_category_id])
REFERENCES [dbo].[m_transaction_category] ([transaction_category_id])
GO
ALTER TABLE [dbo].[m_transaction_type] CHECK CONSTRAINT [FK_m_transaction_type_transaction_category]
GO
/****** Object:  ForeignKey [FK_m_user_status]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user]  WITH CHECK ADD  CONSTRAINT [FK_m_user_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_user] CHECK CONSTRAINT [FK_m_user_status]
GO
/****** Object:  ForeignKey [FK_m_user_menu_group_menu]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_menu]  WITH CHECK ADD  CONSTRAINT [FK_m_user_menu_group_menu] FOREIGN KEY([group_menu_id])
REFERENCES [dbo].[m_group_menu] ([group_menu_id])
GO
ALTER TABLE [dbo].[m_user_menu] CHECK CONSTRAINT [FK_m_user_menu_group_menu]
GO
/****** Object:  ForeignKey [FK_m_user_menu_status]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_menu]  WITH CHECK ADD  CONSTRAINT [FK_m_user_menu_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_user_menu] CHECK CONSTRAINT [FK_m_user_menu_status]
GO
/****** Object:  ForeignKey [FK_m_user_menu_mapping_m_menu]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_menu_mapping]  WITH CHECK ADD  CONSTRAINT [FK_m_user_menu_mapping_m_menu] FOREIGN KEY([menu_id])
REFERENCES [dbo].[m_menu] ([menu_id])
GO
ALTER TABLE [dbo].[m_user_menu_mapping] CHECK CONSTRAINT [FK_m_user_menu_mapping_m_menu]
GO
/****** Object:  ForeignKey [FK_m_user_organization_organization]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_organization]  WITH CHECK ADD  CONSTRAINT [FK_m_user_organization_organization] FOREIGN KEY([organization_id])
REFERENCES [dbo].[m_organization] ([organization_id])
GO
ALTER TABLE [dbo].[m_user_organization] CHECK CONSTRAINT [FK_m_user_organization_organization]
GO
/****** Object:  ForeignKey [FK_m_user_organization_status]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_user_organization]  WITH CHECK ADD  CONSTRAINT [FK_m_user_organization_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_user_organization] CHECK CONSTRAINT [FK_m_user_organization_status]
GO
/****** Object:  ForeignKey [FK_m_workflow_template_status]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template]  WITH CHECK ADD  CONSTRAINT [FK_m_workflow_template_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_status] ([status_id])
GO
ALTER TABLE [dbo].[m_workflow_template] CHECK CONSTRAINT [FK_m_workflow_template_status]
GO
/****** Object:  ForeignKey [FK_m_workflow_template_action_reason_category]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template_action]  WITH CHECK ADD  CONSTRAINT [FK_m_workflow_template_action_reason_category] FOREIGN KEY([reason_category_id])
REFERENCES [dbo].[m_reason_category] ([reason_category_id])
GO
ALTER TABLE [dbo].[m_workflow_template_action] CHECK CONSTRAINT [FK_m_workflow_template_action_reason_category]
GO
/****** Object:  ForeignKey [FK_m_workflow_template_action_status]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template_action]  WITH CHECK ADD  CONSTRAINT [FK_m_workflow_template_action_status] FOREIGN KEY([transaction_status_id])
REFERENCES [dbo].[m_transaction_status] ([transaction_status_id])
GO
ALTER TABLE [dbo].[m_workflow_template_action] CHECK CONSTRAINT [FK_m_workflow_template_action_status]
GO
/****** Object:  ForeignKey [FK_m_workflow_template_action_workflow_template]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template_action]  WITH CHECK ADD  CONSTRAINT [FK_m_workflow_template_action_workflow_template] FOREIGN KEY([workflow_template_id])
REFERENCES [dbo].[m_workflow_template] ([workflow_template_id])
GO
ALTER TABLE [dbo].[m_workflow_template_action] CHECK CONSTRAINT [FK_m_workflow_template_action_workflow_template]
GO
/****** Object:  ForeignKey [FK_m_workflow_template_action_workflow_template_stage]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template_action]  WITH CHECK ADD  CONSTRAINT [FK_m_workflow_template_action_workflow_template_stage] FOREIGN KEY([workflow_template_stage_id])
REFERENCES [dbo].[m_workflow_template_stage] ([workflow_template_stage_id])
GO
ALTER TABLE [dbo].[m_workflow_template_action] CHECK CONSTRAINT [FK_m_workflow_template_action_workflow_template_stage]
GO
/****** Object:  ForeignKey [FK_m_workflow_template_stage_m_group_pic]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[m_workflow_template_stage]  WITH CHECK ADD  CONSTRAINT [FK_m_workflow_template_stage_m_group_pic] FOREIGN KEY([group_pic_id])
REFERENCES [dbo].[m_group_pic] ([group_pic_id])
GO
ALTER TABLE [dbo].[m_workflow_template_stage] CHECK CONSTRAINT [FK_m_workflow_template_stage_m_group_pic]
GO
/****** Object:  ForeignKey [FK_t_transaction_currency]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_currency] FOREIGN KEY([currency_id])
REFERENCES [dbo].[m_currency] ([currency_id])
GO
ALTER TABLE [dbo].[t_transaction] CHECK CONSTRAINT [FK_t_transaction_currency]
GO
/****** Object:  ForeignKey [FK_t_transaction_m_user]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_m_user] FOREIGN KEY([transaction_id])
REFERENCES [dbo].[t_transaction] ([transaction_id])
GO
ALTER TABLE [dbo].[t_transaction] CHECK CONSTRAINT [FK_t_transaction_m_user]
GO
/****** Object:  ForeignKey [FK_t_transaction_source_app]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_source_app] FOREIGN KEY([source_app_id])
REFERENCES [dbo].[m_source_app] ([source_app_id])
GO
ALTER TABLE [dbo].[t_transaction] CHECK CONSTRAINT [FK_t_transaction_source_app]
GO
/****** Object:  ForeignKey [FK_t_transaction_status]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_transaction_status] ([transaction_status_id])
GO
ALTER TABLE [dbo].[t_transaction] CHECK CONSTRAINT [FK_t_transaction_status]
GO
/****** Object:  ForeignKey [FK_t_transaction_transaction_type]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_transaction_type] FOREIGN KEY([transaction_type_id])
REFERENCES [dbo].[m_transaction_type] ([transaction_type_id])
GO
ALTER TABLE [dbo].[t_transaction] CHECK CONSTRAINT [FK_t_transaction_transaction_type]
GO
/****** Object:  ForeignKey [FK_t_transaction_workflow_template_stage]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_workflow_template_stage] FOREIGN KEY([workflow_template_stage_id])
REFERENCES [dbo].[m_workflow_template_stage] ([workflow_template_stage_id])
GO
ALTER TABLE [dbo].[t_transaction] CHECK CONSTRAINT [FK_t_transaction_workflow_template_stage]
GO
/****** Object:  ForeignKey [FK_t_transaction_document_transaction]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_document]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_document_transaction] FOREIGN KEY([transaction_id])
REFERENCES [dbo].[t_transaction] ([transaction_id])
GO
ALTER TABLE [dbo].[t_transaction_document] CHECK CONSTRAINT [FK_t_transaction_document_transaction]
GO
/****** Object:  ForeignKey [FK_t_transaction_document_file_transaction_document]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_document_file]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_document_file_transaction_document] FOREIGN KEY([transaction_document_id])
REFERENCES [dbo].[t_transaction_document] ([transaction_document_id])
GO
ALTER TABLE [dbo].[t_transaction_document_file] CHECK CONSTRAINT [FK_t_transaction_document_file_transaction_document]
GO
/****** Object:  ForeignKey [FK_t_transaction_document_file_history_transaction_document_file]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_document_file_history]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_document_file_history_transaction_document_file] FOREIGN KEY([transaction_document_file_id])
REFERENCES [dbo].[t_transaction_document_file] ([transaction_document_file_id])
GO
ALTER TABLE [dbo].[t_transaction_document_file_history] CHECK CONSTRAINT [FK_t_transaction_document_file_history_transaction_document_file]
GO
/****** Object:  ForeignKey [FK_t_transaction_document_file_history_user]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_document_file_history]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_document_file_history_user] FOREIGN KEY([user_id])
REFERENCES [dbo].[m_user] ([user_id])
GO
ALTER TABLE [dbo].[t_transaction_document_file_history] CHECK CONSTRAINT [FK_t_transaction_document_file_history_user]
GO
/****** Object:  ForeignKey [FK_t_transaction_document_file_history_workflow_template_stage]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_document_file_history]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_document_file_history_workflow_template_stage] FOREIGN KEY([workflow_template_stage_id])
REFERENCES [dbo].[m_workflow_template_stage] ([workflow_template_stage_id])
GO
ALTER TABLE [dbo].[t_transaction_document_file_history] CHECK CONSTRAINT [FK_t_transaction_document_file_history_workflow_template_stage]
GO
/****** Object:  ForeignKey [FK_t_transaction_history_process_reason]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_history_process]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_history_process_reason] FOREIGN KEY([reason_id])
REFERENCES [dbo].[m_reason] ([reason_id])
GO
ALTER TABLE [dbo].[t_transaction_history_process] CHECK CONSTRAINT [FK_t_transaction_history_process_reason]
GO
/****** Object:  ForeignKey [FK_t_transaction_history_process_transaction]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_history_process]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_history_process_transaction] FOREIGN KEY([transaction_id])
REFERENCES [dbo].[t_transaction] ([transaction_id])
GO
ALTER TABLE [dbo].[t_transaction_history_process] CHECK CONSTRAINT [FK_t_transaction_history_process_transaction]
GO
/****** Object:  ForeignKey [FK_t_transaction_history_workflow_transaction]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_history_workflow]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_history_workflow_transaction] FOREIGN KEY([transaction_id])
REFERENCES [dbo].[t_transaction] ([transaction_id])
GO
ALTER TABLE [dbo].[t_transaction_history_workflow] CHECK CONSTRAINT [FK_t_transaction_history_workflow_transaction]
GO
/****** Object:  ForeignKey [FK_t_transaction_history_workflow_workflow_template_stage]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_history_workflow]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_history_workflow_workflow_template_stage] FOREIGN KEY([workflow_template_stage_id])
REFERENCES [dbo].[m_workflow_template_stage] ([workflow_template_stage_id])
GO
ALTER TABLE [dbo].[t_transaction_history_workflow] CHECK CONSTRAINT [FK_t_transaction_history_workflow_workflow_template_stage]
GO
/****** Object:  ForeignKey [FK_t_transaction_task_status]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_task]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_task_status] FOREIGN KEY([status_id])
REFERENCES [dbo].[m_transaction_task_status] ([id])
GO
ALTER TABLE [dbo].[t_transaction_task] CHECK CONSTRAINT [FK_t_transaction_task_status]
GO
/****** Object:  ForeignKey [FK_t_transaction_task_transaction]    Script Date: 11/10/2017 16:09:30 ******/
ALTER TABLE [dbo].[t_transaction_task]  WITH CHECK ADD  CONSTRAINT [FK_t_transaction_task_transaction] FOREIGN KEY([transaction_id])
REFERENCES [dbo].[t_transaction] ([transaction_id])
GO
ALTER TABLE [dbo].[t_transaction_task] CHECK CONSTRAINT [FK_t_transaction_task_transaction]
GO




USE [db_edits]
GO
/****** Object:  View [dbo].[v_m_transaction_document_files]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_m_transaction_document_files]
AS
  SELECT
    ttd.transaction_document_id,  -- id master
    ttdf.transaction_document_file_id,  -- id detail
    ttd.transaction_id,
    ttd.document_type_id,
    ttd.token AS token,
    ttd.hashcode AS final_hashcode,
    ttd.document_index AS final_document_index,
    ttd.document_name AS final_document_name,
    ttdf.document_name,
    ttdf.document_url,
    ttdf.hashcode_ori,
    ttdf.hashcode,
    ttdf.upload_by,
    ttdf.upload_date,
    CONVERT(varchar, ttdf.upload_date, 103) +' '+ CONVERT(varchar(15),CAST(ttdf.upload_date AS TIME),108) AS upload_date_str
  FROM
	  dbo.t_transaction_document AS ttd INNER JOIN
	  dbo.t_transaction_document_file AS ttdf ON ttd.transaction_document_id = ttdf.transaction_document_id
  WHERE
    ttd.is_delete = '0'
    AND ttdf.is_delete = '0'
GO
/****** Object:  View [dbo].[v_m_workflow_template_stage]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_m_workflow_template_stage]
AS

SELECT
	wts.workflow_template_stage_id, 
	wts.workflow_template_id,
	wt.description AS workflow_template_desc,  
	wts.description, 
	wts.is_stage_approval, 
	wts.approv_matrix_id, 
	am.description AS approv_matrix_desc,
	wts.pic_is_requester, 
	wts.group_pic_id,
	wts.user_workflow_id,
	CASE WHEN wts.user_workflow_id = 1 THEN 'Requester'
		 WHEN wts.user_workflow_id = 2 THEN 'Head Requester'
		 WHEN wts.approv_matrix_id IS NOT NULL  THEN 'Approver'
		 WHEN wts.pic_is_requester = 1 THEN 'Requester'
	ELSE gp.description
	END AS pic_desc,
	--gp.description AS pic_desc, 
	wts.can_edit_information, 
	wts.can_upload_document, 
	wts.can_delete_document, 
	wts.seq_number

FROM 	
	m_workflow_template_stage AS wts
	INNER JOIN dbo.m_workflow_template wt ON wts.workflow_template_id = wt.workflow_template_id AND wt.is_delete = 0
	LEFT JOIN dbo.m_group_pic gp ON gp.group_pic_id = wts.group_pic_id AND gp.is_delete = 0
	LEFT JOIN dbo.m_approv_matrix am ON am.approv_matrix_id = wts.approv_matrix_id AND gp.is_delete = 0
WHERE
	wts.is_delete = 0
GO
/****** Object:  View [dbo].[v_user_group_menu]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_user_group_menu] AS
SELECT m.id
      ,m.user_id
      ,m.group_menu_id
      ,m.created_by
      ,m.created_date
      ,m.modified_by
      ,m.modified_date
      ,m.is_delete
	  ,g.description
  FROM m_user_group_menu_mapping m
  JOIN m_group_menu g ON g.group_menu_id = m.group_menu_id
  WHERE g.status_id = 5
  AND g.is_delete = '0'
  AND m.is_delete = '0'
  AND g.is_delete = 0
GO
/****** Object:  UserDefinedFunction [dbo].[func_is_document_complete]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by: Pribadi Pamungkas. 2017-10-04
CREATE FUNCTION [dbo].[func_is_document_complete]
(
	@pi_transaction_id BIGINT
)
RETURNS BIT
AS
BEGIN
	DECLARE 
	  @v_min_valid BIT,
	  @v_max_valid BIT,
	  @v_hasil BIT

  SELECT
    @v_min_valid = CASE
                      WHEN med.minimum_files > 0 THEN CASE  -- jika minimum dibatasi
                                                        WHEN COALESCE(df.jumlah_file,0) >= med.minimum_files THEN 1 -- jika yg diupload lebih besar atau sama dengan minimum, maka benar
                                                        ELSE 0                                                      -- jika tidak, maka salah
                                                      END
                      ELSE 1  -- jika minimum tidak dibatasi, maka benar
                    END,
    @v_max_valid = CASE
                      WHEN med.maximum_files > 0 THEN CASE  -- jika maksimum dibatasi
                                                        WHEN COALESCE(df.jumlah_file,0) <= med.maximum_files THEN 1 -- jika yg diupload lebih sedikit atau sama dengan maksimum, maka benar
                                                        ELSE 0                                                      -- jika tidak, maka salah
                                                      END
                      ELSE 1  -- jika maksimum tidak dibatasi, maka benar
                    END
  FROM
    dbo.t_transaction AS t
    INNER JOIN 
    dbo.m_eform AS me ON t.transaction_type_id = me.transaction_type_id
    INNER JOIN 
    dbo.m_eform_document AS med ON me.eform_id = med.eform_id
    INNER JOIN 
    dbo.m_document AS md ON med.document_id = md.document_id
    INNER JOIN
    (
      SELECT
	      ttd.transaction_id,
	      ttd.document_type_id,
	      COUNT(*) AS jumlah_file
      FROM
	      t_transaction_document AS ttd INNER JOIN
	      t_transaction_document_file AS ttdf ON ttd.transaction_document_id = ttdf.transaction_document_id
      WHERE
        ttd.is_delete = '0'
        AND ttdf.is_delete = '0'
      GROUP BY
	      ttd.transaction_id,
	      ttd.document_type_id
    ) AS df ON t.transaction_id = df.transaction_id
               AND md.document_id = df.document_type_id
  WHERE
    (t.is_delete = 0)
    AND (me.is_delete = '0')
    AND (med.is_delete = '0')
    AND (md.is_delete = '0')
    AND t.transaction_id = @pi_transaction_id
  IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			SET @v_hasil = 0
	ELSE
	  BEGIN
      IF @v_min_valid=1 AND @v_max_valid=1
        SET @v_hasil = 1
      ELSE
        SET @v_hasil = 0
    END

	RETURN @v_hasil

END
GO
/****** Object:  UserDefinedFunction [dbo].[func_get_latest_transaction_action]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION [dbo].[func_get_latest_transaction_action] 
(
	@pi_transaction_id BIGINT
)
RETURNS BIGINT
AS
BEGIN
	-- Declare the return variable here
	DECLARE @pi_action_id BIGINT;

	SELECT TOP 1 
	@pi_action_id = workflow_template_action_id
	FROM t_transaction_history_process
	WHERE transaction_id = @pi_transaction_id
	ORDER BY created_date DESC

	-- Return the result of the function
	RETURN @pi_action_id;

END
GO
/****** Object:  View [dbo].[v_get_transaction_all]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_get_transaction_all] AS

SELECT
  t.transaction_id,
  t.transaction_type_id,
  t.register_number,
  t.transaction_date,
  t.source_app_id,
  t.policy_id_reference,
  t.policy_holder_reference,
  t.product_name_reference,
  t.currency_id_reference,
  t.is_policy_holder,
  t.customer,
  t.address,
  t.mobile_phone,
  t.email_address,
  t.signature_url,
  t.photo_url,
  t.reference_number,
  t.currency_id,
  t.currency_code,
  t.transaction_value,
  t.is_notify_document_completion,
  t.notification_date,
  t.workflow_template_stage_id,
  t.user_id,
  t.branch_id,
  t.status_id,
  t.created_by,
  t.created_date,
  t.modified_by,
  t.modified_date,
  t.is_delete,
  y.description AS type_desc,
  st.description AS stage_desc,
  b.description AS branch_desc,
  u.username AS user_username,
  u.user_fullname AS user_userfullname,
  ts.description AS status_desc,
  dbo.func_is_document_complete(t.transaction_id) AS document_valid,
  dbo.func_get_latest_transaction_action(t.transaction_id) AS last_action_id,
  st.can_edit_information,
  st.can_upload_document,
  st.can_delete_document,
  t.source_transaction_id
FROM
  dbo.t_transaction AS t
  INNER JOIN 
  dbo.m_transaction_type AS y ON y.transaction_type_id = t.transaction_type_id
  INNER JOIN 
  dbo.m_workflow_template_stage AS st ON st.workflow_template_stage_id = t.workflow_template_stage_id
  LEFT JOIN 
  dbo.m_branch AS b ON b.branch_id = t.branch_id
  INNER JOIN 
  dbo.m_user AS u ON u.username = t.user_id
  INNER JOIN 
  dbo.m_transaction_status AS ts ON t.status_id = ts.transaction_status_id
GO
/****** Object:  View [dbo].[v_t_transaction_history_process]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_t_transaction_history_process] AS
SELECT
	th.transaction_history_process_id, 
	th.transaction_id,
	t.register_number,
	t.transaction_date,
	t.policy_id_reference,
	t.policy_holder_reference,
	t.status_desc,
	t.type_desc,
	t.stage_desc,
	th.process_date, 
	th.user_id,
	u.user_fullname, 
	th.workflow_template_action_id, 
	wt.description AS workflow_action_desc,
	th.action_description,
	th.reason_id,
	r.description AS reason_desc, 
	th.remarks,  
	th.is_delete
FROM
	t_transaction_history_process AS th
	LEFT JOIN
	v_get_transaction_all AS t ON t.transaction_id = th.transaction_id
	LEFT JOIN
	dbo.m_workflow_template_action wt ON wt.workflow_template_action_id = th.workflow_template_action_id
	LEFT JOIN
	dbo.m_reason AS r ON r.reason_id = th.reason_id
	LEFT JOIN
	dbo.m_user AS u ON u.username = th.user_id
WHERE 
	th.is_delete = 0 and
	u.is_delete in (0,99)
GO
/****** Object:  View [dbo].[v_t_receipt_form]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by Pribadi Pamungkas. 2017-10-10
-- last modified by Pribadi Pamungkas. 2017-11-01. Tambah alamat, kota, dan propinsi cabang
CREATE VIEW [dbo].[v_t_receipt_form]
AS
    SELECT
      tt.transaction_id,
      mb.description AS elise,
      mb.address AS elise_address,
      ct.city_name,
      pv.province_name,
      CONVERT(varchar, tt.transaction_date, 103) +' '+ CONVERT(varchar(15),CAST(tt.transaction_date AS TIME),108) AS tanggal,
      tt.register_number AS no_registrasi,
      mt.description AS jenis_transaksi,
      tt.policy_id_reference,
      tt.policy_holder_reference,
      mt.footnote_receipt_form
    FROM
	    dbo.t_transaction AS tt INNER JOIN
	    dbo.m_branch AS mb ON tt.branch_id = mb.branch_id INNER JOIN
	    dbo.m_transaction_type AS mt ON tt.transaction_type_id = mt.transaction_type_id LEFT JOIN
	    dbo.m_city AS ct ON mb.city_id = ct.city_id LEFT JOIN
	    dbo.m_province AS pv ON mb.province_id = pv.province_id
    WHERE
      tt.is_delete = 0
      AND mb.is_delete = '0'
      AND mt.is_delete = '0'
GO
/****** Object:  View [dbo].[v_m_transaction_document]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_m_transaction_document]
AS
SELECT
  t.transaction_id,
  md.document_id,
  md.document_code,
  md.description,
  md.remarks,
  med.eform_document_id,
  med.eform_id,
  med.minimum_files,
  med.maximum_files,
  med.seq_number,
  med.status_id,
  COALESCE(df.jumlah_file,0) AS jumlah_file
FROM
  dbo.t_transaction AS t
  INNER JOIN 
  dbo.m_eform AS me ON t.transaction_type_id = me.transaction_type_id
  INNER JOIN 
  dbo.m_eform_document AS med ON me.eform_id = med.eform_id
  INNER JOIN 
  dbo.m_document AS md ON med.document_id = md.document_id
  LEFT JOIN
  (
    SELECT
	    ttd.transaction_id,
	    ttd.document_type_id,
	    COUNT(*) AS jumlah_file
    FROM
	    t_transaction_document AS ttd INNER JOIN
	    t_transaction_document_file AS ttdf ON ttd.transaction_document_id = ttdf.transaction_document_id
    WHERE
      ttd.is_delete = '0'
      AND ttdf.is_delete = '0'
    GROUP BY
	    ttd.transaction_id,
	    ttd.document_type_id
  ) AS df ON t.transaction_id = df.transaction_id
             AND md.document_id = df.document_type_id
WHERE
  (t.is_delete = 0)
  AND (me.is_delete = '0')
  AND (med.is_delete = '0')
  AND (md.is_delete = '0')
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 = "t"
            Begin Extent = 
               Top = 0
               Left = 0
               Bottom = 339
               Right = 240
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "me"
            Begin Extent = 
               Top = 6
               Left = 316
               Bottom = 125
               Right = 507
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "med"
            Begin Extent = 
               Top = 6
               Left = 545
               Bottom = 125
               Right = 729
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "md"
            Begin Extent = 
               Top = 6
               Left = 767
               Bottom = 125
               Right = 932
            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'v_m_transaction_document'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'v_m_transaction_document'
GO
/****** Object:  View [dbo].[v_m_approv_matrix_detail]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_m_approv_matrix_detail]
AS
    SELECT  amd.approv_matrix_detail_id ,
            amd.approv_matrix_id ,
            amd.maximum_value ,
            amd.level_type_id ,
            lt.head_description AS level_type_desc, 
            amd.currency_id,
			cu.currency_code,
			cu.description as currency_description

    FROM    m_approv_matrix_detail amd
            INNER JOIN m_level_type lt ON lt.level_type_id = amd.level_type_id
			left JOIN m_currency cu on cu.currency_id =  amd.currency_id
    WHERE   lt.is_delete = 0
            AND amd.is_delete = 0
GO
/****** Object:  View [dbo].[v_group_menu]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_group_menu] AS
SELECT 
	m.menu_id,
	m.description AS menu_desc,
	m.menu_category_id,
	c.description AS cat_desc,
	m.url,
	m.level,
	m.menu_id_parent,
	m.created_by,
	m.created_date,
	m.modified_by,
	m.modified_date,
	g.group_menu_id,
	g.group_menu_code,
	g.description AS group_desc,
	p1.group_menu_mapping_id
FROM m_menu m
INNER JOIN m_menu_category c ON c.menu_category_id = m.menu_category_id
INNER JOIN m_group_menu_mapping p1 ON p1.menu_id = m.menu_id
INNER JOIN m_group_menu g ON g.group_menu_id = p1.group_menu_id
WHERE m.is_delete = 0
AND c.is_delete = 0
AND p1.is_delete = 0
AND g.is_delete = 0
GO
/****** Object:  View [dbo].[v_organization]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_organization]
AS SELECT 
	dbo.m_organization.organization_id, 
	dbo.m_organization.organization_code, 
	dbo.m_organization.description, 
	dbo.m_organization.level_type_id, 
    dbo.m_organization.organization_id_parent, 
	dbo.m_organization.status_id, 
	dbo.m_organization.is_delete, 
	dbo.m_status.status_code, 
    dbo.m_status.description AS status_desc, 
	m_organization_1.description AS parent_desc, 
	m_organization_1.organization_code AS parent_code, 
	m_organization_1.level_type_id AS parent_level,
	dbo.m_level_type.level_type_code, 
    dbo.m_level_type.description AS level_desc, 
	dbo.m_level_type.head_description, 
	dbo.m_level_type.seq_number,
	(
		SELECT COUNT(organization_id) 
		FROM m_organization 
		WHERE organization_id_parent = dbo.m_organization.organization_id
		AND status_id = 5 AND is_delete = 0
		) AS has_child,
	dbo.m_user.username,
	dbo.m_user.user_fullname
FROM dbo.m_organization 
INNER JOIN
	dbo.m_level_type ON dbo.m_organization.level_type_id = dbo.m_level_type.level_type_id 
LEFT OUTER JOIN
    dbo.m_organization AS m_organization_1 ON dbo.m_organization.organization_id_parent = m_organization_1.organization_id 
INNER JOIN
    dbo.m_status ON dbo.m_organization.status_id = dbo.m_status.status_id
LEFT JOIN dbo.m_user ON dbo.m_user.username = dbo.m_organization.user_id_head
GO
/****** Object:  View [dbo].[v_m_workflow_template_action]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--USE DB_EDITS

CREATE VIEW [dbo].[v_m_workflow_template_action]
 AS
	SELECT 
		wta.workflow_template_action_id, 
		wta.workflow_template_stage_id, 
		wts.description AS workflow_template_stage_desc,
		wta.description, 
		wta.is_final_action, 
		wta.workflow_template_id, 
		wt.description AS workflow_template_desc,
		wta.destination_stage_id,
		wtss.description AS destination_stage_desc,
		wta.is_send_notif_to_requester, 
		wta.is_send_notif_to_next_pic, 
		wta.is_notif_document_completion, 
		wta.is_check_mandatory_document, 
		wta.is_remarks_mandatory,
		wta.is_fill_reference_number, 
		wta.is_check_transaction_status_core,
		wta.code_transaction_status,
		wta.is_need_reason, 
		wta.reason_category_id, 
		wta.transaction_status_id, 
		wta.is_delete,
		r.description AS reason_desc
	FROM m_workflow_template_action wta
	INNER JOIN dbo.m_workflow_template wt ON wt.workflow_template_id = wta.workflow_template_id AND wt.is_delete = 0
	LEFT JOIN dbo.m_workflow_template_stage wts ON wts.workflow_template_stage_id = wta.workflow_template_stage_id AND wts.is_delete = 0
	LEFT JOIN dbo.m_workflow_template_stage wtss ON wta.destination_stage_id = wtss.workflow_template_stage_id AND wtss.is_delete = 0
	LEFT JOIN dbo.m_reason_category r ON r.reason_category_id = wta.reason_category_id
	WHERE wta.is_delete = 0
GO
/****** Object:  UserDefinedFunction [dbo].[func_list_branch]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by Pribadi Pamungkas. 2017-08-07
CREATE FUNCTION [dbo].[func_list_branch]
(	
	@pi_branch_id VARCHAR(5)
)
RETURNS TABLE 
AS
RETURN 
(
  SELECT
  	*
  FROM
  	dbo.m_branch
  WHERE
    --branch_id = CAST((CASE @pi_branch_id WHEN '*' THEN '0' ELSE @pi_branch_id END) AS INT)
    branch_id = CAST(REPLACE(@pi_branch_id,'*','0') AS INT)
    OR @pi_branch_id = '*'
)
GO
/****** Object:  UserDefinedFunction [dbo].[func_list_transaction_type]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by Pribadi Pamungkas. 2017-08-07
CREATE FUNCTION [dbo].[func_list_transaction_type]
(	
	@pi_transaction_type_id VARCHAR(5)
)
RETURNS TABLE 
AS
RETURN 
(
  SELECT
  	*
  FROM
  	dbo.m_transaction_type
  WHERE
    --transaction_type_id = CAST((CASE @pi_transaction_type_id WHEN '*' THEN '0' ELSE @pi_transaction_type_id END) AS INT)
    transaction_type_id = CAST(REPLACE(@pi_transaction_type_id,'*','0') AS INT)
    OR @pi_transaction_type_id = '*'
)
GO
/****** Object:  View [dbo].[v_m_group_pic_detail]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_m_group_pic_detail]
AS
    --SELECT
    --  gpd.group_pic_detail_id,
    --  gpd.group_pic_id,
    --  gpd.branch_id,
    --  bra.description AS branch_desc,
    --  gpd.transaction_type_id,
    --  trt.description AS transaction_desc,
    --  gpd.user_id_group_pic_detail,
    --  usr.user_fullname,
    --  gpd.is_delete
    --FROM
    --  dbo.m_group_pic_detail AS gpd
    --  INNER JOIN 
    --  dbo.m_group_pic AS gpi ON gpd.group_pic_id = gpi.group_pic_id
    --  INNER JOIN 
    --  dbo.m_branch AS bra ON gpd.branch_id = bra.branch_id
    --  INNER JOIN 
    --  dbo.m_transaction_type AS trt ON gpd.transaction_type_id = trt.transaction_type_id
    --  INNER JOIN 
    --  dbo.m_user AS usr ON gpd.user_id_group_pic_detail = usr.user_id
    --WHERE
    --  gpd.is_delete = '0'
    --  AND gpi.is_delete = '0'
    --  AND bra.is_delete = '0'
    --  AND trt.is_delete = '0'

    SELECT DISTINCT
      gpd.group_pic_detail_id,
      gpd.group_pic_id,
      gpd.branch_id,
      --flb.branch_id,
      --flb.description AS branch_desc,
      CASE gpd.branch_id
        WHEN '*' THEN 'All'
        ELSE flb.description
      END AS branch_desc,
      gpd.transaction_type_id,
      --fltt.transaction_type_id,
      --fltt.description AS transaction_desc,
      CASE gpd.transaction_type_id
        WHEN '*' THEN 'All'
        ELSE fltt.description
      END AS transaction_desc,
      gpd.user_id_group_pic_detail,
      usr.user_fullname,
      gpd.is_delete
    FROM
      dbo.m_group_pic_detail AS gpd
      INNER JOIN 
      dbo.m_group_pic AS gpi ON gpd.group_pic_id = gpi.group_pic_id
      CROSS APPLY
      dbo.func_list_branch(gpd.branch_id) AS flb
      CROSS APPLY
      dbo.func_list_transaction_type(gpd.transaction_type_id) AS fltt
      INNER JOIN 
      dbo.m_user AS usr ON gpd.user_id_group_pic_detail = usr.user_id
    WHERE
      gpd.is_delete = '0'
      AND gpi.is_delete = '0'
      AND flb.is_delete = '0'
      AND fltt.is_delete = '0'
GO
/****** Object:  View [dbo].[v_m_eform_workflow]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by Pribadi Pamungkas. 2017-07-26
-- last modified by Pribadi Pamungkas. 2017-10-30
CREATE VIEW [dbo].[v_m_eform_workflow]
AS
    SELECT
  	  ewf.eform_workflow_id,
  	  ewf.eform_id,
  	  ewf.workflow_template_id,
  	  wft.workflow_template_code,
  	  wft.description,
	    wft.remarks,
	    ewf.source_transaction_id,
	    mst.description AS transaction_source,
  	  ewf.effective_date,
  	  ewf.status_id,
  	  ewf.created_by,
  	  ewf.created_date,
  	  ewf.modified_by,
  	  ewf.modified_date
    FROM
    	dbo.m_eform_workflow AS ewf INNER JOIN
    	dbo.m_workflow_template AS wft ON ewf.workflow_template_id = wft.workflow_template_id LEFT JOIN
    	dbo.m_source_transaction AS mst ON ewf.source_transaction_id = mst.source_transaction_id
    WHERE
      ewf.is_delete = '0'
      AND wft.is_delete = '0'
GO
/****** Object:  View [dbo].[v_m_eform_form]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by Pribadi Pamungkas. 2017-08-29
CREATE VIEW [dbo].[v_m_eform_form]
AS
    SELECT
      me.eform_id,
      meft.eform_form_template_id,
      meft.effective_date,
      meft.status_id,
      mtft.transaction_form_template_id,
      mtft.description,
      mtft.filename
    FROM
	    dbo.m_eform AS me INNER JOIN
	    dbo.m_eform_form_template AS meft ON me.eform_id = meft.eform_id INNER JOIN
	    dbo.m_transaction_form_template AS mtft ON meft.transaction_form_template_id = mtft.transaction_form_template_id
    WHERE
      me.is_delete = '0'
      AND meft.is_delete = '0'
      AND mtft.is_delete = '0'
GO
/****** Object:  View [dbo].[v_m_eform_document]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by Pribadi Pamungkas. 2017-07-23
CREATE VIEW [dbo].[v_m_eform_document]
AS
    SELECT
  	  med.eform_document_id,
  	  med.eform_id,
  	  med.document_id,
  	  md.document_code,
  	  md.description,
  	  med.minimum_files,
  	  med.maximum_files,
  	  med.seq_number,
  	  med.status_id,
  	  med.created_by,
  	  med.created_date,
  	  med.modified_by,
  	  med.modified_date,
  	  med.is_delete
    FROM
    	dbo.m_eform_document AS med INNER JOIN
    	dbo.m_document AS md ON med.document_id = md.document_id
    WHERE
      med.is_delete = '0'
      AND md.is_delete = '0'
GO
/****** Object:  View [dbo].[v_m_transaction_type_2]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_m_transaction_type_2]
AS
    SELECT  mtt.transaction_type_id ,
            mtt.transaction_type_code ,
            mtt.description AS transaction_type_desc ,
            mtt.remarks AS transaction_type_remarks ,
            mtt.transaction_category_id ,
            (
				SELECT TOP 1
					mew.eform_workflow_id
				FROM
					dbo.m_eform AS me INNER JOIN
					dbo.m_eform_workflow AS mew ON me.eform_id = mew.eform_id INNER JOIN
					dbo.m_workflow_template AS mwt ON mew.workflow_template_id = mwt.workflow_template_id
				WHERE
					mew.effective_date <= CONVERT (date, GETDATE())
					AND me.is_delete = '0'
					AND mew.is_delete = '0'
					AND mwt.is_delete = '0'
					AND mew.status_id = 5
					AND me.transaction_type_id =  mtt.transaction_type_id
					AND mew.source_transaction_id = 2
					-- tambahkan status aktif kalau perlu
				ORDER BY
					mew.effective_date DESC

			) AS eform_workflow_id,
            --mtc.transaction_category_id ,
            mtc.transaction_category_code ,
            mtc.description AS transaction_category_desc,
            mtt.is_delete
    FROM    m_transaction_type mtt
            INNER JOIN m_transaction_category mtc ON mtc.transaction_category_id = mtt.transaction_category_id
    WHERE   mtt.is_delete = 0
            AND mtc.is_delete = 0
GO
/****** Object:  View [dbo].[v_m_transaction_type]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_m_transaction_type]
AS
    SELECT  mtt.transaction_type_id ,
            mtt.transaction_type_code ,
            mtt.description AS transaction_type_desc ,
            mtt.remarks AS transaction_type_remarks ,
            mtt.footnote_receipt_form AS transaction_type_footnote_receipt_form ,
            mtt.transaction_category_id ,
            (
				SELECT TOP 1
					mew.eform_workflow_id
				FROM
					dbo.m_eform AS me INNER JOIN
					dbo.m_eform_workflow AS mew ON me.eform_id = mew.eform_id INNER JOIN
					dbo.m_workflow_template AS mwt ON mew.workflow_template_id = mwt.workflow_template_id
				WHERE
					mew.effective_date <= CONVERT (date, GETDATE())
					AND me.is_delete = '0'
					AND mew.is_delete = '0'
					AND mwt.is_delete = '0'
					AND mew.status_id = 5
					AND me.transaction_type_id =  mtt.transaction_type_id
					AND mew.source_transaction_id = 1
					-- tambahkan status aktif kalau perlu
				ORDER BY
					mew.effective_date DESC

			) AS eform_workflow_id,
            --mtc.transaction_category_id ,
            mtc.transaction_category_code ,
            mtc.description AS transaction_category_desc,
            mtt.is_delete
    FROM    m_transaction_type mtt
            INNER JOIN m_transaction_category mtc ON mtc.transaction_category_id = mtt.transaction_category_id
    WHERE   mtt.is_delete = 0
            AND mtc.is_delete = 0
GO
/****** Object:  View [dbo].[v_user_organization]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_user_organization] AS

SELECT 
	  o.user_organization_id	
	  ,u.username
	  ,u.user_fullname
	  ,g.description AS organization_name	
      ,o.user_id_organization
      ,o.effective_date
      ,o.organization_id
	  ,g.level_type_id
	  ,t.description AS level_description
      ,o.status_id
      ,o.created_by
      ,o.created_date
      ,o.modified_by
      ,o.modified_date
      ,o.is_delete
  FROM m_user_organization o
  JOIN m_user u ON o.user_id_organization = u.username
  JOIN m_organization g ON o.organization_id = g.organization_id
  JOIN m_level_type t ON t.level_type_id = g.level_type_id
GO
/****** Object:  View [dbo].[v_user]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_user] AS
SELECT 
	m.user_id,
	m.username,
	m.user_fullname,
	m.branch_id,
	m.status_id,
	m.created_by,
	m.created_date,
	m.modified_by,
	m.modified_date,
	b.branch_code,
	b.description,
	org.organization_id,
	org.description AS organization
FROM m_user m
LEFT JOIN m_branch b ON (m.branch_id = b.branch_id)
LEFT JOIN (
	SELECT 
		g.status_id, 
		g.user_id_organization, 
		g.organization_id, 
		m.description
	FROM m_user_organization g
	JOIN m_organization m ON m.organization_id = g.organization_id
	WHERE g.status_id = 5 and g.is_delete = 0
) AS org ON (m.username = org.user_id_organization)
where
	m.is_delete = 0
GO
/****** Object:  View [dbo].[v_t_transaction_task]    Script Date: 11/10/2017 16:10:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_t_transaction_task] AS

SELECT 

	tt.transaction_task_id, 
	tt.transaction_id, 
	tt.process_sequence, 
	tt.user_id,
	u.user_fullname, 
	vt.register_number,
	vt.policy_id_reference,
	vt.policy_holder_reference,
	vt.branch_desc,
	vt.type_desc,
	vt.stage_desc,
	tt.status_id, 
	ts.description AS status_description,
	tt.is_delete
	
FROM
	t_transaction_task AS tt
	INNER JOIN 
	v_get_transaction_all AS vt ON vt.transaction_id = tt.transaction_id
	INNER JOIN
	m_transaction_task_status AS ts ON ts.id = tt.status_id
	INNER JOIN
	v_user AS u on u.username = tt.user_id

WHERE
	tt.is_delete = 0
	AND ts.is_delete = 0
GO
/****** Object:  View [dbo].[v_get_transaction_category_register]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_get_transaction_category_register] AS

SELECT
	me.eform_id,
	mtt.transaction_type_id,
	mtt.transaction_type_code,
	mtt.transaction_type_desc,
	mtt.transaction_category_id,
	mtt.transaction_category_code,
	mtt.transaction_category_desc,
	meft.effective_date,
	meft.status_id,
	mtft.*
FROM
	dbo.m_eform AS me INNER JOIN
	dbo.m_eform_form_template AS meft ON me.eform_id = meft.eform_id INNER JOIN
	dbo.m_transaction_form_template AS mtft ON meft.transaction_form_template_id = mtft.transaction_form_template_id INNER JOIN
	v_m_transaction_type AS mtt ON mtt.transaction_type_id = me.transaction_type_id
WHERE
	me.is_delete = '0'
	AND meft.is_delete = '0'
	AND mtft.is_delete = '0'
	AND me.status_id = 5
	AND meft.effective_date <= CONVERT (date, GETDATE())
GO
/****** Object:  View [dbo].[v_m_e_form]    Script Date: 11/10/2017 16:10:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- last modified by Pribadi Pamungkas. 2017-07-22
CREATE VIEW [dbo].[v_m_e_form]
AS
    SELECT  
      e.eform_id,
			e.eform_code, 
			e.transaction_type_id,
			mtt.transaction_type_desc,
			mtt.transaction_category_id,
			mtt.transaction_category_desc, 
			e.is_need_surat_kuasa, 
			e.remarks, 
			--e.transaction_form_template_id,
			--mtft.transaction_form_template_id,
			e.status_id, 
			e.is_delete
    FROM    
      dbo.m_eform AS e
      INNER JOIN 
      v_m_transaction_type AS mtt ON e.transaction_type_id = mtt.transaction_type_id
      --LEFT JOIN
      ----m_transaction_form_template AS tpl ON e.transaction_form_template_id = tpl.transaction_form_template_id
      
      --dbo.m_eform_form_template AS meft ON e.eform_id = meft.eform_id LEFT JOIN
	    --dbo.m_transaction_form_template AS mtft ON meft.transaction_form_template_id = mtft.transaction_form_template_id
    WHERE   
      e.is_delete = 0
GO


USE [db_edits]
GO


/****** Object:  StoredProcedure [dbo].[proc_update_os_transaction]    Script Date: 11/10/2017 16:12:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		KHU
-- Create date: 2017-09-09
-- Description:	SP Process From Layar Document Standing Transaction
-- =============================================
CREATE PROCEDURE [dbo].[proc_update_os_transaction] 
	
	@pi_transaction_task_id BIGINT,
	--@pi_transaction_id BIGINT,
	@pi_user_id VARCHAR(8),
	@pi_remarks VARCHAR(255),

	@po_message VARCHAR(400) OUTPUT

AS
BEGIN

	SET NOCOUNT ON;
	
	DECLARE @v_result BIT = 0

	BEGIN TRY
	BEGIN TRANSACTION proses

		DECLARE
			@v_transaction_task_id BIGINT,
			@v_transaction_id BIGINT,
			@v_process_sequence INT,
			@v_user_id VARCHAR(8),
			@status_id INT
	
		SELECT
			@v_transaction_task_id = transaction_task_id,
			@v_transaction_id = transaction_id,
			@v_process_sequence = process_sequence, 
			@v_user_id = user_id, 
			@status_id = status_id
		FROM
			dbo.v_t_transaction_task
		WHERE
			transaction_task_id = @pi_transaction_task_id

		IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Transaction not found'
				GOTO ERROR_OUT
			END


		-- Transaction Task Status
		-- 1 Taken
		-- 2 Available
		-- 3 Not Available
		IF @status_id = 1
			BEGIN
				UPDATE
					t_transaction_task
				SET
					status_id = 2,    -- 2 : Available
					modified_by = @pi_user_id,
					modified_date = GETDATE()
				WHERE
					transaction_id = @v_transaction_id AND
					process_sequence = @v_process_sequence AND
					is_delete = 0
			
				IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed Update Task Status'
						GOTO ERROR_OUT
					END


				INSERT INTO dbo.t_transaction_history_process
					(transaction_id,
					process_date,
					[user_id],
					workflow_template_action_id,
					action_description,
					reason_id,
					remarks,
					created_by,
					created_date,
					modified_by,
					modified_date,
					is_delete)
				VALUES
					(@v_transaction_id, -- transaction_id - bigint
					GETDATE(), -- process_date - datetime
					@pi_user_id, -- user_id - int
					NULL, -- workflow_template_action_id - bigint
					'Release Task',
					NULL, -- reason_id - int
					@pi_remarks, -- remarks - varchar(255)
					@pi_user_id, -- created_by - varchar(8)
					GETDATE(), -- created_date - datetime
					@pi_user_id, -- modified_by - varchar(8)
					GETDATE(), -- modified_date - datetime
					'0'  -- is_delete - char(1)
					)
				IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed insert transaction history process'
						GOTO ERROR_OUT
					END

			END
		
		ELSE IF @status_id = 2

			BEGIN

				UPDATE
					t_transaction_task
				SET
					status_id = 3,    -- 3 : Not Available
					modified_by = @pi_user_id,
					modified_date = GETDATE()
				WHERE
					transaction_id = @v_transaction_id AND
					process_sequence = @v_process_sequence AND
					[user_id] <> @pi_user_id AND
					is_delete = 0
			
				IF (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed Update Task Status Not Available'
						GOTO ERROR_OUT
					END


				UPDATE
					t_transaction_task
				SET
					status_id = 1,    -- 1 : Taken
					modified_by = @pi_user_id,
					modified_date = GETDATE()
				WHERE
					--transaction_id = @pi_transaction_id AND
					[user_id] = @pi_user_id AND
					transaction_task_id = @pi_transaction_task_id AND
					is_delete = 0
			
				IF (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed Update Task Status Taken'
						GOTO ERROR_OUT
					END


				INSERT INTO dbo.t_transaction_history_process
					(transaction_id,
					process_date,
					[user_id],
					workflow_template_action_id,
					action_description,
					reason_id,
					remarks,
					created_by,
					created_date,
					modified_by,
					modified_date,
					is_delete)
				VALUES
					(@v_transaction_id, -- transaction_id - bigint
					GETDATE(), -- process_date - datetime
					@pi_user_id, -- user_id - int
					NULL, -- workflow_template_action_id - bigint
					'Take Task',
					NULL, -- reason_id - int
					NULL, -- remarks - varchar(255)
					@pi_user_id, -- created_by - varchar(8)
					GETDATE(), -- created_date - datetime
					@pi_user_id, -- modified_by - varchar(8)
					GETDATE(), -- modified_date - datetime
					'0'  -- is_delete - char(1)
					)
				IF  (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed insert transaction history process Not Available'
						GOTO ERROR_OUT
					END

			END

		ELSE IF @status_id = 3
			BEGIN
				
				DECLARE
					@v_user_fullname VARCHAR(50)

				SELECT 
					@v_user_fullname = user_fullname
				FROM
					dbo.v_t_transaction_task
				WHERE 
					transaction_id = @v_transaction_id AND
					process_sequence = @v_process_sequence AND
					status_id = 1 -- 1 : Taken

				SELECT
					@v_transaction_task_id = transaction_task_id,
					@v_process_sequence = process_sequence, 
					@v_user_id = user_id, 
					@status_id = status_id
				FROM
					dbo.t_transaction_task
				WHERE
					[user_id] = @v_user_id AND
					transaction_task_id = @pi_transaction_task_id AND
					status_id = 3 AND -- 3 : Not Available
					is_delete = 0
				IF (@@ROWCOUNT = 1)
					BEGIN
						SET @po_message = 'Failed, Transaction has been taken by ' + @v_user_fullname
						GOTO ERROR_OUT
					END
			END


		COMMIT TRANSACTION proses
		SET @po_message = 'Sukses'  -- variable output 
			SET @v_result = 1
			SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
			GOTO CLEAN_OUT

	END TRY
	BEGIN CATCH	-- tangkap error message selain yg sudah dideskripsikan
		SET @po_message = LEFT(ERROR_MESSAGE(),400)	-- berhubung variable diatas diset 400, maka potong error message
		GOTO ERROR_OUT
	END CATCH

	ERROR_OUT: 
		ROLLBACK TRANSACTION proses
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		--RETURN 1

	CLEAN_OUT:
		--RETURN 0

END
GO
/****** Object:  UserDefinedFunction [dbo].[get_latest_transaction_process]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE FUNCTION [dbo].[get_latest_transaction_process]
(	
	@pi_transaction_id BIGINT
)
RETURNS TABLE 
AS
RETURN 
(
	SELECT TOP 1
		transaction_history_process_id, 
		transaction_id, 
		process_date, 
		user_id, 
		workflow_template_action_id, 
		reason_id, 
		remarks, 
		created_by, 
		created_date, 
		modified_by, 
		modified_date, 
		is_delete
	FROM t_transaction_history_process
	WHERE transaction_id = @pi_transaction_id
	ORDER BY created_date DESC
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_history_transaction]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_history_transaction]
(	
	@pi_transaction_id BIGINT
)
RETURNS TABLE 
AS
RETURN 
(
	
	SELECT 
		transaction_history_process_id, 
		transaction_id, 
		CAST (process_date AS DATE) AS process_date, 
		user_id, 
		workflow_template_action_id, 
		action_description, 
		reason_id, 
		remarks, 
		created_by, 
		created_date, 
		modified_by, 
		modified_date, 
		is_delete
	FROM 
		t_transaction_history_process
	WHERE transaction_id = @pi_transaction_id
	AND is_delete = 0
)
GO
/****** Object:  StoredProcedure [dbo].[AddTransaction]    Script Date: 11/10/2017 16:12:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddTransaction] (
	@pi_transaction_type_id INT,
	@pi_policy_id_reference VARCHAR(12),
	@pi_policy_holder_reference VARCHAR(100),
	@pi_product_name_reference VARCHAR(100),
	@pi_currency_id_reference VARCHAR(3),
	@pi_currency_code VARCHAR(3),
	@pi_is_policy_holder TINYINT = 0,
	@pi_customer VARCHAR(100),
	@pi_address VARCHAR(255),
	@pi_mobile_phone VARCHAR(15),
	@pi_email_address VARCHAR(30) = NULL,
	@pi_user_id VARCHAR(8),
	@pi_branch_id INT,
	@pi_status_id INT,
	@pi_source_transaction_id SMALLINT,
	@pi_transaction_id BIGINT OUTPUT
)
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	INSERT INTO t_transaction
	(
		transaction_type_id,
		policy_id_reference,
		policy_holder_reference,
		product_name_reference,
		currency_id_reference,
		currency_code,
		is_policy_holder,
		customer,
		address,
		mobile_phone,
		email_address,
		user_id,
		branch_id,
		status_id,
		created_by,
		created_date,
		modified_by,
		modified_date,
		source_transaction_id
	)
	VALUES (
		@pi_transaction_type_id,
		@pi_policy_id_reference,
		@pi_policy_holder_reference,
		@pi_product_name_reference,
		@pi_currency_id_reference,
		@pi_currency_code,
		COALESCE(@pi_is_policy_holder,0),
		@pi_customer,
		@pi_address,
		@pi_mobile_phone,
		@pi_email_address,
		@pi_user_id,
		@pi_branch_id,
		@pi_status_id,
		@pi_user_id,
		GETDATE(),
		@pi_user_id,
		GETDATE(),
		@pi_source_transaction_id
	);

	SET @pi_transaction_id = SCOPE_IDENTITY();

	RETURN
    
END
GO
/****** Object:  StoredProcedure [dbo].[AddTransactionWrapper]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddTransactionWrapper] (
	@pi_transaction_type_id INT,
	@pi_policy_id_reference VARCHAR(12),
	@pi_policy_holder_reference VARCHAR(100),
	@pi_product_name_reference VARCHAR(100),
	@pi_currency_id_reference VARCHAR(3),
	@pi_currency_code VARCHAR(3),
	@pi_is_policy_holder TINYINT = 0,
	@pi_customer VARCHAR(100),
	@pi_address VARCHAR(255),
	@pi_mobile_phone VARCHAR(15),
	@pi_email_address VARCHAR(30) = NULL,
	@pi_user_id VARCHAR(8),
	@pi_branch_id INT,
	@pi_status_id INT,
	@pi_source_transaction_id SMALLINT
)
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	DECLARE @transid BIGINT;
	DECLARE @transreg VARCHAR(9);
	DECLARE @is_ph TINYINT;

	EXEC AddTransaction 
		@pi_transaction_type_id,
		@pi_policy_id_reference,
		@pi_policy_holder_reference,
		@pi_product_name_reference,
		@pi_currency_id_reference,
		@pi_currency_code,
		@pi_is_policy_holder,
		@pi_customer,
		@pi_address,
		@pi_mobile_phone,
		@pi_email_address,
		@pi_user_id,
		@pi_branch_id,
		@pi_status_id,
		@pi_source_transaction_id,
		@transid OUTPUT;

	SET @transreg = (
		SELECT register_number
		FROM t_transaction
		WHERE transaction_id = @transid
	);

	SELECT @transid AS trans_id, @transreg AS trans_reg;
    
END
GO
/****** Object:  StoredProcedure [dbo].[GenerateTriggersDML]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[GenerateTriggersDML]    
 @Schemaname Sysname = 'dbo'    
,@Tablename  Sysname    
,@GenerateScriptOnly    bit = 1   
,@ForceDropAuditTable   bit = 0   
,@IgnoreExistingColumnMismatch   bit = 0   
,@DontAuditforUsers NVARCHAR(4000) =  '' 
,@DontAuditforColumns NVARCHAR(4000) =  '' 
AS    
    
SET NOCOUNT ON    
 /* NOTE FOR DEVELOPER:   
Parameters    
@Schemaname						- SchemaName to which the table belongs to. Default value 'dbo'.    
@Tablename						- TableName for which the procs needs to be generated.    
@GenerateScriptOnly				- When passed 1 , this will generate the scripts alone..    
								  When passed 0 , this will create the audit tables and triggers in the current database.    
								  Default value is 1    
@ForceDropAuditTable			- When passed 1 , will drop the audit table and recreate  
								  When passed 0 , will generate the alter scripts  
								  Default value is 0  
@IgnoreExistingColumnMismatch	- When passed 1 , will not stop with the error on the mismatch of existing column and will create the trigger.  
                                  When passed 0 , will stop with the error on the mismatch of existing column.  
                                  Default value is 0  
@DontAuditforUsers				- Pass the UserName as comma seperated for whom the audit is not required. 
								  Default value is '' which will do audit for all the users. 
 
@DontAuditforColumns - Pass the ColumnNames as comma seperated for which the audit is not required. 
      Default value is '' which will do audit for all the users. 
*/
   
DECLARE @SQL VARCHAR(MAX)    
DECLARE @SQLTrigger VARCHAR(MAX)    
DECLARE @ErrMsg VARCHAR(MAX)     
 
DECLARE @AuditTableName SYSNAME    
DECLARE @QuotedSchemaName SYSNAME 
DECLARE @QuotedTableName SYSNAME 
DECLARE @QuotedAuditTableName SYSNAME 
DECLARE @InsertTriggerName SYSNAME 
DECLARE @UpdateTriggerName SYSNAME 
DECLARE @DeleteTriggerName SYSNAME 
DECLARE @QuotedInsertTriggerName SYSNAME 
DECLARE @QuotedUpdateTriggerName SYSNAME 
DECLARE @QuotedDeleteTriggerName SYSNAME 
DECLARE @DontAuditforUsersTmp NVARCHAR(4000) 
 
SELECT @AuditTableName =  'log_'+@Tablename    
SELECT @QuotedSchemaName = QUOTENAME(@Schemaname) 
SELECT @QuotedTableName = QUOTENAME(@Tablename) 
SELECT @QuotedAuditTableName = QUOTENAME(@AuditTableName) 
SELECT @InsertTriggerName = @Tablename + '_Insert'   
SELECT @UpdateTriggerName = @Tablename + '_Update'   
SELECT @DeleteTriggerName = @Tablename + '_Delete'   
SELECT @QuotedInsertTriggerName = QUOTENAME(@InsertTriggerName) 
SELECT @QuotedUpdateTriggerName = QUOTENAME(@UpdateTriggerName) 
SELECT @QuotedDeleteTriggerName = QUOTENAME(@DeleteTriggerName) 
 
IF LTRIM(RTRIM(@DontAuditforUsers)) <> '' 
BEGIN 
 
    IF RIGHT(@DontAuditforUsers,1) = ',' 
    BEGIN 
        SELECT @DontAuditforUsersTmp = LEFT(@DontAuditforUsers,LEN(@DontAuditforUsers) -1) 
    END 
    ELSE 
    BEGIN 
        SELECT @DontAuditforUsersTmp = @DontAuditforUsers 
    END 
     
    SELECT @DontAuditforUsersTmp = REPLACE(@DontAuditforUsersTmp,',',''',''') 
 
END 
 
 
SELECT @DontAuditforColumns =',' + UPPER(@DontAuditforColumns) + ',' 
 
IF NOT EXISTS (SELECT 1     
             FROM sys.objects     
            WHERE Name= @TableName    
              AND Schema_id=Schema_id(@Schemaname)    
              AND Type = 'U')  
BEGIN 
    SELECT @ErrMsg = @QuotedSchemaName + '.' + @QuotedTableName + ' Table Not Found '  
    RAISERROR(@ErrMsg ,16,1) 
    RETURN 
END 
 
    
----------------------------------------------------------------------------------------------------------------------    
-- Audit Create OR Alter table     
----------------------------------------------------------------------------------------------------------------------    
   
DECLARE @ColList VARCHAR(MAX)   
DECLARE @InsertColList VARCHAR(MAX)   
DECLARE @UpdateCheck VARCHAR(MAX)   
  
DECLARE @NewAddedCols TABLE  
(  
 ColumnName SYSNAME  
,DataType   SYSNAME  
,CharLength INT  
,Collation  SYSNAME NULL  
,ChangeType VARCHAR(20) NULL  
,MainTableColumnName SYSNAME  NULL  
,MainTableDataType   SYSNAME  NULL  
,MainTableCharLength INT  NULL  
,MainTableCollation SYSNAME  NULL  
,AuditTableColumnName SYSNAME  NULL  
,AuditTableDataType   SYSNAME  NULL  
,AuditTableCharLength INT  NULL  
,AuditTableCollation SYSNAME  NULL  
)  
  
   
SELECT @ColList = ''   
SELECT @UpdateCheck = ' '   
SELECT @SQL = ''  
SELECT @InsertColList = '' 
 
  
SELECT @ColList = @ColList +   CASE SC.is_identity   
                                           WHEN 1 THEN 'CONVERT(' + ST.name + ',' + QUOTENAME(SC.name) + ') as ' + QUOTENAME(SC.name)   
                                           ELSE QUOTENAME(SC.name)   
                                           END + ','   
                , @InsertColList = @InsertColList + QUOTENAME(SC.name) + ',' 
                ,  @UpdateCheck = @UpdateCheck +  
                                  CASE  
                                  WHEN CHARINDEX(',' + UPPER(SC.NAME) + ',',@DontAuditforColumns) = 0 THEN 'CASE WHEN UPDATE(' + QUOTENAME(SC.name) + ') THEN ''' + QUOTENAME(SC.name) + '-'' ELSE '''' END + ' +  CHAR(10)   
                                  ELSE '' 
                                  END 
              FROM SYS.COLUMNS SC   
              JOIN SYS.OBJECTS SO   
                ON SC.object_id = SO.object_id      
              JOIN SYS.schemas SCH   
                ON SCH.schema_id = SO.schema_id   
              JOIN SYS.types ST   
                ON ST.user_type_id = SC.user_type_id   
               AND ST.system_type_id = SC.system_type_id    
             WHERE SCH.Name = @Schemaname    
               AND SO.name  = @Tablename    
               AND UPPER(ST.name)  <> UPPER('timestamp')   
   
            SELECT @ColList = SUBSTRING(@ColList,1,LEN(@ColList)-1)   
            SELECT @UpdateCheck = SUBSTRING(@UpdateCheck,1,LEN(@UpdateCheck)-3)   
            SELECT @InsertColList = SUBSTRING(@InsertColList,1,LEN(@InsertColList)-1)   
  
            SELECT @InsertColList = @InsertColList + ',AuditDataState,AuditDMLAction,AuditUser,AuditDateTime,UpdateColumns'  
  
IF EXISTS (SELECT 1     
             FROM sys.objects     
            WHERE Name= @AuditTableName    
              AND Schema_id=Schema_id(@Schemaname)    
              AND Type = 'U')  AND @ForceDropAuditTable = 0  
 BEGIN  
  
            ----------------------------------------------------------------------------------------------------------------------    
            -- Get the comparision metadata for Main and Audit Tables  
            ----------------------------------------------------------------------------------------------------------------------    
  
            INSERT INTO @NewAddedCols  
            (ColumnName,DataType,CharLength,Collation,ChangeType,MainTableColumnName  
            ,MainTableDataType,MainTableCharLength,MainTableCollation,AuditTableColumnName,AuditTableDataType,AuditTableCharLength,AuditTableCollation)  
            SELECT ISNULL(MainTable.ColumnName,AuditTable.ColumnName)  
                  ,ISNULL(MainTable.DataType,AuditTable.DataType)  
                  ,ISNULL(MainTable.CharLength,AuditTable.CharLength)  
                  ,ISNULL(MainTable.Collation,AuditTable.Collation)  
                  ,CASE   
                   WHEN MainTable.ColumnName IS NULL THEN 'Deleted'  
                   WHEN AuditTable.ColumnName IS NULL THEN 'Added'  
                   ELSE NULL  
                   END   
                  ,MainTable.ColumnName  
                  ,MainTable.DataType  
                  ,MainTable.CharLength  
                  ,MainTable.Collation  
                  ,AuditTable.ColumnName  
                  ,AuditTable.DataType  
                  ,AuditTable.CharLength  
                  ,AuditTable.Collation  
              FROM  
      
            (  
            SELECT SC.Name As ColumnName,ST.Name as DataType,SC.is_identity as isIdentity,SC.Max_length as CharLength,SC.Collation_Name as Collation  
              FROM SYS.COLUMNS SC   
              JOIN SYS.OBJECTS SO   
                ON SC.object_id = SO.object_id      
              JOIN SYS.schemas SCH   
                ON SCH.schema_id = SO.schema_id   
              JOIN SYS.types ST   
                ON ST.user_type_id = SC.user_type_id   
               AND ST.system_type_id = SC.system_type_id    
             WHERE SCH.Name = @Schemaname    
               AND SO.name  = @Tablename    
               AND UPPER(ST.name)  <> UPPER('timestamp')   
            ) MainTable  
            FULL OUTER JOIN  
            (  
            SELECT SC.Name As ColumnName,ST.Name as DataType,SC.is_identity as isIdentity,SC.Max_length as CharLength,SC.Collation_Name as Collation  
              FROM SYS.COLUMNS SC   
              JOIN SYS.OBJECTS SO   
                ON SC.object_id = SO.object_id      
              JOIN SYS.schemas SCH   
                ON SCH.schema_id = SO.schema_id   
              JOIN SYS.types ST   
                ON ST.user_type_id = SC.user_type_id   
               AND ST.system_type_id = SC.system_type_id    
             WHERE SCH.Name = @Schemaname    
               AND SO.name  = @AuditTableName    
               AND UPPER(ST.name)  <> UPPER('timestamp')   
               AND SC.Name NOT IN ('AuditDataState','AuditDMLAction','AuditUser','AuditDateTime','UpdateColumns')  
            ) AuditTable  
            ON MainTable.ColumnName = AuditTable.ColumnName  
           
         ----------------------------------------------------------------------------------------------------------------------    
        -- Find data type changes between table  
        ----------------------------------------------------------------------------------------------------------------------    
  
            IF EXISTS ( SELECT * FROM @NewAddedCols NC  
                         WHERE NC.MainTableColumnName = NC.AuditTableColumnName  
                           AND (  
                               NC.MainTableDataType   <> NC.AuditTableDataType  
                               OR  
                               NC.MainTableCharLength  > NC.AuditTableCharLength  
                               OR  
                               NC.MainTableCollation  <> NC.AuditTableCollation  
                               )  
                )  
            BEGIN  
                SELECT CONVERT(VARCHAR(50),  
                           CASE  
                           WHEN NC.MainTableDataType   <> NC.AuditTableDataType   THEN 'DataType Mismatch'  
                           WHEN NC.MainTableCharLength  > NC.AuditTableCharLength THEN 'Length in maintable is greater than Audit Table'  
                           WHEN NC.MainTableCollation  <> NC.AuditTableCollation  THEN 'Collation Difference'  
                           END) AS Mismatch  
                      ,NC.MainTableColumnName  
                      ,NC.MainTableDataType  
                      ,NC.MainTableCharLength  
                      ,NC.MainTableCollation  
                      ,NC.AuditTableColumnName  
                      ,NC.AuditTableDataType  
                      ,NC.AuditTableCharLength  
                      ,NC.AuditTableCollation  
                  FROM @NewAddedCols NC  
                 WHERE NC.MainTableColumnName = NC.AuditTableColumnName  
                   AND (  
                       NC.MainTableDataType   <> NC.AuditTableDataType  
                       OR  
                       NC.MainTableCharLength  > NC.AuditTableCharLength  
                       OR  
                       NC.MainTableCollation  <> NC.AuditTableCollation  
                       )  
  
                RAISERROR('There are differences in Datatype or Lesser Length or Collation difference between the Main table and Audit Table. Please refer the output',16,1)  
                IF @IgnoreExistingColumnMismatch = 0  
                BEGIN  
                    RETURN  
                END  
            END  
  
        ----------------------------------------------------------------------------------------------------------------------    
        -- Find the new and deleted columns   
        ----------------------------------------------------------------------------------------------------------------------    
  
          IF EXISTS(SELECT * FROM @NewAddedCols WHERE ChangeType IS NOT NULL)  
          BEGIN  
  
                SELECT @SQL = @SQL +   'ALTER TABLE ' + @QuotedSchemaName + '.' + @QuotedAuditTableName   
                                   + CASE  
                                     WHEN NC.ChangeType ='Added' THEN ' ADD '  + QUOTENAME(NC.ColumnName) + ' ' + NC.DataType + ' '   
                                     +  CASE   
                                        WHEN NC.DataType IN ('char','varchar','nchar','nvarchar') AND NC.CharLength = -1 THEN '(max) COLLATE ' + NC.Collation + ' NULL '  
                                        WHEN NC.DataType IN ('char','varchar') THEN '(' + CONVERT(VARCHAR(5),NC.CharLength) + ') COLLATE ' + NC.Collation + ' NULL '  
                                        WHEN NC.DataType IN ('nchar','nvarchar') THEN '(' + CONVERT(VARCHAR(5),NC.CharLength/2) + ') COLLATE ' + NC.Collation + ' NULL '  
                                        ELSE ''  
                                        END  
                                     WHEN NC.ChangeType ='Deleted' THEN ' DROP COLUMN '  + QUOTENAME(NC.ColumnName)   
                                     END + CHAR(10)  
                                       
                  FROM @NewAddedCols NC  
                  WHERE NC.ChangeType IS NOT NULL  
          END  
  
  
 END  
 ELSE  
 BEGIN  
   
            SELECT @SQL = '  IF EXISTS (SELECT 1     
                                          FROM sys.objects     
                                         WHERE Name=''' + @AuditTableName + '''    
                                           AND Schema_id=Schema_id(''' + @Schemaname + ''')    
                                           AND Type = ''U'')    
                            DROP TABLE ' + @QuotedSchemaName + '.' + @QuotedAuditTableName + ' 
   
                    SELECT ' + @ColList + '    
                        ,AuditDataState=CONVERT(VARCHAR(10),'''')     
                        ,AuditDMLAction=CONVERT(VARCHAR(10),'''')      
                        ,AuditUser =CONVERT(SYSNAME,'''')    
                        ,AuditDateTime=CONVERT(DATETIME,''01-JAN-1900'')    
                        ,UpdateColumns = CONVERT(VARCHAR(MAX),'''')   
                        Into ' + @QuotedSchemaName + '.' + @QuotedAuditTableName + '    
                    FROM ' + @QuotedSchemaName + '.' + @QuotedTableName +'    
                    WHERE 1=2 '    
END  
 
 
  
IF @GenerateScriptOnly = 1    
BEGIN    
    PRINT REPLICATE ('-',200)    
    PRINT '--Create \ Alter Script Audit table for ' + @QuotedSchemaName + '.' + @QuotedTableName    
    PRINT REPLICATE ('-',200)    
    PRINT @SQL    
    IF LTRIM(RTRIM(@SQL)) <> ''  
    BEGIN  
        PRINT 'GO'   
    END  
    ELSE  
    BEGIN  
        PRINT '-- No changes in table structure'  
    END   
END    
ELSE    
BEGIN    
    IF RTRIM(LTRIM(@SQL)) = ''  
    BEGIN  
        PRINT 'No Table Changes Found'   
    END  
    ELSE  
    BEGIN  
        PRINT 'Creating \ Altered Audit table for ' + @QuotedSchemaName + '.' + @QuotedTableName    
        EXEC(@SQL)    
        PRINT 'Audit table ' + @QuotedSchemaName + '.' + @QuotedAuditTableName + ' Created \ Altered succesfully'    
    END  
END    
    
    
----------------------------------------------------------------------------------------------------------------------    
-- Create Insert Trigger    
----------------------------------------------------------------------------------------------------------------------    
    
    
SELECT @SQL = '    
IF EXISTS (SELECT 1     
             FROM sys.objects     
            WHERE Name=''' + @Tablename + '_Insert' + '''    
              AND Schema_id=Schema_id(''' + @Schemaname + ''')    
              AND Type = ''TR'')    
DROP TRIGGER ' + @QuotedSchemaName + '.' + @QuotedInsertTriggerName     
SELECT @SQLTrigger = '    
CREATE TRIGGER '  + @QuotedSchemaName + '.' + @QuotedInsertTriggerName + ' 
ON '  + @QuotedSchemaName + '.' + @QuotedTableName + '    
FOR INSERT    
AS    
'  
 
 
IF LTRIM(RTRIM(@DontAuditforUsersTmp)) <> ''  
BEGIN 
 
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' IF SUSER_NAME() NOT IN (''' + @DontAuditforUsersTmp + ''')' 
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' BEGIN' 
 
END 
 
 
 
  
SELECT @SQLTrigger =  @SQLTrigger  + CHAR(10) + ' INSERT INTO ' + @QuotedSchemaName + '.' + @QuotedAuditTableName + CHAR(10) +   
 '(' + @InsertColList + ')' + CHAR(10) +   
 'SELECT ' + @ColList + ',''New'',''Insert'',SUSER_SNAME(),getdate(),''''  FROM INSERTED '    
 
 IF LTRIM(RTRIM(@DontAuditforUsersTmp)) <> ''  
BEGIN 
 
    SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' END' 
 
END 
 
    
IF @GenerateScriptOnly = 1    
BEGIN    
    PRINT REPLICATE ('-',200)    
    PRINT '--Create Script Insert Trigger for ' +  @QuotedSchemaName + '.' + @QuotedTablename    
    PRINT REPLICATE ('-',200)    
    PRINT @SQL    
    PRINT 'GO'    
    PRINT @SQLTrigger    
    PRINT 'GO'    
END    
ELSE    
BEGIN    
    PRINT 'Creating Insert Trigger ' + @QuotedInsertTriggerName + '  for ' + @QuotedSchemaName + '.' + @QuotedTablename    
    EXEC(@SQL)    
    EXEC(@SQLTrigger)    
    PRINT 'Trigger ' + @QuotedSchemaName + '.' + @QuotedInsertTriggerName  + ' Created succesfully'    
END    
    
    
----------------------------------------------------------------------------------------------------------------------    
-- Create Delete Trigger    
----------------------------------------------------------------------------------------------------------------------    
    
    
SELECT @SQL = '    
    
IF EXISTS (SELECT 1     
             FROM sys.objects     
            WHERE Name=''' + @Tablename + '_Delete' + '''    
              AND Schema_id=Schema_id(''' + @Schemaname + ''')    
              AND Type = ''TR'')    
DROP TRIGGER ' + @QuotedSchemaName + '.' + + @QuotedDeleteTriggerName + '    
'    
    
SELECT @SQLTrigger =     
'    
CREATE TRIGGER '  + @QuotedSchemaName + '.'  + @QuotedDeleteTriggerName + '    
ON '+ @QuotedSchemaName + '.' + @QuotedTableName + '    
FOR DELETE    
AS   ' 
 
IF LTRIM(RTRIM(@DontAuditforUsersTmp)) <> ''  
BEGIN 
 
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' IF SUSER_NAME() NOT IN (''' + @DontAuditforUsersTmp + ''')' 
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' BEGIN' 
 
END 
 
 
  
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + '  INSERT INTO ' + @QuotedSchemaName + '.' + @QuotedAuditTableName + CHAR(10) +   
 '(' + @InsertColList + ')' + CHAR(10) +   
 'SELECT ' + @ColList + ',''Old'',''Delete'',SUSER_SNAME(),getdate(),''''  FROM DELETED'    
 
IF LTRIM(RTRIM(@DontAuditforUsersTmp)) <> ''  
BEGIN 
 
    SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' END' 
 
END 
 
    
IF @GenerateScriptOnly = 1    
BEGIN    
    PRINT REPLICATE ('-',200)    
    PRINT '--Create Script Delete Trigger for ' + @QuotedSchemaName + '.' + @QuotedTableName    
    PRINT REPLICATE ('-',200)    
    PRINT @SQL    
    PRINT 'GO'    
    PRINT @SQLTrigger    
    PRINT 'GO'    
END    
ELSE    
BEGIN    
    PRINT 'Creating Delete Trigger ' + @QuotedDeleteTriggerName + '  for ' + @QuotedSchemaName + '.' + @QuotedTableName    
    EXEC(@SQL)    
    EXEC(@SQLTrigger)    
    PRINT 'Trigger ' + @QuotedSchemaName + '.' + @QuotedDeleteTriggerName + ' Created succesfully'    
END    
    
----------------------------------------------------------------------------------------------------------------------    
-- Create Update Trigger    
----------------------------------------------------------------------------------------------------------------------    
    
    
SELECT @SQL = '    
    
IF EXISTS (SELECT 1     
             FROM sys.objects     
            WHERE Name=''' + @Tablename + '_Update' + '''    
              AND Schema_id=Schema_id(''' + @Schemaname + ''')    
              AND Type = ''TR'')    
DROP TRIGGER ' + @QuotedSchemaName + '.' + @QuotedUpdateTriggerName + '    
'    
    
SELECT @SQLTrigger =    
'    
CREATE TRIGGER ' + @QuotedSchemaName + '.'  + @QuotedUpdateTriggerName + '      
ON '+ @QuotedSchemaName + '.' + @QuotedTableName + '    
FOR UPDATE    
AS ' 
 
IF LTRIM(RTRIM(@DontAuditforUsersTmp)) <> ''  
BEGIN 
 
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' IF SUSER_NAME() NOT IN (''' + @DontAuditforUsersTmp + ''')' 
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' BEGIN' 
 
END 
 
 
  
SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + '   
 
    DECLARE @UpdatedCols varchar(max) 
 
   SELECT @UpdatedCols = ' + @UpdateCheck + ' 
    
   IF LTRIM(RTRIM(@UpdatedCols)) <> '''' 
   BEGIN 
          INSERT INTO ' + @QuotedSchemaName + '.' + @QuotedAuditTableName + CHAR(10) +   
         '(' + @InsertColList + ')' + CHAR(10) +   
         'SELECT ' + @ColList +',''New'',''Update'',SUSER_SNAME(),getdate(),@UpdatedCols  FROM INSERTED     
    
          INSERT INTO ' + @QuotedSchemaName + '.' + @QuotedAuditTableName + CHAR(10) +   
         '(' + @InsertColList + ')' + CHAR(10) +   
         'SELECT ' + @ColList +',''Old'',''Update'',SUSER_SNAME(),getdate(),@UpdatedCols  FROM DELETED  
   END'    
 
IF LTRIM(RTRIM(@DontAuditforUsersTmp)) <> ''  
BEGIN 
 
    SELECT @SQLTrigger = @SQLTrigger + CHAR(10) + ' END' 
 
END 
 
 
    
IF @GenerateScriptOnly = 1    
BEGIN    
    PRINT REPLICATE ('-',200)    
    PRINT '--Create Script Update Trigger for ' + @QuotedSchemaName + '.' + @QuotedTableName    
    PRINT REPLICATE ('-',200)    
    PRINT @SQL    
    PRINT 'GO'    
    PRINT @SQLTrigger    
    PRINT 'GO'    
END    
ELSE    
BEGIN    
    PRINT 'Creating Delete Trigger ' + @QuotedUpdateTriggerName + '  for ' + @QuotedSchemaName + '.' + @QuotedTableName    
    EXEC(@SQL)    
    EXEC(@SQLTrigger)    
    PRINT 'Trigger ' + @QuotedSchemaName + '.' + @QuotedUpdateTriggerName + '  Created succesfully'    
END    
    
SET NOCOUNT OFF
GO
/****** Object:  StoredProcedure [dbo].[proc_generate_token]    Script Date: 11/10/2017 16:12:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by: Pribadi Pamungkas. 2017-09-13
CREATE PROCEDURE [dbo].[proc_generate_token]
	@pi_tipe VARCHAR(1),
	@po_token VARCHAR(10) OUTPUT
AS
BEGIN

	SET NOCOUNT ON;	-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.

  SELECT
    @po_token = RIGHT(CAST(YEAR(GETDATE()) AS VARCHAR(4)),2) +
                @pi_tipe +
                CHAR(
                    ASCII('A') + 
                    (
                      ABS(
                            CHECKSUM(
                                      NEWID()
                                    )
                         ) % 25
                    )
                  ) + 
                CHAR(
                    ASCII('A') + 
                    (
                      ABS(
                            CHECKSUM(
                                      NEWID()
                                    )
                         ) % 25
                    )
                  ) + 
                CHAR(
                    ASCII('A') + 
                    (
                      ABS(
                            CHECKSUM(
                                      NEWID()
                                    )
                         ) % 25
                    )
                  ) + 
                RIGHT(
                  '0000' +
                  CAST(
                        (
                          ABS(
                              CHECKSUM(
                                        NEWID()
                                      )
                             ) % 10000
                        ) AS VARCHAR(4)
                      ),4)

END
GO
/****** Object:  StoredProcedure [dbo].[proc_document_received]    Script Date: 11/10/2017 16:12:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by: Pribadi Pamungkas. 2017-10-17
-- SP untuk set/unset document received

CREATE PROCEDURE [dbo].[proc_document_received]
    @pi_transaction_id BIGINT,
    @pi_document_type_id INT,
    @pi_receive_doc_check BIT,
    @pi_user_id VARCHAR(8),
    @po_message VARCHAR(200) OUTPUT
AS
BEGIN

	SET NOCOUNT ON; -- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.
	
	DECLARE @v_result BIT = 0
	
	BEGIN TRAN

    IF EXISTS(
			 SELECT
				*
			 FROM
				dbo.t_transaction_document
			 WHERE
				transaction_id = @pi_transaction_id
				AND document_type_id = @pi_document_type_id
    )
	   BEGIN  -- jika sudah ada, maka update t_transaction_document

		  UPDATE
			 t_transaction_document
		  SET
			 receive_doc_check = COALESCE(@pi_receive_doc_check,0),
			 modified_date = GETDATE(),
			 modified_by = @pi_user_id
		  WHERE
			 transaction_id = @pi_transaction_id
			 AND document_type_id = @pi_document_type_id
		  IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			 BEGIN
				SET @po_message = 'Failed update t_transaction_document'
				GOTO ERROR_OUT
			 END
	   END
    ELSE
	   BEGIN  -- jika belum ada, maka insert t_transaction_document
		  -- start: generate token
		  DECLARE	
			 @v_retval_token INT,
			 @po_token VARCHAR(10),
			 @v_tipe_token VARCHAR(1) = 'D'

		  EXEC @v_retval_token = [dbo].[proc_generate_token]
							 @pi_tipe = @v_tipe_token,
							 @po_token = @po_token OUTPUT
		  IF (@@ERROR <> 0) OR (@v_retval_token <> 0)
			 BEGIN
				SET @po_message = 'Error generating token.'
				GOTO ERROR_OUT
			 END

		  WHILE(
				EXISTS(
					   SELECT
						  token
					   FROM
						  t_transaction_document
					   WHERE
						  token = @po_token
				)
		  )
			 BEGIN
				EXEC @v_retval_token = [dbo].[proc_generate_token]
								    @pi_tipe = @v_tipe_token,
								    @po_token = @po_token OUTPUT
				IF (@@ERROR <> 0) OR (@v_retval_token <> 0)
				    BEGIN
					   SET @po_message = 'Error generating token.'
					   GOTO ERROR_OUT
				    END
			 END
		  -- end: generate token
    	
		  INSERT INTO dbo.t_transaction_document
    				(transaction_id,
    				document_type_id,
    				token,
    				receive_doc_check,
    				hashcode,
    				document_index,
    				document_name,
    				created_by,
    				created_date,
    				modified_by,
    				modified_date,
    				is_delete)
		  VALUES
    				(@pi_transaction_id, -- transaction_id - bigint
    				@pi_document_type_id, -- document_type_id - int
    				@po_token, -- token - varchar(30)
    				COALESCE(@pi_receive_doc_check,0), -- receive_doc_check - bit
    				NULL, -- hashcode - varchar(30)        -- ini diisi nanti kalau filenya sudah disatukan dalam PDF
    				NULL, -- document_index - varchar(100) -- URL di DMS (?)
    				NULL, -- document_name - varchar(100)  -- ini diisi nama file yang akan disimpan di DMS ([Nomor Register]_[Jenis Transaksi]_[Jenis Dokumen])
    				@pi_user_id, -- created_by - varchar(8)
    				GETDATE(), -- created_date - datetime
    				@pi_user_id, -- modified_by - varchar(8)
    				GETDATE(), -- modified_date - datetime
    				'0'  -- is_delete - char(1)
    				)
		  IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			 BEGIN
				SET @po_message = 'Failed insert t_transaction_document'
				GOTO ERROR_OUT
			 END

	   END

	
	COMMIT TRAN
	SET @po_message = 'Sukses'  -- variable output 
	SET @v_result = 1
	SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
	GOTO CLEAN_OUT

	
	ERROR_OUT: 
		ROLLBACK TRAN
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		--RETURN 1


	CLEAN_OUT:
		--RETURN 0


END
GO
/****** Object:  StoredProcedure [dbo].[proc_insert_document]    Script Date: 11/10/2017 16:12:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- by: Pribadi Pamungkas. 2017-09-13
-- SP untuk insert dokumen

CREATE PROCEDURE [dbo].[proc_insert_document]
  @pi_transaction_id BIGINT,
  @pi_document_type_id INT,
  @pi_document_name VARCHAR(200), -- nama file asli yang diupload
  @pi_document_url VARCHAR(100),  -- nama file yg ada di server (nama file setelah diupload)
  @pi_hashcode_ori VARCHAR(30),   -- hashcode sebelum diresize (hashcode file asli)
  @pi_hashcode VARCHAR(30),       -- hashcode setelah file gambar diresize
  @pi_upload_date DATETIME,
  --@pi_user_id VARCHAR(8),
  @pi_session_id VARCHAR(50),
	@po_message VARCHAR(200) OUTPUT
AS
BEGIN

	SET NOCOUNT ON; -- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.
	
	BEGIN TRAN
	
	DECLARE
	  @v_transaction_document_id BIGINT,
	  @v_user_id VARCHAR(3)
	
	SELECT
		@v_user_id = username
	FROM
		dbo.s_user_session
	WHERE
	  session_id = @pi_session_id
	
  IF EXISTS(
              SELECT
              	*
              FROM
              	dbo.t_transaction_document
              WHERE
                transaction_id = @pi_transaction_id
                AND document_type_id = @pi_document_type_id
           )
    BEGIN  -- jika sudah ada, maka update t_transaction_document
      SELECT 
        @v_transaction_document_id = transaction_document_id
      FROM
        t_transaction_document
      WHERE
        transaction_id = @pi_transaction_id
        AND document_type_id = @pi_document_type_id
      IF (COALESCE(@v_transaction_document_id,'')='')
				BEGIN
					SET @po_message = 'Empty transaction_document_id'
					ROLLBACK TRAN
					RETURN 1
				END

      UPDATE
        t_transaction_document
      SET
        modified_date = GETDATE(),
        modified_by = @v_user_id
      WHERE
        transaction_id = @pi_transaction_id
        AND document_type_id = @pi_document_type_id
      IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
				BEGIN
					SET @po_message = 'Failed update t_transaction_document'
					ROLLBACK TRAN
					RETURN 1
				END
    END
  ELSE
    BEGIN  -- jika belum ada, maka insert t_transaction_document
    	-- start: generate token
      DECLARE	
        @v_retval_token INT,
		    @po_token VARCHAR(10),
		    @v_tipe_token VARCHAR(1) = 'D'

      EXEC	@v_retval_token = [dbo].[proc_generate_token]
		      @pi_tipe = @v_tipe_token,
		      @po_token = @po_token OUTPUT
      IF (@@ERROR <> 0) OR (@v_retval_token <> 0)
	      BEGIN
		      SET @po_message = 'Error generating token.'
		      ROLLBACK TRAN
		      RETURN 1
	      END

      WHILE(
              EXISTS(
                      SELECT
  	                    token
                      FROM
  	                    t_transaction_document
                      WHERE
                        token = @po_token
                    )
           )
        BEGIN
          EXEC	@v_retval_token = [dbo].[proc_generate_token]
		          @pi_tipe = @v_tipe_token,
		          @po_token = @po_token OUTPUT
          IF (@@ERROR <> 0) OR (@v_retval_token <> 0)
	          BEGIN
		          SET @po_message = 'Error generating token.'
		          ROLLBACK TRAN
		          RETURN 1
	          END
        END
    	-- end: generate token
    	
    	INSERT INTO dbo.t_transaction_document
    	        (transaction_id,
    	         document_type_id,
    	         token,
    	         hashcode,
    	         document_index,
    	         document_name,
    	         created_by,
    	         created_date,
    	         modified_by,
    	         modified_date,
    	         is_delete)
    	VALUES
    	        (@pi_transaction_id, -- transaction_id - bigint
    	         @pi_document_type_id, -- document_type_id - int
    	         @po_token, -- token - varchar(30)
    	         NULL, -- hashcode - varchar(30)        -- ini diisi nanti kalau filenya sudah disatukan dalam PDF
    	         NULL, -- document_index - varchar(100) -- URL di DMS (?)
    	         NULL, -- document_name - varchar(100)  -- ini diisi nama file yang akan disimpan di DMS ([Nomor Register]_[Jenis Transaksi]_[Jenis Dokumen])
    	         @v_user_id, -- created_by - varchar(8)
    	         GETDATE(), -- created_date - datetime
    	         @v_user_id, -- modified_by - varchar(8)
    	         GETDATE(), -- modified_date - datetime
    	         '0'  -- is_delete - char(1)
    	         )
    	IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
				BEGIN
					SET @po_message = 'Failed insert t_transaction_document'
					ROLLBACK TRAN
					RETURN 1
				END
    	
    	SELECT @v_transaction_document_id = SCOPE_IDENTITY()
    	IF (COALESCE(@v_transaction_document_id,'')='')
				BEGIN
					SET @po_message = 'Empty identity output from t_transaction_document'
					ROLLBACK TRAN
					RETURN 1
				END
        
    END

  	INSERT INTO dbo.t_transaction_document_file
  	        (transaction_document_id,
  	         document_name,
  	         document_url,
  	         hashcode_ori,
  	         hashcode,
  	         upload_by,
  	         upload_date,
  	         created_by,
  	         created_date,
  	         modified_by,
  	         modified_date,
  	         is_delete)
  	VALUES
  	        (@v_transaction_document_id, -- transaction_document_id - bigint
  	         @pi_document_name, -- document_name - varchar(200)
  	         @pi_document_url, -- document_url - varchar(100)
  	         @pi_hashcode_ori, -- hashcode_ori - varchar(30)
  	         @pi_hashcode, -- hashcode - varchar(30)
  	         @v_user_id, -- upload_by - varchar(8)
  	         COALESCE(@pi_upload_date,GETDATE()), -- upload_date - datetime
  	         @v_user_id, -- created_by - varchar(8)
  	         GETDATE(), -- created_date - datetime
  	         @v_user_id, -- modified_by - varchar(8)
  	         GETDATE(), -- modified_date - datetime
  	         '0'  -- is_delete - char(1)
  	         )
  	IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Failed insert t_transaction_document_file'
				ROLLBACK TRAN
				RETURN 1
			END

  
	COMMIT TRAN
	
	SET @po_message = 'Sukses'
	SELECT @po_message  -- dual output stored procedure, variable output dan table output
	
	RETURN 0

END
GO
/****** Object:  StoredProcedure [dbo].[test_sp]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[test_sp]
	@pi_input1 VARCHAR(10),
	@pi_input2 VARCHAR(10),
	@po_output VARCHAR(100) OUTPUT
AS
BEGIN
	SET NOCOUNT ON;

  DECLARE @hasil VARCHAR(100)
  SET @hasil = COALESCE(@pi_input1,'') + ' ' + COALESCE(@pi_input2,'') + ' ' + CAST(GETDATE() AS VARCHAR(24))
  
  INSERT INTO dbo.s_log
           ([date]
           ,[request_parameter]
           ,[response])
     VALUES
           (GETDATE()
           ,'test SP'
           ,@hasil)

  SET @po_output = @hasil
  
END
GO
/****** Object:  StoredProcedure [dbo].[CheckSession]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CheckSession] (
	@usercode VARCHAR(3),
	@sessid VARCHAR(50),
	@sig VARCHAR(100),
	@ipaddress VARCHAR(30),
	@useragent VARCHAR(300),
	@expirenum INT
)
AS
BEGIN

	SET NOCOUNT ON;

	--DECLARE @userid INT;
	DECLARE @sessexist INT;



			SET @sessexist = (
				SELECT COUNT(session_id) 
				FROM s_user_session
				WHERE username = @usercode
				AND session_id = @sessid
				AND session_expire > GETDATE()
			);

			IF @sessexist > 0
	
				UPDATE s_user_session
				SET last_activity = GETDATE(),
				session_expire = DATEADD(HOUR, @expirenum, GETDATE())
				WHERE session_id = @sessid
				AND username = @usercode

			ELSE

				INSERT INTO s_user_session
				(
					session_id,
					signature,
					username,
					first_login,
					last_activity,
					session_expire,
					ip_address,
					user_agent
				)
				VALUES (
					@sessid,
					@sig,
					@usercode,
					GETDATE(),
					GETDATE(),
					DATEADD(HOUR, @expirenum, GETDATE()),
					@ipaddress,
					@useragent
				);

END
GO
/****** Object:  StoredProcedure [dbo].[proc_takeover_transaction]    Script Date: 11/10/2017 16:12:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		KHU
-- Create date: 2017-10-24
-- Description:	
-- =============================================
CREATE PROCEDURE [dbo].[proc_takeover_transaction] 
	
	@pi_transaction_task_id BIGINT,
	@pi_username VARCHAR(8),
	@po_message VARCHAR(400) OUTPUT

AS
BEGIN

	SET NOCOUNT ON;
	
	DECLARE @v_result BIT = 0

	BEGIN TRY
	BEGIN TRANSACTION proses_takeover

		DECLARE
			@v_transaction_task_id BIGINT,
			@v_transaction_id BIGINT,
			@v_process_sequence INT,
			@v_user_id VARCHAR(8),
			@status_id INT
	
		SELECT
			@v_transaction_task_id = transaction_task_id,
			@v_transaction_id = transaction_id,
			@v_process_sequence = process_sequence, 
			@v_user_id = user_id, 
			@status_id = status_id
		FROM
			dbo.v_t_transaction_task
		WHERE
			transaction_task_id = @pi_transaction_task_id

		IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Transaction not found'
				GOTO ERROR_OUT
			END

		BEGIN


			UPDATE
					t_transaction_task
				SET
					status_id = 3,    -- 3 : Not Available
					modified_by = @pi_username,
					modified_date = GETDATE()
				WHERE
					transaction_task_id = @pi_transaction_task_id AND
					is_delete = 0
			
				IF (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed Update Task Status Not Available'
						GOTO ERROR_OUT
					END

			INSERT INTO dbo.t_transaction_history_process
					(transaction_id,
					process_date,
					[user_id],
					workflow_template_action_id,
					action_description,
					reason_id,
					remarks,
					created_by,
					created_date,
					modified_by,
					modified_date,
					is_delete)

			SELECT
					@v_transaction_id, -- transaction_id - bigint
					GETDATE(), -- process_date - datetime
					@pi_username, -- user_id - int
					NULL, --@pi_workflow_template_action_id, -- workflow_template_action_id - bigint
					'Take Over Task from '+user_fullname,   -- action_description gunakan nama lengkap
					NULL, -- reason_id - int
					NULL, -- remarks - varchar(255)
					@pi_username, -- created_by - varchar(8)
					GETDATE(), -- created_date - datetime
					@pi_username, -- modified_by - varchar(8)
					GETDATE(), -- modified_date - datetime
					'0'  -- is_delete - char(1)
				FROM
					dbo.m_user
				WHERE
					username = @pi_username

				IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed insert transaction history process'
						GOTO ERROR_OUT
					END


			 INSERT INTO dbo.t_transaction_task
                           ([transaction_id]
                           ,[process_sequence]
                           ,[user_id]
                           ,[status_id]
                           ,[created_by]
                           ,[created_date]
                           ,[modified_by]
                           ,[modified_date]
                           ,[is_delete])
                     VALUES
                           (@v_transaction_id -- transaction_id - bigint
                           ,@v_process_sequence -- process_sequence - int
                           ,@pi_username
                           ,2    -- 2 : Available  -- status_id - int  
                           ,@pi_username -- created_by - varchar(8)
                           ,GETDATE() -- created_date - datetime
                           ,@pi_username -- modified_by - varchar(8)
                           ,GETDATE() -- modified_date - datetime
                           ,'0')
		            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			            BEGIN
				            SET @po_message = 'Failed insert transaction task'
				            GOTO ERROR_OUT
			            END

		END


	COMMIT TRANSACTION proses_takeover
	SET @po_message = 'Sukses'  -- variable output 
		SET @v_result = 1
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		GOTO CLEAN_OUT

	END TRY
	BEGIN CATCH	-- tangkap error message selain yg sudah dideskripsikan
		SET @po_message = LEFT(ERROR_MESSAGE(),400)	-- berhubung variable diatas diset 400, maka potong error message
		GOTO ERROR_OUT
	END CATCH

	ERROR_OUT: 
		ROLLBACK TRANSACTION proses_takeover
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		--RETURN 1

	CLEAN_OUT:
		--RETURN 0

END
GO
/****** Object:  StoredProcedure [dbo].[proc_delegate_transaction]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		KHU
-- Create date: 2017-10-24
-- Description:	
-- =============================================
CREATE PROCEDURE [dbo].[proc_delegate_transaction] 
	
	@pi_transaction_task_id BIGINT,
	--@pi_transaction_id BIGINT,
	@pi_username VARCHAR(8),
	@pi_user_id VARCHAR(8),
	@pi_remarks VARCHAR(255),

	@po_message VARCHAR(400) OUTPUT

AS
BEGIN

	SET NOCOUNT ON;
	
	DECLARE @v_result BIT = 0

	BEGIN TRY
	BEGIN TRANSACTION proses_delegate

		DECLARE
			@v_transaction_task_id BIGINT,
			@v_transaction_id BIGINT,
			@v_process_sequence INT,
			@v_user_id VARCHAR(8),
			@status_id INT
	
		SELECT
			@v_transaction_task_id = transaction_task_id,
			@v_transaction_id = transaction_id,
			@v_process_sequence = process_sequence, 
			@v_user_id = user_id, 
			@status_id = status_id
		FROM
			dbo.v_t_transaction_task
		WHERE
			transaction_task_id = @pi_transaction_task_id

		IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Transaction not found'
				GOTO ERROR_OUT
			END

		BEGIN


			UPDATE
					t_transaction_task
				SET
					status_id = 3,    -- 3 : Not Available
					modified_by = @pi_username,
					modified_date = GETDATE()
				WHERE
					transaction_task_id = @pi_transaction_task_id AND
					is_delete = 0
			
				IF (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed Update Task Status Not Available'
						GOTO ERROR_OUT
					END

			INSERT INTO dbo.t_transaction_history_process
					(transaction_id,
					process_date,
					[user_id],
					workflow_template_action_id,
					action_description,
					reason_id,
					remarks,
					created_by,
					created_date,
					modified_by,
					modified_date,
					is_delete)

			SELECT
					@v_transaction_id, -- transaction_id - bigint
					GETDATE(), -- process_date - datetime
					@pi_username, -- user_id - int
					NULL, --@pi_workflow_template_action_id, -- workflow_template_action_id - bigint
					'Delegate task to '+user_fullname,   -- action_description gunakan nama lengkap
					NULL, -- reason_id - int
					@pi_remarks, --@pi_remarks, -- remarks - varchar(255)
					@pi_username, -- created_by - varchar(8)
					GETDATE(), -- created_date - datetime
					@pi_username, -- modified_by - varchar(8)
					GETDATE(), -- modified_date - datetime
					'0'  -- is_delete - char(1)
				FROM
					dbo.m_user
				WHERE
					username = @pi_user_id

				IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed insert transaction history process'
						GOTO ERROR_OUT
					END


			 INSERT INTO dbo.t_transaction_task
                           ([transaction_id]
                           ,[process_sequence]
                           ,[user_id]
                           ,[status_id]
                           ,[created_by]
                           ,[created_date]
                           ,[modified_by]
                           ,[modified_date]
                           ,[is_delete])
                     VALUES
                           (@v_transaction_id -- transaction_id - bigint
                           ,@v_process_sequence -- process_sequence - int
                           ,@pi_user_id
                           ,2    -- 2 : Available  -- status_id - int  
                           ,@pi_username -- created_by - varchar(8)
                           ,GETDATE() -- created_date - datetime
                           ,@pi_username -- modified_by - varchar(8)
                           ,GETDATE() -- modified_date - datetime
                           ,'0')
		            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			            BEGIN
				            SET @po_message = 'Failed insert transaction task'
				            GOTO ERROR_OUT
			            END

		END


	COMMIT TRANSACTION proses_delegate
	SET @po_message = 'Sukses'  -- variable output 
		SET @v_result = 1
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		GOTO CLEAN_OUT

	END TRY
	BEGIN CATCH	-- tangkap error message selain yg sudah dideskripsikan
		SET @po_message = LEFT(ERROR_MESSAGE(),400)	-- berhubung variable diatas diset 400, maka potong error message
		GOTO ERROR_OUT
	END CATCH

	ERROR_OUT: 
		ROLLBACK TRANSACTION proses_delegate
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		--RETURN 1

	CLEAN_OUT:
		--RETURN 0

END
GO
/****** Object:  UserDefinedFunction [dbo].[get_group_menu_to_add]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_group_menu_to_add]
(	
	@pi_user_id VARCHAR(3)
)
RETURNS TABLE 
AS
RETURN 
(
	SELECT DISTINCT
		g.group_menu_id, 
		g.group_menu_code, 
		g.description,
		g.created_by,
		g.created_date,
		g.modified_by,
		g.modified_date,
		g.is_delete
	FROM m_group_menu g
	WHERE g.is_delete = '0'
	AND g.group_menu_id NOT IN (
		SELECT group_menu_id
		FROM m_user_group_menu_mapping
		WHERE user_id = @pi_user_id
		AND is_delete = 0
	)
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_group_menu_member_user]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_group_menu_member_user]
(	
	@pi_group_menu_id INT,
	@pi_user_id VARCHAR(3)
)
RETURNS TABLE 
AS
RETURN 
(
	
	SELECT * FROM 
	(
	SELECT 
		mp.menu_id,
		mp.group_menu_id,
		m.description AS menu_desc,
		g.description AS group_desc
		FROM m_group_menu_mapping mp
		JOIN m_menu m ON m.menu_id = mp.menu_id
		JOIN m_group_menu g ON g.group_menu_id = mp.group_menu_id
		WHERE mp.is_delete = '0'
		AND m.is_delete = '0'
		AND g.is_delete = '0'
		AND mp.status_id = 5
		AND g.status_id = 5
		AND mp.group_menu_id = @pi_group_menu_id) AS tbl_a
	
	LEFT JOIN 
	(
		SELECT * FROM 
		(
			SELECT 
				mp.menu_id AS menu_id_2,
				mp.group_menu_id AS group_menu_id_2,
				m.description AS menu_desc_2,
				g.description AS group_desc_2
			FROM m_group_menu_mapping mp
			JOIN m_menu m ON m.menu_id = mp.menu_id
			JOIN m_group_menu g ON g.group_menu_id = mp.group_menu_id
			WHERE mp.is_delete = '0'
			AND m.is_delete = '0'
			AND g.is_delete = '0'
			AND mp.status_id = 5
			AND g.status_id = 5
			AND mp.group_menu_id = @pi_group_menu_id
		) AS gmenu,
		(
			SELECT
			menu_id AS user_menu_id,
			is_delete,
			is_exclude,
			user_id
			FROM
			m_user_menu_mapping
			WHERE is_delete = 0 AND user_id = @pi_user_id
		) AS umenu
	WHERE gmenu.menu_id_2 = umenu.user_menu_id
	) AS tbl_b ON tbl_b.menu_id_2 = tbl_a.menu_id
	
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_user_menu_all_not_excluded]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_user_menu_all_not_excluded]
(	
	@pi_user_id VARCHAR(3)
)
RETURNS TABLE 
AS
RETURN 
(
	
	  SELECT * FROM
		  (SELECT 
			DISTINCT
			m.menu_id, 
			m.menu_category_id,
			m.url,
			m.description AS menu_desc,
			m.icon_class,
			m.menu_id_parent,
			c.description AS cat_desc
			--g.group_menu_id,
			--g.description AS group_desc
		  FROM m_menu m
		  JOIN m_group_menu_mapping p ON p.menu_id = m.menu_id
		  JOIN m_group_menu g ON g.group_menu_id = p.group_menu_id
		  JOIN m_user_group_menu_mapping mp ON mp.group_menu_id = p.group_menu_id
		  JOIN m_menu_category c ON c.menu_category_id = m.menu_category_id
		  WHERE m.is_delete = '0'
		  AND p.is_delete = '0'
		  AND g.is_delete = '0'
		  AND mp.user_id = @pi_user_id
		  AND mp.is_delete = 0) AS a 
		  FULL OUTER JOIN (
			SELECT 
				m_user_menu_mapping.user_id, 
				m_user_menu_mapping.menu_id AS menuid,
				m_menu_category.description AS catdesc, 
				m_menu.description AS menudesc,
				m_user_menu_mapping.is_exclude,
				m_user_menu_mapping.id AS mapping_id,
				m_menu.menu_id_parent AS menuidparent,
				m_menu.url AS menuurl,
				m_menu.icon_class AS iconclass 
			FROM m_user_menu_mapping
			JOIN m_menu ON m_menu.menu_id = m_user_menu_mapping.menu_id
			JOIN m_menu_category ON m_menu_category.menu_category_id = m_menu.menu_category_id
			WHERE m_user_menu_mapping.user_id = @pi_user_id
			AND m_user_menu_mapping.is_delete = 0
			AND m_menu.is_delete = '0'

		  ) b ON a.menu_id = b.menuid
		  WHERE is_exclude = 0 OR is_exclude IS NULL
	
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_user_menu_all_excluded]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_user_menu_all_excluded]
(	
	@pi_user_id VARCHAR(3)
)
RETURNS TABLE 
AS
RETURN 
(
	
	  SELECT * FROM
		  (SELECT 
			DISTINCT
			m.menu_id, 
			m.menu_category_id,
			m.url,
			m.description AS menu_desc,
			m.menu_id_parent,
			c.description AS cat_desc
			--g.group_menu_id,
			--g.description AS group_desc
		  FROM m_menu m
		  JOIN m_group_menu_mapping p ON p.menu_id = m.menu_id
		  JOIN m_group_menu g ON g.group_menu_id = p.group_menu_id
		  JOIN m_user_group_menu_mapping mp ON mp.group_menu_id = p.group_menu_id
		  JOIN m_menu_category c ON c.menu_category_id = m.menu_category_id
		  WHERE m.is_delete = '0'
		  AND p.is_delete = '0'
		  AND g.is_delete = '0'
		  AND mp.user_id = @pi_user_id
		  AND mp.is_delete = 0) AS a 
		  FULL OUTER JOIN (
			SELECT 
				m_user_menu_mapping.user_id, 
				m_user_menu_mapping.menu_id AS menuid,
				m_menu_category.description AS catdesc, 
				m_menu.description AS menudesc,
				m_user_menu_mapping.is_exclude,
				m_user_menu_mapping.id AS mapping_id 
			FROM m_user_menu_mapping
			JOIN m_menu ON m_menu.menu_id = m_user_menu_mapping.menu_id
			JOIN m_menu_category ON m_menu_category.menu_category_id = m_menu.menu_category_id
			WHERE m_user_menu_mapping.user_id = @pi_user_id
			AND m_user_menu_mapping.is_delete = 0
			AND m_menu.is_delete = '0'

		  ) b ON a.menu_id = b.menuid
		  WHERE is_exclude = 1
	
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_user_menu_all]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_user_menu_all]
(	
	@pi_user_id VARCHAR(3)
)
RETURNS TABLE 
AS
RETURN 
(
	
	  SELECT * FROM
		  (SELECT 
			DISTINCT
			m.menu_id, 
			m.menu_category_id,
			m.url,
			m.description AS menu_desc,
			m.menu_id_parent,
			mg.description AS parent_desc,
			c.description AS cat_desc
			--g.group_menu_id,
			--g.description AS group_desc
		  FROM m_menu m
		  JOIN m_group_menu_mapping p ON p.menu_id = m.menu_id
		  JOIN m_group_menu g ON g.group_menu_id = p.group_menu_id
		  JOIN m_user_group_menu_mapping mp ON mp.group_menu_id = p.group_menu_id
		  JOIN m_menu_category c ON c.menu_category_id = m.menu_category_id
		  LEFT JOIN m_menu mg ON m.menu_id_parent = mg.menu_id
		  WHERE m.is_delete = '0'
		  AND p.is_delete = '0'
		  AND g.is_delete = '0'
		  AND mp.user_id = @pi_user_id
		  AND mp.is_delete = 0) AS a 
		  FULL OUTER JOIN (
			SELECT 
				m_user_menu_mapping.user_id, 
				m_user_menu_mapping.menu_id AS menuid,
				m_menu_category.description AS catdesc, 
				m_menu.description AS menudesc,
				m_menu.menu_id_parent AS menuidparent,
				m2.description AS parentdesc,
				m_user_menu_mapping.is_exclude,
				m_user_menu_mapping.id AS mapping_id 
			FROM m_user_menu_mapping
			JOIN m_menu ON m_menu.menu_id = m_user_menu_mapping.menu_id
			JOIN m_menu_category ON m_menu_category.menu_category_id = m_menu.menu_category_id
			LEFT JOIN m_menu m2 ON m_menu.menu_id_parent = m2.menu_id
			WHERE m_user_menu_mapping.user_id = @pi_user_id
			AND m_user_menu_mapping.is_delete = 0
			AND m_menu.is_delete = '0'

		  ) b ON a.menu_id = b.menuid
	
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_reason_by_action]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_reason_by_action] 
(	
	@pi_action_id BIGINT
)
RETURNS TABLE 
AS
RETURN 
(
	SELECT
		r.reason_id, 
		r.reason_category_id, 
		r.description, 
		r.status_id, 
		r.created_by, 
		r.created_date, 
		r.modified_by, 
		r.modified_date, 
		r.is_delete
	FROM m_reason r,
	(
		SELECT
			reason_category_id
		FROM m_workflow_template_action 
		WHERE workflow_template_action_id = @pi_action_id
		AND is_delete = 0
		AND is_need_reason = 1
	) a
	WHERE a.reason_category_id = r.reason_category_id
	AND r.is_delete = 0
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_menu_for_add_no_category]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_menu_for_add_no_category]
(	
	@pi_user_id VARCHAR(3)
)
RETURNS TABLE 
AS
RETURN 
(

SELECT 
	mm.*, 
	c.description AS category_desc,
	mp.description AS parent_desc
FROM m_menu mm
JOIN m_menu_category c ON mm.menu_category_id = c.menu_category_id
LEFT JOIN m_menu mp ON mp.menu_id = mm.menu_id_parent
WHERE mm.is_delete = '0'
AND c.is_delete = '0'
AND mm.menu_id NOT IN
(
	SELECT COALESCE(menu_id, menuid) 
	FROM
		  (SELECT 
			DISTINCT
			m.menu_id 
		  FROM m_menu m
		  JOIN m_group_menu_mapping p ON p.menu_id = m.menu_id
		  JOIN m_group_menu g ON g.group_menu_id = p.group_menu_id
		  JOIN m_user_group_menu_mapping mp ON mp.group_menu_id = p.group_menu_id
		  JOIN m_menu_category c ON c.menu_category_id = m.menu_category_id
		  WHERE m.is_delete = '0'
		  AND p.is_delete = '0'
		  AND g.is_delete = '0'
		  AND mp.user_id = @pi_user_id
		  AND mp.is_delete = 0) AS a 
		  FULL OUTER JOIN (
			SELECT 
				m_user_menu_mapping.menu_id AS menuid
			FROM m_user_menu_mapping
			JOIN m_menu ON m_menu.menu_id = m_user_menu_mapping.menu_id
			JOIN m_menu_category ON m_menu_category.menu_category_id = m_menu.menu_category_id
			WHERE m_user_menu_mapping.user_id = @pi_user_id
			AND m_user_menu_mapping.is_delete = 0
			AND m_menu.is_delete = '0'

		  ) b ON a.menu_id = b.menuid

)

)
GO
/****** Object:  UserDefinedFunction [dbo].[get_menu_for_add]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_menu_for_add]
(	
	@pi_user_id VARCHAR(3),
	@pi_menu_category_id INT
)
RETURNS TABLE 
AS
RETURN 
(

SELECT 
	mm.*, 
	c.description AS category_desc,
	mp.description AS parent_desc
FROM m_menu mm
JOIN m_menu_category c ON mm.menu_category_id = c.menu_category_id
LEFT JOIN m_menu mp ON mp.menu_id = mm.menu_id_parent
WHERE mm.is_delete = '0'
AND c.is_delete = '0'
AND mm.menu_category_id = @pi_menu_category_id
AND mm.menu_id NOT IN
(
	SELECT COALESCE(menu_id, menuid) 
	FROM
		  (SELECT 
			DISTINCT
			m.menu_id 
		  FROM m_menu m
		  JOIN m_group_menu_mapping p ON p.menu_id = m.menu_id
		  JOIN m_group_menu g ON g.group_menu_id = p.group_menu_id
		  JOIN m_user_group_menu_mapping mp ON mp.group_menu_id = p.group_menu_id
		  JOIN m_menu_category c ON c.menu_category_id = m.menu_category_id
		  WHERE m.is_delete = '0'
		  AND p.is_delete = '0'
		  AND g.is_delete = '0'
		  AND mp.user_id = @pi_user_id
		  AND mp.is_delete = 0) AS a 
		  FULL OUTER JOIN (
			SELECT 
				m_user_menu_mapping.menu_id AS menuid
			FROM m_user_menu_mapping
			JOIN m_menu ON m_menu.menu_id = m_user_menu_mapping.menu_id
			JOIN m_menu_category ON m_menu_category.menu_category_id = m_menu.menu_category_id
			WHERE m_user_menu_mapping.user_id = @pi_user_id
			AND m_user_menu_mapping.is_delete = 0
			AND m_menu.is_delete = '0'

		  ) b ON a.menu_id = b.menuid

)

)
GO
/****** Object:  UserDefinedFunction [dbo].[get_menu_by_category_excl_group]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE FUNCTION [dbo].[get_menu_by_category_excl_group] 
(	
	@pi_group_menu_id INT,
	@pi_menu_category_id INT
)
RETURNS TABLE 
AS
RETURN 
(
	SELECT m.* FROM m_menu m
	WHERE m.menu_id NOT IN (
		SELECT g.menu_id FROM m_group_menu_mapping g
		WHERE g.group_menu_id = @pi_group_menu_id
		AND g.is_delete = '0'
	)
	AND m.menu_category_id = @pi_menu_category_id
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_HigherOrganization]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_HigherOrganization] (@pi_level_id int)  
RETURNS TABLE  
AS  
RETURN
(
	SELECT 
		o.organization_id, 
		o.organization_code, 
		o.description,
		o.organization_id_parent,
		o.level_type_id,
		l.seq_number 
	FROM m_organization o,
		(
			SELECT 
				level_type_id,
				level_type_code,
				description,
				seq_number
			FROM m_level_type
		) l,
		(
			SELECT seq_number FROM m_level_type
			WHERE level_type_id = @pi_level_id
		) s
	  WHERE o.level_type_id = l.level_type_id

	  AND l.seq_number < s.seq_number
)
GO
/****** Object:  UserDefinedFunction [dbo].[get_higher_organization]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_higher_organization] (@pi_level_id int)  
RETURNS TABLE  
AS  
RETURN
(
	SELECT 
		o.organization_id, 
		o.organization_code, 
		o.description,
		o.organization_id_parent,
		o.level_type_id,
		l.seq_number 
	FROM m_organization o,
		(
			SELECT 
				level_type_id,
				level_type_code,
				description,
				seq_number
			FROM m_level_type
		) l,
		(
			SELECT seq_number FROM m_level_type
			WHERE level_type_id = @pi_level_id
		) s
	  WHERE o.level_type_id = l.level_type_id
	  AND l.seq_number < s.seq_number
	  AND o.status_id = 5
)
GO
/****** Object:  StoredProcedure [dbo].[AddUserMenuMapping]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[AddUserMenuMapping]
	@pi_menu_id INT,
	@pi_user_id VARCHAR(3),
	@pi_created_by VARCHAR(3)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    DECLARE @idexist INT;

	SELECT @idexist = COUNT(id) 
	FROM m_user_menu_mapping
	WHERE menu_id = @pi_menu_id
	AND user_id = @pi_user_id
	AND is_delete = 0;

	IF @idexist = 0
		
		BEGIN

			BEGIN TRANSACTION

				INSERT INTO m_user_menu_mapping
				(
					user_id,
					menu_id,
					is_exclude,
					created_by,
					created_date,
					modified_by,
					modified_date,
					is_delete
				)
				VALUES
				(
					@pi_user_id,
					@pi_menu_id,
					0,
					@pi_created_by,
					GETDATE(),
					@pi_created_by,
					GETDATE(),
					0
				);

				IF @@ERROR <> 0
					 BEGIN
						-- Rollback the transaction
						ROLLBACK

						-- Raise an error and return
						--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
						RETURN
					 END

				DECLARE @parents CURSOR;
				DECLARE @menu_id INT;
				DECLARE @parent_id INT;

				SET @parents = CURSOR FOR
				WITH Menus AS 
					( 
					--initialization 
						SELECT menu_id, menu_id_parent 
						FROM m_menu 
						WHERE menu_id = @pi_menu_id
						UNION ALL 
					--recursive execution 
						SELECT e.menu_id, e.menu_id_parent
						FROM m_menu e INNER JOIN Menus m  
						ON e.menu_id = m.menu_id_parent 
					)
			
				SELECT * FROM Menus;			
	
				OPEN @parents
					FETCH NEXT FROM @parents into @menu_id, @parent_id

						WHILE @@fetch_status = 0
			  
						  BEGIN
				  
							  IF @menu_id <> @pi_menu_id
					
								BEGIN

									DECLARE @pidexist INT;

									SELECT @pidexist = COUNT(id) 
									FROM m_user_menu_mapping
									WHERE menu_id = @menu_id
									AND user_id = @pi_user_id
									AND is_delete = 0;	

									IF @pidexist = 0
							
										INSERT INTO m_user_menu_mapping
										(
											user_id,
											menu_id,
											is_exclude,
											created_by,
											created_date,
											modified_by,
											modified_date,
											is_delete
										)
										VALUES
										(
											@pi_user_id,
											@menu_id,
											0,
											@pi_created_by,
											GETDATE(),
											@pi_created_by,
											GETDATE(),
											0
										);

										IF @@ERROR <> 0
											 BEGIN
												-- Rollback the transaction
												ROLLBACK

												-- Raise an error and return
												--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
												RETURN
											 END

								END

							  FETCH NEXT FROM @parents into @menu_id, @parent_id
						  END

			COMMIT
		END


END
GO
/****** Object:  StoredProcedure [dbo].[AddUserGroupMenuMapping]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddUserGroupMenuMapping]
	@pi_group_menu_id INT,
	@pi_user_id VARCHAR(3),
	@pi_created_by VARCHAR(3)
AS

BEGIN

DECLARE @groupcursor CURSOR;
DECLARE @m_menu_id int;

BEGIN TRANSACTION

INSERT INTO m_user_group_menu_mapping
(
	user_id,
	group_menu_id,
	created_by,
	created_date,
	modified_by,
	modified_date,
	is_delete
)
VALUES
(
	@pi_user_id,
	@pi_group_menu_id,
	@pi_created_by,
	GETDATE(),
	@pi_created_by,
	GETDATE(),
	0
);

IF @@ERROR <> 0
	BEGIN
						-- Rollback the transaction
		ROLLBACK

						-- Raise an error and return
						--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
		RETURN
	END

SET @groupcursor = CURSOR FOR SELECT menu_id FROM m_group_menu_mapping WHERE group_menu_id = @pi_group_menu_id AND is_delete=0;

OPEN @groupcursor
FETCH NEXT FROM @groupcursor into @m_menu_id

WHILE @@fetch_status = 0
	BEGIN

			DECLARE @parents CURSOR;
			DECLARE @c_menu_id INT;
			DECLARE @parent_id INT;

			SET @parents = CURSOR FOR
			WITH Menus AS 
				( 
				--initialization 
					SELECT menu_id, menu_id_parent 
					FROM m_menu 
					WHERE menu_id = @m_menu_id
					UNION ALL 
				--recursive execution 
					SELECT e.menu_id, e.menu_id_parent
					FROM m_menu e INNER JOIN Menus m  
					ON e.menu_id = m.menu_id_parent 
				) 
			
			SELECT * FROM Menus;			
	
			OPEN @parents
			FETCH NEXT FROM @parents into @c_menu_id, @parent_id

			WHILE @@fetch_status = 0
			  
			  BEGIN
				  
				  IF @c_menu_id <> @m_menu_id
					
					BEGIN

						DECLARE @pidexist INT;

						SELECT @pidexist = COUNT(id) 
						FROM m_user_menu_mapping
						WHERE menu_id = @c_menu_id
						AND user_id = @pi_user_id
						AND is_delete = 0;	

						IF @pidexist = 0
							
							BEGIN
							
								INSERT INTO m_user_menu_mapping
								(
									user_id,
									menu_id,
									is_exclude,
									created_by,
									created_date,
									modified_by,
									modified_date,
									is_delete
								)
								VALUES
								(
									@pi_user_id,
									@c_menu_id,
									0,
									@pi_created_by,
									GETDATE(),
									@pi_created_by,
									GETDATE(),
									0
								);

								IF @@ERROR <> 0
								 BEGIN
									-- Rollback the transaction
									ROLLBACK

									-- Raise an error and return
									--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
									RETURN
								 END
							
							END

					END

				  FETCH NEXT FROM @parents into @c_menu_id, @parent_id
			  END

	FETCH NEXT FROM @groupcursor into @m_menu_id;
	END

	COMMIT

END
GO
/****** Object:  StoredProcedure [dbo].[IncludeExcludeUserMenu]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[IncludeExcludeUserMenu] (
	@pi_user_id VARCHAR(3),
	@pi_menu_id INT,
	@pi_act VARCHAR(10),
	@pi_created_by VARCHAR(3)
)
AS
BEGIN

	SET NOCOUNT ON;

	DECLARE @cnt INT;

	SET @cnt = (
		SELECT 
			COUNT(id)
		FROM m_user_menu_mapping
		WHERE user_id = @pi_user_id
		AND menu_id = @pi_menu_id
		AND is_delete = 0
	);
	
	BEGIN TRANSACTION

	IF @cnt > 0
		
		BEGIN
			
			IF @pi_act = 'include'

				BEGIN

					UPDATE m_user_menu_mapping
					SET is_exclude = 0,
						modified_by = @pi_created_by,
						modified_date = GETDATE()
					WHERE user_id = @pi_user_id
					AND menu_id = @pi_menu_id;

					IF @@ERROR <> 0
					 BEGIN
						-- Rollback the transaction
						ROLLBACK

						-- Raise an error and return
						--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
						RETURN
					 END

					DECLARE @parents CURSOR;
					DECLARE @menu_id INT;
					DECLARE @parent_id INT;

					SET @parents = CURSOR FOR
					WITH Menus AS 
					( 
					--initialization 
						SELECT menu_id, menu_id_parent 
						FROM m_menu 
						WHERE menu_id = @pi_menu_id
						UNION ALL 
					--recursive execution 
						SELECT e.menu_id, e.menu_id_parent
						FROM m_menu e INNER JOIN Menus m  
						ON e.menu_id = m.menu_id_parent 
					) 
			
					SELECT * FROM Menus;			
	
					OPEN @parents
					FETCH NEXT FROM @parents into @menu_id, @parent_id

					WHILE @@fetch_status = 0
			  
						BEGIN
				  
							IF @menu_id <> @pi_menu_id
					
								BEGIN

									DECLARE @pidexist INT;

									SELECT @pidexist = COUNT(id) 
									FROM m_user_menu_mapping
									WHERE menu_id = @menu_id
									AND user_id = @pi_user_id
									AND is_delete = 0;	

									IF @pidexist = 0
							
										INSERT INTO m_user_menu_mapping
										(
											user_id,
											menu_id,
											is_exclude,
											created_by,
											created_date,
											modified_by,
											modified_date,
											is_delete
										)
										VALUES
										(
											@pi_user_id,
											@menu_id,
											0,
											@pi_created_by,
											GETDATE(),
											@pi_created_by,
											GETDATE(),
											0
										);

									ELSE

										UPDATE m_user_menu_mapping
										SET is_exclude = 0,
											modified_by = @pi_created_by,
											modified_date = GETDATE()
										WHERE user_id = @pi_user_id
										AND menu_id = @menu_id;
										
									IF @@ERROR <> 0
										 BEGIN
											-- Rollback the transaction
											ROLLBACK

											-- Raise an error and return
											--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
											RETURN
										 END
								END --END IF @menu_id <> @pi_menu_id

					  FETCH NEXT FROM @parents into @menu_id, @parent_id
				  END --END WHILE

				END --IF @pi_act = 'include'

			ELSE

				BEGIN
					
					UPDATE m_user_menu_mapping
					SET is_exclude = 1,
						modified_by = @pi_created_by,
						modified_date = GETDATE()
					WHERE user_id = @pi_user_id
					AND menu_id = @pi_menu_id;

					IF @@ERROR <> 0
					 BEGIN
						-- Rollback the transaction
						ROLLBACK

						-- Raise an error and return
						--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
						RETURN
					 END

				END
		END 

	ELSE

		BEGIN

			IF @pi_act = 'include'
				
				BEGIN
				
					INSERT INTO m_user_menu_mapping (
						user_id,
						menu_id,
						is_exclude,
						created_by,
						created_date,
						modified_by,
						modified_date
					)
					VALUES (
						@pi_user_id,
						@pi_menu_id,
						0,
						@pi_created_by,
						GETDATE(),
						@pi_created_by,
						GETDATE()
					);

					IF @@ERROR <> 0
					 BEGIN
						-- Rollback the transaction
						ROLLBACK

						-- Raise an error and return
						--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
						RETURN
					 END
					

					DECLARE @parents2 CURSOR;
					DECLARE @menu_id2 INT;
					DECLARE @parent_id2 INT;

					SET @parents = CURSOR FOR
					WITH Menus AS 
					( 
					--initialization 
						SELECT menu_id, menu_id_parent 
						FROM m_menu 
						WHERE menu_id = @pi_menu_id
						UNION ALL 
					--recursive execution 
						SELECT e.menu_id, e.menu_id_parent
						FROM m_menu e INNER JOIN Menus m  
						ON e.menu_id = m.menu_id_parent 
					) 
			
					SELECT * FROM Menus;			
	
					OPEN @parents2
					FETCH NEXT FROM @parents2 into @menu_id2, @parent_id2

					WHILE @@fetch_status = 0
			  
						BEGIN
				  
							IF @menu_id2 <> @pi_menu_id
					
								BEGIN

									DECLARE @pidexists INT;

									SELECT @pidexists = COUNT(id) 
									FROM m_user_menu_mapping
									WHERE menu_id = @menu_id2
									AND user_id = @pi_user_id
									AND is_delete = 0;	

									IF @pidexists = 0
							
										INSERT INTO m_user_menu_mapping
										(
											user_id,
											menu_id,
											is_exclude,
											created_by,
											created_date,
											modified_by,
											modified_date,
											is_delete
										)
										VALUES
										(
											@pi_user_id,
											@menu_id2,
											0,
											@pi_created_by,
											GETDATE(),
											@pi_created_by,
											GETDATE(),
											0
										);

									ELSE

										UPDATE m_user_menu_mapping
										SET is_exclude = 0,
											modified_by = @pi_created_by,
											modified_date = GETDATE()
										WHERE user_id = @pi_user_id
										AND menu_id = @menu_id2
										AND is_delete = 0;

									IF @@ERROR <> 0
									 BEGIN
										-- Rollback the transaction
										ROLLBACK

										-- Raise an error and return
										--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
										RETURN
									 END

								END --END IF @menu_id <> @pi_menu_id

					  FETCH NEXT FROM @parents2 into @menu_id2, @parent_id2
				  END --END WHILE
				
				END -- END IF @pi_act = 'include'

			ELSE

				BEGIN
				
					INSERT INTO m_user_menu_mapping (
						user_id,
						menu_id,
						is_exclude,
						created_by,
						created_date,
						modified_by,
						modified_date,
						is_delete
					)
					VALUES (
						@pi_user_id,
						@pi_menu_id,
						1,
						@pi_created_by,
						GETDATE(),
						@pi_created_by,
						GETDATE(),
						0
					);

					IF @@ERROR <> 0
						 BEGIN
										-- Rollback the transaction
							ROLLBACK

										-- Raise an error and return
										--RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1)
							RETURN
						END			

				END
		
		END 

	COMMIT
	
END
GO
/****** Object:  StoredProcedure [dbo].[RemoveUserGroupMenu]    Script Date: 11/10/2017 16:12:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[RemoveUserGroupMenu] (
	@pi_user_id VARCHAR(3),
	@pi_group_menu_id INT,
	@pi_created_by VARCHAR(3)
)
	
AS
BEGIN

	UPDATE m_user_group_menu_mapping
	SET is_delete = 1,
		modified_by = @pi_created_by,
		modified_date = GETDATE()
	WHERE user_id = @pi_user_id
	AND group_menu_id = @pi_group_menu_id;

	UPDATE m_user_menu_mapping
	SET is_delete = 1,
		modified_by = @pi_created_by,
		modified_date = GETDATE()
	WHERE user_id = @pi_user_id
	AND menu_id IN (
		SELECT menu_id
		FROM m_group_menu_mapping
		WHERE group_menu_id = @pi_group_menu_id
		AND is_delete = '0'
	);

END
GO
/****** Object:  StoredProcedure [dbo].[proc_submit_transaction]    Script Date: 11/10/2017 16:12:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- Note: Saat script ini dicreate di Production, mohon diubah bagian exec SP sbb:
--       - proc_get_new_business_information
--       - proc_get_alteration_information
--       - proc_get_claim_information
-- SP tsb saat di server Development menggunakan link server ke [ELI-DB10\EQUITY].[db_link_project_uat]
-- Saat dicreate di Production, tidak perlu lagi menggunakan link server, cukup [db_link_project] saja


-- last modified by Pribadi Pamungkas. 2017-11-06 => - apakah sudah digunakan di transaksi edits yang lain? Jika sudah maka sistem akan menolak proses dan mengeluarkan pesan "Duplicate Reference No. with Register No [RegisterNumber EDITS]! "
--																									 - apakah nomor transaksi sudah terdaftar di aplikasi core sistem? Jika sudah maka sistem akan menolak proses dan mengeluarkan pesan "Reference No. not found. Please input Register No. from Core System!"
--
-- todo: - cek status tiap tabel (active) dan is_delete
--       - informasi mandatory
CREATE PROCEDURE [dbo].[proc_submit_transaction]
	@pi_transaction_id BIGINT,
	@pi_workflow_template_action_id BIGINT,  -- next workflow_template_action_id yg akan dituju
	@pi_reason_id INT,
	@pi_reference_number VARCHAR(50),
	@pi_remarks VARCHAR(255),
	@pi_user_id VARCHAR(8),
	@po_message VARCHAR(400) OUTPUT
AS
BEGIN
	SET NOCOUNT ON;	-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.

	DECLARE 
	  @v_result BIT = 0,
	  @v_current_datetime DATETIME = GETDATE()
	

	BEGIN TRY
	BEGIN TRANSACTION proses_utama

		--====================== get transaction ======================
		DECLARE
			@v_current_workflow_template_stage_id BIGINT,
			@v_requester_id VARCHAR(8),
			@v_branch_id INT,
			@v_transaction_type_id INT,
			@v_currency_id INT,
			@v_currency_code VARCHAR(3),
			@v_transaction_value DECIMAL(12,2),
			@v_is_policy_holder TINYINT = 0
		SELECT
			@v_current_workflow_template_stage_id = workflow_template_stage_id,
			@v_requester_id = [user_id],
			@v_branch_id = branch_id,
			@v_transaction_type_id = transaction_type_id,
			@v_currency_id = currency_id,
			@v_currency_code = currency_code,
			@v_transaction_value = COALESCE(transaction_value,0),
			@v_is_policy_holder = COALESCE(is_policy_holder,0)
		FROM
			dbo.t_transaction
		WHERE
			transaction_id = @pi_transaction_id
		IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Transaction not found'
				GOTO ERROR_OUT
			END
	

		--====================== validasi next workflow stage adalah benar lanjutan dari workflow stage saat ini ======================
		DECLARE 
			@v_destination_stage_id INT,
			@v_is_check_mandatory_document BIT = 0,
			@v_workflow_template_stage_id BIGINT,
			@v_action_description VARCHAR(255),
			@v_is_stage_approval VARCHAR(1),
			@v_approv_matrix_id INT,
			@v_is_final_action VARCHAR(1) = '0',
			@v_transaction_status_id INT,
			@v_is_fill_reference_number VARCHAR(1), -- new
			@v_is_need_reason VARCHAR(1), -- new
			@v_pic_is_requester VARCHAR(1), -- new
			--sudah di-declare dibawah  --@v_group_pic_id INT -- new
			@v_is_remarks_mandatory VARCHAR(1) = '0'
		SELECT
			@v_destination_stage_id = act.destination_stage_id,
			@v_is_check_mandatory_document = CASE act.is_check_mandatory_document
												                WHEN '1' THEN 1
												                ELSE 0
											                 END,
			@v_workflow_template_stage_id = act.workflow_template_stage_id,
			@v_action_description = act.[description],
			--@v_is_stage_approval = COALESCE(stg.is_stage_approval,'0'),
			@v_is_stage_approval = COALESCE(next_stg.is_stage_approval,'0'),  -- modified by Pribadi Pamungkas. 2017-10-11. fix ke next stage
			--@v_approv_matrix_id = stg.approv_matrix_id,
			@v_approv_matrix_id = next_stg.approv_matrix_id,      -- modified by Pribadi Pamungkas. 2017-10-11. fix ke next stage
			@v_is_final_action = COALESCE(act.is_final_action,'0'),
			@v_transaction_status_id = act.transaction_status_id,
	    @v_is_fill_reference_number = COALESCE(act.is_fill_reference_number,'0'), -- new
	    @v_is_need_reason = COALESCE(act.is_need_reason,'0'), -- new
	    @v_pic_is_requester = COALESCE(next_stg.pic_is_requester,'0'), -- new
	    --sudah di-declare dibawah  --@v_group_pic_id = next_stg.group_pic_id, -- new
	    @v_is_remarks_mandatory = COALESCE(act.is_remarks_mandatory,'0')
		FROM
			dbo.m_workflow_template_action AS act INNER JOIN
			dbo.m_workflow_template_stage AS stg ON act.workflow_template_stage_id = stg.workflow_template_stage_id LEFT JOIN
			dbo.m_workflow_template_stage AS next_stg ON act.destination_stage_id = next_stg.workflow_template_stage_id
		WHERE
			act.workflow_template_stage_id = @v_current_workflow_template_stage_id  -- workflow_template_stage_id saat ini
			AND act.workflow_template_action_id = @pi_workflow_template_action_id   -- 
			AND act.is_delete = '0'
			AND stg.is_delete = '0'
		IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Destination Action is not valid'
				GOTO ERROR_OUT
			END

    IF (@v_is_final_action = '0') AND (@v_destination_stage_id IS NULL) -- jika bukan final action, tetapi tidak ada destination_stage
			BEGIN
				SET @po_message = 'Missing Destination Stage'
				GOTO ERROR_OUT
			END


		--====================== cek remarks ======================
		IF (@v_is_remarks_mandatory = '1')	-- jika remarks wajib diisi
			BEGIN
				IF (LEN(COALESCE(@pi_remarks,''))<=1)	-- jika remaks berisi 1 karakter atau kurang
					BEGIN
			      SET @po_message = 'Please fill in the remarks field'
			      GOTO ERROR_OUT
					END
			END


		--====================== cek informasi transaksi mandatory ======================
		IF (@v_is_fill_reference_number = '1')
		  BEGIN
		    IF (COALESCE(@pi_reference_number,'') = '')
		      BEGIN
			      SET @po_message = 'Reference Number is empty'
			      GOTO ERROR_OUT
		      END
		    ELSE
		      BEGIN
						IF EXISTS(SELECT
												* 
											FROM 
												dbo.t_transaction 
											WHERE 
												reference_number = @pi_reference_number 
												AND status_id NOT IN (3,5)	-- Reject / Cancel
												AND is_delete = 0
												AND transaction_id <> @pi_transaction_id)
							BEGIN		-- jika sudah terpakai
								DECLARE @register_number_terpakai VARCHAR(9)
								SELECT
									@register_number_terpakai = register_number 
								FROM 
									dbo.t_transaction 
								WHERE 
									reference_number = @pi_reference_number 
									AND status_id NOT IN (3,5)	-- Reject / Cancel
									AND is_delete = 0
									AND transaction_id <> @pi_transaction_id
								SET @po_message = 'Duplicate Reference No. with Register No '+@register_number_terpakai
								GOTO ERROR_OUT
							END
						ELSE
							BEGIN
								-- note: saat live (pindah ke Production), ini di-enable-kan lagi, dan tidak menggunakan linked server
								---- cek di PL ada gak
								DECLARE @v_transaction_category_code VARCHAR(6)
								SELECT
									@v_transaction_category_code = mtc.transaction_category_code
								FROM
									dbo.m_transaction_type AS mtt INNER JOIN
									dbo.m_transaction_category AS mtc ON mtt.transaction_category_id = mtc.transaction_category_id
								WHERE
									mtt.transaction_type_id = @v_transaction_type_id

								DECLARE
									@return_value_core INT,
									@return_numrow_core INT = 0 

								IF @v_transaction_category_code = 'NB'	-- New Business
									BEGIN
										EXEC @return_value_core = [db_link_project].[EDITS].[proc_get_new_business_information] @pi_proposal_no = @pi_reference_number
										SELECT @return_numrow_core = @@ROWCOUNT	-- step ini hanya mengecek apakah data tsb ada atau tidak di PL, jadi cukup pake @@ROWCOUNT aja, gak usah melihat isi data hasilnya
										IF (@return_value_core = 0) OR (@@ERROR = 0)	-- jika tidak ada error pas execute
											BEGIN
												IF (@return_numrow_core = 0)
													BEGIN
														SET @po_message = 'Reference No. not found. Please input Register No. from Core System!'
														GOTO ERROR_OUT
													END
											END
										ELSE
											BEGIN
												SET @po_message = 'Failed to get data from core system'
												GOTO ERROR_OUT
											END
									END
								ELSE IF @v_transaction_category_code = 'PS'	-- Policy Service
									BEGIN
										EXEC @return_value_core = [db_link_project].[EDITS].[proc_get_alteration_information] @pi_registration_no = @pi_reference_number
										SELECT @return_numrow_core = @@ROWCOUNT	-- step ini hanya mengecek apakah data tsb ada atau tidak di PL, jadi cukup pake @@ROWCOUNT aja, gak usah melihat isi data hasilnya
										IF (@return_value_core = 0) OR (@@ERROR = 0)	-- jika tidak ada error pas execute
											BEGIN
												IF (@return_numrow_core = 0)
													BEGIN
														SET @po_message = 'Reference No. not found. Please input Register No. from Core System!'
														GOTO ERROR_OUT
													END
											END
										ELSE
											BEGIN
												SET @po_message = 'Failed to get data from core system'
												GOTO ERROR_OUT
											END
									END
								ELSE IF @v_transaction_category_code = 'CL'	-- Claim
									BEGIN
										EXEC @return_value_core = [db_link_project].[EDITS].[proc_get_claim_information] @pi_claim_no = @pi_reference_number
										SELECT @return_numrow_core = @@ROWCOUNT	-- step ini hanya mengecek apakah data tsb ada atau tidak di PL, jadi cukup pake @@ROWCOUNT aja, gak usah melihat isi data hasilnya
										IF (@return_value_core = 0) OR (@@ERROR = 0)	-- jika tidak ada error pas execute
											BEGIN
												IF (@return_numrow_core = 0)
													BEGIN
														SET @po_message = 'Reference No. not found. Please input Register No. from Core System!'
														GOTO ERROR_OUT
													END
											END
										ELSE
											BEGIN
												SET @po_message = 'Failed to get data from core system'
												GOTO ERROR_OUT
											END
									END
								--ELSE IF @v_transaction_category_code = 'CO'	-- Collection
								--	BEGIN
									
								--	END
								ELSE
									BEGIN
										SET @po_message = 'Unknown transaction category'
										GOTO ERROR_OUT
									END

								UPDATE
									dbo.t_transaction
								SET
									reference_number = @pi_reference_number
								WHERE
									transaction_id = @pi_transaction_id
								IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
									BEGIN
										SET @po_message = 'Failed update reference_number'
										GOTO ERROR_OUT
									END
							END
		      END
		  END


		IF (@v_is_need_reason = '1')
		  IF (COALESCE(@pi_reason_id,0) = 0)
		    BEGIN
			    SET @po_message = 'Reason is empty'
			    GOTO ERROR_OUT
		    END


		DECLARE @v_information_valid BIT = 1  -- nanti kalau sudah dikasih pengecekan, ganti dengan 0
		--bla bla bla
		IF @v_information_valid = 0
			BEGIN
				SET @po_message = 'Document can not be processed. Please check mandatory Information'
				GOTO ERROR_OUT
			END


		--====================== cek dokumen transaksi mandatory ======================
		IF @v_is_check_mandatory_document=1
			BEGIN
				DECLARE @v_document_valid BIT = 0
				SELECT @v_document_valid = dbo.func_is_document_complete(@pi_transaction_id)
				IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					BEGIN
						SET @po_message = 'Failed check document'
						GOTO ERROR_OUT
					END
    	
				IF @v_document_valid = 0
					BEGIN
						SET @po_message = 'Document can not be processed. Please check mandatory Document'
						GOTO ERROR_OUT
					END
			END
	
	
		--====================== update transaction task sebelumnya menjadi not available ======================
		UPDATE
			tt
		SET
			status_id = 3,    -- 3:Not Available
			modified_by = @pi_user_id,
			modified_date = @v_current_datetime
		FROM
			dbo.t_transaction_task AS tt INNER JOIN
			(
				SELECT
					MAX(process_sequence) AS process_sequence,
					transaction_id
				FROM
					dbo.t_transaction_task
				WHERE
					transaction_id = @pi_transaction_id
				GROUP BY
					transaction_id
			) AS tt_max ON tt.transaction_id = tt_max.transaction_id
							AND tt.process_sequence = tt_max.process_sequence
		IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Failed update t_transaction_task'
				GOTO ERROR_OUT
			END


		--====================== history workflow ======================
		-- added by Pribadi Pamungkas. 2017-10-12
    IF EXISTS(SELECT
              	*
              FROM
              	dbo.t_transaction_history_workflow
              WHERE
                transaction_id = @pi_transaction_id
                AND workflow_template_stage_id = @v_workflow_template_stage_id  -- cek stage awal
                AND is_delete = 0)
      BEGIN  -- jika di stage awal (stage saat ini) sudah ada di tabel history_workflow

        UPDATE
          dbo.t_transaction_history_workflow
        SET
          last_user = @pi_user_id,                -- update user
          last_submit_date = @v_current_datetime  -- update tanggal
        WHERE
          transaction_id = @pi_transaction_id
          AND workflow_template_stage_id = @v_workflow_template_stage_id  -- update stage awal
          AND is_delete = 0

      END
    ELSE
      BEGIN  -- jika di stage awal (stage saat ini) BELUM ada di tabel history_workflow
        -- insert stage awal di tabel history_workflow
        INSERT INTO dbo.t_transaction_history_workflow
                   ([transaction_id]
                   ,[workflow_template_stage_id]
                   ,[last_user]
                   ,[last_submit_date]
                   ,[created_by]
                   ,[created_date]
                   ,[modified_by]
                   ,[modified_date]
                   ,[is_delete])
             VALUES
                   (@pi_transaction_id
                   ,@v_workflow_template_stage_id
                   ,@pi_user_id
                   ,@v_current_datetime
                   ,@pi_user_id
                   ,@v_current_datetime
                   ,@pi_user_id
                   ,@v_current_datetime
                   ,0)
      END



    -- insert transaction task
    DECLARE
      @v_next_process_sequence INT,
      @v_next_task_status_id INT = 2 --         <------------------ [1:Taken, 2:Available, 3:Not Available]
    SELECT
      @v_next_process_sequence = MAX(process_sequence) + 1
    FROM
      dbo.t_transaction_task
    WHERE
      transaction_id = @pi_transaction_id
    GROUP BY
      transaction_id

    IF (@v_is_final_action = '0') -- jika bukan final
      BEGIN
		    --====================== APPROVAL ======================
		    IF @v_is_stage_approval = '1'
		      BEGIN
		        IF @v_approv_matrix_id IS NULL
		          BEGIN
				        SET @po_message = 'Approval Matrix is not defined'
				        GOTO ERROR_OUT
		          END
            
            DECLARE @v_level_type_id INT
            SELECT
	            @v_level_type_id = mtd.level_type_id
            FROM
	            m_approv_matrix AS mtx INNER JOIN
	            m_approv_matrix_detail AS mtd ON mtx.approv_matrix_id = mtd.approv_matrix_id
            WHERE
              mtx.approv_matrix_id = @v_approv_matrix_id
              AND mtd.maximum_value >= @v_transaction_value
              AND mtd.currency_id = @v_currency_id


            -- list head (masih hardcode menggunakan SELECT satu-satu, harusnya menggunakan looping hierarki)
            DECLARE @list_user_approval TABLE ( userid VARCHAR(8))
            
            DECLARE 
              @v_organization_id INT,
              @v_organization_id_parent_1 INT,
              @v_organization_id_parent_2 INT,
              @v_organization_id_parent_3 INT,
              @v_organization_id_parent_4 INT,
              @v_organization_id_parent_5 INT,
              @v_level_type_id_1 INT,
              @v_level_type_id_2 INT,
              @v_level_type_id_3 INT,
              @v_level_type_id_4 INT,
              @v_level_type_id_5 INT,
              @v_user_id_head_1 VARCHAR(8),
              @v_user_id_head_2 VARCHAR(8),
              @v_user_id_head_3 VARCHAR(8),
              @v_user_id_head_4 VARCHAR(8),
              @v_user_id_head_5 VARCHAR(8)
            DECLARE list_organization_cursor CURSOR FAST_FORWARD FOR  
            SELECT
	            org.organization_id
            FROM
	            m_user AS usr INNER JOIN
	            m_user_organization AS org ON usr.username = org.user_id_organization
            WHERE
              usr.username = @pi_user_id
            
            OPEN list_organization_cursor  
            FETCH NEXT FROM list_organization_cursor INTO @v_organization_id
            
            WHILE @@FETCH_STATUS = 0  
            BEGIN    
            
              -- reset
              SET @v_organization_id_parent_1 = NULL
              SET @v_organization_id_parent_2 = NULL
              SET @v_organization_id_parent_3 = NULL
              SET @v_organization_id_parent_4 = NULL
              SET @v_organization_id_parent_5 = NULL
              SET @v_level_type_id_1 = NULL
              SET @v_level_type_id_2 = NULL
              SET @v_level_type_id_3 = NULL
              SET @v_level_type_id_4 = NULL
              SET @v_level_type_id_5 = NULL
              SET @v_user_id_head_1 = NULL
              SET @v_user_id_head_2 = NULL
              SET @v_user_id_head_3 = NULL
              SET @v_user_id_head_4 = NULL
              SET @v_user_id_head_5 = NULL

              IF (@v_organization_id IS NOT NULL) AND (@v_level_type_id IS NOT NULL)
                BEGIN
                  SELECT
	                  @v_level_type_id_1 = level_type_id,
	                  @v_user_id_head_1 = user_id_head,
	                  @v_organization_id_parent_1 = organization_id_parent
                  FROM
	                  m_organization
                  WHERE
                    organization_id = @v_organization_id
                    AND level_type_id >= @v_level_type_id
                  IF (@@ROWCOUNT > 0) AND (COALESCE(@v_user_id_head_1,'')<>'')
                    INSERT INTO @list_user_approval ( userid ) VALUES (@v_user_id_head_1)
                END
              
              IF (@v_organization_id_parent_1 IS NOT NULL) AND (@v_level_type_id_1 IS NOT NULL)
                BEGIN
                  SELECT
	                  @v_level_type_id_2 = level_type_id,
	                  @v_user_id_head_2 = user_id_head,
	                  @v_organization_id_parent_2 = organization_id_parent
                  FROM
	                  m_organization
                  WHERE
                    organization_id = @v_organization_id_parent_1
                    AND level_type_id < @v_level_type_id_1
                  IF (@@ROWCOUNT > 0) AND (COALESCE(@v_user_id_head_2,'')<>'')
                    INSERT INTO @list_user_approval ( userid ) VALUES (@v_user_id_head_2)
                END

              IF (@v_organization_id_parent_2 IS NOT NULL) AND (@v_level_type_id_2 IS NOT NULL)
                BEGIN
                  SELECT
	                  @v_level_type_id_3 = level_type_id,
	                  @v_user_id_head_3 = user_id_head,
	                  @v_organization_id_parent_3 = organization_id_parent
                  FROM
	                  m_organization
                  WHERE
                    organization_id = @v_organization_id_parent_2
                    AND level_type_id < @v_level_type_id_2
                  IF (@@ROWCOUNT > 0) AND (COALESCE(@v_user_id_head_3,'')<>'')
                    INSERT INTO @list_user_approval ( userid ) VALUES (@v_user_id_head_3)
                END

              IF (@v_organization_id_parent_3 IS NOT NULL) AND (@v_level_type_id_3 IS NOT NULL)
                BEGIN
                  SELECT
	                  @v_level_type_id_4 = level_type_id,
	                  @v_user_id_head_4 = user_id_head,
	                  @v_organization_id_parent_4 = organization_id_parent
                  FROM
	                  m_organization
                  WHERE
                    organization_id = @v_organization_id_parent_3
                    AND level_type_id < @v_level_type_id_3
                  IF (@@ROWCOUNT > 0) AND (COALESCE(@v_user_id_head_4,'')<>'')
                    INSERT INTO @list_user_approval ( userid ) VALUES (@v_user_id_head_4)
                END

              IF (@v_organization_id_parent_4 IS NOT NULL) AND (@v_level_type_id_4 IS NOT NULL)
                BEGIN
                  SELECT
	                  @v_level_type_id_5 = level_type_id,
	                  @v_user_id_head_5 = user_id_head,
	                  @v_organization_id_parent_5 = organization_id_parent
                  FROM
	                  m_organization
                  WHERE
                    organization_id = @v_organization_id_parent_4
                    AND level_type_id < @v_level_type_id_4
                  IF (@@ROWCOUNT > 0) AND (COALESCE(@v_user_id_head_5,'')<>'')
                    INSERT INTO @list_user_approval ( userid ) VALUES (@v_user_id_head_5)
                END
      
              FETCH NEXT FROM list_organization_cursor INTO @v_organization_id  
            END  

            CLOSE list_organization_cursor  
            DEALLOCATE list_organization_cursor 


    			        
            IF EXISTS(SELECT * FROM @list_user_approval)
              BEGIN
		            -- insert history proses untuk pergantian action
		            -- Saat user memproses task transaksi untuk berpindah stage
		            -- Proses ini dijalankan saat user menekan tombol submit pada layar task information untuk memproses transaksi ke tahapan selanjutnya. Berikut informasi histori yang dibentuk oleh sistem:
		            -- 1.	Process Date = get date
		            -- 2.	Process Time = get time
		            -- 3.	User = get user
		            -- 4.	Action = get from field action
		            -- 5.	Reason = get from field reason
		            -- 6.	Remarks = get from field remarks
		            INSERT INTO dbo.t_transaction_history_process
				            (transaction_id,
				            process_date,
				            [user_id],
				            workflow_template_action_id,
				            action_description,
				            reason_id,
				            remarks,
				            created_by,
				            created_date,
				            modified_by,
				            modified_date,
				            is_delete)
		            VALUES
				            (@pi_transaction_id, -- transaction_id - bigint
				            @v_current_datetime, -- process_date - datetime
				            @pi_user_id, -- user_id - int
				            @pi_workflow_template_action_id, -- workflow_template_action_id - bigint
				            @v_action_description,
				            @pi_reason_id, -- reason_id - int
				            @pi_remarks, -- remarks - varchar(255)
				            @pi_user_id, -- created_by - varchar(8)
				            @v_current_datetime, -- created_date - datetime
				            @pi_user_id, -- modified_by - varchar(8)
				            @v_current_datetime, -- modified_date - datetime
				            '0'  -- is_delete - char(1)
				            )
		            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			            BEGIN
				            SET @po_message = 'Failed insert t_transaction_history_process'
				            GOTO ERROR_OUT
			            END


				        INSERT INTO dbo.t_transaction_task
							        (transaction_id,
							        process_sequence,
							        [user_id],
							        status_id,
							        created_by,
							        created_date,
							        modified_by,
							        modified_date,
							        is_delete)
			          SELECT
			            @pi_transaction_id, -- transaction_id - bigint
			            @v_next_process_sequence, -- process_sequence - int
			            mu.username,   -- 
			            @v_next_task_status_id, -- status_id - int
			      	    @pi_user_id, -- created_by - varchar(8)
					        @v_current_datetime, -- created_date - datetime
					        @pi_user_id, -- modified_by - varchar(8)
					        @v_current_datetime, -- modified_date - datetime
					        '0'  -- is_delete - char(1)
			          FROM
			      	    @list_user_approval AS usr_appr INNER JOIN
			      	    dbo.m_user AS mu ON usr_appr.userid = mu.username
			          WHERE
			            mu.is_delete = 0
    			        
				        -- insert history pengiriman task ke pic yang dituju 
				        -- Saat sistem mengirimkan task ke pic yang dituju 
				        -- Proses ini dijalankan otomatis saat sistem sudah mengirimkan task ke PIC yang akan mengerjakan task tersebut. Berikut informasi histori yang dibentuk oleh sistem:
				        -- 1.	Process Date = get date
				        -- 2.	Process Time = get time
				        -- 3.	User = System
				        -- 4.	Action = ‘Assign task to  [Destination PIC]’
				        -- 5.	Reason = ‘NULL’
				        -- 6.	Remarks = ‘NULL’
				        INSERT INTO dbo.t_transaction_history_process
					        (transaction_id,
					        process_date,
					        [user_id],
					        workflow_template_action_id,
					        action_description,
					        reason_id,
					        remarks,
					        created_by,
					        created_date,
					        modified_by,
					        modified_date,
					        is_delete)
			          SELECT
			            @pi_transaction_id, -- transaction_id - bigint
			            @v_current_datetime, -- process_date - datetime
					        @pi_user_id, -- user_id - int
					        @pi_workflow_template_action_id, -- workflow_template_action_id - bigint
					        'Send approval to '+mu.user_fullname,  -- gunakan nama lengkap
                  @pi_reason_id, -- reason_id - int
					        @pi_remarks, -- remarks - varchar(255)
					        @pi_user_id, -- created_by - varchar(8)
					        @v_current_datetime, -- created_date - datetime
					        @pi_user_id, -- modified_by - varchar(8)
					        @v_current_datetime, -- modified_date - datetime
					        '0'  -- is_delete - char(1)
			          FROM
			      	    @list_user_approval AS usr_appr INNER JOIN
			      	    dbo.m_user AS mu ON usr_appr.userid = mu.username
			          WHERE
			            mu.is_delete = 0
    			      
                --Send approval to john
              END
            ELSE
              BEGIN
				        SET @po_message = 'There is no approver is intended'
				        GOTO ERROR_OUT
              END
            
		      END
        ELSE
		    --====================== BUKAN APPROVAL, ALIAS STAGE NORMAL ======================
          BEGIN

            -- tambahin: jika stage next sudah ada di tabel t_transaction_history_workflow, maka gunakan pic di tabel tsb,
            --           jika belum ada, insert
            DECLARE @v_user_history_workflow VARCHAR(8) = NULL
            IF EXISTS(SELECT
                  	    *
                      FROM
                  	    dbo.t_transaction_history_workflow
                      WHERE
                        transaction_id = @pi_transaction_id
                        AND workflow_template_stage_id = @v_destination_stage_id  --stage tujuan
                        AND is_delete = 0)
              BEGIN
                -- gunakan pic ini
                SELECT
            	    @v_user_history_workflow = last_user
                FROM
            	    dbo.t_transaction_history_workflow
                WHERE
                  transaction_id = @pi_transaction_id
                  AND workflow_template_stage_id = @v_destination_stage_id  --stage tujuan
                  AND is_delete = 0

              END
            ELSE
              BEGIN
                -- get/cari pic
                SET @v_user_history_workflow = NULL
              END
     
            IF (COALESCE(@v_user_history_workflow,'') <> '')  -- jika user pada history_workflow sudah ada, maka gunakan user tsb sebagai pic
              BEGIN
		            -- insert history proses untuk pergantian action
		            -- Saat user memproses task transaksi untuk berpindah stage
		            -- Proses ini dijalankan saat user menekan tombol submit pada layar task information untuk memproses transaksi ke tahapan selanjutnya. Berikut informasi histori yang dibentuk oleh sistem:
		            -- 1.	Process Date = get date
		            -- 2.	Process Time = get time
		            -- 3.	User = get user
		            -- 4.	Action = get from field action
		            -- 5.	Reason = get from field reason
		            -- 6.	Remarks = get from field remarks
		            INSERT INTO dbo.t_transaction_history_process
				            (transaction_id,
				            process_date,
				            [user_id],
				            workflow_template_action_id,
				            action_description,
				            reason_id,
				            remarks,
				            created_by,
				            created_date,
				            modified_by,
				            modified_date,
				            is_delete)
		            VALUES
				            (@pi_transaction_id, -- transaction_id - bigint
				            @v_current_datetime, -- process_date - datetime
				            @pi_user_id, -- user_id - int
				            @pi_workflow_template_action_id, -- workflow_template_action_id - bigint
				            @v_action_description,
				            @pi_reason_id, -- reason_id - int
				            @pi_remarks, -- remarks - varchar(255)
				            @pi_user_id, -- created_by - varchar(8)
				            @v_current_datetime, -- created_date - datetime
				            @pi_user_id, -- modified_by - varchar(8)
				            @v_current_datetime, -- modified_date - datetime
				            '0'  -- is_delete - char(1)
				            )
		            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			            BEGIN
				            SET @po_message = 'Failed insert t_transaction_history_process'
				            GOTO ERROR_OUT
			            END

                INSERT INTO dbo.t_transaction_task
                           ([transaction_id]
                           ,[process_sequence]
                           ,[user_id]
                           ,[status_id]
                           ,[created_by]
                           ,[created_date]
                           ,[modified_by]
                           ,[modified_date]
                           ,[is_delete])
                     VALUES
                           (@pi_transaction_id -- transaction_id - bigint
                           ,@v_next_process_sequence -- process_sequence - int
                           ,@v_user_history_workflow
                           ,@v_next_task_status_id -- status_id - int  
                           ,@pi_user_id -- created_by - varchar(8)
                           ,@v_current_datetime -- created_date - datetime
                           ,@pi_user_id -- modified_by - varchar(8)
                           ,@v_current_datetime -- modified_date - datetime
                           ,'0')
		            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			            BEGIN
				            SET @po_message = 'Failed insert t_transaction_task'
				            GOTO ERROR_OUT
			            END

		            -- insert history pengiriman task ke pic yang dituju 
		            -- Saat sistem mengirimkan task ke pic yang dituju 
		            -- Proses ini dijalankan otomatis saat sistem sudah mengirimkan task ke PIC yang akan mengerjakan task tersebut. Berikut informasi histori yang dibentuk oleh sistem:
		            -- 1.	Process Date = get date
		            -- 2.	Process Time = get time
		            -- 3.	User = System
		            -- 4.	Action = ‘Assign task to  [Destination PIC]’
		            -- 5.	Reason = ‘NULL’
		            -- 6.	Remarks = ‘NULL’
		            INSERT INTO dbo.t_transaction_history_process
			            (transaction_id,
			            process_date,
			            [user_id],
			            workflow_template_action_id,
			            action_description,
			            reason_id,
			            remarks,
			            created_by,
			            created_date,
			            modified_by,
			            modified_date,
			            is_delete)
		            SELECT
			            @pi_transaction_id, -- transaction_id - bigint
			            @v_current_datetime, -- process_date - datetime
			            'SYS', -- user_id - int
			            NULL, --@pi_workflow_template_action_id, -- workflow_template_action_id - bigint
			            'Assign task to '+user_fullname,  -- gunakan nama lengkap
			            @pi_reason_id, -- reason_id - int
			            NULL, --@pi_remarks, -- remarks - varchar(255)
			            @pi_user_id, -- created_by - varchar(8)
			            @v_current_datetime, -- created_date - datetime
			            @pi_user_id, -- modified_by - varchar(8)
			            @v_current_datetime, -- modified_date - datetime
			            '0'  -- is_delete - char(1)
		            FROM
			            dbo.m_user
		            WHERE
			            username = @v_user_history_workflow
		            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			            BEGIN
				            SET @po_message = 'Transaction not found'
				            GOTO ERROR_OUT
			            END

              END
            ELSE  -- jika belum ada, maka cari pic
              BEGIN
		            -- check pic yg dibutuhkan
		            DECLARE @v_pic_yg_dibutuhkan TINYINT = 0
		            -- 1: user dia sendiri
		            -- 2: head requester
		            -- 3: grup pic id
              
		            DECLARE @v_group_pic_id INT
		            SELECT
			            @v_pic_yg_dibutuhkan = CASE
										            WHEN pic_is_requester = '1' THEN 1--'user dia sendiri'
										            ELSE CASE user_workflow_id
												            WHEN 2 THEN 2 --'head requester'
												            WHEN 3 THEN 3 --'gunakan grup pic id'
											            END
									            END,
			            @v_group_pic_id = group_pic_id
		            FROM
			            dbo.m_workflow_template_stage
		            WHERE
			            workflow_template_stage_id = @v_destination_stage_id  --@v_workflow_template_stage_id
                
		            -- head requester
		            DECLARE @v_head_requester_user_id VARCHAR(8)
		            SELECT
			            @v_head_requester_user_id = org.user_id_head
		            FROM
			            dbo.m_user_organization AS muo INNER JOIN 
			            dbo.m_status AS ms ON muo.status_id = ms.status_id INNER JOIN
			            dbo.m_organization AS org ON muo.organization_id = org.organization_id
		            WHERE
			            muo.user_id_organization = @pi_user_id
			            AND muo.status_id = 5
			            AND ms.status_id = 5


			          IF (@v_pic_yg_dibutuhkan = 3)
			            IF (@v_group_pic_id IS NULL)
			              BEGIN
				              SET @po_message = 'Group PIC undefined'
				              GOTO ERROR_OUT
			              END
			          ELSE IF (@v_pic_yg_dibutuhkan = 2)
			            IF (COALESCE(@v_head_requester_user_id,'') = '')
			              BEGIN
				              SET @po_message = 'Head Requester PIC is empty'
				              GOTO ERROR_OUT
			              END

			          IF (@v_pic_yg_dibutuhkan <> 3)
			            BEGIN
		                -- get PIC
		                DECLARE @v_user_pic VARCHAR(8) = NULL
		                SELECT
			                @v_user_pic = CASE
							                WHEN pic_is_requester = '1' THEN @v_requester_id--'user dia sendiri'
							                ELSE CASE user_workflow_id
									                WHEN 2 THEN @v_head_requester_user_id --'head requester' (tambahin, jika kosong maka error, tidak bisa submit)
									                --WHEN 3 THEN @v_user_group_pic_id  --'gunakan grup pic id'
									                ELSE NULL
								                END
							                END
		                FROM
			                dbo.m_workflow_template_stage
		                WHERE
			                workflow_template_stage_id = @v_destination_stage_id  --@v_workflow_template_stage_id
		                IF @v_user_pic IS NULL
			                BEGIN
				                SET @po_message = 'PIC is empty'
				                GOTO ERROR_OUT
			                END
			            END


		            -- insert history proses untuk pergantian action
		            -- Saat user memproses task transaksi untuk berpindah stage
		            -- Proses ini dijalankan saat user menekan tombol submit pada layar task information untuk memproses transaksi ke tahapan selanjutnya. Berikut informasi histori yang dibentuk oleh sistem:
		            -- 1.	Process Date = get date
		            -- 2.	Process Time = get time
		            -- 3.	User = get user
		            -- 4.	Action = get from field action
		            -- 5.	Reason = get from field reason
		            -- 6.	Remarks = get from field remarks
		            INSERT INTO dbo.t_transaction_history_process
				            (transaction_id,
				            process_date,
				            [user_id],
				            workflow_template_action_id,
				            action_description,
				            reason_id,
				            remarks,
				            created_by,
				            created_date,
				            modified_by,
				            modified_date,
				            is_delete)
		            VALUES
				            (@pi_transaction_id, -- transaction_id - bigint
				            @v_current_datetime, -- process_date - datetime
				            @pi_user_id, -- user_id - int
				            @pi_workflow_template_action_id, -- workflow_template_action_id - bigint
				            @v_action_description,
				            @pi_reason_id, -- reason_id - int
				            @pi_remarks, -- remarks - varchar(255)
				            @pi_user_id, -- created_by - varchar(8)
				            @v_current_datetime, -- created_date - datetime
				            @pi_user_id, -- modified_by - varchar(8)
				            @v_current_datetime, -- modified_date - datetime
				            '0'  -- is_delete - char(1)
				            )
		            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			            BEGIN
				            SET @po_message = 'Failed insert t_transaction_history_process'
				            GOTO ERROR_OUT
			            END
              
              
		            --==================================================
		            -- insert transaction task
		            --DECLARE
			          --  @v_next_process_sequence INT,
			          --  @v_next_task_status_id INT = 2 --         <------------------ [1:Taken, 2:Available, 3:Not Available]
		            SELECT
			            @v_next_process_sequence = MAX(process_sequence) + 1
		            FROM
			            dbo.t_transaction_task
		            WHERE
			            transaction_id = @pi_transaction_id
		            GROUP BY
			            transaction_id

		            -- jika user_workflow_id = 5, maka pakai group_pic_id
		            IF @v_pic_yg_dibutuhkan=3 --(jika yg dibutuhkan adalah group_pic_id)
			            BEGIN
				            -- cek ada grup pic enggak?
				            IF NOT EXISTS(
						            SELECT
							            mu.username
						            FROM
							            dbo.m_group_pic AS mgp INNER JOIN
							            dbo.m_group_pic_detail AS mgpd ON mgp.group_pic_id = mgpd.group_pic_id INNER JOIN
							            dbo.m_user AS mu ON mgpd.user_id_group_pic_detail = mu.[user_id]
						            WHERE
							            mgp.group_pic_id = @v_group_pic_id
							            AND (mgpd.branch_id = CAST(@v_branch_id AS VARCHAR(5)) OR mgpd.branch_id = '*')
							            AND (mgpd.transaction_type_id = CAST(@v_transaction_type_id AS VARCHAR(5)) OR mgpd.transaction_type_id = '*')
							            AND mgp.is_delete = '0'
							            AND mgpd.is_delete = '0'
							            AND mu.is_delete = 0
						            )
					            BEGIN
						            SET @po_message = 'Group PIC is empty'
						            GOTO ERROR_OUT
					            END

				            INSERT INTO dbo.t_transaction_task
							            (transaction_id,
							            process_sequence,
							            [user_id],
							            status_id,
							            created_by,
							            created_date,
							            modified_by,
							            modified_date,
							            is_delete)
				            SELECT DISTINCT
					            @pi_transaction_id, -- transaction_id - bigint
					            @v_next_process_sequence, -- process_sequence - int
					            mu.username,   -- gunakan user group pic (bisa lebih dari 1)
					            @v_next_task_status_id, -- status_id - int                             <----------------------- [1:Taken, 2:Available, 3:Not Available]
					            @pi_user_id, -- created_by - varchar(8)
					            @v_current_datetime, -- created_date - datetime
					            @pi_user_id, -- modified_by - varchar(8)
					            @v_current_datetime, -- modified_date - datetime
					            '0'  -- is_delete - char(1)
				            FROM
					            dbo.m_group_pic AS mgp INNER JOIN
					            dbo.m_group_pic_detail AS mgpd ON mgp.group_pic_id = mgpd.group_pic_id INNER JOIN
					            dbo.m_user AS mu ON mgpd.user_id_group_pic_detail = mu.[user_id]
				            WHERE
					            mgp.group_pic_id = @v_group_pic_id
					            AND (mgpd.branch_id = CAST(@v_branch_id AS VARCHAR(5)) OR mgpd.branch_id = '*')
					            AND (mgpd.transaction_type_id = CAST(@v_transaction_type_id AS VARCHAR(5)) OR mgpd.transaction_type_id = '*')
					            AND mgp.is_delete = '0'
					            AND mgpd.is_delete = '0'
					            AND mu.is_delete = 0
				            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					            BEGIN
						            SET @po_message = 'Group PIC is empty'
						            GOTO ERROR_OUT
					            END
            	    
				            -- insert history pengiriman task ke pic yang dituju 
				            -- Saat sistem mengirimkan task ke pic yang dituju 
				            -- Proses ini dijalankan otomatis saat sistem sudah mengirimkan task ke PIC yang akan mengerjakan task tersebut. Berikut informasi histori yang dibentuk oleh sistem:
				            -- 1.	Process Date = get date
				            -- 2.	Process Time = get time
				            -- 3.	User = System
				            -- 4.	Action = ‘Assign task to  [Destination PIC]’
				            -- 5.	Reason = ‘NULL’
				            -- 6.	Remarks = ‘NULL’
				            INSERT INTO dbo.t_transaction_history_process
					            (transaction_id,
					            process_date,
					            [user_id],
					            workflow_template_action_id,
					            action_description,
					            reason_id,
					            remarks,
					            created_by,
					            created_date,
					            modified_by,
					            modified_date,
					            is_delete)
				            SELECT DISTINCT
					            @pi_transaction_id, -- transaction_id - bigint
					            @v_current_datetime, -- process_date - datetime
					            'SYS', -- user_id - int
					            NULL, --@pi_workflow_template_action_id, -- workflow_template_action_id - bigint
					            'Assign task to '+mu.user_fullname,  -- gunakan nama lengkap
					            @pi_reason_id, -- reason_id - int
					            NULL, --@pi_remarks, -- remarks - varchar(255)
					            @pi_user_id, -- created_by - varchar(8)
					            @v_current_datetime, -- created_date - datetime
					            @pi_user_id, -- modified_by - varchar(8)
					            @v_current_datetime, -- modified_date - datetime
					            '0'  -- is_delete - char(1)
				            FROM
					            dbo.m_group_pic AS mgp INNER JOIN
					            dbo.m_group_pic_detail AS mgpd ON mgp.group_pic_id = mgpd.group_pic_id INNER JOIN
					            dbo.m_user AS mu ON mgpd.user_id_group_pic_detail = mu.[user_id]
				            WHERE
					            mgp.group_pic_id = @v_group_pic_id
					            AND (mgpd.branch_id = CAST(@v_branch_id AS VARCHAR(5)) OR mgpd.branch_id = '*')
					            AND (mgpd.transaction_type_id = CAST(@v_transaction_type_id AS VARCHAR(5)) OR mgpd.transaction_type_id = '*')
					            AND mgp.is_delete = '0'
					            AND mgpd.is_delete = '0'
					            AND mu.is_delete = 0
				            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					            BEGIN
						            SET @po_message = 'Transaction not found'
						            GOTO ERROR_OUT
					            END

			            END
		            ELSE -- jika yang dibutuhkan adalah SELAIN group_pic_id
			            BEGIN

				            INSERT INTO dbo.t_transaction_task
							            (transaction_id,
							            process_sequence,
							            [user_id],
							            status_id,
							            created_by,
							            created_date,
							            modified_by,
							            modified_date,
							            is_delete)
				            SELECT
					            @pi_transaction_id, -- transaction_id - bigint
					            MAX(process_sequence) + 1, -- process_sequence - int
					            @v_user_pic, -- user_id - varchar(8)  
					            @v_next_task_status_id, -- status_id - int 
					            @pi_user_id, -- created_by - varchar(8)
					            @v_current_datetime, -- created_date - datetime
					            @pi_user_id, -- modified_by - varchar(8)
					            @v_current_datetime, -- modified_date - datetime
					            '0'  -- is_delete - char(1)
				            FROM
					            dbo.t_transaction_task
				            WHERE
					            transaction_id = @pi_transaction_id
				            GROUP BY
					            transaction_id
				            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					            BEGIN
						            SET @po_message = 'Failed insert t_transaction_task'
						            GOTO ERROR_OUT
					            END

				            -- insert history pengiriman task ke pic yang dituju 
				            -- Saat sistem mengirimkan task ke pic yang dituju 
				            -- Proses ini dijalankan otomatis saat sistem sudah mengirimkan task ke PIC yang akan mengerjakan task tersebut. Berikut informasi histori yang dibentuk oleh sistem:
				            -- 1.	Process Date = get date
				            -- 2.	Process Time = get time
				            -- 3.	User = System
				            -- 4.	Action = ‘Assign task to  [Destination PIC]’
				            -- 5.	Reason = ‘NULL’
				            -- 6.	Remarks = ‘NULL’
				            INSERT INTO dbo.t_transaction_history_process
							            (transaction_id,
							            process_date,
							            [user_id],
							            workflow_template_action_id,
							            action_description,
							            reason_id,
							            remarks,
							            created_by,
							            created_date,
							            modified_by,
							            modified_date,
							            is_delete)
				            SELECT
					            @pi_transaction_id, -- transaction_id - bigint
					            @v_current_datetime, -- process_date - datetime
					            'SYS', -- user_id - int
					            NULL, --@pi_workflow_template_action_id, -- workflow_template_action_id - bigint
					            'Assign task to '+user_fullname,  -- gunakan nama lengkap
					            @pi_reason_id, -- reason_id - int
					            NULL, --@pi_remarks, -- remarks - varchar(255)
					            @pi_user_id, -- created_by - varchar(8)
					            @v_current_datetime, -- created_date - datetime
					            @pi_user_id, -- modified_by - varchar(8)
					            @v_current_datetime, -- modified_date - datetime
					            '0'  -- is_delete - char(1)
				            FROM
					            dbo.m_user
				            WHERE
					            username = @v_user_pic
				            IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
					            BEGIN
						            SET @po_message = 'Transaction not found'
						            GOTO ERROR_OUT
					            END

			            END
              END

          END
      END
    ELSE  -- jika final
      BEGIN
        -- insert history proses untuk pergantian action
        -- Saat user memproses task transaksi untuk berpindah stage
        -- Proses ini dijalankan saat user menekan tombol submit pada layar task information untuk memproses transaksi ke tahapan selanjutnya. Berikut informasi histori yang dibentuk oleh sistem:
        -- 1.	Process Date = get date
        -- 2.	Process Time = get time
        -- 3.	User = get user
        -- 4.	Action = get from field action
        -- 5.	Reason = get from field reason
        -- 6.	Remarks = get from field remarks
        INSERT INTO dbo.t_transaction_history_process
            (transaction_id,
            process_date,
            [user_id],
            workflow_template_action_id,
            action_description,
            reason_id,
            remarks,
            created_by,
            created_date,
            modified_by,
            modified_date,
            is_delete)
        VALUES
            (@pi_transaction_id, -- transaction_id - bigint
            @v_current_datetime, -- process_date - datetime
            @pi_user_id, -- user_id - int
            @pi_workflow_template_action_id, -- workflow_template_action_id - bigint
            @v_action_description,
            @pi_reason_id, -- reason_id - int
            @pi_remarks, -- remarks - varchar(255)
            @pi_user_id, -- created_by - varchar(8)
            @v_current_datetime, -- created_date - datetime
            @pi_user_id, -- modified_by - varchar(8)
            @v_current_datetime, -- modified_date - datetime
            '0'  -- is_delete - char(1)
            )
        IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
          BEGIN
            SET @po_message = 'Failed insert t_transaction_history_process'
            GOTO ERROR_OUT
          END
      END


		

		--====================== update t_transaction ======================
		DECLARE @v_final_destination_stage_id INT
		IF (@v_is_final_action = '1')
		  SET @v_final_destination_stage_id = @v_current_workflow_template_stage_id -- jika Final Action, maka biarkan menggunakan stage_id sebelumnya (maksudnya saat ini)
		ELSE
		  SET @v_final_destination_stage_id = @v_destination_stage_id

		UPDATE
			dbo.t_transaction
		SET
			workflow_template_stage_id = @v_final_destination_stage_id,
			status_id = @v_transaction_status_id,
			modified_by = @pi_user_id,
			modified_date = @v_current_datetime
		WHERE
			transaction_id = @pi_transaction_id
		IF (@@ROWCOUNT = 0) OR (@@ERROR <> 0)
			BEGIN
				SET @po_message = 'Failed update t_transaction'
				GOTO ERROR_OUT
			END

		COMMIT TRANSACTION proses_utama
		SET @po_message = 'Sukses'  -- variable output 
		SET @v_result = 1
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		GOTO CLEAN_OUT

	END TRY
	BEGIN CATCH	-- tangkap error message selain yg sudah dideskripsikan
		SET @po_message = LEFT(ERROR_MESSAGE(),400)	-- berhubung variable diatas diset 400, maka potong error message
		GOTO ERROR_OUT
	END CATCH

	
	ERROR_OUT: 
		ROLLBACK TRANSACTION proses_utama
		SELECT @v_result AS [status], @po_message AS [message]  -- dual output stored procedure, variable output dan table output
		--RETURN 1

	CLEAN_OUT:
		--RETURN 0
			
END
GO
/****** Object:  StoredProcedure [dbo].[UpdateUserActiveOrganization]    Script Date: 11/10/2017 16:12:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateUserActiveOrganization]
AS
BEGIN
	
	SET NOCOUNT ON;

	UPDATE m_user_organization
	SET status_id = 5
	WHERE user_organization_id IN (
		SELECT g.user_organization_id FROM m_user_organization g
		WHERE g.effective_date = CONVERT(DATE, GETDATE()) 
		AND g.status_id = 7
		AND g.is_delete = '0'
	)

	UPDATE m_user_organization
	SET status_id = 6
	WHERE user_organization_id IN (
		SELECT u.user_organization_id FROM m_user_organization u
		WHERE u.status_id = 5
		AND u.is_delete = '0'
		AND u.effective_date < CONVERT(DATE, GETDATE())
		AND u.user_id_organization IN (
			SELECT g.user_id_organization FROM m_user_organization g
			WHERE g.effective_date = CONVERT(DATE, GETDATE()) 
		)
	)

END
GO
/****** Object:  StoredProcedure [dbo].[GetUserMenuForAdd]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetUserMenuForAdd] (
	@pi_user_id VARCHAR(3),
	@pi_pagenumber INT,
	@pi_rowsperpage INT,
	@pi_menu_category_id INT = NULL
)
AS
BEGIN
	
	IF @pi_menu_category_id IS NULL
		
		SELECT * FROM (
			SELECT ROW_NUMBER() OVER(ORDER BY menu_id) AS IdOrder,
				get_menu_for_add_no_category.* FROM get_menu_for_add_no_category(@pi_user_id) 
			) AS TBL 
		WHERE IdOrder BETWEEN ((@pi_pagenumber - 1) * @pi_rowsperpage + 1) AND (@pi_pagenumber * @pi_rowsperpage) ORDER BY description;

	ELSE
		
		SELECT * FROM (
			SELECT ROW_NUMBER() OVER(ORDER BY menu_id) AS IdOrder,
				get_menu_for_add.* FROM get_menu_for_add(@pi_user_id, @pi_menu_category_id) 
			) AS TBL 
		WHERE IdOrder BETWEEN ((@pi_pagenumber - 1) * @pi_rowsperpage + 1) AND (@pi_pagenumber * @pi_rowsperpage) ORDER BY description;
		

END
GO
/****** Object:  StoredProcedure [dbo].[GetUserMenuAll]    Script Date: 11/10/2017 16:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetUserMenuAll] (
	@pi_userid VARCHAR(3),
	@pi_pagenumber INT,
	@pi_rowsperpage INT
)
AS
BEGIN
SELECT * FROM (
                    SELECT ROW_NUMBER() OVER(ORDER BY menu_id) AS IdOrder,
                        get_user_menu_all.* FROM get_user_menu_all(@pi_userid) 
  
                ) AS TBL 
               WHERE IdOrder BETWEEN ((@pi_pagenumber - 1) * @pi_rowsperpage + 1) AND (@pi_pagenumber * @pi_rowsperpage) ORDER BY menu_desc;
END
GO
/****** Object:  UserDefinedFunction [dbo].[get_view_file_by_trans_type]    Script Date: 11/10/2017 16:12:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[get_view_file_by_trans_type]
(	
	@pi_transaction_type_id INT
)
RETURNS TABLE 
AS
RETURN 
(
	  
	SELECT TOP 1
		me.eform_id,
		meft.effective_date,
		meft.status_id,
		mtft.*
	FROM
		dbo.m_eform AS me INNER JOIN
		dbo.m_eform_form_template AS meft ON me.eform_id = meft.eform_id INNER JOIN
		dbo.m_transaction_form_template AS mtft ON meft.transaction_form_template_id = mtft.transaction_form_template_id
	WHERE
		meft.effective_date <= CAST(GETDATE() AS DATE)
		AND me.is_delete = '0'
		AND meft.is_delete = '0'
		AND mtft.is_delete = '0'
		AND me.transaction_type_id = @pi_transaction_type_id
		AND me.status_id = 5
		AND meft.status_id = 5
		-- tambahkan status aktif kalau perlu
	ORDER BY
		meft.effective_date DESC

	 
)
GO





/****** Object:  DdlTrigger [tri_DDLEvents]    Script Date: 11/10/2017 16:12:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [tri_DDLEvents]
    ON DATABASE
    FOR CREATE_PROCEDURE, ALTER_PROCEDURE, DROP_PROCEDURE,
        ALTER_SCHEMA, RENAME, CREATE_TABLE, ALTER_TABLE,DROP_TABLE,CREATE_VIEW, ALTER_VIEW, DROP_VIEW
AS
BEGIN
    SET NOCOUNT ON;
    DECLARE
        @EventData XML = EVENTDATA();
 
    DECLARE 
        @ip VARCHAR(32) =
        (
            SELECT client_net_address
                FROM sys.dm_exec_connections
                WHERE session_id = @@SPID
        );
 
    INSERT log_DDLEvents
    (
        EventType,
        EventDDL,
        EventXML,
        DatabaseName,
        SchemaName,
        ObjectName,
        HostName,
        IPAddress,
        ProgramName,
        LoginName
    )
    SELECT
        @EventData.value('(/EVENT_INSTANCE/EventType)[1]',   'NVARCHAR(100)'), 
        @EventData.value('(/EVENT_INSTANCE/TSQLCommand)[1]', 'NVARCHAR(MAX)'),
        @EventData,
        DB_NAME(),
        @EventData.value('(/EVENT_INSTANCE/SchemaName)[1]',  'NVARCHAR(255)'), 
        @EventData.value('(/EVENT_INSTANCE/ObjectName)[1]',  'NVARCHAR(255)'),
        HOST_NAME(),
        @ip,
        PROGRAM_NAME(),
        SUSER_SNAME();
END
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
DISABLE TRIGGER [tri_DDLEvents] ON DATABASE
GO
/****** Object:  DdlTrigger [tri_DDLEvents]    Script Date: 11/10/2017 16:12:52 ******/
Enable Trigger [tri_DDLEvents] ON Database
GO
