Table Subcode Group
[sql]
CREATE TABLE [Accounting].[Subcode.Group]
(
[group_id] [INT] IDENTITY(1,1)
NOT NULL
,[group_name] [NVARCHAR(50)] NOT NULL
,[group_manual] [BIT] NOT NULL
,CONSTRAINT [PK_Subcode.Group] PRIMARY KEY CLUSTERED([group_id] ASC)
WITH(PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON)
)
GO
ALTER TABLE [Accounting].[Subcode.Group]
ADD CONSTRAINT [DF_Subcode.Group_group_manual] DEFAULT((1)) FOR [group_manual]
GO
[/sql]
Table Subcode Item
[sql]
CREATE TABLE [Accounting].[Subcode.Item]
(
[subcode_id] [INT] IDENTITY(1,1)
NOT NULL
,[group_id] [INT] NOT NULL
,[gl_subcode] [VARCHAR](50) NULL
,[subcode_desc] [NVARCHAR(250)] NULL
,[cc_id] [INT] NULL
,[loc_id] [TINYINT] NULL
,[loc_linkid] [INT] NULL
,CONSTRAINT [PK_Subcode.Item] PRIMARY KEY CLUSTERED([subcode_id] ASC)
WITH(PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON)
)
GO
ALTER TABLE [Accounting].[Subcode.Item]
ADD CONSTRAINT [DF_Subcode.Item_group_id] DEFAULT((1)) FOR [group_id]
GO
ALTER TABLE [Accounting].[Subcode.Item]
WITH CHECK
ADD CONSTRAINT [FK_Subcode.Item_Subcode.Group] FOREIGN KEY([group_id]) REFERENCES [Accounting].[Subcode.Group](
[group_id]) ON UPDATE CASCADE ON DELETE CASCADE
GO
ALTER TABLE [Accounting].[Subcode.Item] CHECK CONSTRAINT [FK_Subcode.Item_Subcode.Group]
GO
[/sql]
Table Accounting Group
[sql]
CREATE TABLE [Accounting].[Group]
(
[group_id] [INT] IDENTITY(1,1)
NOT NULL
,[group_category] [VARCHAR](50) NOT NULL
,[group_idx] [TINYINT] NOT NULL
,[group_name] [NVARCHAR(50)] NOT NULL
,CONSTRAINT [PK_Group] PRIMARY KEY CLUSTERED([group_id] ASC)
WITH(PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON)
)
GO
[/sql]
Table Chart Of Account
[sql]
CREATE TABLE [Accounting].[COA]
(
[acc_id] [INT] IDENTITY(1,1)
NOT NULL
,[acc_no] [CHAR(10)] NOT NULL
,[acc_name] [NVARCHAR(50)] NULL
,[acc_journal] [BIT] NULL
,[acc_pl] [BIT] NULL
,[acc_bs] [BIT] NULL
,[acc_exclusive] [BIT] NULL
,[acc_currency] [CHAR(3)] NULL
,[acc_group] [TINYINT] NOT NULL
,[subcode_group] [INT] NULL
,[acc_remark] [NVARCHAR(250)] NULL
,[acc_level] [NVARCHAR(500)] NULL
,[acc_nature] [TINYINT] NOT NULL
,[acc_cf] [TINYINT] NOT NULL
,[acc_cfnature] [TINYINT] NOT NULL
,[acc_enable] [BIT] NOT NULL
,[book_version] [TINYINT] NULL
,[cc_id] [INT] NOT NULL
,CONSTRAINT [PK_COA] PRIMARY KEY CLUSTERED([acc_id] ASC)
WITH(PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON)
,CONSTRAINT [IX_COA] UNIQUE NONCLUSTERED([acc_no] ASC)
WITH(PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON)
)
GO
ALTER TABLE [Accounting].[COA]
ADD CONSTRAINT [DF_COA_acc_nature] DEFAULT((1)) FOR [acc_nature]
GO
ALTER TABLE [Accounting].[COA]
ADD CONSTRAINT [DF_COA_acc_cf] DEFAULT((1)) FOR [acc_cf]
GO
ALTER TABLE [Accounting].[COA]
ADD CONSTRAINT [DF_COA_acc_cfnature] DEFAULT((1)) FOR [acc_cfnature]
GO
ALTER TABLE [Accounting].[COA]
ADD CONSTRAINT [DF_COA_acc_enable] DEFAULT((1)) FOR [acc_enable]
GO
ALTER TABLE [Accounting].[COA]
ADD
DEFAULT((1)) FOR [cc_id]
GO
[/sql]
Komentar
Posting Komentar