use of org.mifos.accounts.productdefinition.util.helpers.PrdStatus in project head by mifos.
the class PrdOfferingBO method getPrdStatus.
private PrdStatusEntity getPrdStatus(final Date startDate, final ProductTypeEntity prdType) throws ProductDefinitionException {
logger.debug("getting the Product status for prdouct offering with start date :" + startDate + " and product Type :" + prdType.getProductTypeID());
PrdStatus prdStatus = null;
if (!prdType.getProductTypeID().equals(ProductType.LOAN.getValue()) && startDate.compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) == 0) {
prdStatus = getActivePrdStatus(prdType);
} else if (prdType.getProductTypeID().equals(ProductType.LOAN.getValue()) && startDate.compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) <= 0) {
prdStatus = getActivePrdStatus(prdType);
} else {
prdStatus = getInActivePrdStatus(prdType);
}
try {
logger.debug("getting the Product status for product status :" + prdStatus);
return new PrdOfferingPersistence().getPrdStatus(prdStatus);
} catch (PersistenceException e) {
throw new ProductDefinitionException(e);
}
}
Aggregations