Skip to content

Commit

Permalink
Merge pull request openMF#700 from mayank-kgp/repaid
Browse files Browse the repository at this point in the history
Fix 693: repaid every field
  • Loading branch information
therajanmaurya authored Jun 26, 2017
2 parents 21eeca4 + 2fa4f3a commit cc876f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ private void inflateRepaidMonthSpinners() {
.setDropDownViewResource(layout.simple_spinner_dropdown_item);
spRepaymentFreqDayOfWeek.setAdapter(mRepaymentFrequencyDayOfWeekTypeOptionsAdapter);
spRepaymentFreqDayOfWeek.setOnItemSelectedListener(this);
spRepaymentFreqNthDay.setSelection(mListRepaymentFrequencyNthDayTypeOptions.size() - 1);
spRepaymentFreqDayOfWeek.setSelection(
mListRepaymentFrequencyDayOfWeekTypeOptions.size() - 1);
}

private void inflateLoansProductSpinner() {
Expand Down Expand Up @@ -471,6 +474,8 @@ public void showLoanAccountTemplate(LoanTemplate loanTemplate) {
for (RepaymentFrequencyNthDayTypeOptions options : mRepaymentFrequencyNthDayTypeOptions) {
mListRepaymentFrequencyNthDayTypeOptions.add(options.getValue());
}
mListRepaymentFrequencyNthDayTypeOptions.add(
getResources().getString(R.string.select_week_hint));

mListRepaymentFrequencyDayOfWeekTypeOptions.clear();
mRepaymentFrequencyDaysOfWeekTypeOptions = mLoanTemplate
Expand All @@ -479,6 +484,8 @@ public void showLoanAccountTemplate(LoanTemplate loanTemplate) {
: mRepaymentFrequencyDaysOfWeekTypeOptions) {
mListRepaymentFrequencyDayOfWeekTypeOptions.add(options.getValue());
}
mListRepaymentFrequencyDayOfWeekTypeOptions.add(
getResources().getString(R.string.select_day_hint));

mListLoanPurposeOptions.clear();
for (com.mifos.objects.templates.loans.LoanPurposeOptions loanPurposeOptions :
Expand Down Expand Up @@ -619,15 +626,25 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
}
break;
case R.id.sp_repayment_freq_nth_day:
repaymentFrequencyNthDayType = mLoanTemplate
.getRepaymentFrequencyNthDayTypeOptions()
.get(position).getId();
if (mListRepaymentFrequencyNthDayTypeOptions.get(position)
.equals(getResources().getString(R.string.select_week_hint))) {
repaymentFrequencyNthDayType = null;
} else {
repaymentFrequencyNthDayType = mLoanTemplate
.getRepaymentFrequencyNthDayTypeOptions()
.get(position).getId();
}
break;

case R.id.sp_repayment_freq_day_of_week:
repaymentFrequencyDayOfWeek = mLoanTemplate
.getRepaymentFrequencyDaysOfWeekTypeOptions()
.get(position).getId();
if (mListRepaymentFrequencyDayOfWeekTypeOptions.get(position)
.equals(getResources().getString(R.string.select_day_hint))) {
repaymentFrequencyDayOfWeek = null;
} else {
repaymentFrequencyDayOfWeek = mLoanTemplate
.getRepaymentFrequencyDaysOfWeekTypeOptions()
.get(position).getId();
}
break;

case R.id.sp_fund :
Expand Down
2 changes: 2 additions & 0 deletions mifosng-android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@
<string name="loan_disbursement_date">Disbursement Date</string>
<string name="loan_account_linking_option_label">Link Savings</string>
<string name="select_linkage_account_hint">Select Account</string>
<string name="select_week_hint">Select Week</string>
<string name="select_day_hint">Select Day</string>
<string name="savings_interest_earned">Interest Earned</string>
<string name="sync">Sync</string>
<string name="enter_center_id">Center Id</string>
Expand Down

0 comments on commit cc876f6

Please sign in to comment.