Skip to content

Commit

Permalink
better debugging msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Park committed Sep 4, 2012
1 parent 78c95fb commit 9b4f88d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ use Rack::Coffee, {
:urls => '/js'
}

run Npv
map '/fincal' do
run Npv
end
5 changes: 1 addition & 4 deletions web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ def web_prefix
calendar_end = Date.parse(Time.at(params["end"].to_i).to_s)
puts "data range #{calendar_start} #{calendar_end}"
values = Value.all
puts "values size #{values.size}"
puts "Values.all count #{values.size}"

report = []
first_day_total = Value.where(["date < ?", calendar_start]).sum(:amount)
report_total = first_day_total
(calendar_start..calendar_end).each do |day|
puts "day report for #{day}"

day_report = []
today_values = values.select{|v| v.date.to_date == day}
Expand All @@ -75,10 +74,8 @@ def web_prefix
day_report << {:title => "$#{"%0.2f" % report_total} Balance",
:start => day, :editable => false}

puts "adding day report to report"
report += day_report.reverse
end
puts "data report is size #{report.size}"
report.to_json
end

Expand Down

0 comments on commit 9b4f88d

Please sign in to comment.