ACQ: Possible to Over-allocate from a Funding Source

Bug #1175400 reported by Jennifer Pringle
58
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
High
Unassigned

Bug Description

Evergreen 2.4 Beta
Ubuntu 12
Postgres 9.1.4

A funding source will currently allow a user to allocate money to a fund even if there is no credit or not enough credit in the funding source. It should not be possible to over-allocate a funding source.

Steps to re-create:
From Funding Source
1. Admin -> Server Administration -> Acquisitions -> Funding Source
2. Click on the name of the funding source.
3. Click "Allocate to Fund"
4. Select the fund you wish to allocate to from the drop down menu.
5. Enter an amount that is greater than the amount of credit (money) in the funding source.
6. Click "Apply"
7. Your funding source will now show a negative balance.

From Fund
1. Admin -> Server Administration -> Acquisitions -> Funds
2. Click on the name of the funds.
3. Click "Create Allocation"
4. Select the funding source you wish to allocate from from the drop down menu.
5. Enter an amount that is greater than the amount of credit (money) in the funding source.
6. Click "Apply"
7. Your funding source will now show a negative balance.

If a user attempts to over-allocate a funding source they should get a message along the lines of : "The (funding source name here) funding source does not contain the money required to create this allocation. Please apply more credit to the funding source." If there is a senario in which a user would want to be able to over-allocate a funding source then there could be the ability to override at this point.

This bug is present on 2.0, 2.2, and 2.4 beta

Tags: acq acq-funds
Revision history for this message
Galen Charlton (gmc) wrote :

I confirm that it currently behaves this way, and I agree that it would be reasonable to warn and/or block over-allocating from a funding source. Marking this is a wishlist item.

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Leslie St. John (lstjohn-deactivatedaccount) wrote :

Also behaving this way in 2.5.1
A fix would be appreciated.

Revision history for this message
Chris Sharp (chrissharp123) wrote :

Still present in 2.7.2, FYI.

Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

Also still present in 2.8.1

Changed in evergreen:
importance: Wishlist → High
Revision history for this message
Leslie St. John (lstjohn-deactivatedaccount) wrote :

More notes - "overallocation" is the right word but when a user can put money into a fund and spend it without ever funding a funding source the situation violates basic accounting principles and makes this behavior more serious than a wishlist item, hence our upgrade of this bug.
The steps are the same as described above:
From Fund
1. Admin -> Server Administration -> Acquisitions -> Funds
2. Click on the name of the funds.
3. Click "Create Allocation"
4. Select the funding source you wish to allocate from from the drop down menu.
5. Enter an amount that is greater than the amount of credit (money) in the funding source. The funding source can be at 0.
6. Click "Apply"
7. Your funding source will now show a negative balance.

Now, as long as the fund shows a balance it is valid for a purchase order, even though there is no "real" money available. To over expend a funding source would be the exception (probably in the extreme) rather than the rule. We agree that "If there is a senario in which a user would want to be able to over-allocate a funding source then there could be the ability to override at this point."

Liam Whalen (whalen-ld)
Changed in evergreen:
assignee: nobody → Liam Whalen (whalen-ld)
Revision history for this message
Liam Whalen (whalen-ld) wrote :

I have some code that displays a message prompting the user if they are sure they want to over allocate. If they do not have a new perm (ACQ_OVERRIDE_OVER_ALLOCATION) then it also displays a message letting them know they need that perm before they can override the over allocation.

This code is here:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/ldw/lp1175400_over_allocation

In the process of testing, I noticed an issue where the value being allocated is not always updated in the Balance, Total Credits, and Total Debits fields. However, upon a reload of the page the value is corrected to however many times I tried to allocate funds before hitting reload. The fields seem to update the first 2 times on my VM, but after that I need to click reload to see the changes.

For example, if the balance is $60.00, and I allocate $10 5 times, I will see the Balance go to $50.00, then to $40.00. After that it stays at $40.00. If, after the 5th $10.00 allocation, I hit reload then the balance changes to $10.00.

I reverted my code and noticed this happening with the original code as well.

When I check the Javascript Console after this occurs, I see a number of errors like this:

Timestamp: 11/06/2015 11:14:43 AM
Error: Error: assertion failed in ItemFileWriteStore
Source File: oils://remote/js/dojo/dojo/dojo.js
Line: 42

I still need to add the SQL that will insert the new perm to my working branch, but it would be good to see if anyone else can replicate the need to hit reload to get the UI to display with the original code.

Revision history for this message
Chris Sharp (chrissharp123) wrote :

Liam,

I was just testing your branch. I can confirm that it works when you take the following steps:

1) Enter Admin -> Acquisitions Administration -> Funding Sources.

2) Click on the Funding Source name.

3) Click on Allocate to Fund and enter a value above the balance.

I get the pop-up window that allows me to override or not. I haven't tested that the permission works yet.

However, when I take these steps:

1) Enter Admin -> Acquisitions Administration -> Funds.

2) Click on a fund name.

3) Click Create Allocation and enter a value above the funding allocation balance

I'm still able to overallocate. I don't know if there are other workflows to consider as well. I'll check with our acq people here when I get a chance.

Changed in evergreen:
assignee: Liam Whalen (whalen-ld) → nobody
Changed in evergreen:
assignee: nobody → Brahmina Burgess (brahmina-burgess)
Andrea Neiman (aneiman)
Changed in evergreen:
assignee: Brahmina Burgess (brahmina-burgess) → nobody
tags: added: acq-funds
removed: funds
Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

Confirmed this is still an issue in the new angular acq admin in 3.8.0. Ideally Evergreen should warn you if you're going to over-allocate from a funding source.

Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

Confirmed still possible to overallocate from a funding source without warning in 3.11.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.