Skip to content

Commit

Permalink
Fixed: transactions not saved when double-entry enabled but no transf…
Browse files Browse the repository at this point in the history
…er account specified

Fixes codinguser#277
  • Loading branch information
codinguser committed Feb 11, 2015
1 parent 2b05d00 commit 7c4087c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
else if (mAmountEditText.getText().length() == 0) {
Toast.makeText(getActivity(), R.string.toast_transanction_amount_required, Toast.LENGTH_SHORT).show();
} else
saveNewTransaction();
} else if (mUseDoubleEntry && mDoubleAccountSpinner.getCount() == 0){
//TODO: Or automatically create an imbalance account
Toast.makeText(getActivity(),
"Create & specify a transfer account OR disable double-entry in settings to save the transaction",
Toast.LENGTH_LONG).show();
} else {
saveNewTransaction();
}
return true;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ private void validateEditTransactionFields(Transaction transaction){
actualValue = timeView.getText().toString();// mSolo.getText(7).getText().toString();
assertEquals(expectedValue, actualValue);
}


//TODO: Add test for only one account but with double-entry enabled

public void testAddTransaction(){
setDoubleEntryEnabled(true);
mSolo.waitForText(TRANSACTION_NAME);
Expand Down

0 comments on commit 7c4087c

Please sign in to comment.