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 @@ -689,6 +689,17 @@ private void saveNewTransaction() {
689689 Currency currency = Currency .getInstance (mTransactionsDbAdapter .getAccountCurrencyCode (mAccountUID ));
690690 Money amount = new Money (amountBigd , currency ).absolute ();
691691
692+ if (mSplitsList .size () == 1 ){ //means split editor was opened but no split was added
693+ String transferAcctUID ;
694+ if (mUseDoubleEntry ) {
695+ long transferAcctId = mDoubleAccountSpinner .getSelectedItemId ();
696+ transferAcctUID = mAccountsDbAdapter .getUID (transferAcctId );
697+ } else {
698+ transferAcctUID = mAccountsDbAdapter .getOrCreateImbalanceAccountUID (currency );
699+ }
700+ mSplitsList .add (mSplitsList .get (0 ).createPair (transferAcctUID ));
701+ }
702+
692703 //capture any edits which were done directly (not using split editor)
693704 if (mSplitsList .size () == 2 && mSplitsList .get (0 ).isPairOf (mSplitsList .get (1 ))) {
694705 //if it is a simple transfer where the editor was not used, then respect the button
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public void onActivityCreated(Bundle savedInstanceState) {
116116
117117 getDialog ().setTitle (R .string .title_transaction_splits );
118118
119- mSplitItemViewList = new ArrayList <View >();
119+ mSplitItemViewList = new ArrayList <>();
120120 mSplitsDbAdapter = SplitsDbAdapter .getInstance ();
121121
122122 //we are editing splits for a new transaction.
You can’t perform that action at this time.
0 commit comments