1. 4
  1. 2

    While I like the idea, generally, it starts to become problematic when you add more logic. If the price changes for the item, do you now need to recalculate? What if the price changes after the invoice has been paid? What if there’s a discount applied? The number of possibilities that you have to account for, and the ways in which they tie to the database schema become quite complicated.

    (I used to work on an e-commerce platform (15 yrs ago) that did everything with stored procedures. It was interesting… for lots of reasons)