@@ -70,6 +70,11 @@ get '/services/?' do | |||||
haml :services | haml :services | ||||
end | end | ||||
get '/payments/:id' do | |||||
@payment = Payment.get(params[:id]) | |||||
haml :payment | |||||
end | |||||
get '/error' do | get '/error' do | ||||
haml :error | haml :error | ||||
end | end | ||||
@@ -131,6 +131,6 @@ tr | |||||
.download a:hover | .download a:hover | ||||
{ | { | ||||
background-color: #ccc; | |||||
background-color: #eee; | |||||
color: red; | color: red; | ||||
} | } |
@@ -0,0 +1,16 @@ | |||||
require 'lib/models' | |||||
for supplier in Supplier.all | |||||
supplier.slug = Supplier.slugify(supplier.name) | |||||
supplier.save! | |||||
end | |||||
for service in Service.all | |||||
service.slug = Service.slugify(service.name) | |||||
service.save! | |||||
end | |||||
for directorate in Directorate.all | |||||
directorate.slug = Directorate.slugify(directorate.name) | |||||
directorate.save! | |||||
end |
@@ -12,6 +12,7 @@ | |||||
%table | %table | ||||
%tr | %tr | ||||
%th Date | %th Date | ||||
%th Ref. | |||||
%th Service | %th Service | ||||
%th Supplier | %th Supplier | ||||
%th.right £ | %th.right £ | ||||
@@ -19,6 +20,9 @@ | |||||
- for payment in @directorate.payments | - for payment in @directorate.payments | ||||
%tr | %tr | ||||
%td= payment.d.strftime("%d %b %Y") | %td= payment.d.strftime("%d %b %Y") | ||||
%td | |||||
%a{ :href => "/payments/#{payment.id}" } | |||||
= payment.id | |||||
%td | %td | ||||
%a{ :href => '/services/' + payment.service.slug } | %a{ :href => '/services/' + payment.service.slug } | ||||
= payment.service.name | = payment.service.name | ||||
@@ -33,5 +37,5 @@ | |||||
%td | %td | ||||
%strong TOTAL | %strong TOTAL | ||||
%td.right= sprintf("%0d", @total) | %td.right= sprintf("%0d", @total) | ||||
%td | |||||
@@ -0,0 +1,33 @@ | |||||
.grid_12 | |||||
%h2= @page_title = "Payment " + @payment.id.to_s | |||||
%table | |||||
%tr | |||||
%td Date | |||||
%td= @payment.d.strftime("%d %b %Y") | |||||
%tr | |||||
%td Directorate | |||||
%td | |||||
%a{ :href => "/directorates/#{@payment.directorate.slug}" } | |||||
= @payment.directorate.name | |||||
%tr | |||||
%td Service | |||||
%td | |||||
%a{ :href => "/services/#{@payment.service.slug}" } | |||||
= @payment.service.name | |||||
%tr | |||||
%td Supplier | |||||
%td | |||||
%a{ :href => "/suppliers/#{@payment.supplier.slug}" } | |||||
= @payment.supplier.name | |||||
%tr | |||||
%td Amount £ | |||||
%td= sprintf("%0.2f", @payment.amount) | |||||
%tr | |||||
%td Transaction Number | |||||
%td= @payment.trans_no > 0 ? @payment.trans_no : "unknown" | |||||
%tr | |||||
%td Type | |||||
%td= @payment.tyype | |||||
@@ -16,6 +16,7 @@ | |||||
%table | %table | ||||
%tr | %tr | ||||
%th Date | %th Date | ||||
%th Ref. | |||||
%th Directorate | %th Directorate | ||||
%th Supplier | %th Supplier | ||||
%th.right £ | %th.right £ | ||||
@@ -23,6 +24,9 @@ | |||||
- for payment in @service.payments | - for payment in @service.payments | ||||
%tr | %tr | ||||
%td= payment.d.strftime("%d %b %Y") | %td= payment.d.strftime("%d %b %Y") | ||||
%td | |||||
%a{ :href => "/payments/#{payment.id}" } | |||||
= payment.id | |||||
%td | %td | ||||
%a{ :href => '/directorates/' + payment.directorate.slug } | %a{ :href => '/directorates/' + payment.directorate.slug } | ||||
= payment.directorate.name | = payment.directorate.name | ||||
@@ -16,6 +16,7 @@ | |||||
%table | %table | ||||
%tr | %tr | ||||
%th Date | %th Date | ||||
%th Ref. | |||||
%th Directorate | %th Directorate | ||||
%th Service | %th Service | ||||
%th.right £ | %th.right £ | ||||
@@ -23,6 +24,9 @@ | |||||
- for payment in @supplier.payments | - for payment in @supplier.payments | ||||
%tr | %tr | ||||
%td= payment.d.strftime("%d %b %Y") | %td= payment.d.strftime("%d %b %Y") | ||||
%td | |||||
%a{ :href => "/payments/#{payment.id}" } | |||||
= payment.id | |||||
%td | %td | ||||
%a{ :href => '/directorates/' + payment.directorate.slug } | %a{ :href => '/directorates/' + payment.directorate.slug } | ||||
= payment.directorate.name | = payment.directorate.name | ||||