Nate Mendes
61c1e0d7e1
fix(accounts): keep the entered current balance when it differs from the opening one ( #3301 )
...
create_and_sync anchors only the opening balance. For an account whose
opening balance differs from today's — a loan entered with its original
principal alongside its current remaining balance — that opening anchor is
the account's only entry, so the initial sync walks forward from it and
overwrites the balance the user just typed.
Anchor today's balance too, as an explicit same-day reconciliation, whenever
the two differ and the opening anchor sits on an earlier day. The date guard
matters because opening_balance_date is user-editable and can be today:
ReconciliationManager matches an existing valuation by date alone, kind is
not part of the lookup, so it would reuse the opening anchor and reassign its
amount — discarding the opening balance and leaving a kind: "opening_anchor"
row holding the current balance. On its own date the opening balance wins.
A direct reconciliation rather than CurrentBalanceManager keeps the anchor
type-agnostic: the manager's cash-account strategy computes a zero delta at
creation and would only rewrite the opening anchor, leaving today's balance
unanchored for the first sync.
initial_balance's presence is read from the raw value, because "".to_d is 0.
A blank field would otherwise set an opening balance of 0 and, since 0
differs from the entered balance, write a reconciliation on top. An explicit
0 is still a real opening balance.
initial_balance is a Loan attribute today, so the loan regression tests cover
the reachable path.
2026-09-01 02:30:47 +02:00
..
2026-08-22 03:14:03 +02:00
2026-09-01 01:48:05 +02:00
2026-06-02 21:44:57 +02:00
2026-07-30 02:29:13 +02:00
2026-07-25 20:11:25 +02:00
2026-08-26 21:12:06 +02:00
2026-08-24 23:32:45 +02:00
2026-08-22 04:30:23 +02:00
2026-08-28 08:14:42 +02:00
2026-08-28 08:14:42 +02:00
2026-05-13 18:13:48 +02:00
2026-05-13 18:13:48 +02:00
2026-05-13 18:13:48 +02:00
2026-08-26 07:59:00 +02:00
2026-07-17 06:35:57 +02:00
2026-04-01 20:25:06 +02:00
2026-04-01 20:25:06 +02:00
2026-06-20 21:43:20 +02:00
2026-02-06 18:04:03 +01:00
2026-08-27 12:27:01 -07:00
2026-08-01 08:44:30 +02:00
2026-08-22 23:52:35 +02:00
2026-08-01 08:27:59 +02:00
2026-02-06 18:04:03 +01:00
2026-04-13 00:51:23 +02:00
2026-08-31 23:41:38 +02:00
2026-08-26 21:15:31 +02:00
2026-06-08 21:45:35 +02:00
2026-08-28 07:53:33 +02:00
2026-05-26 22:48:23 +02:00
2026-05-12 23:45:19 +02:00
2026-08-26 07:59:00 +02:00
2026-07-26 01:47:53 +02:00
2026-08-31 23:41:38 +02:00
2026-06-30 07:35:14 +02:00
2026-06-30 07:35:14 +02:00
2026-01-09 13:14:14 +01:00
2026-07-30 02:29:13 +02:00
2026-08-26 07:55:25 +02:00
2026-05-30 23:27:18 +02:00
2026-06-30 07:37:14 +02:00
2026-06-30 07:37:14 +02:00
2026-06-30 07:37:14 +02:00
2026-07-04 08:24:31 +02:00
2026-08-22 21:27:38 +02:00
2026-08-26 21:07:58 +02:00
2026-08-26 08:22:17 +02:00
2026-06-11 20:26:40 +02:00
2026-07-17 07:22:50 +02:00
2026-08-04 23:33:01 +02:00
2026-08-31 23:27:04 +02:00
2026-06-09 23:02:26 +02:00
2026-07-08 09:00:49 +02:00
2026-08-31 23:41:38 +02:00
2026-07-26 07:40:25 +02:00
2026-07-26 07:40:25 +02:00
2026-08-26 07:59:00 +02:00
2026-08-27 21:58:34 +02:00
2025-11-24 14:07:14 +01:00
2026-08-22 06:34:09 +02:00
2026-07-30 01:13:02 +02:00
2026-08-27 00:02:44 +02:00
2026-07-25 18:54:37 +02:00
2026-05-09 21:55:20 +02:00
2026-08-31 22:49:48 +02:00
2026-08-05 19:47:34 +02:00
2026-08-22 08:26:48 +02:00
2026-08-22 08:26:48 +02:00
2026-06-20 20:33:09 +02:00
2026-08-24 22:41:08 +02:00
2026-07-14 03:16:28 +02:00
2026-08-11 23:21:08 +02:00
2026-08-11 23:21:08 +02:00
2026-08-11 23:21:08 +02:00
2026-05-12 23:45:19 +02:00
2026-05-13 20:07:00 +02:00
2026-01-07 15:59:04 +01:00
2026-03-25 10:50:23 +01:00
2025-11-24 14:07:14 +01:00
2026-07-04 03:27:59 +02:00
2026-09-01 02:30:47 +02:00
2026-06-11 09:04:56 +02:00
2026-04-29 15:30:04 +02:00
2026-08-31 19:47:48 +02:00
2026-06-02 21:44:57 +02:00
2026-06-02 21:44:57 +02:00
2026-06-02 21:44:57 +02:00
2026-06-26 06:47:38 +02:00
2026-03-14 20:14:18 +01:00
2026-08-15 06:12:22 +02:00
2026-08-21 21:58:47 +02:00
2026-07-21 05:50:40 +02:00
2026-06-25 05:44:44 +02:00
2026-06-27 00:57:03 +00:00
2026-04-07 14:43:17 +02:00
2026-04-07 14:43:17 +02:00
2026-05-13 18:13:48 +02:00
2026-05-13 18:13:48 +02:00
2026-08-26 21:17:51 +02:00
2026-08-31 23:41:38 +02:00
2026-08-18 08:36:46 +02:00
2026-08-26 06:29:15 +02:00
2026-03-11 15:54:01 +01:00
2026-08-26 07:59:00 +02:00
2026-08-15 06:12:22 +02:00
2026-01-21 22:56:39 +01:00
2026-01-21 22:56:39 +01:00
2026-04-11 21:37:07 +02:00
2026-01-07 15:59:04 +01:00
2026-02-19 19:51:42 +01:00
2026-05-17 16:55:01 +02:00
2026-07-08 08:08:10 +02:00
2026-04-10 23:19:48 +02:00
2026-06-04 19:53:52 +02:00
2026-08-22 03:14:03 +02:00
2026-05-09 12:36:41 +02:00
2026-08-04 23:03:12 +02:00
2026-06-28 16:12:33 +02:00
2026-02-19 18:07:47 +01:00
2026-02-11 15:22:56 +01:00
2026-07-25 05:04:30 +02:00
2026-07-26 01:38:31 +02:00
2026-08-25 04:02:01 +02:00
2026-08-26 07:20:48 +02:00
2026-08-27 21:15:43 +02:00
2026-06-02 14:00:16 +02:00
2026-08-28 07:32:30 +02:00
2026-08-28 07:53:33 +02:00
2026-05-18 21:03:04 +02:00
2026-05-12 23:45:19 +02:00
2026-05-12 23:45:19 +02:00
2026-05-12 23:45:19 +02:00
2026-06-16 17:13:03 +02:00
2026-07-25 05:04:30 +02:00
2026-08-22 03:55:08 +02:00
2026-07-25 04:59:29 +02:00
2026-02-08 18:19:37 +01:00
2026-02-08 18:19:37 +01:00
2026-08-01 08:39:04 +02:00
2026-06-06 17:11:33 +02:00
2026-08-25 03:40:57 +02:00
2026-05-05 01:04:29 +02:00
2026-07-14 01:39:26 +02:00
2026-05-12 00:22:37 +02:00
2026-07-15 19:47:42 +02:00
2026-04-18 00:06:24 +02:00
2026-07-08 08:08:10 +02:00
2026-05-12 12:18:17 +02:00
2026-04-07 20:46:05 +02:00
2026-05-03 10:56:31 +02:00
2026-05-03 10:56:31 +02:00
2026-05-12 00:00:49 +02:00
2026-08-22 21:54:32 +02:00
2026-08-22 21:54:32 +02:00
2026-08-26 21:07:58 +02:00
2026-08-26 08:22:17 +02:00
2026-08-22 03:14:03 +02:00
2026-05-30 00:22:25 +02:00
2026-06-04 23:11:43 +02:00
2026-08-18 08:36:46 +02:00
2026-03-19 15:17:55 +01:00
2026-08-27 21:34:09 +02:00
2026-06-28 16:12:33 +02:00
2026-05-30 23:27:18 +02:00
2026-07-25 04:47:58 +02:00
2026-08-31 23:27:04 +02:00
2026-06-28 17:02:07 +02:00
2026-08-31 23:41:38 +02:00
2026-08-31 23:41:38 +02:00
2026-08-31 23:41:38 +02:00
2026-08-31 23:41:38 +02:00
2026-07-26 07:40:25 +02:00
2026-04-03 12:38:37 +02:00
2026-08-22 23:28:37 +02:00
2026-03-13 07:59:45 +01:00
2026-08-26 21:07:58 +02:00
2026-08-22 04:30:23 +02:00
2026-08-22 07:17:29 +02:00
2026-04-29 13:00:38 +02:00
2026-06-25 05:38:06 +02:00
2026-07-25 03:35:35 +02:00
2026-08-17 06:00:43 +02:00
2026-07-31 02:20:03 +02:00
2026-01-23 00:27:00 +01:00
2026-08-25 04:28:25 +02:00
2026-07-31 02:20:03 +02:00
2026-05-08 15:15:23 +02:00
2026-05-09 21:55:20 +02:00
2026-08-22 21:54:32 +02:00
2026-02-10 23:14:58 +01:00
2026-05-05 00:47:45 +02:00
2026-08-30 04:33:39 +02:00
2026-07-25 03:35:35 +02:00
2026-07-25 03:35:35 +02:00
2026-05-13 20:07:00 +02:00
2026-08-28 07:16:40 +02:00
2026-07-25 04:54:30 +02:00
2026-07-25 04:54:30 +02:00
2026-07-25 04:54:30 +02:00
2026-07-25 04:54:30 +02:00
2026-07-25 04:54:30 +02:00
2026-07-25 04:54:30 +02:00
2026-07-25 04:54:30 +02:00
2026-03-14 23:56:27 +01:00
2026-05-13 20:07:00 +02:00
2026-08-22 02:43:29 +02:00
2026-06-28 19:47:53 +00:00
2026-07-04 03:13:39 +02:00
2026-06-20 20:33:09 +02:00
2026-05-03 20:33:29 +02:00
2026-08-31 23:29:38 +02:00
2026-08-24 22:41:08 +02:00
2026-07-14 03:16:28 +02:00
2026-07-14 03:16:28 +02:00
2026-06-16 08:32:17 +02:00