From 9d47f49e116d41c966d3ca59986edadf5c46e186 Mon Sep 17 00:00:00 2001 From: ashok-conflux Date: Tue, 17 Dec 2013 11:03:48 +0530 Subject: [PATCH 1/6] add currency details to journal entries api --- .../api/JournalEntriesApiResource.java | 2 +- .../journalentry/data/JournalEntryData.java | 6 +++++- .../JournalEntryReadPlatformServiceImpl.java | 20 ++++++++++++++++--- ...lEntryRunningBalanceUpdateServiceImpl.java | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/api/JournalEntriesApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/api/JournalEntriesApiResource.java index 884ca1b9e..8edcd640a 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/api/JournalEntriesApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/api/JournalEntriesApiResource.java @@ -48,7 +48,7 @@ public class JournalEntriesApiResource { private static final Set RESPONSE_DATA_PARAMETERS = new HashSet(Arrays.asList("id", "officeId", "officeName", "glAccountName", "glAccountId", "glAccountCode", "glAccountType", "transactionDate", "entryType", "amount", "transactionId", "manualEntry", "entityType", "entityId", "createdByUserId", "createdDate", "createdByUserName", "comments", "reversed", - "referenceNumber")); + "referenceNumber", "currency")); private final String resourceNameForPermission = "JOURNALENTRY"; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/data/JournalEntryData.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/data/JournalEntryData.java index 8d7bfd11b..0e9327cdd 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/data/JournalEntryData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/data/JournalEntryData.java @@ -9,6 +9,7 @@ import java.math.BigDecimal; import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.core.data.EnumOptionData; +import org.mifosplatform.organisation.monetary.data.CurrencyData; /** * Immutable object representing a General Ledger Account @@ -33,6 +34,8 @@ public class JournalEntryData { private final EnumOptionData entryType; private final BigDecimal amount; @SuppressWarnings("unused") + private final CurrencyData currency; + @SuppressWarnings("unused") private final String transactionId; @SuppressWarnings("unused") private final Boolean manualEntry; @@ -68,7 +71,7 @@ public class JournalEntryData { final Boolean manualEntry, final EnumOptionData entityType, final Long entityId, final Long createdByUserId, final LocalDate createdDate, final String createdByUserName, final String comments, final Boolean reversed, final String referenceNumber, final BigDecimal officeRunningBalance, final BigDecimal organizationRunningBalance, - final Boolean runningBalanceComputed,final TransactionDetailData transactionDetailData) { + final Boolean runningBalanceComputed,final TransactionDetailData transactionDetailData, final CurrencyData currency) { this.id = id; this.officeId = officeId; this.officeName = officeName; @@ -93,6 +96,7 @@ public class JournalEntryData { this.organizationRunningBalance = organizationRunningBalance; this.runningBalanceComputed = runningBalanceComputed; this.transactionDetails = transactionDetailData; + this.currency = currency; } public Long getId() { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java index 789c46f3a..7ef8c2367 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java @@ -27,6 +27,7 @@ import org.mifosplatform.infrastructure.core.domain.JdbcSupport; import org.mifosplatform.infrastructure.core.service.Page; import org.mifosplatform.infrastructure.core.service.PaginationHelper; import org.mifosplatform.infrastructure.core.service.RoutingDataSource; +import org.mifosplatform.organisation.monetary.data.CurrencyData; import org.mifosplatform.portfolio.group.service.SearchParameters; import org.mifosplatform.portfolio.note.data.NoteData; import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData; @@ -71,7 +72,9 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat .append(" journalEntry.type_enum as entryType,journalEntry.amount as amount, journalEntry.transaction_id as transactionId,") .append(" journalEntry.entity_type_enum as entityType, journalEntry.entity_id as entityId, creatingUser.id as createdByUserId, ") .append(" creatingUser.username as createdByUserName, journalEntry.description as comments, ") - .append(" journalEntry.created_date as createdDate, journalEntry.reversed as reversed "); + .append(" journalEntry.created_date as createdDate, journalEntry.reversed as reversed, ") + .append(" journalEntry.currency_code as currencyCode, curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, ") + .append(" curr.display_symbol as currencyDisplaySymbol, curr.decimal_places as currencyDigits, curr.currency_multiplesof as inMultiplesOf "); if(associationParametersData.isRunningBalanceRequired()){ sb.append(" ,journalEntry.is_running_balance_caculated as runningBalanceComputed, ") .append(" journalEntry.office_running_balance as officeRunningBalance, ") @@ -91,7 +94,8 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat sb.append(" from acc_gl_journal_entry as journalEntry ") .append(" left join acc_gl_account as glAccount on glAccount.id = journalEntry.account_id") .append(" left join m_office as office on office.id = journalEntry.office_id") - .append(" left join m_appuser as creatingUser on creatingUser.id = journalEntry.createdby_id "); + .append(" left join m_appuser as creatingUser on creatingUser.id = journalEntry.createdby_id ") + .append(" join m_currency curr on curr.code = journalEntry.currency_code "); if(associationParametersData.isTransactionDetailsRequired()){ sb.append(" left join m_loan_transaction as lt on journalEntry.loan_transaction_id = lt.id ") .append(" left join m_savings_account_transaction as st on journalEntry.savings_transaction_id = st.id ") @@ -136,6 +140,16 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat BigDecimal officeRunningBalance = null; BigDecimal organizationRunningBalance =null; Boolean runningBalanceComputed =null; + + final String currencyCode = rs.getString("currencyCode"); + final String currencyName = rs.getString("currencyName"); + final String currencyNameCode = rs.getString("currencyNameCode"); + final String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol"); + final Integer currencyDigits = JdbcSupport.getInteger(rs, "currencyDigits"); + final Integer inMultiplesOf = JdbcSupport.getInteger(rs, "inMultiplesOf"); + final CurrencyData currency = new CurrencyData(currencyCode, currencyName, currencyDigits, inMultiplesOf, + currencyDisplaySymbol, currencyNameCode); + if(associationParametersData.isRunningBalanceRequired()){ officeRunningBalance = rs.getBigDecimal("officeRunningBalance"); organizationRunningBalance = rs.getBigDecimal("organizationRunningBalance"); @@ -171,7 +185,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat } return new JournalEntryData(id, officeId, officeName, glAccountName, glAccountId, glCode, accountType, transactionDate, entryType, amount, transactionId, manualEntry, entityType, entityId, createdByUserId, createdDate, createdByUserName, - comments, reversed, referenceNumber,officeRunningBalance,organizationRunningBalance,runningBalanceComputed,transactionDetailData); + comments, reversed, referenceNumber,officeRunningBalance,organizationRunningBalance,runningBalanceComputed,transactionDetailData, currency); } } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java index 7d7fa3a21..bf4623935 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java @@ -268,7 +268,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry final EnumOptionData entryType = AccountingEnumerations.journalEntryType(entryTypeId); return new JournalEntryData(id, officeId, null, null, glAccountId, null, accountType, null, entryType, amount, null, null, - null, null, null, null, null, null, null, null, null, null, null,null); + null, null, null, null, null, null, null, null, null, null, null,null, null); } } From 14a7e6a067bad38d7068c85072fc43da9e1e84eb Mon Sep 17 00:00:00 2001 From: ashok-conflux Date: Tue, 17 Dec 2013 13:35:34 +0530 Subject: [PATCH 2/6] returning valid commandId for api actions when maker checker is enabled --- .../commands/service/SynchronousCommandProcessingService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java index 2a1e9b931..bbfbd0f8c 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java @@ -93,10 +93,10 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer @Transactional @Override - public CommandProcessingResult logCommand(final CommandSource commandSourceResult) { + public CommandProcessingResult logCommand(CommandSource commandSourceResult) { commandSourceResult.markAsAwaitingApproval(); - this.commandSourceRepository.save(commandSourceResult); + commandSourceResult = this.commandSourceRepository.save(commandSourceResult); return new CommandProcessingResultBuilder().withCommandId(commandSourceResult.getId()) .withEntityId(commandSourceResult.getResourceId()).build(); From 99340eca7475fa16421edfe8f466980813968d4d Mon Sep 17 00:00:00 2001 From: Madhukar Date: Fri, 20 Dec 2013 13:14:24 +0530 Subject: [PATCH 3/6] mifosx-834 update report parameter query --- .../migrations/core_db/V136__update_script_strechy_parameter.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 mifosng-db/migrations/core_db/V136__update_script_strechy_parameter.sql diff --git a/mifosng-db/migrations/core_db/V136__update_script_strechy_parameter.sql b/mifosng-db/migrations/core_db/V136__update_script_strechy_parameter.sql new file mode 100644 index 000000000..d5b786658 --- /dev/null +++ b/mifosng-db/migrations/core_db/V136__update_script_strechy_parameter.sql @@ -0,0 +1 @@ +UPDATE stretchy_parameter SET `parameter_sql`='select p.id, p.`name`\r\nfrom m_product_loan p\r\nwhere (p.currency_code = \'${currencyId}\' or \'-1\'= \'${currencyId}\')\r\norder by 2' WHERE parameter_name='loanProductIdSelectAll'; \ No newline at end of file From 6cb756bab194a7828961ffac7e768e7fe0021b1f Mon Sep 17 00:00:00 2001 From: Vishwas Babu A J Date: Sun, 22 Dec 2013 02:12:18 +0530 Subject: [PATCH 4/6] renaming sql patch --- ..._parameter.sql => V136_1__update_script_strechy_parameter.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mifosng-db/migrations/core_db/{V136__update_script_strechy_parameter.sql => V136_1__update_script_strechy_parameter.sql} (100%) diff --git a/mifosng-db/migrations/core_db/V136__update_script_strechy_parameter.sql b/mifosng-db/migrations/core_db/V136_1__update_script_strechy_parameter.sql similarity index 100% rename from mifosng-db/migrations/core_db/V136__update_script_strechy_parameter.sql rename to mifosng-db/migrations/core_db/V136_1__update_script_strechy_parameter.sql From d0e5677b4d6def455b7db22be62ec962b24c83fa Mon Sep 17 00:00:00 2001 From: Vishwas Babu A J Date: Sun, 29 Dec 2013 21:43:29 +0530 Subject: [PATCH 5/6] Update CHANGELOG.md for 1.16.1 release --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10d0cf5fc..fa1c583c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ See VERSIONING (https://github.com/openMF/mifosx/blob/master/VERSIONING.md) for Releases =============== +1. 29 Dec 2013 - 1.16.1.RELEASE 1. 15 Dec 2013 - 1.16.0.RELEASE 1. 12 Dec 2013 - 1.15.2.RELEASE 1. 04 Dec 2013 - 1.15.1.RELEASE @@ -54,6 +55,16 @@ Releases 1. 05 April 2013 - 0.11.1.beta 1. 05 April 2013 - 0.11.0.beta +1.16.1.RELEASE +============= +Bug Release + +Bugs + - [MIFOSX-802] - Loan life cycle is not considered in validations for loan operations + - [MIFOSX-812] - Journalentries Api is not returning currency while retrieving transactions + - [MIFOSX-825] - Timeline is not displaying while fetching the details of created centers + - [MIFOSX-830] - APIs are returning invalid commandId for all actions when maker-checker is enabled. + - [MIFOSX-834] - Reports-Loan products are not listing for currency ALL(Active Loans - Summary) 1.16.0.RELEASE ============= From f32ca69a377af855be51b3bb58984167959ea7e9 Mon Sep 17 00:00:00 2001 From: Vishwas Babu A J Date: Sun, 29 Dec 2013 21:44:35 +0530 Subject: [PATCH 6/6] update gradle.properties for 1.16.1 release --- mifosng-provider/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mifosng-provider/gradle.properties b/mifosng-provider/gradle.properties index 3a567cec6..f534ec1cb 100644 --- a/mifosng-provider/gradle.properties +++ b/mifosng-provider/gradle.properties @@ -1,4 +1,4 @@ -releaseVersion=1.16.0.RELEASE +releaseVersion=1.16.1.RELEASE