MODFISTO-233 added a test to prevent unreleasing encumbrance if it was expended (the implementation was simply checking if amountExpended is different from 0). This is causing an issue when reopening an order: in some cases, we want to unrelease expended encumbrance.
- Requirement It should be possible to reopen an order with expended encumbrance
A possible fix is to revert the check added in
MODFISTO-233 and allow to unrelease expended encumbrance. Additionally, the new amount for an unreleased encumbrance should be changed to initialAmountEncumbered - amountAwaitingPayment - amountExpended.
- Updated modfisto implementation, updated unit tests (see code and test added for
- Integration tests should replicate use cases given in the comments.