Move the whole split when a part's date changes
Fixes #5655
Problem
Changing the date of a split transaction from the bulk edit drawer did nothing. Entry.bulk_update! dropped date for every split child, because a split part must keep its parent's date (split_child_date_matches_parent). The activity list only shows the split parts, so the user had no way to move a split to another day, and the drawer still reported the rows as updated.
Change
When a bulk update gives a split part a new date, the parent and all of its parts move to that date, parent first, so the validation keeps holding. The moved rows lock their date and are marked user-modified, like the row the user edited, and their accounts get the usual sync window. Matched transfer legs still keep their date, as before.
Validation
- Added
bulk_update! moving one split part moves the parent and every parttotest/models/entry_split_test.rb: it moves one part and checks that the parent and both parts have the new date. - I could not run the test suite locally (no Ruby toolchain on this machine), so I am relying on CI for the full run.
Summary by cubic
Fixes #5655. Bulk-editing the date of a split transaction part now moves the parent and every part of the split to the new date, instead of silently dropping the change because a part must keep its parent's date.
- The whole split (parent and siblings) is locked in one ordered lock before updating.
- Parts are saved parent first so the validation keeps holding.
- Each moved row is noted before the follow-up saves reset
saved_change_to_date, then locked, marked user-modified, and gets the usual sync window. - A split with a matched transfer leg keeps its date, as before.
- Adds tests that moving one part moves the parent and both parts, and that a confirmed transfer leg keeps the split's date.
Summary by CodeRabbit
- Bug Fixes
- Bulk date updates to a split entry now apply consistently to its parent and all child entries.
- If any part of the split is a confirmed transfer, the date change is rejected and all dates remain unchanged.
- Date changes across affected entries are tracked for account synchronization and scheduled-entry rescheduling.