feat(cashier): add GL denomination tracking, live GL balance, and enhanced closing report

- Add CashierGlDenominationApiResource: new POST /v1/cashier/gl-denomination endpoint
  to record denomination breakdown for GL journal entries in m_savings_txn_denomination
- Fix GL account real-time balance in GLAccountReadPlatformServiceImpl using live SUM query
- Add Liquibase migrations 0318/0319/0320: make savings_account_id and txn_id nullable,
  add payment_type column to m_savings_txn_denomination
- Add validCheckSum to 0317b changeset to resolve checksum mismatch on existing installs
- Enhance GL entries closing report SQL with date, time, teller, payment type, txn source

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-06-10 15:31:12 +05:30
co-authored by Claude Sonnet 4.6
parent 53b6a94bf8
commit 19639c9e02
9 changed files with 299 additions and 10 deletions
@@ -345,4 +345,7 @@
<include file="parts/0315_grant_cashier_transaction_entry_permissions.xml" relativeToChangelogFile="true"/>
<include file="parts/0316_create_clerk_role_and_permissions.xml" relativeToChangelogFile="true"/>
<include file="parts/0317_grant_cashier_gl_loan_share_read_permissions.xml" relativeToChangelogFile="true"/>
<include file="parts/0318_allow_nullable_savings_account_denomination.xml" relativeToChangelogFile="true"/>
<include file="parts/0319_allow_nullable_txn_id_denomination.xml" relativeToChangelogFile="true"/>
<include file="parts/0320_add_payment_type_to_denomination.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
@@ -46,4 +46,42 @@
</rollback>
</changeSet>
<!--
Grant journal entry and financial activity permissions to CASHIER role
for GL transactions posted via the Cashier Transaction Entry screen.
- CREATE_JOURNALENTRY : Post manual journal entries (Dr/Cr GL accounts)
- READ_JOURNALENTRY : Read journal entries for confirmation/history
- READ_FINANCIALACTIVITYACCOUNT: Read financial activity → GL mappings (cash vault lookup)
-->
<changeSet id="0317b_grant_cashier_journal_entry_permissions" author="fineract">
<validCheckSum>9:b3a623604e792772bc89005772540108</validCheckSum>
<sql>
INSERT INTO m_role_permission (role_id, permission_id)
SELECT r.id, p.id
FROM m_role r
JOIN m_permission p ON p.code IN (
'CREATE_JOURNALENTRY',
'READ_JOURNALENTRY',
'READ_FINANCIALACTIVITYACCOUNT'
)
WHERE r.name = 'CASHIER'
AND NOT EXISTS (
SELECT 1 FROM m_role_permission rp
WHERE rp.role_id = r.id AND rp.permission_id = p.id
);
</sql>
<rollback>
DELETE FROM m_role_permission
WHERE role_id = (SELECT id FROM m_role WHERE name = 'CASHIER')
AND permission_id IN (
SELECT id FROM m_permission
WHERE code IN (
'CREATE_JOURNALENTRY',
'READ_JOURNALENTRY',
'READ_FINANCIALACTIVITYACCOUNT'
)
);
</rollback>
</changeSet>
</databaseChangeLog>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
for licensing details.
-->
<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">
<!--
Allow savings_account_id to be NULL in m_savings_txn_denomination so that
GL account transactions (journal entries) can also record denomination
breakdown without a savings account reference.
-->
<changeSet id="0318_allow_nullable_savings_account_denomination" author="fineract">
<dropNotNullConstraint tableName="m_savings_txn_denomination"
columnName="savings_account_id"
columnDataType="BIGINT"/>
</changeSet>
</databaseChangeLog>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
for licensing details.
-->
<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">
<!--
Allow txn_id to be NULL in m_savings_txn_denomination so that
GL account transactions (journal entries with hex IDs) can also
record denomination breakdown without a numeric transaction ID.
-->
<changeSet id="0319_allow_nullable_txn_id_denomination" author="fineract">
<dropNotNullConstraint tableName="m_savings_txn_denomination"
columnName="txn_id"
columnDataType="BIGINT"/>
</changeSet>
</databaseChangeLog>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
for licensing details.
-->
<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 id="0320_add_payment_type_to_denomination" author="fineract">
<addColumn tableName="m_savings_txn_denomination">
<column name="payment_type" type="VARCHAR(100)">
<constraints nullable="true"/>
</column>
</addColumn>
</changeSet>
</databaseChangeLog>