Details
-
Task
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
None
-
None
-
-
ACQ Sprint 144, ACQ Sprint 145, ACQ Sprint 146, ACQ Sprint 147
-
2
-
Thunderjet
-
Not For Release
-
TBD
Description
An external script needs to be created to fix issues with encumbrances in Lotus.
The related fixes in Morning Glory cannot safely be added to a hotfix because they are complex. Also, because finding encumbrances of closed orders without using the encumbrance's orderStatus property cannot be done in a database migration, some issues cannot be fixed in the migration to Morning Glory (although they should be fixed after a rollover in Morning Glory).
Issues to resolve :
Lotus environments, before rollover, might have:
- closed orders with encumbrances having orderStatus=Open and status=Released (
MODORDERS-712)
Lotus environments, after rollover, might have:
- closed orders with encumbrances having orderStatus=Open and status=Released (
MODORDERS-712) - open orders with encumbrances having orderStatus=Open and status=Released when they should be Unreleased (
MODFISTO-325) - wrong budgets because something was done to these orders (such as changing the fund distribution) (
MODFISTO-325)
Logic :
- Fix encumbrances orderStatus for closed orders. In order to do this, the relevant encumbrances have to be unreleased first and released afterwards because it is not possible to change orderStatus of released encumbrances.
- Change encumbrance status to Unreleased for all open orders' encumbrances with non-zero amounts
- Recalculate the encumbered property for all the budgets related to these encumbrances
- Release all unreleased encumbrances for closed orders
Additional specifications :
- The script needs to be able to handle tens of thousands of orders. This could be a problem with Postman because it runs out of memory for a large number of requests; python can be used instead.
- Running the script twice should not change the result.
Running the script :
The script should not be used before a rollover in Lotus (because if it was, encumbrances would not be created for closed orders, and they could not be reopened - see MODORDERS-706). It can be used after a rollover for all ledgers, or just before migration to Morning Glory. If necessary it could also be used in Morning Glory.
Operations affecting order encumbrances or budgets should be avoided while the script is running. It could take a long time with a large number of orders.
Script arguments :
- Fiscal year code
- Okapi URL
- Tenant
- Username
- User password is required as a command-line input.
Execution example :
./fix_lotus_encumbrances.py 'FY2022' 'http://localhost:9130/' 'diku' 'diku_admin'
Required permissions for the user :
- finance.budgets.collection.get
- finance.encumbrances.item.put
- finance.fiscal-years.collection.get
- finance.order-transaction-summaries.item.put
- finance.transactions.collection.get
- finance.transactions.item.get
- finance-storage.budgets.item.put
- orders.collection.get
TestRail: Results
Attachments
Issue Links
- defines
-
UXPROD-3396 Thunderjet - Morning Glory Bugfixes
-
- Closed
-
- relates to
-
MODFISTO-325 Encumbered amount remains in Budget summary for fiscal year #2 after rollover when fund name was changing in POL and related paid invoice exists
-
- Closed
-
-
MODFISTO-329 Improve performance of script to fix Lotus encumbrance issues
-
- Closed
-
-
MODORDERS-712 Encumbrances are created for closed orders during FYRO
-
- Closed
-