Skip to content

Commit

Permalink
Account for loan payback openoakland#360
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeubell committed Jan 21, 2015
1 parent 637de95 commit a07ba34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/fetchers/loan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def self.parse_loan(row)
puts "Skipping " + row.values_at('filer_naml', 'tran_id').join(':')
return
end
return if row['loan_amt1'].to_i == 0
return if row['loan_amt1'].to_i == 0 and row['loan_amt5'].to_i == 0

recipient = DataFetcher.get_filer(row)

Expand Down Expand Up @@ -48,7 +48,7 @@ def self.parse_loan(row)

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

0 comments on commit a07ba34

Please sign in to comment.