diff --git a/app/controllers/finance/balancing_controller.rb b/app/controllers/finance/balancing_controller.rb index 628ebdb0..6ed042c1 100644 --- a/app/controllers/finance/balancing_controller.rb +++ b/app/controllers/finance/balancing_controller.rb @@ -2,6 +2,12 @@ class Finance::BalancingController < ApplicationController before_filter :authenticate_finance def index + @financial_transactions = FinancialTransaction.find(:all, :order => "created_on DESC", :limit => 8) + @orders = Order.find(:all, :conditions => 'finished = 1 AND booked = 0', :order => 'ends DESC') + @unpaid_invoices = Invoice.unpaid + end + + def list @orders = Order.finished.paginate :page => params[:page], :per_page => 10, :order => 'ends DESC' end diff --git a/app/controllers/finance_controller.rb b/app/controllers/finance_controller.rb deleted file mode 100644 index 5761ea93..00000000 --- a/app/controllers/finance_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class FinanceController < ApplicationController - before_filter :authenticate_finance - - def index - @financial_transactions = FinancialTransaction.find(:all, :order => "created_on DESC", :limit => 8) - @orders = Order.find(:all, :conditions => 'finished = 1 AND booked = 0', :order => 'ends DESC') - @unpaid_invoices = Invoice.unpaid - end - -end \ No newline at end of file diff --git a/app/views/finance/index.haml b/app/views/finance/balancing/index.haml similarity index 95% rename from app/views/finance/index.haml rename to app/views/finance/balancing/index.haml index e7be6259..c491e5f7 100644 --- a/app/views/finance/index.haml +++ b/app/views/finance/balancing/index.haml @@ -43,7 +43,7 @@ .box_title %h2 noch nicht abgerechnet .column_content - %p= link_to "Bestellungsübersicht", :controller => 'finance/orders' + %p= link_to "Bestellungsübersicht", :controller => 'balancing', :action => 'list' - unless @orders.empty? %table.list %thead diff --git a/app/views/finance/balancing/index.html.haml b/app/views/finance/balancing/list.html.haml similarity index 100% rename from app/views/finance/balancing/index.html.haml rename to app/views/finance/balancing/list.html.haml diff --git a/app/views/finance/transactions/_order_group.haml b/app/views/finance/transactions/_ordergroup.haml similarity index 100% rename from app/views/finance/transactions/_order_group.haml rename to app/views/finance/transactions/_ordergroup.haml diff --git a/app/views/finance/transactions/create.html.erb b/app/views/finance/transactions/create.html.erb deleted file mode 100644 index c7fdf134..00000000 --- a/app/views/finance/transactions/create.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

Finance::Transactions#create

-

Find me in app/views/finance/transactions/create.html.erb

diff --git a/app/views/finance/transactions/create_collection.html.erb b/app/views/finance/transactions/create_collection.html.erb deleted file mode 100644 index dc280bc8..00000000 --- a/app/views/finance/transactions/create_collection.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

Finance::Transactions#create_collection

-

Find me in app/views/finance/transactions/create_collection.html.erb

diff --git a/app/views/finance/transactions/new_collection.html.erb b/app/views/finance/transactions/new_collection.html.erb deleted file mode 100644 index 6921d39c..00000000 --- a/app/views/finance/transactions/new_collection.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

Finance::Transactions#new_collection

-

Find me in app/views/finance/transactions/new_collection.html.erb

diff --git a/app/views/layouts/_main_tabnav.html.erb b/app/views/layouts/_main_tabnav.html.erb index 5fd5066d..48d47a7d 100644 --- a/app/views/layouts/_main_tabnav.html.erb +++ b/app/views/layouts/_main_tabnav.html.erb @@ -34,11 +34,11 @@ ] }, { :name => "Finance", :url => "/finance", - :active => ["finance", "finance/invoices", "finance/transactions", "finance/balancing"], + :active => ["finance/invoices", "finance/transactions", "finance/balancing"], :access? => (u.role_finance?), :subnav => [ { :name => "Manage accounts", :url => "/finance/transactions" }, - { :name => "Balance orders", :url => "/finance/balancing" }, + { :name => "Balance orders", :url => "/finance/balancing/list" }, { :name => "Invoices", :url => finance_invoices_path } ] }, diff --git a/config/routes.rb b/config/routes.rb index 9b9b766d..2d70b4ec 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,9 +13,8 @@ ActionController::Routing::Routes.draw do |map| end map.namespace :finance do |finance| + finance.root :controller => 'balancing' finance.resources :invoices - finance.connect 'transactions/:action/:id', :controller => 'transactions' - finance.connect 'balancing/:action/:id', :controller => 'balancing' end map.resources :suppliers, :collection => { :shared_suppliers => :get } do |suppliers|