Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : closed filter functionality #783

Merged
merged 1 commit into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ public Status withOverpaid(Boolean overpaid) {
return this;
}

public boolean isLoanTypeWithdrawn() {

return !(this.active || this.closed || this.pendingApproval || this.waitingForDisbursal
|| this.closedObligationsMet || this.closedWrittenOff || this.closedRescheduled
|| this.overpaid);
}

@Override
public String toString() {
return "Status{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class Timeline implements Parcelable {
@SerializedName("expectedMaturityDate")
List<Integer> expectedMaturityDate;

@SerializedName("withdrawnOnDate")
List<Integer> withdrawnOnDate;

public List<Integer> getSubmittedOnDate() {
return submittedOnDate;
}
Expand Down Expand Up @@ -180,6 +183,13 @@ public void setExpectedMaturityDate(List<Integer> expectedMaturityDate) {
this.expectedMaturityDate = expectedMaturityDate;
}

public List<Integer> getWithdrawnOnDate() {
return withdrawnOnDate;
}

public void setWithdrawnOnDate(List<Integer> withdrawnOnDate) {
this.withdrawnOnDate = withdrawnOnDate;
}

@Override
public int describeContents() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ public boolean test(LoanAccount account) {
} else if (status.getStatus().compareTo(context.getString(R.string.
closed)) == 0 && account.getStatus().getClosed()) {
return true;
} else if (status.getStatus().compareTo(context.getString(R.string.
withdrawn)) == 0 && account.getStatus().isLoanTypeWithdrawn()) {
return true;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,17 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
string_and_string, context.getString(R.string.disbursement), DateHelper
.getDateAsString(loanAccount.getTimeline().getActualDisbursementDate())));

} else {
} else if (loanAccount.getStatus().getClosed()) {

setLoanAccountsGeneralDetails(holder, R.color.black, context.getString(R.string.
string_and_string, context.getString(R.string.closed), DateHelper
.getDateAsString(loanAccount.getTimeline().getClosedOnDate())));

} else {
setLoanAccountsGeneralDetails(holder, R.color.gray_dark, context.getString(R.string.
string_and_string, context.getString(R.string.withdrawn), DateHelper
.getDateAsString(loanAccount.getTimeline().getWithdrawnOnDate())));

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public static List<CheckboxStatus> getLoanAccountStatusList(Context context) {
getColor(context, R.color.purple)));
arrayList.add(new CheckboxStatus(context.getString(R.string.closed), ContextCompat.
getColor(context, R.color.black)));
arrayList.add(new CheckboxStatus(context.getString(R.string.withdrawn), ContextCompat.
getColor(context, R.color.gray_dark)));

return arrayList;
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<string name="savings_charges">Savings Charges</string>
<string name="active">Active</string>
<string name="closed">Closed</string>
<string name="withdrawn">Withdrawn</string>
<string name="need_approval">Need Approval</string>
<string name="pending">Pending</string>
<string name="matured">Matured</string>
Expand Down