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() {
|
private LocalDate getCreatedDate() {
|
||||||
return new LocalDate(this.createdDate);
|
return new LocalDate(this.createdDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedDateTime() {
|
||||||
|
return new LocalDateTime(this.createdDate);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isLastTransaction(final LoanTransaction loanTransaction) {
|
public boolean isLastTransaction(final LoanTransaction loanTransaction) {
|
||||||
boolean isLatest = false;
|
boolean isLatest = false;
|
||||||
|
|||||||
+12
-6
@@ -17,13 +17,19 @@ public class LoanTransactionComparator implements Comparator<LoanTransaction> {
|
|||||||
int compareResult = 0;
|
int compareResult = 0;
|
||||||
final int comparsion = o1.getTransactionDate().compareTo(o2.getTransactionDate());
|
final int comparsion = o1.getTransactionDate().compareTo(o2.getTransactionDate());
|
||||||
if (comparsion == 0) {
|
if (comparsion == 0) {
|
||||||
|
int comparsionCreate = 0;
|
||||||
|
if (o1.getCreatedDateTime() != null && o2.getCreatedDateTime() != null){
|
||||||
|
comparsionCreate = o1.getCreatedDateTime().compareTo(o2.getCreatedDateTime());
|
||||||
|
}
|
||||||
// equal transaction dates
|
// equal transaction dates
|
||||||
if (o1.isWaiver() && o2.isNotWaiver()) {
|
if (comparsionCreate == 0) {
|
||||||
compareResult = -1;
|
if (o1.isWaiver() && o2.isNotWaiver()) {
|
||||||
} else if (o1.isNotWaiver() && o2.isWaiver()) {
|
compareResult = -1;
|
||||||
compareResult = 1;
|
} else if (o1.isNotWaiver() && o2.isWaiver()) {
|
||||||
} else {
|
compareResult = 1;
|
||||||
compareResult = 0;
|
} else {
|
||||||
|
compareResult = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
compareResult = comparsion;
|
compareResult = comparsion;
|
||||||
|
|||||||
Reference in New Issue
Block a user