Skip to content

Commit

Permalink
Release v8.6.1 (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdulkhakimov authored Apr 4, 2024
1 parent c1bdad0 commit f6dbfd4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## 8.7.0 - Unreleased

## 8.6.1 - Released (Quesnelia R1 2024)
The primary focus of this release was to improve the flow of editing PO fund distribution where the re-encumber flag is disabled
[Full Changelog](https://github.com/folio-org/mod-finance-storage/compare/v8.6.0...v8.6.1)

### Bug fixes
* [MODFISTO-477](https://folio-org.atlassian.net/browse/MODFISTO-477) A new encumbrance is needed during FYRO for orders with "Re-encumber" = false

## 8.6.0 - Released (Quesnelia R1 2024)
The primary focus of this release was to introduce Batch Transactions API
[Full Changelog](https://github.com/folio-org/mod-finance-storage/compare/v8.5.0...v8.6.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.calculate_planned_encumbr
input_fromFiscalYearId uuid := (_rollover_record->>'fromFiscalYearId')::uuid;
BEGIN

IF
NOT((_transaction->'encumbrance'->>'reEncumber')::boolean)
THEN
RETURN 0.0;
END IF;

SELECT sum((jsonb->'encumbrance'->>'initialAmountEncumbered')::decimal) INTO po_line_cost
FROM ${myuniversity}_${mymodule}.transaction
WHERE input_fromFiscalYearId=fiscalYearId AND ${myuniversity}_${mymodule}.to_btree_format(jsonb->'encumbrance'->>'sourcePoLineId')=_transaction->'encumbrance'->>'sourcePoLineId'
Expand Down Expand Up @@ -131,7 +137,10 @@ CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.rollover_order(_order_id
'initialAmountEncumbered', ${myuniversity}_${mymodule}.calculate_planned_encumbrance_amount(tr.jsonb, _rollover_record, true),
'amountAwaitingPayment', 0,
'amountExpended', 0,
'status', 'Unreleased'
'status', CASE WHEN (tr.jsonb->'encumbrance'->>'reEncumber')::boolean
THEN 'Unreleased'
ELSE 'Released'
END
),
'metadata', _rollover_record->'metadata' || jsonb_build_object('createdDate', to_char(clock_timestamp(),'YYYY-MM-DD"T"HH24:MI:SS.MSTZHTZM'))

Expand All @@ -140,7 +149,7 @@ CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.rollover_order(_order_id
LEFT JOIN ${myuniversity}_${mymodule}.fund fund ON fund.id = tr.fromFundId
WHERE ${myuniversity}_${mymodule}.to_btree_format(tr.jsonb->'encumbrance'->>'sourcePurchaseOrderId')=_order_id
AND tr.fiscalYearId=input_fromFiscalYearId
AND (tr.jsonb->'encumbrance'->>'reEncumber')::boolean AND tr.jsonb->'encumbrance'->>'orderStatus'='Open'
AND tr.jsonb->'encumbrance'->>'orderStatus'='Open'
AND (_rollover_record->>'rolloverType' <> 'Preview' OR (_rollover_record->>'rolloverType' = 'Preview' AND fund.ledgerId = input_ledgerId));

-- #9.1 calculate and add missing penny to appropriate temp transaction
Expand Down Expand Up @@ -708,7 +717,6 @@ CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.budget_encumbrances_rollo
WHERE tr.jsonb->>'transactionType' = 'Encumbrance'
AND tr.fiscalYearId = input_fromFiscalYearId
AND tr.jsonb->'encumbrance'->>'orderStatus' = 'Open'
AND (tr.jsonb->'encumbrance'->>'reEncumber')::boolean
AND ledger.id=input_ledgerId
GROUP BY order_id
ORDER BY date
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/db_scripts/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
{
"run": "after",
"snippetPath": "budget_encumbrances_rollover.sql",
"fromModuleVersion": "mod-finance-storage-8.6.0"
"fromModuleVersion": "mod-finance-storage-8.6.1"
},
{
"run": "after",
Expand Down

0 comments on commit f6dbfd4

Please sign in to comment.