adamsaghy commented on PR #6174:
URL: https://github.com/apache/fineract/pull/6174#issuecomment-5992170803

   @Abhishek6122008 Can you review the below?
   
   I reviewed [apache/fineract#6174 · FINERACT-2705: Resolve 
cash…](https://github.com/apache/fineract/pull/6174) and found one problem: the 
Post Interest job will still fail for cash-based savings accounts that withhold 
tax. I traced it through the code but didn't run it.
   
   **SavingsAccountWritePlatformServiceJpaRepositoryImpl.java:740:** Cash-based 
withhold-tax transaction still gets GL account 0.
   - The new cash-based branches handle only interest posting and overdraft 
interest.
   - When the job posts interest on an account with tax withholding, it also 
creates a withhold-tax transaction. That transaction still lands in the else 
branch, which debits the Interest Payable account.
   - Cash-based products have no Interest Payable mapping, so the query returns 
null, which rs.getLong reads as 0. The job then inserts acc_gl_journal_entry 
with account_id=0.
   - That breaks the foreign key FK_acc_gl_journal_entry_acc_gl_account, so the 
batch insert throws and interest posting fails for that account and the rest of 
its batch.
   - The fix is to book withhold tax the way 
CashBasedAccountingProcessorForSavings does: Savings Control to the tax 
component's liability account. The query already loads those account ids as 
debitAccountId and creditAccountId.


-- 
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