use of org.mifos.accounts.business.AccountActionEntity in project head by mifos.
the class BirtAdminDocumentUploadAction method updateSelectedStatus.
@TransactionDemarcate(joinToken = true)
private void updateSelectedStatus(HttpServletRequest request, BirtAdminDocumentUploadActionForm uploadForm) throws PageExpiredException, ServiceException {
List selectList = null;
if (uploadForm.getStatusList() != null) {
Short accountTypeId = Short.valueOf(uploadForm.getAccountTypeId());
if (accountTypeId.shortValue() <= 2) {
selectList = new ArrayList<AccountStateEntity>();
List<AccountStateEntity> masterList = new AccountBusinessService().retrieveAllActiveAccountStateList(AccountTypes.getAccountType(accountTypeId));
for (AccountStateEntity product : masterList) {
for (String productStatusId : uploadForm.getStatusList()) {
if (productStatusId != null && product.getId().intValue() == Integer.valueOf(productStatusId).intValue()) {
selectList.add(product);
}
}
}
} else {
Short currentLocaleId = (Short) SessionUtils.getAttribute("CURRENT_LOCALE_ID", request);
selectList = new ArrayList<AccountActionEntity>();
List<AccountActionEntity> masterList = getAvailableLoanTransactions(currentLocaleId);
for (String accountActionId : uploadForm.getStatusList()) {
AccountActionTypes accountActionType = AccountActionTypes.fromInt(Integer.valueOf(accountActionId));
AccountActionEntity accountAction = new AccountBusinessService().getAccountAction(accountActionType.getValue(), currentLocaleId);
if (masterList.contains(accountAction)) {
selectList.add(accountAction);
}
}
}
}
SessionUtils.setCollectionAttribute("SelectedStatus", selectList, request);
}
use of org.mifos.accounts.business.AccountActionEntity in project head by mifos.
the class LegacyAccountDaoIntegrationTest method testGetAccountAction.
@Test
public void testGetAccountAction() throws Exception {
AccountActionEntity accountAction = legacyMasterDao.getPersistentObject(AccountActionEntity.class, AccountActionTypes.SAVINGS_INTEREST_POSTING.getValue());
Assert.assertNotNull(accountAction);
}
use of org.mifos.accounts.business.AccountActionEntity in project head by mifos.
the class SavingsApplyAdjustmentAction method load.
@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
clearActionForm(form);
doCleanUp(request);
UserContext uc = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
SavingsBO savings = (SavingsBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
SessionUtils.removeAttribute(Constants.BUSINESS_KEY, request);
Long savingsId = Long.valueOf(savings.getAccountId());
savings = this.savingsDao.findById(savingsId);
savings.setUserContext(uc);
String paymentIdParam = request.getParameter("paymentId");
Integer paymentId;
if (paymentIdParam == null) {
AccountPaymentEntity payment = savings.getLastPmnt();
paymentId = (payment == null) ? null : payment.getPaymentId();
} else {
paymentId = Integer.valueOf(paymentIdParam);
}
SavingsAdjustmentReferenceDto savingsAdjustmentDto = this.savingsServiceFacade.retrieveAdjustmentReferenceData(savingsId, paymentId);
if (savingsAdjustmentDto.isDepositOrWithdrawal()) {
AccountPaymentEntity payment = (paymentId == null) ? savings.findMostRecentPaymentByPaymentDate() : savings.findPaymentById(paymentId);
AccountActionEntity accountAction = legacyMasterDao.getPersistentObject(AccountActionEntity.class, new SavingsHelper().getPaymentActionType(payment));
Hibernate.initialize(savings.findMostRecentPaymentByPaymentDate().getAccountTrxns());
SessionUtils.setAttribute(SavingsConstants.ACCOUNT_ACTION, accountAction, request);
SessionUtils.setAttribute(SavingsConstants.CLIENT_NAME, savingsAdjustmentDto.getClientName(), request);
SessionUtils.setAttribute(SavingsConstants.IS_LAST_PAYMENT_VALID, Constants.YES, request);
SessionUtils.setAttribute(SavingsConstants.ADJUSTMENT_AMOUNT, payment.getAmount().getAmount(), request);
SavingsApplyAdjustmentActionForm actionForm = (SavingsApplyAdjustmentActionForm) form;
actionForm.setPaymentId(paymentId);
actionForm.setTrxnDate(new LocalDate(payment.getPaymentDate()));
} else {
SessionUtils.setAttribute(SavingsConstants.IS_LAST_PAYMENT_VALID, Constants.NO, request);
}
SessionUtils.setAttribute(Constants.BUSINESS_KEY, savings, request);
return mapping.findForward("load_success");
}
use of org.mifos.accounts.business.AccountActionEntity in project head by mifos.
the class SavingsTrxnDetailEntity method savingsAdjustment.
public static SavingsTrxnDetailEntity savingsAdjustment(AccountPaymentEntity accountPayment, CustomerBO customer, Money balAfterAdjust, Money negate, PersonnelBO loggedInUser, Date dueDate, Date actionDate, Date transactionCreatedDate, String adjustmentComment, SavingsTrxnDetailEntity relatedTrxn) {
AccountActionEntity applicationTransactionType = new AccountActionEntity(AccountActionTypes.SAVINGS_ADJUSTMENT);
AccountActionEntity monetaryTransactionType = new AccountActionEntity(AccountActionTypes.SAVINGS_ADJUSTMENT);
Short installmentIdNotNeeded = null;
SavingsTrxnDetailEntity adjustment = new SavingsTrxnDetailEntity(accountPayment, customer, applicationTransactionType, monetaryTransactionType, negate, balAfterAdjust, loggedInUser, dueDate, actionDate, installmentIdNotNeeded, adjustmentComment, transactionCreatedDate, relatedTrxn);
return adjustment;
}
use of org.mifos.accounts.business.AccountActionEntity in project head by mifos.
the class SavingsTrxnDetailEntity method savingsDeposit.
public static SavingsTrxnDetailEntity savingsDeposit(AccountPaymentEntity newAccountPayment, CustomerBO customer, Money savingsBalance, Money depositAmount, PersonnelBO createdBy, Date dueDate, Date actionDate, Date transactionCreatedDate, Short installmentId) {
AccountActionEntity accountAction = new AccountActionEntity(AccountActionTypes.SAVINGS_DEPOSIT);
SavingsTrxnDetailEntity relatedTrxnNotApplicable = null;
return new SavingsTrxnDetailEntity(newAccountPayment, customer, accountAction, accountAction, depositAmount, savingsBalance, createdBy, dueDate, actionDate, installmentId, "", transactionCreatedDate, relatedTrxnNotApplicable);
}
Aggregations