Skip to content

Commit

Permalink
Fix editing amount of a transaction
Browse files Browse the repository at this point in the history
Only validate split items if the SplitView is actually shown, which
makes the transaction a "split-transaction". Only then the original
amount cannot be different that the split-total.

Fixes #100
  • Loading branch information
humdingerb committed Aug 17, 2024
1 parent 275730a commit 436a6ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/SplitView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,13 @@ SplitView::MessageReceived(BMessage* msg)
if (!fAmount->Validate())
break;

if (fSplitContainer->IsHidden())
if (fSplitContainer->IsHidden()) {
if (!fCategory->Validate())
break;

if (!ValidateSplitItems())
break;
} else {
if (!ValidateSplitItems())
break;
}
Account* account = fTransaction.GetAccount();
if (!account)
ShowBug("NULL transaction account in SplitView::M_ENTER_TRANSACTION");
Expand Down

0 comments on commit 436a6ce

Please sign in to comment.