It should be possible to unrelease expended encumbrance

Description

Purpose/Overview:
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.

Requirements/Scope:

  1. Requirement It should be possible to reopen an order with expended encumbrance

Approach:
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.

Acceptance criteria:

  • Updated modfisto implementation, updated unit tests (see code and test added for MODFISTO-233).

  • Integration tests should replicate use cases given in the comments.

Environment

None

Potential Workaround

None

Attachments

1

Checklist

hide

TestRail: Results

Activity

Show:

Andrei Makaranka June 7, 2021 at 8:15 AM

Damien June 4, 2021 at 3:19 PM

I checked the Karate tests in the testing environment (see attached screenshot).

Dennis Bridges May 17, 2021 at 6:03 PM
Edited

Use case 1: (Allow encumbrance with expended value to be unreleased)
Note: This use case does not change if the invoice is only "Approved" but not "Paid".

User has created a POL for $100 for a quantity of 2
User receive 1 copy and pays first invoice for $49
Encumbrance amount is now $51
User closes order by mistake and encumbrance is released
User Reopens order and $51 is re-encumbered

Use case 2: (Prevent encumbrance from being unreleased)
Note: This use case does not change if the invoice is only "Approved" but not "Paid". Either way the encumbrance has been released

User has created a POL for $75 for a quantity of 2
User receive 2 copies and pays all on 1 invoice line. Invoice lines has "Release encumbrance" = true
POL payment status changes to fully paid and order is closed as complete.
One of the books is damaged so user reopens the order.
Encumbrance is NOT unreleased because the amount has already been paid in full. Invoice lines has "Release encumbrance" = true
User receives a replacement book and closes order again.

Use case 3: (Allow encumbrance to be unreleased)

User has created a POL for $100 for a quantity of 1
User closes order before receiving or paying anything
Encumbrance is released
User Reopens order and encumbrance is unreleased, $100 is re-encumbered

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created May 17, 2021 at 3:39 PM
Updated June 7, 2021 at 8:15 AM
Resolved June 7, 2021 at 8:15 AM
TestRail: Cases
TestRail: Runs