use of org.mifos.accounts.financial.business.service.activity.BaseFinancialActivity in project head by mifos.
the class SavingsBO method doPostInterest.
private void doPostInterest(LocalDate currentPostingDate, Money actualInterestToBePosted, PersonnelBO loggedInUser) {
this.savingsBalance = this.savingsBalance.add(actualInterestToBePosted);
this.savingsPerformance.setTotalInterestDetails(actualInterestToBePosted);
SavingsActivityEntity savingsActivity = SavingsActivityEntity.savingsInterestPosting(this, personnel, this.savingsBalance, actualInterestToBePosted, currentPostingDate.toDateMidnight().toDate());
savingsActivityDetails.add(savingsActivity);
AccountPaymentEntity interestPayment = AccountPaymentEntity.savingsInterestPosting(this, actualInterestToBePosted, currentPostingDate.toDateMidnight().toDate(), loggedInUser);
DateTime dueDate = new DateTime();
SavingsTrxnDetailEntity interestPostingTransaction = SavingsTrxnDetailEntity.savingsInterestPosting(interestPayment, this.customer, this.savingsBalance, currentPostingDate.toDateMidnight().toDate(), dueDate, loggedInUser);
interestPayment.addAccountTrxn(interestPostingTransaction);
this.addAccountPayment(interestPayment);
// NOTE: financial Transaction Processing should be decoupled from application domain model.
try {
BaseFinancialActivity baseFinancialActivity = new SavingsInterestPostingFinancialActivity(interestPostingTransaction);
baseFinancialActivity.buildAccountEntries();
} catch (FinancialException e) {
throw new MifosRuntimeException(e);
}
}
Aggregations