From 613b802c0d410e9fc74b1268c222d3b9d48bf6d4 Mon Sep 17 00:00:00 2001 From: Nenge Date: Thu, 8 Feb 2018 15:05:39 +0300 Subject: [PATCH] FINERACT-574 --- .../shareaccounts/domain/PurchasedSharesStatusType.java | 4 ++++ .../fineract/portfolio/shareaccounts/domain/ShareAccount.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/PurchasedSharesStatusType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/PurchasedSharesStatusType.java index 949218a244f..0989146f6a3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/PurchasedSharesStatusType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/PurchasedSharesStatusType.java @@ -69,6 +69,10 @@ public String getCode() { public boolean isApproved() { return this.value.equals(PurchasedSharesStatusType.APPROVED.getValue()); } + + public boolean isRejected() { + return this.value.equals(PurchasedSharesStatusType.REJECTED.getValue()); + } public boolean isPurchased() { return this.value.equals(PurchasedSharesStatusType.PURCHASED.getValue()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java index 085126816ba..d51a99340fb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java @@ -439,7 +439,7 @@ public void reject(final Date rejectedDate, final AppUser rejectedUser) { this.totalSharesPending = null; this.totalSharesApproved = null; for (ShareAccountTransaction transaction : this.shareAccountTransactions) { - if(transaction.isPurchasTransaction()) { + if(transaction.isPendingForApprovalTransaction()) { transaction.reject(); } }