|
@@ -100,7 +100,7 @@ end |
|
|
|
|
|
|
|
|
get '/services/:slug/payments' do |
|
|
get '/services/:slug/payments' do |
|
|
@service = Service.first(:slug => params[:slug]) |
|
|
@service = Service.first(:slug => params[:slug]) |
|
|
@payments = Payment.all(:service => @service, :amount.gte => 0, :order => [ 'd' ]) |
|
|
|
|
|
|
|
|
@payments = Payment.all(:service_id => @service.id, :amount.gte => 0, :order => [ 'd' ]) |
|
|
@total = @payments.sum(:amount) |
|
|
@total = @payments.sum(:amount) |
|
|
haml :servicepayments |
|
|
haml :servicepayments |
|
|
end |
|
|
end |
|
@@ -111,7 +111,7 @@ get '/services/:slug/paymentsdetail' do |
|
|
if params[:min].to_i > 0 |
|
|
if params[:min].to_i > 0 |
|
|
min = params[:min].to_i |
|
|
min = params[:min].to_i |
|
|
end |
|
|
end |
|
|
@payments = Payment.all(:service => @service, :amount.gte => min, :order => [ 'd' ]) |
|
|
|
|
|
|
|
|
@payments = Payment.all(:service_id => @service.id, :amount.gte => min, :order => [ 'd' ]) |
|
|
@total = @payments.sum(:amount) |
|
|
@total = @payments.sum(:amount) |
|
|
haml :servicepaymentsdetail, :layout => false |
|
|
haml :servicepaymentsdetail, :layout => false |
|
|
end |
|
|
end |
|
|