MIFOSX-2046 fixed overpaid loans not been transferred along when transfering a client

This commit is contained in:
andrew-dzak
2015-05-18 12:25:36 +02:00
parent 75f774e7ee
commit abec451ec2
2 changed files with 3 additions and 1 deletions
@@ -52,7 +52,7 @@ public interface LoanRepository extends JpaRepository<Loan, Long>, JpaSpecificat
public static final String FIND_ACTIVE_LOANS_PRODUCT_IDS_BY_GROUP = "Select loan.loanProduct.id from Loan loan where "
+ "loan.group.id = :groupId and loan.loanStatus = :loanStatus and loan.client.id is NULL group by loan.loanProduct.id";
public static final String DOES_CLIENT_HAVE_NON_CLOSED_LOANS = "select case when (count (loan) > 0) then true else false end from Loan loan where loan.client.id = :clientId and loan.loanStatus in (100,200,300,303,304)";
public static final String DOES_CLIENT_HAVE_NON_CLOSED_LOANS = "select case when (count (loan) > 0) then true else false end from Loan loan where loan.client.id = :clientId and loan.loanStatus in (100,200,300,303,304,700)";
@Query(FIND_GROUP_LOANS_DISBURSED_AFTER)
List<Loan> getGroupLoansDisbursedAfter(@Param("disbursementDate") Date disbursementDate, @Param("groupId") Long groupId,
@@ -435,6 +435,8 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr
if (staff != null) {
client.updateStaff(staff);
}
}else if(destinationGroup == null) { /** for individual with no groups **/
if(staff !=null){ client.updateStaff(staff);}
}
break;
case PROPOSAL: