mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 18:40:34 -05:00
* Adds balance variable to rule templates Enables access to the account balance within rule templates. This allows for more complex rule creation based on the current account balance. Calculates the account balance up to the transaction being processed, including transactions on the same date with lower sort order. Handles cases where the balance is undefined gracefully, defaulting to 0 to prevent errors. ## AI disclaimer This PR contains code that was partially or fully generated by AI and may contain errors. All suggestions for improvement are welcome. * Add release notes * indexed sql params not supported * [autofix.ci] apply automated fixes * Skip parent transactions of splits * Uses aql for account balance Updates transaction rule preparation to use aql instead of sql calculating it from past transactions. The balance is defaulted to 0 if no account is set. Refactor account balance calculation to build a proper query with date and sort_order filters * Add block scoping to switch cases and ensure correct fallthrough handling in Action type conversions * Corrects transaction rule sorting order Reverses the sort order comparison in transaction rules to ensure correct identification of prior transactions with the same date. This ensures that the correct balance is used when calculating balance-based rule conditions. fixup! Corrects transaction rule sorting order * Improves transaction rule balance calculation Uses a more efficient query for calculating the account balance up to a transaction when applying rules, improving performance. This change reduces the complexity of the balance calculation. * Apply coderabbit lessons learned * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
See the Writing Good Release Notes section of the README for the documentation repo for more information on how to create a release notes file here.