MIFOSX-1788:Waive interest is not working as expected
This commit is contained in:
+4
@@ -640,6 +640,10 @@ public final class LoanTransaction extends AbstractPersistable<Long> {
|
||||
private LocalDate getCreatedDate() {
|
||||
return new LocalDate(this.createdDate);
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return new LocalDateTime(this.createdDate);
|
||||
}
|
||||
|
||||
public boolean isLastTransaction(final LoanTransaction loanTransaction) {
|
||||
boolean isLatest = false;
|
||||
|
||||
+12
-6
@@ -17,13 +17,19 @@ public class LoanTransactionComparator implements Comparator<LoanTransaction> {
|
||||
int compareResult = 0;
|
||||
final int comparsion = o1.getTransactionDate().compareTo(o2.getTransactionDate());
|
||||
if (comparsion == 0) {
|
||||
int comparsionCreate = 0;
|
||||
if (o1.getCreatedDateTime() != null && o2.getCreatedDateTime() != null){
|
||||
comparsionCreate = o1.getCreatedDateTime().compareTo(o2.getCreatedDateTime());
|
||||
}
|
||||
// equal transaction dates
|
||||
if (o1.isWaiver() && o2.isNotWaiver()) {
|
||||
compareResult = -1;
|
||||
} else if (o1.isNotWaiver() && o2.isWaiver()) {
|
||||
compareResult = 1;
|
||||
} else {
|
||||
compareResult = 0;
|
||||
if (comparsionCreate == 0) {
|
||||
if (o1.isWaiver() && o2.isNotWaiver()) {
|
||||
compareResult = -1;
|
||||
} else if (o1.isNotWaiver() && o2.isWaiver()) {
|
||||
compareResult = 1;
|
||||
} else {
|
||||
compareResult = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
compareResult = comparsion;
|
||||
|
||||
Reference in New Issue
Block a user