fix: loan transfer kind assignment to use destination account (#874)

* fix: loan transfer kind assignment to use destination account

* fix: update system test to use depository account instead of investment account
This commit is contained in:
BitToby
2026-02-07 08:06:30 -03:00
committed by GitHub
parent c6d3d85922
commit 5239c3c11a
3 changed files with 58 additions and 4 deletions

View File

@@ -201,10 +201,11 @@ class TransactionsTest < ApplicationSystemTestCase
end
test "transfers should always sum to zero" do
# Use two accounts that result in funds_movement kind (not investment/crypto which become investment_contribution)
asset_account = accounts(:other_asset)
investment_account = accounts(:investment)
depository_account = accounts(:depository)
outflow_entry = create_transaction("outflow", Date.current, 500, account: asset_account)
inflow_entry = create_transaction("inflow", 1.day.ago.to_date, -500, account: investment_account)
inflow_entry = create_transaction("inflow", 1.day.ago.to_date, -500, account: depository_account)
@user.family.auto_match_transfers!
visit transactions_url