openoakland/opendisclosure — pull request #252 by tdooner (2014-09-02 04:33:38+00:00)
Title: Make all mathbars add up right

We have been grappling with data integrity problems. The primary reason
is that there are two factors that are included on one half of the
equation, but not the other:

1. Unpaid bills are counted as an "Expenditure" but do not subtract from
"Cash on Hand"
2. Candidates can report "Miscellaneous Adjustments" which are things
like interest, selling things for fair market value, or transfers from
another committee by the name name.

These are accounted for in two ways:

1. Unpaid bills are subtracted from "Cash on Hand" to produce a new
figure "Available Balance". This number more-accurately reflects a
campaign's fiscal status and, if the candidate accrues too many
unpaid bills, will be negative. I think a negative number reflects
properly on the candidate's situation.
2. "Miscellaneous Adjustments" are all positive, and as such are
income, so they are added to "Contributions". This isn't completely
clean, but the amount of these are negligible.

This adds a bin/test_amounts script which performs the math in the
mathbar to see if it checks out.

@lla2105 @mikeubell @evanwolf @elinaru Does this sound good?