diff --git a/app.rb b/app.rb index cc0818e..c39f8f0 100644 --- a/app.rb +++ b/app.rb @@ -32,6 +32,7 @@ end get '/directorates/:id' do @directorate = Directorate.get(params[:id]) + @total = @directorate.payments.sum(:amount) haml :directorate end @@ -53,6 +54,7 @@ end get '/suppliers/:id' do @supplier = Supplier.get(params[:id]) + @total = @supplier.payments.sum(:amount) haml :supplier end @@ -79,6 +81,7 @@ end get '/services/:id' do @service = Service.get(params[:id]) + @total = @service.payments.sum(:amount) haml :service end diff --git a/public/style.css b/public/style.css index 945bf2e..edaabdc 100644 --- a/public/style.css +++ b/public/style.css @@ -61,6 +61,7 @@ h1 line-height: 1.4em; font-weight: bold; color: #86a11d; + font-size: 180%; } h2 diff --git a/views/directorate.haml b/views/directorate.haml index 09dd019..72e228a 100644 --- a/views/directorate.haml +++ b/views/directorate.haml @@ -27,4 +27,11 @@ = payment.supplier.name %td.right= sprintf("%0d", payment.amount) + %tr + %td + %td + %td + %strong TOTAL + %td.right= sprintf("%0d", @total) + \ No newline at end of file diff --git a/views/service.haml b/views/service.haml index 55e3f80..1ff0ece 100644 --- a/views/service.haml +++ b/views/service.haml @@ -30,4 +30,11 @@ = payment.supplier.name %td.right= sprintf("%0d", payment.amount) - \ No newline at end of file + %tr + %td + %td + %td + %strong TOTAL + %td.right= sprintf("%0d", @total) + + \ No newline at end of file diff --git a/views/supplier.haml b/views/supplier.haml index d579ae7..09808e0 100644 --- a/views/supplier.haml +++ b/views/supplier.haml @@ -31,4 +31,11 @@ = payment.service.name %td.right= sprintf("%0d", payment.amount) + %tr + %td + %td + %td + %strong TOTAL + %td.right= sprintf("%0d", @total) + \ No newline at end of file