ledger / ledger-mode

Emacs Lisp files for interacting with the C++Ledger accounting system
GNU General Public License v2.0
385 stars 75 forks source link

Allow `ledger-insert-effective-date` to work with regions. #404

Open ChickenProp opened 7 months ago

ChickenProp commented 7 months ago

It updates or removes the effective date of all transactions that start in the region (technically, that start on a line in the region), without editing any postings.

With my credit card, I use the statement date as the effective date. That means I have a long block of transactions that all have the same effective date. This makes it easy to set them all at once.

ChickenProp commented 3 months ago

Tests added. They're not as thorough as I'd like: in particular, I don't know how to test prompting behavior, and when refactoring I briefly introduced a bug that my tests didn't catch. (If I called (ledger-insert-effective-date date) instead of (... date-string), then interactive use would ask for a different date for every xact in the region, plus one up front that would be ignored. Tests don't catch it because they never get dates from prompts.)