diff --git a/CHANGELOG.md b/CHANGELOG.md index 250a4d5ad..ac9b7c482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ See VERSIONING (https://github.com/openMF/mifosx/blob/master/VERSIONING.md) for Releases =============== +1. 18 Sep 2013 - 1.9.2.RELEASE 1. 10 Sep 2013 - 1.9.1.RELEASE 1. 8 Sep 2013 - 1.9.0.RELEASE 1. 21 Aug 2013 - 1.8.1.RELEASE @@ -35,6 +36,22 @@ Releases 1. 05 April 2013 - 0.11.1.beta 1. 05 April 2013 - 0.11.0.beta +1.9.2.RELEASE +============= +Bug Release + +Platform & API + +Bug + - [MIFOSX-659] - Not able to transfer Client between Branch offices which were created under same parent office. + - [MIFOSX-663] - No API documentation on Holidays or Working Days features + - [MIFOSX-671] - "Minimum opening balance" assigned is not displaying as balance in Transaction page after activation of savings account + - [MIFOSX-672] - Final installment of FLAT interest loans incorrectly has closing loan balance thats greater than zero. + +Improvement + - [MIFOSX-669] - Ability to not allow to "close" a client while transfer of client is in progress + + 1.9.1.RELEASE ============= Bug Release diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/api/OfficesApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/api/OfficesApiResource.java index 41ec1a823..563645349 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/api/OfficesApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/api/OfficesApiResource.java @@ -11,12 +11,14 @@ import java.util.HashSet; import java.util.Set; import javax.ws.rs.Consumes; +import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; @@ -69,11 +71,12 @@ public class OfficesApiResource { @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public String retrieveOffices(@Context final UriInfo uriInfo) { + public String retrieveOffices(@Context final UriInfo uriInfo, + @DefaultValue("false") @QueryParam("includeAllOffices") final boolean onlyManualEntries) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); - final Collection offices = this.readPlatformService.retrieveAllOffices(); + final Collection offices = this.readPlatformService.retrieveAllOffices(onlyManualEntries); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); return this.toApiJsonSerializer.serialize(settings, offices, this.RESPONSE_DATA_PARAMETERS); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformService.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformService.java index b01582dc0..51144ddc0 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformService.java @@ -15,7 +15,7 @@ public interface OfficeReadPlatformService { MifosPlatformTenant loadTenantById(String tenantIdentifier); - Collection retrieveAllOffices(); + Collection retrieveAllOffices(boolean includeAllOffices); Collection retrieveAllOfficesForDropdown(); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java index 31aa156cc..cf32cd041 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/office/service/OfficeReadPlatformServiceImpl.java @@ -123,8 +123,8 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService final Integer currencyDigits = JdbcSupport.getInteger(rs, "currencyDigits"); final Integer inMultiplesOf = JdbcSupport.getInteger(rs, "inMultiplesOf"); - final CurrencyData currencyData = new CurrencyData(currencyCode, currencyName, currencyDigits, inMultiplesOf, currencyDisplaySymbol, - currencyNameCode); + final CurrencyData currencyData = new CurrencyData(currencyCode, currencyName, currencyDigits, inMultiplesOf, + currencyDisplaySymbol, currencyNameCode); final BigDecimal transactionAmount = rs.getBigDecimal("transactionAmount"); final String description = rs.getString("description"); @@ -134,15 +134,18 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService } } + /** TODO: Vishwas This change breaks caching, need to have a relook **/ @Override @Cacheable(value = "offices", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy()+'of')") - public Collection retrieveAllOffices() { - + public Collection retrieveAllOffices(boolean includeAllOffices) { final AppUser currentUser = this.context.authenticatedUser(); - final String hierarchy = currentUser.getOffice().getHierarchy(); - final String hierarchySearchString = hierarchy + "%"; - + String hierarchySearchString = null; + if (includeAllOffices) { + hierarchySearchString = "." + "%"; + } else { + hierarchySearchString = hierarchy + "%"; + } final OfficeMapper rm = new OfficeMapper(); final String sql = "select " + rm.officeSchema() + "where o.hierarchy like ? order by o.hierarchy"; @@ -242,7 +245,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService } @Override - @Cacheable(value = "tenantsById", key="#tenantIdentifier") + @Cacheable(value = "tenantsById", key = "#tenantIdentifier") public MifosPlatformTenant loadTenantById(final String tenantIdentifier) { try { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java index 64adc6dc5..7da023864 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java @@ -344,6 +344,9 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP if (ClientStatus.fromInt(client.getStatus()).isClosed()) { final String errorMessage = "Client is alread closed."; throw new InvalidClientStateTransitionException("close", "is.already.closed", errorMessage); + } else if (ClientStatus.fromInt(client.getStatus()).isUnderTransfer()) { + final String errorMessage = "Cannot Close a Client under Transfer"; + throw new InvalidClientStateTransitionException("close", "is.under.transfer", errorMessage); } if (client.isNotPending() && client.getActivationLocalDate().isAfter(closureDate)) { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java index 70b6e635d..325834aad 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/SavingsAccount.java @@ -169,7 +169,7 @@ public class SavingsAccount extends AbstractPersistable { /** * The interest period is the span of time at the end of which savings in a * client's account earn interest. - * + * * A value from the {@link SavingsCompoundingInterestPeriodType} * enumeration. */ @@ -424,11 +424,11 @@ public class SavingsAccount extends AbstractPersistable { /** * All interest calculation based on END-OF-DAY-BALANCE. - * + * * Interest calculation is performed on-the-fly over all account * transactions. - * - * + * + * * 1. Calculate Interest From Beginning Of Account 1a. determine the * 'crediting' periods that exist for this savings acccount 1b. determine * the 'compounding' periods that exist within each 'crediting' period @@ -1682,13 +1682,17 @@ public class SavingsAccount extends AbstractPersistable { // activating account. final Money minRequiredOpeningBalance = Money.of(this.currency, this.minRequiredOpeningBalance); if (minRequiredOpeningBalance.isGreaterThanZero()) { - final SavingsAccountTransactionDTO transactionDTO = new SavingsAccountTransactionDTO(fmt, activationDate, minRequiredOpeningBalance.getAmount(), existingTransactionIds, existingReversedTransactionIds, null); - deposit(transactionDTO); + // no openingBalance concept supported yet but probably will to + // allow + // for migrations. final Money openingAccountBalance = Money.zero(this.currency); + + // update existing transactions so derived balance fields are + // correct. recalculateDailyBalances(openingAccountBalance); }