实施发票销售税策略

发布于 2024-10-06 17:23:07 字数 882 浏览 2 评论 0原文

在南非,我们实行增值税 (VAT),它与销售税几乎相同,目前固定为 14%,但可能随时发生变化。

我需要在由多个发票行组成的发票(不可变)中包含增值税。每行引用一个带有布尔属性 IsTaxableProduct,并且几乎所有产品都是应税的。

我不想将税前价格存储在数据库中,因为这使得很难读取客户将要支付的实际价格,并且在我显示这些价格的任何地方,我都必须记住加税。当增值税税率确实发生变化时,对于该特定业务,所有价格都自动变化是不可取的。

因此,我认为反向税收计算是可行的方法,而且可能并不罕见。发票总额是所有发票行总额的总和,其中包括任何行折扣并且应含税。因此,发票总额本身是含税的:

TaxTotal = InvoiceTotal / (1 + TaxRate),

其中 InvoiceTotal 是含税的,并且 TaxRate == 0.14

由于发票一旦开具就无法更改(它们是不可变的),我应该:

  1. 在我的 Invoices 表中存储一个不变的 Tax 金额?或者...
  2. 存储每个发票行的税额并在每次显示发票时计算发票税总额?

从 DBA 的角度来看,选项 2 似乎更安全,因为如果发票被手动更改,那么税费将被正确计算,但是如果发票已经开具,这仍然会带来一个问题不一致。如果我坚持使用选项 1,那么我无法显示单个行项目的税费,但它使管理税费总额和进行汇总计算变得更容易,尽管如果发生更改,它也会出现不一致。

我不能两者都做,因为这会重复数据。

  • 哪条路是正确的?或者反向税收计算真的是一个坏主意吗?

Here in South Africa we have Value Added Tax (VAT) which is pretty much identical to Sales Tax and is currently fixed at 14%, but could change at any time.

I need to include VAT on invoices (which are immutable) consisting of several Invoice Lines. Each line references a Product with a Boolean property, IsTaxable, and almost all products are taxable.

I don't want to store pre-tax prices in the database, because that just makes it hard to read the real price that the customer is going to pay and everywhere I display those prices, I then have to remember to add tax. And when the VAT rate does change, for this particular business, it is undesirable for all prices to change automagically.

So I reckon a reverse tax calculation is the way to go and probably not uncommon. The invoice total is the sum of all invoice line totals, which includes any line discounts and should be tax-inclusive. Therefore the invoice total itself is tax-inclusive:

TaxTotal = InvoiceTotal / (1 + TaxRate),

where InvoiceTotal is tax-inclusive and TaxRate == 0.14

Since invoices cannot be changed once issued (they are immutable), should I:

  1. Store a single Tax amount in my Invoices table that does not change? Or...
  2. Store a tax amount for each invoice line and calculate the invoice tax total every time I display the invoice?

Option 2 seems safer from a DBA point-of-view since if an invoice is ever manually changed, then Tax will be calculated correctly, but if the invoice has already been issued, this still presents a problem of inconsistency. If I stick with option 1, then I cannot display tax for a single line item, but it makes managing the tax total and doing aggregate calculations easier, though it also presents inconsistency if ever changed.

I can't do both since that would be duplicating data.

  • Which is the right way to go? Or is a reverse tax calculation a really bad idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

落墨 2024-10-13 17:23:07

将税前值存储在数据库中,您还可以存储含税值并将其用于大多数用例。

我预见到的大问题是发票上增值税的舍入规则。这些规则(至少在英国)非常严格,您的反向计算无法做到这一点。

此外,您还需要逐项存储税款,因为如果退回某件商品,增值税龙将希望您准确退还所缴纳的税款。在开始之前,您确实需要了解当地的销售税规则。

我的经验是,如果你的计算误差只有一分钱,你可能会被拖垮,而且,如果你接受了审计,你需要能够展示你是如何得出增值税数字的,所以不要存储你的数据中使用的任何东西。计算会让你出局。

Store the pre tax value in the data base, you can also store the with tax value and use that for most use cases.

Th big problem I forsee is the rounding rules for VAT on invoices.These (at least in the UK) are really strict and there is no way for your reverse calculation to get this right.

Also you need to store the tax item by item as the VAT dragons will expect you to refund exactly the tax paid if an item is returned. You really need to get hold of the local sales tax rules before you start.

My experience is that you can get dragged over the coals if your calculations are out by as little as a penny, and, if you are audited you need to be able to show how you arrived at the VAT figure so not storing anything used in your calculations will catch you out.

浮云落日 2024-10-13 17:23:07

我完全同意詹姆斯·安德森的观点!德国的增值税计算规则与英国一样严格。

我们必须按增值税百分比(我们有三种类型:0%、7% 和 19%)累积净值,四舍五入到两位数。我们必须根据这个四舍五入的值计算增值税。
增值税必须四舍五入两位数,并且必须在发票上显示。

但尽管如此,您可以存储含税价格。这取决于税收上涨时净价格或最终价格是否保持不变。在德国,通常 B2B 净价格保持不变,但 B2C 最终价格保持不变 - 这取决于情况。

您可以这样计算:

with cPriceIncludingVAT as (
    select  InvoiceNo, VATPercentage,
            PriceIncludingVAT = cast(sum(amount * price) as decimal(12,2))
    from    InvoiceLines inner join VAT on VAT.VATID=InvoiceLines.VATID
    group by InvoiceNo, VATPercentage
),
cVATcalculated as (
    select  InvoiceNo, VATPercentage, PriceIncludingVAT,
            VAT = cast(PriceIncludingVAT * VATPercentage / 
                         (1+VATPercentage) as decimal(12,2))
    from    cVATcalculated
)
select    InvoiceNo, VATPercentage, PriceIncludingVAT, VAT,
          NetPrice = PriceIncludingVAT - VAT
from      cVATcalculated;

如果将其保存为视图,您应该能够准确地重新打印动态计算的增值税值。当有会计系统时,您可以(并且应该)导出与打印的数据完全相同的数据。
通常您应该将这样的值保存为数据库中的字段值 - 但我理解如果您想要采用更动态的方法......

I totally agree with James Anderson! In Germany the rules according VAT calculations are as strict as in the UK.

We have to accumulate the net value by VAT percentage (we have three types: 0, 7 and 19 percent) rounded by two digits. On this rounded value we have to calculcate VAT.
VAT has to be rounded by two digits and has to be showed at the invoice.

But nonetheless you can store prices including tax. It depends whether the net prices or the end prices stay unchanged when tax rises. In Germany usually B2B net prices stay unchanged but B2C end prices stay unchanged - it depends.

You can calculate it this way:

with cPriceIncludingVAT as (
    select  InvoiceNo, VATPercentage,
            PriceIncludingVAT = cast(sum(amount * price) as decimal(12,2))
    from    InvoiceLines inner join VAT on VAT.VATID=InvoiceLines.VATID
    group by InvoiceNo, VATPercentage
),
cVATcalculated as (
    select  InvoiceNo, VATPercentage, PriceIncludingVAT,
            VAT = cast(PriceIncludingVAT * VATPercentage / 
                         (1+VATPercentage) as decimal(12,2))
    from    cVATcalculated
)
select    InvoiceNo, VATPercentage, PriceIncludingVAT, VAT,
          NetPrice = PriceIncludingVAT - VAT
from      cVATcalculated;

If you save this as a view you should be able to reprint a dynamically calculated VAT value exactly. When there is an accounting system you can (and should) export exactly the same data you printed.
Usually you should save values like these as field values within the database - but I understand if you'd like to have a more dynamic approach ...

2024-10-13 17:23:07

其他答案都很好,但正如 idevlop 提到的,几乎可以肯定的是,在未来的某个时候,您将开始对不同类别的产品采用不同的费率。预先添加该功能将为您节省以后的大量心痛。去过那里,做过那件事。

The other answers are good, but as idevlop mentions, it's almost a certainty that at some time in the future, you'll start having different rates for different categories of products. Adding that capability up front will save you a ton of heartache later on. Been there, done that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文