I think the transactions table is misnamed. This is a table of posting legs. Which all must balance for a single transaction.
I don't think you should get hung up on +ve-ve versus cr and Dr. When double entry was formalised negative numbers were not common and then thought errant. It is only in the eighteenth century it became normal.
I enjoyed the entry. Note that you might you use different minimum fractions eg we use 0.00001p as a discrete value.
memset|2 years ago
I think a lot of people are glossing over the fact that you not only need 1/-1 for DR/CR, but also the "normal" balance of the account to tabulate balances.
sverhagen|2 years ago
lelanthran|2 years ago
Almost always multiple, depending on what you consider a transaction, and the PoV of the accounts involved, etc.
I cannot think of a transaction that has a single leg only.
Here's a possibility: You buy something online. You pay $100 by credit card ($80 cost plus $20 shipping).
The accounting system needs to record your purchase. Maybe dr 'Mr ClientName' with $100, cr 'Clearing' with $100.
At some point bank recon will happen, the payment will reflect and the amount will be considered 'cleared'. At this point dr 'Clearing' with $100, cr 'depot' with $100 and delivery details.
The depot will cr 'Stock' for $80 worth of stock, dr 'Courier' for $20[1] using the order number and the companys client number at the courier for folio. Payment request fired off to people with authority to approve payments (PWATAP).
PWATAP will place order at supplier for $80 of stock (to replenish), dr 'PurchaseInProgress' with $80, pay courier service and cr 'Courier' with $20.
In reality, all of those things either happen in a more streamlined way (a holding account is used and replenishments are purchased periodically in batches, not individually), or behind the scenes and invisible to the end-user (dispatcher simply puts "fulfilled order" into the system, and the system will split it up however it needs to).
[1] The courier will go through the same process, for their services rendered
hum3hum3|2 years ago