You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by Ippezrobert <gi...@git.apache.org> on 2017/03/04 07:53:30 UTC

[GitHub] incubator-fineract pull request #302: Ability to reopen savings accounts whe...

GitHub user Ippezrobert opened a pull request:

    https://github.com/apache/incubator-fineract/pull/302

    Ability to reopen savings accounts when closed or rejected - First stage

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Ippezrobert/incubator-fineract reopen_closed_reject_savings

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-fineract/pull/302.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #302
    
----
commit 1f6748efa2dccadedd7e1d5491f3d104d4b95b96
Author: Ippez Robert <ip...@gmail.com>
Date:   2017-02-28T12:19:36Z

    Ability to reopen savings accounts when closed or rejected

----


---
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.
---

[GitHub] incubator-fineract pull request #302: Ability to reopen savings accounts whe...

Posted by Ippezrobert <gi...@git.apache.org>.
Github user Ippezrobert commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/302#discussion_r104605492
  
    --- 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 , These changes will only be possible if the issues https://issues.apache.org/jira/browse/FINERACT-232 and  https://issues.apache.org/jira/browse/FINERACT-408 are implemented and those are more technical for me.


---
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.
---

[GitHub] incubator-fineract pull request #302: Ability to reopen savings accounts whe...

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/302#discussion_r104604062
  
    --- 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 --
    
    I don't see those changes here. It just resets the account status or am I missing something?


---
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.
---

[GitHub] incubator-fineract pull request #302: Ability to reopen savings accounts whe...

Posted by Ippezrobert <gi...@git.apache.org>.
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.
---

[GitHub] incubator-fineract pull request #302: Ability to reopen savings accounts whe...

Posted by nazeer1100126 <gi...@git.apache.org>.
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/302#discussion_r104383417
  
    --- 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 --
    
    While closing a savings account user can withdraw amount. There will be accounting entry in journal entry table if accounting is enabled for that savings product. If you are re opening this account, what happens to that entry?


---
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.
---