本文介绍了数据库设计:多币种账户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在您的会计软件中,您将如何设计您的COA帐户数据库

In your accounting software how would you design your accounts database for COA

设计1)1个帐户只能持有1个货币

Design 1) 1 account can hold 1 currency only

设计2)1个帐户可以持有多种货币,只需通过CurrencyId(USD,GBP等)过滤交易。

Design 2) 1 account can hold multi currency, just filter the transaction by CurrencyId (USD, GBP etc..)

设计1)1个帐户只能持有1个货币

Design 1) 1 account can hold 1 currency only

ACCOUNT
Id
AccountNumber
CurrencyCode
...

TRANSACTION
Id
AccountId
Amount
...

设计2)1个帐户可以持有多种货币

Design 2) 1 account can hold multi currency

ACCOUNT
Id
AccountNumber
...

TRANSACTION
Id
AccountId
Amount
CurrencyCode
....


推荐答案

首先,我不会设计会计软件。我会买它会计是您需要领域专家(即会计师)帮助开发软件的领域之一。

In the first place, I wouldn't design accounting software. I'd buy it. Accounting is one of the fields where you need domain experts (that is, accountants) helping to develop the software.

第二,如果您需要接受多种货币,那么你必须存储货币的类型和价值。在这样的系统中,30的借记是无意义的。只有30美元或30欧元的借记是有意义的。

In the second place, if you're required to accept multiple currencies, then you have to store the type of currency along with the value. In a system like that, a debit of 30 is meaningless. Only debits of 30 USD or 30 EUR are meaningful.

但存储是您问题中最简单的部分。你如何组合涉及多种货币的交易?有不止一种方法可以做到这一点,可能有一个以上的正确答案,您的会计师可能会以正确的方式来打击这种方式。

But storage is the simplest part of your problem. How are you going to add up transactions involving multiple currencies? There's more than one way to do that, there's probably more than one "right" answer, and your accountants will probably come to blows over which way is the "right" way.

这篇关于数据库设计:多币种账户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 22:02