Refactors journal entry lines to use single amount
Simplifies the representation of journal entry lines by replacing separate debit and credit fields with a single 'amount' field. Positive amounts represent debits, while negative amounts represent credits, aligning with Beancount's approach. This change improves code readability and simplifies calculations for balancing entries.
This commit is contained in:
parent
d0bec3ea5a
commit
4ae6a8f7d2
5 changed files with 35 additions and 45 deletions
|
|
@ -41,7 +41,7 @@ Only entries with `flag='*'` (CLEARED) are included in balance calculations:
|
|||
|
||||
```sql
|
||||
-- Balance query excludes pending/flagged/voided entries
|
||||
SELECT SUM(debit), SUM(credit)
|
||||
SELECT SUM(amount)
|
||||
FROM entry_lines el
|
||||
JOIN journal_entries je ON el.journal_entry_id = je.id
|
||||
WHERE el.account_id = :account_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue