Skip to content

Commit b692248

Browse files
committed
FINERACT-2326: Fix Trial Balance Summary with asset owner report
1 parent c9c9e9f commit b692248

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fineract-provider/src/main/resources/db/changelog/tenant/parts/0202_trial_balance_summary_with_asset_owner_journal_entry_aggregation.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2424
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
2525

26-
<changeSet author="fineract" id="trial-balance-summary-with-asset-owner-update-3">
26+
<changeSet author="fineract" id="trial-balance-summary-with-asset-owner-update-4">
2727
<update tableName="stretchy_report">
2828
<column name="report_sql" value="WITH retained_earning AS (
2929
SELECT DISTINCT '${endDate}' AS postingdate,
@@ -57,7 +57,7 @@
5757
JOIN m_product_loan lp ON lp.id = ags.product_id
5858
WHERE ags.entity_type_enum = 1
5959
AND ags.manual_entry = false
60-
AND ags.submitted_on_date &lt;= (select latest from aggregated_date)
60+
AND ags.aggregated_on_date &lt;= (select latest from aggregated_date)
6161
AND (ags.office_id = ${officeId})
6262
GROUP BY productname, glcode, glname, assetowner
6363
),
@@ -75,7 +75,10 @@
7575
LEFT JOIN m_external_asset_owner_journal_entry_mapping aw ON aw.journal_entry_id = acc_gl_journal_entry.id
7676
WHERE acc_gl_journal_entry.entity_type_enum = 1
7777
AND acc_gl_journal_entry.manual_entry = false
78-
AND acc_gl_journal_entry.submitted_on_date &gt; (select latest from aggregated_date)
78+
AND (
79+
(SELECT latest FROM aggregated_date) IS NULL
80+
OR acc_gl_journal_entry.submitted_on_date &gt; (SELECT latest FROM aggregated_date)
81+
)
7982
AND acc_gl_journal_entry.submitted_on_date &lt; '${endDate}'
8083
AND (acc_gl_journal_entry.office_id = ${officeId})
8184
GROUP BY productname, glcode, glname, assetowner

0 commit comments

Comments
 (0)