Skip to content

Commit 62eab82

Browse files
committed
Merge pull request #252 from fefe982/fix-db-split
Correction of condition for simple double-entry account
2 parents 555d431 + 8eba403 commit 62eab82

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

app/src/org/gnucash/android/ui/transaction/TransactionFormFragment.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,17 @@ private void initializeViewsWithTransaction(){
343343

344344
//if there are more than two splits (which is the default for one entry), then
345345
//disable editing of the transfer account. User should open editor
346-
if (mTransaction.getSplits().size() > 2) {
347-
setAmountEditViewVisible(View.GONE);
348-
} else {
346+
if (mSplitsList.size() == 2 && mSplitsList.get(0).isPairOf(mSplitsList.get(1))) {
349347
for (Split split : mTransaction.getSplits()) {
350348
//two splits, one belongs to this account and the other to another account
351349
if (mUseDoubleEntry && !split.getAccountUID().equals(mAccountUID)) {
352350
setSelectedTransferAccount(mAccountsDbAdapter.getAccountID(split.getAccountUID()));
353351
}
354352
}
353+
} else {
354+
if (mUseDoubleEntry) {
355+
setAmountEditViewVisible(View.GONE);
356+
}
355357
}
356358
mSplitsList = new ArrayList<Split>(mTransaction.getSplits()); //we need a copy so we can modify with impunity
357359
mAmountEditText.setEnabled(mSplitsList.size() <= 2);

0 commit comments

Comments
 (0)