Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loan repayment date. FAQ on payment dates. #380

Merged
merged 1 commit into from
Feb 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions assets/js/templates/faq.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
This chart displays the proportion of funds that came from the candidate or were collected by the candidate from individuals, companies, committees, unions and registered Oakland lobbyists and lobbying companies. The proportion of money not itemized is also displayed. Candidates do not need to itemize individual contributions less than $100. Lobbyists are identified from the <a href='https://data.oaklandnet.com/Public-Services/2014-Lobbyist-Directory/7jq6-spyn?category=Public-Services&view_'> 2041 lobbyist directory</a>. Unions are identified “by hand” from the names of the contributors. Unlike the Top Contributors display, employees are NOT aggregated with their employers.
</p></div>
</div>
<div class='question'>
<a name='paymentDate'></a>
<h3>Why do some candidates not have dates associated with thier payments?</h3>
<p>
There is no statutory requirement to report the dates on which payments are made. Some vendors of campaign finance software provide the ability to report this and this is reflected in the data of those candidates that use those vendors. Other candidates data will not contain payment dates.
</p>
</div>
<div class='question'>
<a name='groupBy'></a>
<h3>How do you group by business and employer?</h3>
Expand Down
1 change: 1 addition & 0 deletions assets/js/views/_paymentsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ OpenDisclosure.PaymentsView = Backbone.View.extend({
leftPayments : left.map(this.renderPayment).join(''),
rightPayments : right.map(this.renderPayment).join('')
}));
this.$el.append("<h5 class='footnote'>Some data does not have dates see <a href='/faq#paymentDate'>FAQ</a></h5>");
},

renderPayment: function(payment) {
Expand Down
15 changes: 12 additions & 3 deletions backend/fetchers/loan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,20 @@ def parse_row(row)
end
end

# "amount received this period less amount paid backand amount forgiven"
loan_amt = row['loan_amt1'].to_i - (row['loan_amt5'].to_i + row['loan_amt6'].to_i)
# There is no date recorded for the rempayment/forgiven date, so just use
# the report date.
if loan_amt > 0
loan_date = row['loan_date1']
else
loan_date = row['rpt_date']
end

::Contribution.where(recipient: recipient, transaction_id: row['tran_id'],
contributor: contributor,
# "amount received this period less amount paid backand amount forgiven"
amount: row['loan_amt1'].to_i - (row['loan_amt5'].to_i + row['loan_amt6'].to_i),
date: row['loan_date1'],
amount: loan_amt,
date: loan_date,
type: 'loan'
).first_or_create
end
Expand Down