use of org.mifos.customers.client.business.ClientPerformanceHistoryEntity in project head by mifos.
the class LoanBO method updatePerformanceHistory.
private void updatePerformanceHistory(boolean accountReOpened) {
if (accountReOpened && this.getCustomer().isClient()) {
ClientPerformanceHistoryEntity clientHistory = (ClientPerformanceHistoryEntity) this.getCustomer().getPerformanceHistory();
clientHistory.incrementNoOfActiveLoans();
Money newLastLoanAmount = getlegacyLoanDao().findClientPerformanceHistoryLastLoanAmountWhenRepaidLoanAdjusted(this.getCustomer().getCustomerId(), this.getAccountId());
clientHistory.setLastLoanAmount(newLastLoanAmount);
}
if (accountReOpened && this.getCustomer().isGroup()) {
final GroupPerformanceHistoryEntity groupHistory = (GroupPerformanceHistoryEntity) this.getCustomer().getPerformanceHistory();
Money newLastGroupLoanAmount = getlegacyLoanDao().findGroupPerformanceHistoryLastLoanAmountWhenRepaidLoanAdjusted(this.getCustomer().getCustomerId(), this.getAccountId());
groupHistory.setLastGroupLoanAmount(newLastGroupLoanAmount);
}
}
use of org.mifos.customers.client.business.ClientPerformanceHistoryEntity in project head by mifos.
the class LoanBO method updateCustomerHistoryOnPayment.
private void updateCustomerHistoryOnPayment() {
if (getCustomer().isClient() && getCustomer().getPerformanceHistory() != null) {
ClientPerformanceHistoryEntity clientPerfHistory = (ClientPerformanceHistoryEntity) getCustomer().getPerformanceHistory();
clientPerfHistory.decrementNoOfActiveLoans();
}
}
use of org.mifos.customers.client.business.ClientPerformanceHistoryEntity in project head by mifos.
the class CustomerBOIntegrationTest method testClientPerfObject.
@Test
public void testClientPerfObject() throws PersistenceException {
createInitialObjects();
ClientPerformanceHistoryEntity clientPerformanceHistory = client.getClientPerformanceHistory();
clientPerformanceHistory.setNoOfActiveLoans(Integer.valueOf("1"));
clientPerformanceHistory.setLastLoanAmount(new Money(getCurrency(), "100"));
TestObjectFactory.updateObject(client);
client = (ClientBO) customerPersistence.findBySystemId(client.getGlobalCustNum(), client.getCustomerLevel().getId());
Assert.assertEquals(client.getCustomerId(), client.getClientPerformanceHistory().getClient().getCustomerId());
Assert.assertEquals(new Money(getCurrency(), "100"), client.getClientPerformanceHistory().getLastLoanAmount());
Assert.assertEquals(new Money(getCurrency(), "0"), client.getClientPerformanceHistory().getDelinquentPortfolioAmount());
}
Aggregations