diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm
index 6526774d7..6e94d6580 100644
--- a/api-docs/apiLive.htm
+++ b/api-docs/apiLive.htm
@@ -7873,6 +7873,14 @@ Request Body:
- | name, currencyCode, digitsAfterDecimal, inMultiplesOf, principal,
+ | name, shortName, currencyCode, digitsAfterDecimal, inMultiplesOf, principal,
numberOfRepayments, repaymentEvery, repaymentFrequencyType,
interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType,
interestCalculationPeriodType, transactionProcessingStrategyId,
@@ -9222,6 +9232,7 @@ Request Body:
],
"accountingRule":"2",
"name":"product 5",
+"shortName":"prd5",
"principal":"5000",
"numberOfRepayments":"7",
"repaymentEvery":"7",
@@ -9253,6 +9264,7 @@ Content-Type: application/json
Request Body:
{
"name": "LP Cash Accounting",
+ "shortName": "LPCA",
"currencyCode": "USD",
"locale": "en_GB",
"digitsAfterDecimal": "2",
@@ -9312,6 +9324,7 @@ Content-Type: application/json
Request Body:
{
"name": "LP Accrual Accounting",
+ "shortName": "LPAA",
"currencyCode": "USD",
"locale": "en_GB",
"digitsAfterDecimal": "2",
@@ -12934,6 +12947,11 @@ Content-Type: application/json
|
Mandatory Fields |
- | name, description, currencyCode, digitsAfterDecimal,inMultiplesOf, nominalAnnualInterestRate,
+ | name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, nominalAnnualInterestRate,
interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType,accountingRule |
@@ -13561,6 +13579,7 @@ Content-Type: application/json
Request Body:
{
"name": "Passbook Savings",
+ "shortName": "PBSV",
"description": "Daily compounding using Daily Balance, 5% per year, 365 days in year",
"currencyCode": "USD",
"digitsAfterDecimal": 2,
@@ -13586,6 +13605,7 @@ Request Body:
{
"locale": "en",
"name": "New Passbook Savings ",
+ "shortName": "NPBS",
"description": "A savings product",
"currencyCode": "USD",
"digitsAfterDecimal": "2",
@@ -13652,6 +13672,7 @@ Request Body:
{
"id": 1,
"name": "savings product",
+ "shortName": "sa1",
"description": "gtasga",
"currency": {
"code": "USD",
@@ -13835,6 +13856,7 @@ Content-Type: application/json
{
"id": 1,
"name": "Savings product",
+ "shortName": "sa1",
"description": "gtasga",
"currency": {
"code": "USD",
diff --git a/mifosng-db/migrations/core_db/V137_1__add_short_name_for_m_product_loan_and_m_savings_product.sql b/mifosng-db/migrations/core_db/V137_1__add_short_name_for_m_product_loan_and_m_savings_product.sql
new file mode 100644
index 000000000..bab1844ee
--- /dev/null
+++ b/mifosng-db/migrations/core_db/V137_1__add_short_name_for_m_product_loan_and_m_savings_product.sql
@@ -0,0 +1,18 @@
+ALTER TABLE `m_product_loan`
+ ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `id`;
+update m_product_loan set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
+ALTER TABLE `m_product_loan`
+ ALTER `short_name` DROP DEFAULT;
+ALTER TABLE `m_product_loan`
+ CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `id`;
+ALTER TABLE `m_product_loan`
+ ADD UNIQUE INDEX `unq_short_name` (`short_name`);
+
+ALTER TABLE `m_savings_product`
+ ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `name`;
+update m_savings_product set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
+ALTER TABLE `m_savings_product`
+ ALTER `short_name` DROP DEFAULT;
+ALTER TABLE `m_savings_product`
+ CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `name`,
+ ADD UNIQUE INDEX `sp_unq_short_name` (`short_name`);
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java
index c0afd6b92..95f30c603 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java
@@ -215,7 +215,7 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
+ "ln.id As loanId, "
+ "ln.account_no As accountId, "
+ "ln.loan_status_id As accountStatusId, "
- + "pl.name As productShortName, "
+ + "pl.short_name As productShortName, "
+ "ln.product_id As productId, "
+ "ln.currency_code as currencyCode, ln.currency_digits as currencyDigits, ln.currency_multiplesof as inMultiplesOf, rc.`name` as currencyName, rc.display_symbol as currencyDisplaySymbol, rc.internationalized_name_code as currencyNameCode, "
+ "if(ln.loan_status_id = 200 , ln.principal_amount , null) As disbursementAmount, "
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java
index 2452bc8b5..69f819cc9 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java
@@ -49,4 +49,5 @@ public interface LoanProductConstants {
public static final String VALUE_CONDITION_END_WITH_ERROR = "condition.type.must.end.with.greterthan";
public static final String VALUE_CONDITION_START_WITH_ERROR = "condition.type.must.start.with.equal";
+ public static final String shortName = "shortName";
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java
index c14e0d423..a55cbe902 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/api/LoanProductsApiResource.java
@@ -63,7 +63,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton")
public class LoanProductsApiResource {
- private final Set