AnvayKharb commented on code in PR #6211:
URL: https://github.com/apache/fineract/pull/6211#discussion_r3706689135


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadServiceImpl.java:
##########
@@ -152,13 +163,54 @@ public String searchSchema(final SearchConditions 
searchConditions) {
                 g.id as entityId, g.display_name as entityName, \
                 g.external_id as entityExternalId, g.account_no as 
entityAccountNo, \
                 g.office_id as parentId, o.name as parentName, null as 
entityMobileNo, \
-                g.status_enum as entityStatusEnum, null as subEntityType, null 
as parentType \
+                g.status_enum as entityStatusEnum, null as subEntityType, null 
as parentType, \
+                null as transactionId, null as transactionType, null as 
transactionExternalId, null as transactionRefNo, \
+                null as accountId, null as accountNo, null as accountType \
                 from m_group g join m_office o on o.id = g.office_id \
                 where o.hierarchy like :hierarchy \
                 and (g.account_no like :search or g.display_name like :search \
                 or g.external_id like :search)) \
                 order by g.id desc)""";
 
+        final String loanTransactionMatchSql = """
+                ( (select 'LOAN_TRANSACTION' as entityType, l.id as entityId, 
pl.name as entityName, \
+                lt.external_id as entityExternalId, l.account_no as 
entityAccountNo, \
+                coalesce(c.id,g.id) as parentId, 
coalesce(c.display_name,g.display_name) as parentName, \
+                null as entityMobileNo, l.loan_status_id as entityStatusEnum, 
null as subEntityType, \
+                CASE WHEN g.id is null THEN 'client' ELSE 'group' END as 
parentType, \
+                lt.id as transactionId, 'repayment' as transactionType, 
lt.external_id as transactionExternalId, \
+                null as transactionRefNo, l.id as accountId, l.account_no as 
accountNo, 'loan' as accountType \
+                from m_loan_transaction lt join m_loan l on l.id = lt.loan_id \
+                left join m_client c on l.client_id = c.id \
+                left join m_group g ON l.group_id = g.id \
+                left join m_office o on o.id = coalesce(c.office_id, 
g.office_id) \
+                left join m_product_loan pl on pl.id=l.product_id \
+                where o.hierarchy like :hierarchy \
+                and lt.transaction_type_enum = 2 \

Review Comment:
   Hi @adamsaghy , I kept this filter because the current scope is limited to 
loan repayments, savings deposits, and savings withdrawals. If you'd prefer it 
to cover all transaction types, I can update it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to