我创建这样的日记帐交易表:
CREATE TABLE [dbo].[Finance_Journal_header]
(
[ID] [NVARCHAR](60) NOT NULL,
[Header_number] [INT] NOT NULL,
[Header_date] [DATETIME] NOT NULL,
[nots] [NVARCHAR](4000) NULL,
[UserID] [NVARCHAR](60)NOT NULL,
[isdelete] [BIT] NOT NULL,
[begin_Date] [DATETIME] NOT NULL,
[Company_ID] [NVARCHAR](60) NOT NULL,
[Last_update] [DATETIME] NULL
)
CREATE TABLE [dbo].[Finance_Journal_details]
(
[ID] [NVARCHAR](60) NOT NULL,
[Header_ID] [NVARCHAR](60) NOT NULL,
[Account_code] [NVARCHAR](60) NOT NULL,
[sr] [INT] NOT NULL,
[nots] [NVARCHAR](4000) NULL,
[Debit_value] [NUMERIC](14, 3)NOT NULL,
[Credit_Value] [NUMERIC](14, 3) NOT NULL,
[UserID] [NVARCHAR](60) NOT NULL,
[isdelete] [BIT] NULL,
[begin_Date] [DATETIME] NOT NULL,
[Company_ID] [NVARCHAR](60) NOT NULL,
[Cost_center] [NVARCHAR](60)NOT NULL,
[related_doc] [INT] NOT NULL,
[Exchange_Rate] [DECIMAL](18, 2)NOT NULL,
[Currency_name] [NVARCHAR](60) NOT NULL,
[Last_update] [DATETIME] NULL
)
我还有其他一些用于模块交易的表格,例如销售,购买,银行和库存交易
如何将其他模块事务与GL日记帐项目链接?
我有两种可能的解决方案:
创建一个通用视图,并联合选择以加入诸如日记帐项目之类的任何交易
触发触发器以更新日记帐项目表详细信息,其中任何模块在插入,更新或删除表中进行任何更改
最好的方法是什么?