简体   繁体   English

会计数据库-存储贷方和借方?

[英]Accounting Database - storing credit and debit?

When you store a transaction into a database 当您将事务存储到数据库中时

1) Do you store Credit and debit in the same record under two different columns? 1)您是否将贷方和借方存储在同一记录中的两个不同列下? (without the positive or the negative sign) (不带正号或负号)

Example 1A 实施例1A

TABLENAME
...
...
(Credit) null
(Debit) 100

Example 1B 实施例1B

TABLENAME
...
...
(Credit) 250
(Debit) null

Or 要么

2) Do you store 1 value with a positive for credit, and a negative sign for debit? 2)您是否存储1个值,其中贷方为正,借方为负?

Example 2A 实施例2A

TABLENAME
...
...
(Amount) -100

Example 2B 实施例2B

TABLENAME
...
...
(Amount) 250

Accountants (and many bookkeepers, if they're any good) know that there is absolutely no difference between credits and debits. 会计师(以及许多簿记员,如果有的话)都知道贷方和借方之间绝对没有区别。 They're simply movements of value. 它们只是价值的运动。

They should be stored in the same column, with a signed value. 它们应与带符号的值存储在同一列中。 That makes double-entry accounting so much easier (a) . 这使得重复输入记帐变得更加容易(a) Some people believe that double entry accounting means you keep two sets of books, one for the tax department (to minimise tax paid) and one for reality. 有人认为,重复记账会计意味着您要保留两套账本,一套用于税务部门(以最大程度减少已付税款),另一套用于实际。

However, it really means that every transaction is balanced , that it has a credit and debit entry although they often consist of lots of parts rather than just two, and they cross freely between the balance sheet (eg, equity, assets, liabilities) and the profit and loss (eg, income, expenditure). 但是,这实际上意味着每笔交易都是平衡的 ,尽管有很多部分而不是只有两个部分,但它具有贷方和借方项,并且它们在资产负债表(例如,股权,资产,负债)之间自由交叉。损益(例如收入,支出)。 For example, buying some shares with brokerage may be: 例如,通过经纪购买一些股票可能是:

cash at bank     Asset     2019.95 cr
shares at cost   Asset     2000.00 dr
brokerage        Expense     19.95 dr
                           ----------
                              0.00

(a) You can treat me as an authority here (b) . (a)您可以在(b)处将我视为权威。 I've worked on multiple commercial-scale accounting packages, one of which was huge . 我研究过多个商业规模的会计软件包,其中一个非常庞大 More importantly, my wife is a CA and she agrees with me, and that's unusual enough that I have to be right :-) 更重要的是,我的妻子是CA,​​她同意我的看法,这非常不寻常,我必须正确:-)


(b) Of course, you shouldn't treat anyone as an authority (c) . (b)当然,您不应该将任何人都视为权威(c) "Everyone, by the age of 30, is either their own doctor or an idiot" and so on. “到30岁时,每个人都是他们自己的医生或白痴”等等。 Make sure you understand why something is accepted as "right", don't just blindly follow the crowd. 确保您了解为什么某些东西被认为是“正确的”,而不是盲目跟随人群。


(c) Unless it's me :-) (c)除非是我:-)

One exception was not mentioned. 没有提到一个例外。 What do you call an entry with a zero amount - is it a credit or debit? 您称零金额的分录是什么-是贷项还是借项? In some cases I have needed to show the amount was computed to an unrounded value which is non-zero, but the rounded amount is zero as with currency exchanges, tax amounts, etc. As such, I prefer an explicit indicator of the debit or credit flag and store the amount as a positive value. 在某些情况下,我需要证明金额被计算为非零的非四舍五入值,但与货币兑换,税额等一样,四舍五入后的金额为零。因此,我希望使用借记卡或信用标记并将金额存储为正值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM