Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

...

{
    "id": "f2715f25-8504-4698-afd0-3025aa779ac6",
    "numTransactions": -
1
}

Note : "orderId" possible to get from encumbrance "sourcePurchaseOrderId"

...


PUT {{protocol}}://{{url}}:{{okapiport}}/finance-storage/order-transaction-summaries/{{orderId}}
Request sample:
{
    "id": "{{orderId}}",
    "numTransactions":
1
}
Note : Change only "numTransactions" : "Total number of encumbrances(transactions) expected to update for this order(for your case should be 1)

...

Check that the encumbrance "amount" is not already included in the budget's "encumbered" amount.

If not then update budget's "encumbered" and "awaitingPayment" amounts :

  1. New "encumbered" = Prev. budget's "encumbered" + encumbrance "amount"
  2. New "awaitingPayment" = Prev. budget's "awaitingPayment" - encumbrance "amount"

PUT {{protocol}}://{{url}}:{{okapiport}}/finance/budgets/{{budgetId}}

Code Block
languagegroovy
themeMidnight
titleBudget
collapsetrue
{
  "id" : "{{budgetId}}",
  "_version" : 13,
  "name" : "ASIAHIST-FY2022",
  "budgetStatus" : "Active",
  "allowableEncumbrance" : 110.0,
  "allowableExpenditure" : 100.0,
  "allocated" : 23000.0,
  "awaitingPayment" : 0.0,
  "available" : 22850.0,
  "encumbered" : 54.65,
  "expenditures" : 0.0,
  "netTransfers" : 0.0,
  "unavailable" : 150.0,
  "overEncumbrance" : 0.0,
  "overExpended" : 0.0,
  "fundId" : "55f48dc6-efa7-4cfe-bc7c-4786efe493e3",
  "fiscalYearId" : "a06a95ef-5a96-4839-a2d9-ac484a25c261",
  "acqUnitIds" : [ ]
  "initialAllocation" : 23000.0,
  "allocationTo" : 0.0,
  "allocationFrom" : 0.0,
  "totalFunding" : 23000.0,
  "cashBalance" : 23000.0,
  "statusExpenseClasses" : [ ]
}

...

Note : {{fundId}} please take from fund distributions

2. Reopen order

GET : {{protocol}}://{{url}}:{{okapiport}}/orders-storage/purchase-orders/{{orderId}}

Response : {{orderBody}}


PUT : {{protocol}}://{{url}}:{{okapiport}}/orders/composite-orders/{{orderId}}

Body : {{orderBody}} and set "workflowStatus" to "Open"

In scope of reopening status of the encumbrance will be set to "Unrelease", but amount of encumbrance and budget  are not always updated.

...

  • New "encumbered" = Prev. budget's "encumbered" + encumbrance "amount"
  • New "awaitingPayment" = Prev. budget's "awaitingPayment" - encumbrance "amount"

4. Get order transaction summary for order where we need to UnRelease encumbrance:

...

{
    "id": "f2715f25-8504-4698-afd0-3025aa779ac6",
    "numTransactions": -
1
}

Note : "orderId" possible to get from encumbrance "sourcePurchaseOrderId"

...


PUT {{protocol}}://{{url}}:{{okapiport}}/finance-storage/order-transaction-summaries/{{orderId}}
Request sample:
{
    "id": "{{orderId}}",
    "numTransactions":
1
}
Note : Change only "numTransactions" : "Total number of encumbrances(transactions) expected to update for this order(for your case should be 1)

...

Check that the encumbrance "amount" is not already included in the budget's "encumbered" amount.

If not then update budget's "encumbered" and "awaitingPayment" amounts :

  1. New "encumbered" = Prev. budget's "encumbered" + encumbrance "amount"
  2. New "awaitingPayment" = Prev. budget's "awaitingPayment" - encumbrance "amount"

PUT {{protocol}}://{{url}}:{{okapiport}}/finance/budgets/{{budgetId}}

Code Block
languagegroovy
themeMidnight
titleBudget
collapsetrue
{
  "id" : "{{budgetId}}",
  "_version" : 13,
  "name" : "ASIAHIST-FY2022",
  "budgetStatus" : "Active",
  "allowableEncumbrance" : 110.0,
  "allowableExpenditure" : 100.0,
  "allocated" : 23000.0,
  "awaitingPayment" : 0.0,
  "available" : 22850.0,
  "encumbered" : 54.65,
  "expenditures" : 0.0,
  "netTransfers" : 0.0,
  "unavailable" : 150.0,
  "overEncumbrance" : 0.0,
  "overExpended" : 0.0,
  "fundId" : "55f48dc6-efa7-4cfe-bc7c-4786efe493e3",
  "fiscalYearId" : "a06a95ef-5a96-4839-a2d9-ac484a25c261",
  "acqUnitIds" : [ ]
  "initialAllocation" : 23000.0,
  "allocationTo" : 0.0,
  "allocationFrom" : 0.0,
  "totalFunding" : 23000.0,
  "cashBalance" : 23000.0,
  "statusExpenseClasses" : [ ]
}

...

1. Get invoice transaction summary for invoice where need to update encumbrance reference:
GET {{protocol}}://{{url}}:{{okapiport}}/finance-storage/invoice-transaction-summaries/{{invoiceId}}

Response sample:
{
"id": "ae27a94f-6313-48c6-b887-2b703bafc25f",
"numPendingPayments": 1,
"numPaymentsCredits": 1
}

2. Get pending payments for invoice
GET all pending payments -> {{protocol}}://{{url}}:{{okapiport}}/finance-storage/transactions?query=sourceInvoiceLineId=={{invoiceLineId}}
Or
GET exact one pending payment where need to update encumbrance reference -> {{protocol}}://{{url}}:{{okapiport}}/finance-storage/transactions/{{pendingPaymentId}}

3. Update invoice transaction summary for invoice

PUT {{protocol}}://{{url}}:{{okapiport}}/finance-storage/invoice-transaction-summaries/{{invoiceId}}
Request sample:
{
"id": "{{invoiceId}}",
"numPendingPayments": 1,
"numPaymentsCredits": 1
}
Note : Change only "numPendingPayments" : "Total number of pending payments(transactions) expected to update for this invoice(for your case should be 1)
Don't update "numPaymentsCredits", because this is total number of payment transaction which will be created in invoice Pay time.
For your case I suppose body should be
{
"id": "{{invoiceId}}",
"numPendingPayments": 1,
"numPaymentsCredits": 15
}
4. Update pending payment with right encumbrance reference

PUT {{protocol}}://{{url}}:{{okapiport}}/finance-storage/transactions/{{pendingPaymentId}}
Request sample:
{
"id": "{{pendingPaymentId}}",
"amount": 4.6,
"awaitingPayment": {
"encumbranceId": "{{rightEncumbranceReference}}",
"releaseEncumbrance": true
},
"currency": "USD",
"fiscalYearId": "a06a95ef-5a96-4839-a2d9-ac484a25c261",
"fromFundId": "65032151-39a5-4cef-8810-5350eb316300",
"source": "Invoice",
"sourceInvoiceId": "ae27a94f-6313-48c6-b887-2b703bafc25f",
"sourceInvoiceLineId": "3e19f3c1-7a9f-4939-8083-06bf3afb4cae",
"transactionType": "Pending payment"
}
Success response : 204

...

1. Get order transaction summary for order where we need to release encumbrance:
GET {{protocol}}://{{url}}:{{okapiport}}/finance-storage/order-transaction-summaries/{{orderId}}

Response sample:

{
"id": "f2715f25-8504-4698-afd0-3025aa779ac6",
"numTransactions": -1
}

3. Update order transaction summary for order

PUT {{protocol}}://{{url}}:{{okapiport}}/finance-storage/order-transaction-summaries/{{orderId}}
Request sample:
{
"id": "{{orderId}}",
"numTransactions": 1
}
Note : Change only "numTransactions" : "Total number of encumbrances(transactions) expected to update for this order(for your case should be 1)

2. Release encumbrance for which duplication error occurs
POST {{protocol}}://{{url}}:{{okapiport}}/finance/release-encumbrance/{encumbranceId}

Request body is Empty

3. Remove "encumbranceId" from fund distributions

...