Page tree

Versions Compared

Key

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

...

Updating Allocated/Unavailable/Available and Other Running Totals

  • cross (x)(error)Option A:  Have the business logic module perform calculations as money is moved
    • Harder to guarantee consistency/accuracy - is eventual consistency OK for finances?
    • Keeps business logic out of the storage module, consistent with approach taken in other acquisition apps
  • cross (x)(error)Option B:  Perform summary/total calculations in the storage module and update all tables within a transaction.  Either they all succeed, or the entire operation fails
    • Much better control over consistency/accuracy
    • Bleeds business logic into the storage module
    • Other business logic remains in mod-finance - e.g. acquisitionUnits, what can be modified vs what can't, etc.
  • cross (x)(error)Option C:  Calculate these numbers on-the-fly in the business logic module
    • Difficult/inefficient to do if these numbers are needed to be shown in search results (they are)
    • Likely means we'll need a more complicated data model with more views and schemas
    • Since we're calculating these numbers on the fly, consistency is less of a problem... the numbers only live in one place
  • (tick)Option D: Hybrid of B and C
    • Calculate most of these totals in the storage module and update all tables in a transaction
    • For some special cases, we need to perform calculations on the fly
      • e.g. GET groups for a ledger/FY - Only sum the amounts from the funds in those groups which are part of the ledger for this FY...

...

The "Remaining Allowable Exp." in the flowchart is calculated as follows:

[remaining amount we can expend] = (allocated * allowableExpenditure) - (allocated - (unavailable + available)) - (awaitingPayment + expended)

[remaining amount we can expend] = (totalFunding * allowableExpenditure) - unavailable + relatedEncumbranceForPendingPayment

The "restrictExpenditures" flag actually lives in the ledger, so we'll need to find traverse:  budget → fund → ledger.restrictExpenditures  

...

The "Remaining Allowable Enc." in the flowchar is calculated as follows:

[remaining amount we can encumber] = (allocated * allowableEncumbered) - (encumbered + awaitingPayment + expended)

[remaining amount we can encumber] = (totalFunding * allowableEncumbered) - unavailable

The "restrictEncumbrances" flag actually lives in the ledger, so we'll need to find traverse:  budget → fund → ledger.restrictEncumbrances  

...

PropertyTypeDefaultRequiredUpdated On TransactionNotesRequirements tickets
idstring
NNUUID - system generated if not specified
namestring
YN= <fund.code>-<fiscal_year.code>, eg. AFRICAHIST-FY19.  Unique
budgetStatusstring
YNenum: Active, Frozen, Planned, Closed
allowableEncumbrancenumber
NNpercentage
allowableExpenditurenumber
NNpercentage
initialAllocationnumber
NYFirst allocation transaction amount
allocationTonumber
NYTotal of allocations to this budget
allocationFromnumber
NYTotal of allocations from this budget
allocatednumber0YNY

Running total of all the allocation transactions against the budget.

= initialAllocation + allocationTo - allocationFrom


totalFundingnumber
NY= allocated + netTransfers
cashBalancenumber
NY= totalFunding - expenditures
awaitingPaymentnumber
NY (encumbrance only)Running total of all the invoiced amounts (i.e. waiting to be paid)
availablenumber0NY

= (allocation + <transfers>) - awaiting_payment - encumbered - expendituresmax(totalFunding - unavailable)

NOTE: Doesn't include allowableEncumbered amount


encumberednumber
NY (encumbrance only)Running total of money set aside for purchases
expendituresnumber0NY (encumbrance only)Running total of all the payments recorded by the fund
unavailablenumber
NY

= awaiting_payment encumbered + encumbered awaitingPayment + expenditures

NOTE: Doesn't include overEncumbered amount


overEncumbrancenumber
NY (encumbrance only)Amount the budget is over encumbered.  i.e.  overEncumbered =  MAXmax(0, encumbered - max(MAXmax(totalFunding - expenditures, 0, (allocated - awaitingPayment - expended)) - awaytingPayment, 0), 0)
overExpendednumber
NY (encumbrance only)Amount the budget is over expended. i.e. overExpended = max(0, expended awaytingPayment + awaitingPayment expenditures - allocatedtotalFunding, 0)
netTransfersnumber0NYThis would actually be calculated by summing all the "Transfers" on this budget.

Jira
serverFOLIO Issue Tracker
serverId6ccf3fe4-3301-368a-983e-20c466b11a49
keyUIF-215

fundIdstring
YNUUID of fund
fiscalYearIdstring
YNUUID of fiscal year
ledgerIdstring
YNUUID of ledger
acquisitionUnitsarray<string>
NNArray of UUIDs corresponding to the acquisition units assigned to this budget.
tagstags
NNinherited from fund
metadatametadata
NYSystem generated metadata (createdBy/updatedBy/createdOn/etc.)

...