Explorar el Código

Added total amounts to directorates, services & suppliers

pull/3/head
Adrian Short hace 14 años
padre
commit
20637fe085
Se han modificado 5 ficheros con 26 adiciones y 1 borrados
  1. +3
    -0
      app.rb
  2. +1
    -0
      public/style.css
  3. +7
    -0
      views/directorate.haml
  4. +8
    -1
      views/service.haml
  5. +7
    -0
      views/supplier.haml

+ 3
- 0
app.rb Ver fichero

@@ -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



+ 1
- 0
public/style.css Ver fichero

@@ -61,6 +61,7 @@ h1
line-height: 1.4em;
font-weight: bold;
color: #86a11d;
font-size: 180%;
}

h2


+ 7
- 0
views/directorate.haml Ver fichero

@@ -27,4 +27,11 @@
= payment.supplier.name
%td.right= sprintf("%0d", payment.amount)
%tr
%td
%td
%td
%strong TOTAL
%td.right= sprintf("%0d", @total)

+ 8
- 1
views/service.haml Ver fichero

@@ -30,4 +30,11 @@
= payment.supplier.name
%td.right= sprintf("%0d", payment.amount)
%tr
%td
%td
%td
%strong TOTAL
%td.right= sprintf("%0d", @total)

+ 7
- 0
views/supplier.haml Ver fichero

@@ -31,4 +31,11 @@
= payment.service.name
%td.right= sprintf("%0d", payment.amount)
%tr
%td
%td
%td
%strong TOTAL
%td.right= sprintf("%0d", @total)

Cargando…
Cancelar
Guardar