Repository: fineract
Updated Branches:
  refs/heads/develop 1d38bd25d -> 8e7bd01ed


FINERACT-590


Project: http://git-wip-us.apache.org/repos/asf/fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/fineract/commit/8e7bd01e
Tree: http://git-wip-us.apache.org/repos/asf/fineract/tree/8e7bd01e
Diff: http://git-wip-us.apache.org/repos/asf/fineract/diff/8e7bd01e

Branch: refs/heads/develop
Commit: 8e7bd01ed46021d09a80b1a427cf7e65564d26d1
Parents: 1d38bd2
Author: conradsp <sconr...@gmail.com>
Authored: Sat Feb 3 14:29:02 2018 -0600
Committer: conradsp <sconr...@gmail.com>
Committed: Sat Feb 3 14:29:02 2018 -0600

----------------------------------------------------------------------
 .../portfolio/client/domain/AccountNumberGenerator.java         | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/fineract/blob/8e7bd01e/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java
----------------------------------------------------------------------
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java
index e977114..3d2deb1 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/AccountNumberGenerator.java
@@ -108,6 +108,11 @@ public class AccountNumberGenerator {
                 break;
 
             }
+
+            // FINERACT-590
+            // Because account_no is limited to 20 chars, we can only use the 
first 10 chars of prefix - trim if necessary
+            prefix = prefix.substring(0, Math.min(prefix.length(), 10));
+
             accountNumber = StringUtils.overlay(accountNumber, prefix, 0, 0);
         }
         return accountNumber;

Reply via email to