Skip to content

Conversation

georgeef
Copy link
Contributor

@georgeef georgeef commented Sep 9, 2024

This PR adds an option to include scheduled transactions in mmCheckingPanel, as proposed in #6860.

Implementation

  • Declare struct Fused_Transaction::Data derived from Model_Checking::Data, which represents either a transaction or a single execution of a scheduled transaction. It contains the additional fields m_bdid and m_repeat_num. For a transaction, m_bdid and m_repeat_num are set to 0. For an execution of a scheduled transaction, m_bdid is the BDID of the original scheduled transaction, TRANSID is set to 0, m_repeat_num is the repetition number (starting from 1), TRANSDATE is the date of execution (it may be different than the TRANSDATE of the original scheduled transaction), and all other data fields are as if the scheduled transaction has been executed.

  • Declare struct Fused_Transaction::Full_Data derived from Model_Checking::Full_Data, with the additional fields m_bdid and m_repeat_num. For an execution of a scheduled transaction, m_tags is set to the tags of the original scheduled transaction, while m_splits contains the execution of the original scheduled transaction splits (with TRANSID set to 0).

  • Define Model_Billsdeposits::unroll(r, end_date), which returns the list (vector) of execution dates for the scheduled transaction r, until end_date. An optional argument limit can be used in order to limit the number of executions.

  • Extend the main loop in mmCheckingPanel::filterTable() to also process scheduled transactions. If scheduled transactions are disabled, the loop behavior and efficiency are the same as before. The vector of transactions and the executions of scheduled transactions are processed in parallel (they are both sorted by date), choosing the entry with the smaller date in each iteration (or choosing a transaction, if both have the same date).

Interface changes

  • In the header (top) area of transactions panels, show the balance information above (closer to the title) and the controls below (closer to the main action area).

  • If all transactions are reconciled, then hide Reconciled Bal and Diff, since they are redundant. If at least one transaction is not reconciled, show Reconciled Bal and Diff, even if the difference is zero (this also serves as a warning to the user that there are unreconciled transactions).

Additional changes

  • Rename enum cases MENU_VIEW_* to FILTER_ID_* in mmcheckingpanel.h.
  • Remove VIEW_TRANS_*_STR from constants. Add FILTER_STR in mmcheckingpanel.
  • Refactor Model_Checking::Full_Data constructors.

This change is Reviewable

@georgeef
Copy link
Contributor Author

georgeef commented Sep 9, 2024

replaced the "Schduled Transactions" checkbox (which had quite long text), with a wxBitmapToggleButton containing the RECURRING bitmap (same as in nav tree). i tested on macOS, according to wxWidgets manual this button is not available in all systems. please check.

@georgeef
Copy link
Contributor Author

georgeef commented Sep 9, 2024

there is an error in static code analysis, about an initialization in Model_Billsdeposits::Full_Data. this line has indeed changed (only renaming, in the first commit), but the error seems to be irrelevant to the change. so it doesn't seem to be about the change of the checkbox in the last commit.

@georgeef
Copy link
Contributor Author

new commit:

  • fix issue in static analysis
  • change FILTER_ID_NONE to FILTER_ID_ALL
  • set min width of the filter button to 200

@georgeef
Copy link
Contributor Author

new commit: add dynamic tooltip on scheduled button (depending on its state).

@georgeef
Copy link
Contributor Author

georgeef commented Sep 10, 2024

new commit: hide Reconciled Bal and Diff in header, if all transactions are reconciled (see also updated description).

@vomikan vomikan added the on hold waiting for something label Sep 13, 2024
@vomikan vomikan added this to the v1.9.0 milestone Oct 2, 2024
@whalley whalley removed the on hold waiting for something label Dec 1, 2024
@georgeef
Copy link
Contributor Author

georgeef commented Dec 1, 2024

Replaced by #6981.

@whalley whalley removed this from the v1.9.0 milestone Dec 13, 2024
@georgeef georgeef deleted the new_mmcheckingpanel-1 branch December 21, 2024 14:59
@georgeef georgeef changed the title new(#6860): show scheduled transactions in mmCheckingPanel new(#6860), part 1: show scheduled transactions in mmCheckingPanel Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants