fineract-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ippezrobert <...@git.apache.org>
Subject [GitHub] incubator-fineract pull request #302: Ability to reopen savings accounts whe...
Date Mon, 06 Mar 2017 12:39:51 GMT
Github user Ippezrobert commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/302#discussion_r104404118
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
---
    @@ -446,6 +446,72 @@ public CommandProcessingResult rejectApplication(final Long savingsId,
final Jso
                     .build();
         }
     
    +	@Transactional
    +    @Override
    +    public CommandProcessingResult undoApplicationRejection(final Long savingsId, final
JsonCommand command) {
    +        this.context.authenticatedUser();
    +
    +        this.savingsAccountApplicationTransitionApiJsonValidator.validateForUndo(command.json());
    +
    +        final SavingsAccount savingsAccount = this.savingAccountAssembler.assembleFrom(savingsId);
    +        checkClientOrGroupActive(savingsAccount);
    +
    +        final Map<String, Object> changes = savingsAccount.undoApplicationRejection();
    +        if (!changes.isEmpty()) {
    +            this.savingAccountRepository.save(savingsAccount);
    +
    +            final String noteText = command.stringValueOfParameterNamed("note");
    +            if (StringUtils.isNotBlank(noteText)) {
    +                final Note note = Note.savingNote(savingsAccount, noteText);
    +                changes.put("note", noteText);
    +                this.noteRepository.save(note);
    +            }
    +        }
    +
    +        return new CommandProcessingResultBuilder() //
    +                .withCommandId(command.commandId()) //
    +                .withEntityId(savingsId) //
    +                .withOfficeId(savingsAccount.officeId()) //
    +                .withClientId(savingsAccount.clientId()) //
    +                .withGroupId(savingsAccount.groupId()) //
    +                .withSavingsId(savingsId) //
    +                .with(changes) //
    +                .build();
    +    }
    +
    +    @Transactional
    +    @Override
    +    public CommandProcessingResult reopen(final Long savingsId, final JsonCommand command)
{
    --- End diff --
    
    @nazeer1100126 , Actually that depends on what payment method has been used. For example,
if the payment method is cash during account closure, then when the account is reopened the
balance is zero as this directly affected cash. If payment method is not by cash (i.e by Voucher)
then the balances at closure are to be booked to a GL account say "Account Closure Account"
and when the account is reopened, the balance is got from the GL Account (Account Closure
Account) and posted back to the account reopened.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message