Permalink
Browse files

fixed par

  • Loading branch information...
1 parent 7cc29b1 commit 78b3b5a8e2150563982e4e49c73c88a2f646706c @piyushranjan piyushranjan committed Aug 13, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 app/controllers/dashboard.rb
@@ -287,7 +287,12 @@ def loans
graph.data_type = :individual
graph.data(vals.map{|x|
branch=Branch.get(x.branch_id)
- [(100*(LoanHistory.defaulted_loan_info_for(branch).principal_due/(x.actual_outstanding_principal||0)).to_f).round(2), branch.name]
+ principal_overdue = if history = LoanHistory.defaulted_loan_info_for(branch)
+ history.principal_due
+ else
+ 0
+ end
+ [(100*(principal_overdue/(x.actual_outstanding_principal||0)).to_f).round(2), branch.name]
})
return graph.generate
end

0 comments on commit 78b3b5a

Please sign in to comment.