renaming a couple of methods for better readability in SavingsAccountCharge.java

This commit is contained in:
Vishwas Babu A J
2014-06-19 20:46:51 -07:00
parent 722e657ea9
commit f23a0cb18b
@@ -194,7 +194,7 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
this.status = status; this.status = status;
} }
public void recalculateAmountOutstanding() { public void resetPropertiesForRecurringFees() {
if (isMonthlyFee() || isAnnualFee()) { if (isMonthlyFee() || isAnnualFee()) {
// FIXME: AA: If charge is percentage of x amount then need to // FIXME: AA: If charge is percentage of x amount then need to
// update amount outstanding accordingly. // update amount outstanding accordingly.
@@ -282,7 +282,7 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
this.amountOutstanding = BigDecimal.ZERO; this.amountOutstanding = BigDecimal.ZERO;
} }
// to reset amount outstanding for annual and monthly fee // to reset amount outstanding for annual and monthly fee
recalculateAmountOutstanding(); resetPropertiesForRecurringFees();
updateToPreviousDueDate();// reset annual and monthly due date. updateToPreviousDueDate();// reset annual and monthly due date.
this.paid = false; this.paid = false;
} }
@@ -294,8 +294,8 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
this.amountOutstanding = BigDecimal.ZERO; this.amountOutstanding = BigDecimal.ZERO;
this.waived = true; this.waived = true;
recalculateAmountOutstanding(); resetPropertiesForRecurringFees();
updateToNextDueDate(); updateNextDueDateForRecurringFees();
return amountOutstanding; return amountOutstanding;
} }
@@ -307,7 +307,7 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
this.amountOutstanding = calculateAmountOutstanding(currency); this.amountOutstanding = calculateAmountOutstanding(currency);
this.waived = false; this.waived = false;
recalculateAmountOutstanding(); resetPropertiesForRecurringFees();
updateToPreviousDueDate(); updateToPreviousDueDate();
} }
@@ -322,8 +322,8 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
if (BigDecimal.ZERO.compareTo(this.amountOutstanding) == 0) { if (BigDecimal.ZERO.compareTo(this.amountOutstanding) == 0) {
// full outstanding is paid, update to next due date // full outstanding is paid, update to next due date
updateToNextDueDate(); updateNextDueDateForRecurringFees();
recalculateAmountOutstanding(); resetPropertiesForRecurringFees();
} }
return Money.of(currency, this.amountOutstanding); return Money.of(currency, this.amountOutstanding);
@@ -688,7 +688,7 @@ public class SavingsAccountCharge extends AbstractPersistable<Long> {
} }
} }
public void updateToNextDueDate() { public void updateNextDueDateForRecurringFees() {
if (isAnnualFee() || isMonthlyFee()) { if (isAnnualFee() || isMonthlyFee()) {
LocalDate nextDueLocalDate = new LocalDate(dueDate); LocalDate nextDueLocalDate = new LocalDate(dueDate);
int maxDayOfMonth = nextDueLocalDate.dayOfMonth().withMaximumValue().getDayOfMonth(); int maxDayOfMonth = nextDueLocalDate.dayOfMonth().withMaximumValue().getDayOfMonth();