Fix swapped opening and closing balance

This commit is contained in:
2024-07-12 14:57:42 +02:00
parent 9d53d5a309
commit 9ef09c4708

View File

@@ -52,8 +52,10 @@ const load_transactions = async () => {
} }
if (month.rows && month.rows.length > 0) { if (month.rows && month.rows.length > 0) {
month.balance_start = month.rows[0].new_balance // Days are ordered from new to old, so the opening balance is the
month.balance_end = month.rows[month.rows.length-1].new_balance // last row
month.balance_start = month.rows[month.rows.length-1].new_balance
month.balance_end = month.rows[0].new_balance
} }
month.rows.forEach(row => { month.rows.forEach(row => {