Page tree

Versions Compared

Key

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

...

  • awaitingPayment decreases by transaction amount (min 0)
  • expended increases by transaction amountamount decreases by the transaction amount
  • amount (effectiveEncumbrance) is recalculated

Delete related awaiting payment transaction

...

  • If there is an encumbrance associated with the payment
    • awaitingPayment decreases by transaction amount (min 0)
  • Else
    • available decreases by transaction amount (min 0)
    • unavailable increases by the transaction amount
  • Always
    • awaitingPayment decreases by transaction amount (min 0)
    • expenditures increases by transaction amount 
    • recalculate overExpended

...

  • expended decreases by transaction amount (min 0)
  • amount (effectiveEncumbrance) is recalculated
  • if(status == Released), the encumbered amount is immediately released (see update encumbrance section below) 
    • Update the budget identified by the transaction(encumbrance) fiscal year (fiscalYearId) and the source fund (fromFundId)
      • encumbered decreases by the amount being released
      • available increases by the amount being released
      • unavailable decreases by the amount being released (min 0)

...

Update Budget identified by the transaction's fiscal year (fiscalYearId) and the destination fund (toFundId)

  • If there is a released encumbrance associated with the credit
    • available increases by transaction amount
    • unavailable decreases by transaction amount (min 0)
  • Else
    • encumbered increases by the transaction amount
  • Always
    • awaitingPayment increases by transaction amount
    • expenditures decreases by transaction amount (min 0)
    • recalculate overExpended

Update LedgerFY identified by the transactions fiscal year (fiscalYearId) and destination fund (toFundId)

  • If there is a released encumbrance is associated with the credit
    • available increases by the transaction amount 
    • unavailable decreases by the transaction amount (min 0)

Encumbrances

Upon Creation

...

  • ALWAYS DO THIS PART:

    • Update Budget identified by the transaction fiscal year (fiscalYearId) and the source fund (fromFundId)
      • TBD

    IN ADDITION TO ABOVE, DO THIS PART IF ENCUMBRANCE IS RELEASED:

    • If encumbrance.status = Released 
      • Update the encumbrance
        • transaction.amount becomes 0 (save the original value for updating the budget)
      • Update the budget identified by the transaction fiscal year (fiscalYearId) and the source fund (fromFundId)
        • encumbered decreases by the amount being released
        • available increases by the amount being released
        • unavailable decreases by the amount being released (min 0)
      • Update LedgerFY identified by the transactions fiscal year (fiscalYearId) and source fund (fromFundId)

        • available increases by the transaction amount (min 0)
        • unavailable decreases by the transaction amount

Pending payments

Upon Creation

  • if awaitngPayment.encumbranceId specified
    • ALWAYS DO THIS PART:
      • Update Budget identified by the transaction fiscal year (fiscalYearId) and the source fund (fromFundId)
        • encumbered decreases by the transaction.amount
        • awaitingPayment increases by the same amount
      • update related encumbrance:
        • transaction(encumbrance).amount is updated to (transaction(encumbrance.)amount - transaction(pending payment).amount)
      • if pendingPayment.amout > encumbrance.amount
        • Update the budget identified by the transaction(encumbrance) fiscal year (fiscalYearId) and the source fund (fromFundId)
          • available decreases by the  pendingPayment.amout - encumbrance.amount
          • unavailable increases by the pendingPayment.amout - encumbrance.amount  (min 0)
          • recalculate overExpended?
    • IN ADDITION TO ABOVE, DO THIS PART IF ENCUMBRANCE IS RELEASED:
      • If encumbrance.status = Released 
        • Update the related encumbrance
          • transaction.amount becomes 0 (save the original value for updating the budget)
          • Update the budget identified by the transaction(encumbrance) fiscal year (fiscalYearId) and the source fund (fromFundId)
            • encumbered decreases by the amount being released
            • available increases by the amount being released
            • unavailable decreases by the amount being released (min 0)
          • Update LedgerFY identified by the transactions fiscal year (fiscalYearId) and source fund (fromFundId)

            • available increases by the transaction amount (min 0)
            • unavailable decreases by the transaction amount
  • if awaitngPayment.encumbranceId is empty
    • Update budget identified by the transaction fiscal year (fiscalYearId) and the source fund (fromFundId)
      • available decreases by transaction amount (min 0)
      • unavailable increases by the transaction amount
      • awaitingPayment increases by the transaction.amount
    • Update LedgerFY identified by the transactions fiscal year (fiscalYearId) and destination fund (toFundId)

      • available increases by the transaction amount 
      • unavailable decreases by the transaction amount (min 0)

Example payment:

Budget:

allocated: 100

unavailable: 0

available: 100


encumbrance:

amount: 50

initialEncumbered: 50


Budget:

allocated: 100

unavailable: 50

available: 50

encumbered: 50


Pending payment:

amount: 51


encumbrance:

amount: 0

awaitingPayment: 51

initialEncumbered: 50


Budget:

allocated: 100

unavailable: 51 

available: 49

encumbered: 0

awaitngPayment: 51


Payment:

amount: 51


encumbrance:

amount: 0

awaitingPayment: 0

initialEncumbered: 50

expended: 51


Budget:

allocated: 100

unavailable: 51 

available: 49

encumbered: 0

awaitngPayment: 0

expended: 51

overExpended: rcalculate


Example credit:

Budget:

allocated: 100

unavailable: 0

available: 100


encumbrance:

amount: 50

initialEncumbered: 50


Budget:

allocated: 100

unavailable: 50

available: 50

encumbered: 50


Pending payment:

amount: -10


encumbrance:

amount: 50 + 10 = 60

awaitingPayment:  0

initialEncumbered: 50


Budget:

allocated: 100

unavailable: 40 

available: 60

encumbered: 60

awaitngPayment: 0


Credit:

amount: 10


encumbrance:

amount: 50

awaitingPayment: 0

initialEncumbered: 50

expended: -10


Budget:

allocated: 100

unavailable: 40 

available: 60

encumbered: 50

awaitngPayment: 0

expended: -10

overExpended: rcalculate


release:

encumbrance:

amount: 0 

awaitingPayment: 0

initialEncumbered: 50

expended: -10

status: released


Budget:

allocated: 100

unavailable: max(40 -50, 0) = 0

available: 110

encumbered: 0

awaitngPayment: 0

expended: -10

overExpended: rcalculate


Without encumbrance:

Budget:

allocated: 100

unavailable: 0

available: 100


Pending payment:

amount: 50


Budget:

allocated: 100

unavailable: 50 

available: 50

encumbered: 0

awaitngPayment: 50

expended: 0


Payment:

amount: 50


Budget:

allocated: 100

unavailable: 50 

available: 50

encumbered: 0

awaitngPayment: 0

expended: 50

overExpended: rcalculate

Transaction Restrictions

It's often necessary to check if a transaction should be allowed to happen based on the current budget values.  This section explains these restrictions and how they're applied.

...