[英]Designing table to store the transaction entry in a double entry accounting database
I try to develope a small accounting system using codeigniter. 我尝试使用codeigniter开发一个小型会计系统。
Case I: The database have 2 tables: tbl_transaction
and tbl_journal
to record daily transactions. 案例I:数据库有2个表:
tbl_transaction
和tbl_journal
记录每日交易。
ie, in tbl_journal
the date, amount, narration
of the transaction will be stored and the tbl_transaction
contains the journal_id, account, amount
accounts involved in each transaction, which means there will be 2 entries in tbl_transaction
, one entry showing positive amount
& other showing negative amount
with the debit/credit account name. 即,在
tbl_journal
中date, amount, narration
将存储交易的date, amount, narration
,并且tbl_transaction
包含每笔交易涉及的tbl_transaction
journal_id, account, amount
科目,这意味着tbl_transaction
中将有2个条目,一个条目表示positive amount
,其他表示借方/贷方帐户名称为negative amount
。
Case II: The database with single table tbl_journal
to store the transaction information. 情况二:数据库具有单个表
tbl_journal
来存储事务信息。 ie, tbl_journal
with fields for date, amount, debit account, credit account, narration
. 即
tbl_journal
其中包含date, amount, debit account, credit account, narration
等字段。
Which of these would be good? 其中哪一个会好? Or what could be the better design?
还是更好的设计? Somebody please help me..
有人请帮助我。
The first is better. 首先是更好。 In accounting you get cases where one Credit entry is matched by multiple debit entries, and vice versa.
在会计中,您会遇到一个贷项项与多个借项项匹配的情况,反之亦然。 Your second option wouldn't cover that.
您的第二个选择将无法解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.