Comment 4 for bug 1589586

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

The prorate_invoice function gathers a list of fund debits in order to calculate the total invoice amount to prorate against and to determine which funds the prorated charges should be debited against. However, it only looks for fund debits where encumbrance=f. If all existing fund debits have encumbrance=t, then the prorate_invoice function ends up with no fund totals to work with, and prorating does not work (when you click Prorate, the grey progress bar appears and never goes away).

If we change the prorate_invoice function so that it retrieves ALL related fund debits, not just those with encumbrance=f, prorating appears to work just fine. I have a commit in working branch user/jeffdavis/lp1589586-prorate-invoice that does exactly this:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commitdiff;h=a3df498

However, my understanding of debits and encumbrances is shaky, so I'm not sure if this is a good approach. Does it make sense to include both encumbered and un-encumbered debits during prorate?