This is an automated email from the ASF dual-hosted git repository.

arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new b8ebc3967 FINERACT-1695: Accounting report not able to fetch the data 
in table format
b8ebc3967 is described below

commit b8ebc3967e288cf00f1ee3f71ed2840679e9c0b5
Author: Dhaval Maniyar <[email protected]>
AuthorDate: Tue Aug 23 18:46:56 2022 +0530

    FINERACT-1695: Accounting report not able to fetch the data in table format
---
 .../db/changelog/tenant/changelog-tenant.xml       |  1 +
 .../tenant/parts/0042_table_report_query_fix.xml   | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git 
a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml 
b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
index 1630472f8..8d9911947 100644
--- 
a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
+++ 
b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
@@ -61,4 +61,5 @@
     <include file="parts/0039_add_loan_account_locks.xml" 
relativeToChangelogFile="true"/>
     <include file="parts/0040_add_delinquency_tags_job.xml" 
relativeToChangelogFile="true"/>
     <include file="parts/0041_add_update_business_step_permission.xml" 
relativeToChangelogFile="true"/>
+    <include file="parts/0042_table_report_query_fix.xml" 
relativeToChangelogFile="true"/>
 </databaseChangeLog>
diff --git 
a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0042_table_report_query_fix.xml
 
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0042_table_report_query_fix.xml
new file mode 100644
index 000000000..81447a840
--- /dev/null
+++ 
b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0042_table_report_query_fix.xml
@@ -0,0 +1,40 @@
+<?xml version="1.1" encoding="UTF-8" standalone="no"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog";
+                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+                   
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog 
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd";>
+    <changeSet author="fineract" id="1-mysql" context="mysql">
+        <update tableName="stretchy_report">
+            <column name="report_sql" value = "select details.edate 
entry_date, sum(details.debit_amount) debit_amount, sum(details.credit_amount) 
credit_amount, details.description, ifnull(opb.openingbalance, 0) 
openingbalance, if(details.manual_entry = 1, details.id, '0system') transtype, 
if (actype in (1, 5), (sum(details.debit_amount) - sum(details.credit_amount)), 
(sum(details.credit_amount) - sum(details.debit_amount))) as cumulative_sum 
from ( select a.account_id acid1 , concat(gl [...]
+            <where>report_name='GeneralLedgerReport Table'</where>
+        </update>
+        <update tableName="stretchy_report">
+            <column name="report_sql" value = "(select * from ( select 
debits.glcode as 'glcode', debits.name as 'name',  'Expense'as IncomeOrExpense, 
(ifnull(debits.debitamount,0)-ifnull(credits.creditamount,0)) as 'balance' from 
(select acc_gl_account.gl_code as 'glcode',name,sum(amount) as 'debitamount' 
from acc_gl_journal_entry,acc_gl_account where acc_gl_account.id = 
acc_gl_journal_entry.account_id and acc_gl_journal_entry.type_enum=2 and 
acc_gl_account.classification_enum in (5) an [...]
+            <where>report_name='Income Statement Table'</where>
+        </update>
+        <update tableName="stretchy_report">
+            <column name="report_sql" value = "( select debits.glcode as 
'glcode', debits.name as 'name', 'Assets' as BalanceType, ( 
ifnull(debits.debitamount, 0)- ifnull(credits.creditamount, 0) ) as 'balance' 
from ( select acc_gl_account.gl_code as 'glcode', name, sum(amount) as 
'debitamount' from acc_gl_journal_entry, acc_gl_account where acc_gl_account.id 
= acc_gl_journal_entry.account_id and acc_gl_journal_entry.type_enum = 2 and 
acc_gl_account.classification_enum in (1) and acc_gl_ [...]
+            <where>report_name='Balance Sheet Table'</where>
+        </update>
+    </changeSet>
+</databaseChangeLog>

Reply via email to