File tree Expand file tree Collapse file tree
app/src/main/java/org/gnucash/android/ui/transaction Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -485,8 +485,18 @@ private void initalizeViews() {
485485 mCurrencyTextView .setText (accountCurrency .getSymbol ());
486486
487487 if (mUseDoubleEntry ){
488- long accountId = mAccountsDbAdapter .getID (mAccountUID );
489- long defaultTransferAccountID = mAccountsDbAdapter .getDefaultTransferAccountID (accountId );
488+ String currentAccountUID = mAccountUID ;
489+ long defaultTransferAccountID = 0 ;
490+
491+ do {
492+ long transAccID = mAccountsDbAdapter .getDefaultTransferAccountID (mAccountsDbAdapter .getID (currentAccountUID ));
493+ if (transAccID > 0 ) {
494+ defaultTransferAccountID = transAccID ;
495+ }
496+ currentAccountUID = mAccountsDbAdapter .getParentAccountUID (currentAccountUID );
497+ }
498+ while (currentAccountUID != null && defaultTransferAccountID == 0 );
499+
490500 if (defaultTransferAccountID > 0 ){
491501 setSelectedTransferAccount (defaultTransferAccountID );
492502 }
You can’t perform that action at this time.
0 commit comments