Skip to content

Commit

Permalink
fix openMF#778:transfer within same account
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshGautam committed Mar 22, 2018
1 parent 70830ec commit b479be4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class SavingsMakeTransferFragment extends BaseFragment implements
private String transferDate;
private AccountOption toAccountOption, fromAccountOption;
private AccountOptionsTemplate accountOptionsTemplate;
private String transferType;
private String transferType, payTo, payFrom;
private long accountId;

/**
Expand Down Expand Up @@ -295,9 +295,11 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
switch (parent.getId()) {
case R.id.sp_pay_to:
toAccountOption = accountOptionsTemplate.getToAccountOptions().get(position);
payTo = toAccountOption.getAccountNo();
break;
case R.id.sp_pay_from:
fromAccountOption = accountOptionsTemplate.getFromAccountOptions().get(position);
payFrom = fromAccountOption.getAccountNo();
break;
}

Expand Down Expand Up @@ -353,7 +355,7 @@ public void payToSelected() {
*/
@OnClick(R.id.btn_pay_from)
public void payFromSelected() {
if (spPayTo.getSelectedItem().toString().equals(spPayFrom.getSelectedItem().toString())) {
if (payTo.equals(payFrom) && payTo!=null) {
showToaster(getString(R.string.error_same_account_transfer));
return;
}
Expand Down

0 comments on commit b479be4

Please sign in to comment.