[Evergreen-acq] Purchases and funding sources

Galen Charlton gmc at equinoxinitiative.org
Thu Jan 16 12:47:01 EST 2020


Hi,

On Thu, Jan 16, 2020 at 12:42 PM Tiffany Little <
tlittle at georgialibraries.org> wrote:

> Thank you, Galen! Even if this isn't very functional--depending on testing
> it, which I now absolutely want to do--it's cool to know that it exists.
>

Great, I'll be curious to hear what you find out when you try.

For reference, here's the code comment describing the stored procedure's
calculation:

"Function to attribute expenditures and encumbrances to funding source
credits,
and thereby to funding sources.

Read the debits in chonological order, attributing each one to one or
more funding source credits.  Constraints:

1. Don't attribute more to a credit than the amount of the credit.

2. For a given fund, don't attribute more to a funding source than the
source has allocated to that fund.

3. Attribute debits to credits with deadlines before attributing them to
credits without deadlines.  Otherwise attribute to the earliest credits
first, based on the deadline date when present, or on the effective date
when there is no deadline.  Use funding_source_credit.id as a tie-breaker.
This ordering is defined by an ORDER BY clause on the view
acq.ordered_funding_source_credit.

Start by truncating the table acq.debit_attribution.  Then insert a row
into that table for each attribution.  If a debit cannot be fully
attributed, insert a row for the unattributable balance, with the
funding_source_credit and credit_amount columns NULL."

Caveat: I have not examined the code to try to verify whether the comment
matches reality.

Regards,

Galen
-- 
Galen Charlton
Implementation and Services Manager
Equinox Open Library Initiative
phone:  1-877-OPEN-ILS (673-6457)
email:  gmc at equinoxInitiative.org
web:  https://equinoxInitiative.org
direct: +1 770-709-5581
cell:   +1 404-984-4366
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-acq/attachments/20200116/f97defd1/attachment.html>


More information about the Evergreen-acq mailing list