Skip to content

Conversation

@Sha-yol
Copy link
Contributor

@Sha-yol Sha-yol commented Mar 2, 2025

The updateTransaction method was not set up to handle split transactions, which occur with the new debt tracking functionality.
This PR modifies updateTransaction to handle such cases by handling list inputs (representing splits), aligning them according to the real and cover splits by identifying the transaction whose description starts with "Cover for:", and then proceeds to update the fields as for a regular transaction.

Comment on lines +246 to +251
if len(newTxns) > 1:
# order lists so that the first element is the one that is not the balance account transaction
cover_new = [txn for txn in newTxns if txn['description'].startswith('Cover for:')]
cover_old = [txn for txn in oldTxns if txn['description'].startswith('Cover for:')]
newTxns = [txn for txn in newTxns if not txn['description'].startswith('Cover for:')] + cover_new
oldTxns = [txn for txn in oldTxns if not txn['description'].startswith('Cover for:')] + cover_old
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem like the best way to do this, but it is faster than sorting, so I am fine with it.

@adyanth
Copy link
Owner

adyanth commented Mar 15, 2025

thanks, I missed this, merging now!

@adyanth adyanth merged commit 00dd48e into adyanth:main Mar 15, 2025
0 of 2 checks passed
@Sha-yol Sha-yol deleted the bugfix-updateTransaction-debt-tracking branch March 15, 2025 09:47
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.

2 participants