|
23 | 23 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
24 | 24 | xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"> |
25 | 25 |
|
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"> |
27 | 27 | <update tableName="stretchy_report"> |
28 | 28 | <column name="report_sql" value="WITH retained_earning AS ( |
29 | 29 | SELECT DISTINCT '${endDate}' AS postingdate, |
|
57 | 57 | JOIN m_product_loan lp ON lp.id = ags.product_id |
58 | 58 | WHERE ags.entity_type_enum = 1 |
59 | 59 | AND ags.manual_entry = false |
60 | | - AND ags.submitted_on_date <= (select latest from aggregated_date) |
| 60 | + AND ags.aggregated_on_date <= (select latest from aggregated_date) |
61 | 61 | AND (ags.office_id = ${officeId}) |
62 | 62 | GROUP BY productname, glcode, glname, assetowner |
63 | 63 | ), |
|
75 | 75 | LEFT JOIN m_external_asset_owner_journal_entry_mapping aw ON aw.journal_entry_id = acc_gl_journal_entry.id |
76 | 76 | WHERE acc_gl_journal_entry.entity_type_enum = 1 |
77 | 77 | AND acc_gl_journal_entry.manual_entry = false |
78 | | - AND acc_gl_journal_entry.submitted_on_date > (select latest from aggregated_date) |
| 78 | + AND ( |
| 79 | + (SELECT latest FROM aggregated_date) IS NULL |
| 80 | + OR acc_gl_journal_entry.submitted_on_date > (SELECT latest FROM aggregated_date) |
| 81 | + ) |
79 | 82 | AND acc_gl_journal_entry.submitted_on_date < '${endDate}' |
80 | 83 | AND (acc_gl_journal_entry.office_id = ${officeId}) |
81 | 84 | GROUP BY productname, glcode, glname, assetowner |
|
0 commit comments