Hi all,

I'd like to pick up *FINERACT-2400 – "Use available on savings account if
the available balance is not enough to cover the installment".*

The ticket was raised by Kigenyi Wilfred in Oct 2025, and Bharath endorsed
it with one addition: the option to allow part payments should sit on the
standing instruction itself. Adam gave a go-ahead to a contributor on 21
Nov 2025, but I can't find a PR against it since, so I'm assuming it's free
– happy to stand down if someone is still on it.

*The problem*

The EXECUTE_STANDING_INSTRUCTIONS job is all-or-nothing today. If the
linked savings account can't cover the full amount due, transferFunds
throws InsufficientAccountBalanceException, the tasklet records a 'failed'
history row, and nothing is collected.

On a 40,000 installment with 39,900 available, the lender recovers zero.

*Proposed approach*

   -

   New boolean column allow_partial_transfer on
   m_account_transfer_standing_instructions, exposed as allowPartialTransfer
   through the existing standing-instruction create/update API. Default false,
   so behaviour is unchanged for every existing tenant. No new endpoints.
   -

   In ExecuteStandingInstructionsTasklet, when the flag is set and the
   amount due exceeds what the from-account can release, clamp the transfer to
   the available amount and log it; skip the instruction when nothing is
   available.
   -

   For "available" I intend to reuse SavingsAccount.getWithdrawableBalance()
   rather than recomputing anything in the job – it already accounts for
   minimum required balance (only when enforced), overdraft headroom, on-hold
   funds and hold amounts. A clamped transfer that still fails the deeper
   balance check falls through to the existing failed-history path, so this
   can improve on current behaviour but not regress it.
   -

   Unit tests on the tasklet covering flag off / clamped / nothing
   available / sufficient balance, plus one integration scenario through the
   job.

*Two things I'd like a steer on before I start*

*1. Per-instruction flag*
As Bharath suggested, rather than a global configuration – I've assumed
per-instruction. Shout if you'd rather it were global.

*2. History status for partial transfers*
Whether a partially-covered run should be recorded as 'success' or as a
distinct status in m_account_transfer_standing_instructions_history.

I plan to record it as 'success' with the actual transferred amount, since
a transfer did occur, but I'm happy to add a status instead.

If there are no objections I'll raise a PR against develop.

Thanks,
Abhishek

Reply via email to