ActionController::Routing::Routes.draw do |map|
  map.resources :accept_orders, :collection => { :ext_index => :post, :linkage => :get, :with_details => :post, :auto_flow => :post}
  map.resources :accept_order_details, :collection => {:child => :get}
  map.resources :orders, :collection => {:ext_index => :post, :linkage => :get, :print_sheet => :post, :with_details => :post}
  map.resources :order_details, :collection => {:child => :get}
  map.resources :manufactures, :collection => {:ext_index => :post, :linkage => :get, :print_sheet => :post, :with_details => :post}
  map.resources :manufacture_details, :collection => {:child => :get}
  map.resources :manufacture_product_details, :collection => {:child => :get}
  map.resources :purchases, :collection => { :ext_index => :post, :linkage => :get, :with_details => :post, :print_sheet => :post, :print_lot_sheet => :post}
  map.resources :purchase_details, :collection => {:child => :get}
  map.resources :sales, :collection => { :ext_index => :post, :print_sheet => :post, :linkage => :get, :summary => :get, :with_details => :post}
  map.resources :sale_details, :collection => {:child => :get}
  map.resources :samples, :collection => { :ext_index => :post, :linkage => :get, :with_details => :post}
  map.resources :sample_details, :collection => {:child => :get}
  map.resources :shippings, :collection => {:ext_index => :post, :print_sheet => :post, :print_picking_sheet => :post, :with_details => :post, :print_trucking_notes => :post}
  map.resources :shipping_details, :collection => {:child => :get}
  map.resources :restorations, :collection => { :ext_index => :post, :print_sheet => :post, :with_details => :post}
  map.resources :restoration_details, :collection => {:child => :get}
  map.resources :disposals, :collection => {:ext_index => :post, :linkage => :get, :with_details => :post}
  map.resources :disposal_details, :collection => {:child => :get}
  map.resources :adjustments, :collection => { :ext_index => :post, :with_details => :post}
  map.resources :adjustment_details, :collection => {:child => :get}
  map.resources :stocks, :collection => {:ext_index => :post}
  map.resources :logs, :collection => {:show_log => :get}
  map.resources :log_details, :collection => {:show_log => :get}
  map.resources :quotations, :collection => { :ext_index => :post, :linkage => :get, :with_details => :post, :print_sheet => :post}
  map.resources :quotation_details, :collection => {:child => :get}
  
  map.resources :payings, :collection => {:ext_index => :post, :with_details => :post}
  map.resources :paying_details, :collection => {:child => :get, :with_parent => :post}
  map.resources :payable_details, :collection => {:child => :get, :with_parent => :post}
  map.resources :payable_carry_remains, :collection => {:ext_index => :post}
  map.resources :payables, :collection => {:ext_index => :post, :print_sheet => :post}
  map.resources :receivings, :collection => {:ext_index => :post, :with_details => :post}
  map.resources :receiving_details, :collection => {:child => :get, :with_parent => :post}
  map.resources :receivables, :collection => { :ext_index => :post, :print_sheet => :post}
  map.resources :receivables_details, :collection => {:print_sheet => :post}
  map.resources :receivable_details, :collection => {:child => :get, :with_parent => :post}
  map.resources :receivable_carry_remains, :collection => { :ext_index => :post}
  map.resources :bill_details, :collection => { :print_sheet => :post}
  
  map.resources :banks, :collection => {:ext_index => :post}
  map.resources :consumers, :collection => {:ext_index => :post, :search => :get}
  map.resources :customer_group_payments, :collection => {:ext_index => :post}
  map.resources :customer_groups, :collection => {:ext_index => :post}
  map.resources :customers, :collection => {:ext_index => :post}
  map.resources :deliveries, :collection => {:ext_index => :post}
  map.resources :global_areas, :collection => {:ext_index => :post}
  map.resources :invoice_prices, :collection => {:ext_index => :post}
  map.resources :menus, :collection => {:ext_index => :post}
  map.resources :product1_tags, :collection => {:ext_index => :post}
  map.resources :product2_tags, :collection => {:ext_index => :post}
  map.resources :product_categories, :collection => {:ext_index => :post}
  map.resources :product_sets, :collection => {:ext_index => :post}
  map.resources :products, :collection => {:ext_index => :post}
  map.resources :manufacture_products, :collection => {:products_index => :get}
  map.resources :roles, :collection => {:ext_index => :post}
  map.resources :roles_menus, :collection => {:menus_index => :get}
  map.resources :roles_users, :collection => {:ext_index => :post, :roles_index => :get, :roles_update => :post}
  map.resources :sales_areas, :collection => {:ext_index => :post}
  map.resources :supplier_group_payments, :collection => {:ext_index => :post}
  map.resources :supplier_groups, :collection => {:ext_index => :post}
  map.resources :suppliers, :collection => {:ext_index => :post}
  map.resources :systems, :collection => {:ext_index => :post}
  map.resources :systems_users, :collection => {:ext_index => :post, :systems_index => :get}
  map.resources :truckings, :collection => {:ext_index => :post, :systems_index => :get}
  map.resources :users, :collection => {:ext_index => :post, :show_tree => :get, :update_tree => :post, :index_path => :get, :update_path => :post}
  map.resources :sections, :collection => {:ext_index => :post}
  map.resources :users_menus, :collection => {:menus_index => :get}
  map.resources :user_positions, :collection => {:ext_index => :post}
  map.resources :warehouses, :collection => {:ext_index => :post}
  map.resources :warehouses_customers, :collection => {:ext_index => :post}
  map.resources :wholesale_prices, :collection => {:ext_index => :post}
  map.resources :suppliers_users, :collection => {:ext_index => :post, :suppliers_index => :get, :suppliers_update => :post}
  map.resources :customers_users, :collection => {:ext_index => :post, :suppliers_index => :get, :suppliers_update => :post}
  map.resources :master_revisions, :collection => {:get_latest => :get}
  map.resources :stock_locations, :collection => {:ext_index => :post}
  
  map.resources :ranks_approvals, :collection => {:ext_index => :post, :table => :post, :table_update => :post}
  map.resources :wholesale_approvals, :collection => {:ext_index => :post, :table => :post, :table_update => :post}
  map.resources :ranks, :collection => {:ext_index => :post}
  map.resources :application_categories, :collection => {:ext_index => :post}
  map.resources :application_types, :collection => {:ext_index => :post}
  
  map.resources :sales_users_lists, :collection => {:ext_index => :post}
  map.resources :sales_warehouses_lists, :collection => {:ext_index => :post}
  map.resources :customers_ledgers_lists, :collection => {:ext_index => :post, :print_sheet=>:post}
  map.resources :customers_ledgers_details, :collection => {:print_sheet => :post}
  map.resources :suppliers_ledgers_lists, :collection => {:ext_index => :post, :print_sheet=>:post}
  map.resources :suppliers_ledgers_details, :collection => {:print_sheet => :post}
  map.resources :stocks_arrivings_lists, :collection => {:ext_index => :post}
  map.resources :stocks_owns_lists, :collection => {:ext_index => :post}
  map.resources :stocks_others_lists, :collection => {:ext_index => :post}
  map.resources :stocks_reserves_lists, :collection => {:ext_index => :post}
  map.resources :accept_orders_stocks_lists, :collection => {:ext_index => :post}
  map.resources :backorders_lists, :collection => {:ext_index => :post}
  map.resources :shipping_sheets_lists, :collection => {:ext_index => :post}
  map.resources :shipping_shorts_lists, :collection => {:ext_index => :post}
  map.resources :stocks_ubd_lists, :collection => {:ext_index => :post}
  map.resources :sales_products_lists, :collection => {:ext_index => :post, :print_sheet=>:post}
  map.resources :stocks_manufactured_lists, :collection => {:ext_index => :post}
  map.resources :stocks_shippings_and_sales_lists, :collection => {:ext_index => :post}
  map.resources :sales_samples_lists, :collection => {:ext_index => :post}
  map.resources :stocks_books_lists, :collection => {:ext_index => :post, :print_sheet=>:post}
  map.resources :stocks_books_select_lists, :collection => {:ext_index => :post, :print_sheet=>:post}
  map.resources :stocks_books_dealers_lists, :collection => {:ext_index => :post, :print_sheet=>:post}
  map.resources :stocks_books_dealers_details, :collection => {:ext_index => :post, :print_sheet=>:post}
  map.resources :stocks_customers_lists, :collection => {:ext_index => :post}
  map.resources :stocks_customers_details, :collection => {:print_sheet => :post}
  map.resources :trans_search_lists, :collection => {:ext_index => :post}
  map.resources :stock_search_lists, :collection => {:ext_index => :post, :print_sheet => :post}
  map.resources :customers_cashflow_lists, :collection => {:ext_index => :post}
  map.resources :customers_drafts_lists, :collection => {:ext_index => :post, :print_sheet => :post}
  map.resources :customers_gross_lists, :collection => {:ext_index => :post}
  map.resources :customers_receivables_lists, :collection => {:ext_index => :post, :print_sheet => :post}
  map.resources :customers_receivings_lists, :collection => {:ext_index => :post, :print_sheet => :post}
  map.resources :customers_unrealized_lists, :collection => {:ext_index => :post, :print_sheet => :post}
  map.resources :stocks_products_lists, :collection => {:ext_index => :post}
  map.resources :trucking_notes_lists, :collection => {:ext_index => :post}
  map.resources :own_order_point_lists, :collection => {:ext_index => :post}
  map.resources :other_order_point_lists, :collection => {:ext_index => :post}
  map.resources :non_active_lists, :collection => {:ext_index => :post}
  map.resources :customers_profit_lists, :collection => {:ext_index => :post}
  map.resources :customers_products_profit_lists, :collection => {:ext_index => :post}
  map.resources :suppliers_sales_warehouses_lists, :collection => {:ext_index => :post}
  map.resources :suppliers_stocks_lists, :collection => {:ext_index => :post}
  map.resources :suppliers_stocks_products_lists, :collection => {:ext_index => :post}
  map.resources :suppliers_own_order_point_lists, :collection => {:ext_index => :post}
  map.resources :suppliers_stocks_arrivings_lists, :collection => {:ext_index => :post}  
  map.resources :customers_stocks_lists, :collection => {:ext_index => :post}
  map.resources :customers_sales_warehouses_lists, :collection => {:ext_index => :post}
  map.resources :customers_other_order_point_lists, :collection => {:ext_index => :post}
  map.resources :inventories, :collection => {:ext_index => :post, :print_sheet => :post, :refresh => :post, :update_records => :post}
  map.resources :products_stocks_turnover_lists, :collection => {:ext_index => :post}
  map.resources :warehouses_stocks_turnover_lists, :collection => {:ext_index => :post}
  map.resources :warehouses_products_stocks_turnover_lists, :collection => {:ext_index => :post}
  map.resources :sales_warehouses_total_lists, :collection => {:ext_index => :post}
  map.resources :sales_products_total_lists, :collection => {:ext_index => :post}
  map.resources :sales_warehouses_products_total_lists, :collection => {:ext_index => :post}
  map.resources :sales_warehouses_transition_lists, :collection => {:ext_index => :post}
  map.resources :sales_products_transition_lists, :collection => {:ext_index => :post}
  map.resources :sales_warehouses_products_transition_lists, :collection => {:ext_index => :post}
  map.resources :sales_product1_tags_lists, :collection => {:ext_index => :post}
  map.resources :sales_product2_tags_lists, :collection => {:ext_index => :post}
  map.resources :wholesale_prices_lists, :collection => {:ext_index => :post}
  map.resources :invoice_prices_lists, :collection => {:ext_index => :post}
  
  map.resources :sales_by_product_lists, :collection => {:ext_index => :post}
  map.resources :sales_by_customer_lists, :collection => {:ext_index => :post}
  map.resources :sales_by_sales_area_lists, :collection => {:ext_index => :post}
  map.resources :sales_by_user_position_lists, :collection => {:ext_index => :post}
  
  map.resources :sales_by_warehouse_lists, :collection => {:ext_index => :post}
  map.resources :stocks_lists, :collection=>{:ext_index=>:post}
  map.resources :sales_by_product_category_trees, :collection=>{:ext_index => :post}
  map.resources :sales_by_user_trees, :collection=>{:ext_index => :post}
  map.resources :sales_by_warehouse_trees, :collection=>{:ext_index => :post}
  
  map.resources :sales_closes
  map.resources :trans_closes
  map.resources :master_helps
  
  map.resources :customer_groups_cashflow_lists, :collection => {:ext_index => :post}
  map.resources :customer_groups_profit_lists, :collection => {:ext_index => :post}
  map.resources :customer_groups_products_profit_lists, :collection => {:ext_index => :post}

  #テスト用
  map.resources :file, :collection=>{:create_file => :post}
  
  #OMKK固有
  map.resources :case_numbers, :collection => {:ext_index => :post}
  map.resources :target_cases, :collection => {:ext_index => :post}
  
  map.resource :session
  map.resources :download

  map.logout '/logout', :controller => 'sessions', :action => 'destroy'
  map.login '/login', :controller => 'sessions', :action => 'new'

  map.disp_names '/disp_names', :controller => 'disp_names', :action => 'index', :conditions=>{:method=>:post}
  map.menu_trees '/menu_trees', :controller => 'menu_trees', :action => 'index'
  map.auth_codes '/auth_codes', :controller => 'auth_codes', :action => 'index'
  map.top        '/top', :controller => 'top', :action => 'index'
  map.resources :http_states
  
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'

  # namespace for mobile environment
  # mobile files are stored at /lib/comm_logistics/controllers/mobile,views/mobile
  map.namespace(:mobile) do |mobile|
    mobile.resources :top
    mobile.resources :sales
    mobile.resources :sale_details
    mobile.resources :sales_product_category
    mobile.resources :sales_product_category_monthly
    mobile.resources :samples_top
    mobile.resources :samples
    mobile.resources :sample_details
    mobile.resources :samples_product_category
    mobile.resources :samples_product_category_monthly
    mobile.resources :stocks_top
    mobile.resources :stocks_product_category
    mobile.resources :stocks_details
  end
  map.namespace(:graph) do |graph|
    graph.resources :monthly_sales_by_area
    graph.resources :sales_product_each_warehouse
    graph.resources :sales_product_category
    graph.resources :sales_product_set
    graph.resources :sales_product_each_area
    graph.resources :inventory_turnover_each_area
  end

end
