I ask the best practitioners from veterans of financial programmers.
for example, PSUDO code:
class Transaction(Model): order = ForeignKey() amount = DecimalField() type = 'refund' or 'purchase'
If you store the return in a negative amount, I can just run the sum() all transactions to get the balance, the math operations will become a bit native.
If you store the return in a positive quantity, then it is more friendly for a person according to a formula such as purchase - refund = balance , I also do not need to invert to display the positive amount of return in the template.
Which should I choose to have more benefits and fewer errors?
source share