DEV Community

loading...
Cover image for VAT Out of Hell (in Germany). A Riddle for CodeNewbies.

VAT Out of Hell (in Germany). A Riddle for CodeNewbies.

lifelongthinker profile image Sebastian ・1 min read

Meanwhile, Germany reduced VAT rates effective from July 1 through the end of this year. This happened very quickly as part of a stimulus package against the #COVIDー19
lockdowns.

I've had the joy of overseeing some software updates (basically shopping and invoicing systems).

Some software vendors have been struggling with what should be a very simple update (one that shouldn't even require any development effort at all).

But, we do not live in a perfect world. So let's consider this some valuable teaching and learning material.

To all codingnewbies out there: The following database schema shows exactly why some software vendors have troubles updating their systems to the new VAT rates. Can you spot the problem? Assume no other entities or attributes.

ERD

Discussion

pic
Editor guide
Collapse
alexandrudanpop profile image
Alexandru-Dan Pop

I think the SalesTaxRate should be in the OrderDetails table. Is this the correct answer?

Also I think the Amount should probably be always computed as it is derrived state.

Collapse
lifelongthinker profile image
Sebastian Author

Perfect, that's exactly the problem 👍👍

How would you compute the quantity (amount)?

Collapse
alexandrudanpop profile image
Alexandru-Dan Pop

Ahh, was confused by the word Amount, as I thought it means the total sum that order costs. 😊 Quantity sounds much better.

Thread Thread
lifelongthinker profile image
Sebastian Author

Sorry, I should have picked a different wording. My bad. This was a glitch on my part.