diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 0ae7c603..16352261 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -53,9 +53,7 @@ class OrdersController < ApplicationController # Page to create a new order. def new - @supplier = Supplier.find(params[:supplier_id]) - @order = @supplier.orders.build :ends => 4.days.from_now - @template_orders = @supplier.orders.finished :order => 'starts DESC', :limit => 5 + @order = Order.new :ends => 4.days.from_now, :supplier_id => params[:supplier_id] end # Save a new order. @@ -104,13 +102,13 @@ class OrdersController < ApplicationController # Renders the groups-orderd PDF. def groupsPdf @order = Order.find(params[:id]) - prawnto :filename => "#{Date.today}_#{@order.supplier.name}_GruppenSortierung.pdf" + prawnto :filename => "#{Date.today}_#{@order.name}_GruppenSortierung.pdf" end # Renders the articles-orderd PDF. def articlesPdf @order = Order.find(params[:id]) - prawnto :filename => "#{Date.today}_#{@order.supplier.name}_ArtikelSortierung.pdf", + prawnto :filename => "#{Date.today}_#{@order.name}_ArtikelSortierung.pdf", :prawn => { :left_margin => 48, :right_margin => 48, :top_margin => 48, @@ -120,7 +118,7 @@ class OrdersController < ApplicationController # Renders the fax PDF. def faxPdf @order = Order.find(params[:id]) - prawnto :filename => "#{Date.today}_#{@order.supplier.name}_FAX.pdf" + prawnto :filename => "#{Date.today}_#{@order.name}_FAX.pdf" end # Renders the fax-text-file @@ -147,13 +145,13 @@ class OrdersController < ApplicationController end send_data text, :type => 'text/plain; charset=utf-8; header=present', - :disposition => "attachment; filename=#{order.supplier.name}" + :disposition => "attachment; filename=#{order.name}" end # Renders the matrix PDF. def matrixPdf @order = Order.find(params[:id]) - prawnto :filename => "#{Date.today}_#{@order.supplier.name}_Matrix.pdf" + prawnto :filename => "#{Date.today}_#{@order.name}_Matrix.pdf" end # adds a Comment to the Order diff --git a/app/models/article.rb b/app/models/article.rb index eaee27f0..fe642528 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -32,6 +32,7 @@ class Article < ActiveRecord::Base belongs_to :supplier belongs_to :article_category has_many :article_prices, :order => "created_at" + has_many :stock_changes named_scope :in_stock, :conditions => "quantity > 0", :order => 'suppliers.name', :include => :supplier named_scope :available, :conditions => {:availability => true} @@ -172,8 +173,9 @@ class Article < ActiveRecord::Base end end - def update_quantity(amount) - update_attribute :quantity, quantity + amount + # Update the quantity of items in stock + def update_quantity! + update_attribute :quantity, stock_changes.collect(&:quantity).sum end protected diff --git a/app/models/group_order.rb b/app/models/group_order.rb index 3a21439c..73d73787 100644 --- a/app/models/group_order.rb +++ b/app/models/group_order.rb @@ -26,8 +26,8 @@ class GroupOrder < ActiveRecord::Base validates_numericality_of :price validates_uniqueness_of :ordergroup_id, :scope => :order_id # order groups can only order once per order - named_scope :open, lambda { {:conditions => ["order_id IN (?)", Order.open.collect{|o| o.id}]} } - named_scope :finished, lambda { {:conditions => ["order_id IN (?)", Order.finished.collect{|o| o.id}]} } + named_scope :open, lambda { {:conditions => ["order_id IN (?)", Order.open.collect(&:id)]} } + named_scope :finished, lambda { {:conditions => ["order_id IN (?)", Order.finished.collect(&:id)]} } # Updates the "price" attribute. # This will be the maximum value of an order diff --git a/app/models/group_order_article.rb b/app/models/group_order_article.rb index 9f460e99..f0c1085f 100644 --- a/app/models/group_order_article.rb +++ b/app/models/group_order_article.rb @@ -154,8 +154,8 @@ class GroupOrderArticle < ActiveRecord::Base memoize :calculate_result # Returns order result, - # either calcualted on the fly or fetched from quantity_/tolerance_result - # After an order is finished, there is only the result + # either calcualted on the fly or fetched from result attribute + # Result is set when finishing the order. def result(type = :total) self[:result] || calculate_result[type] end diff --git a/app/models/order.rb b/app/models/order.rb index 05e5bc71..44d2bbf9 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -28,21 +28,44 @@ class Order < ActiveRecord::Base belongs_to :updated_by, :class_name => "User", :foreign_key => "updated_by_user_id" # Validations - validates_presence_of :supplier_id, :starts - validate_on_create :starts_before_ends, :include_articles + validates_presence_of :starts + validate :starts_before_ends, :include_articles # Callbacks after_update :update_price_of_group_orders # Finders - named_scope :open, :conditions => { :state => 'open' }, - :order => 'ends DESC' - named_scope :finished, :conditions => "state = 'finished' OR state = 'closed'", - :order => 'ends DESC' - named_scope :finished_not_closed, :conditions => { :state => 'finished' }, - :order => 'ends DESC' - named_scope :closed, :conditions => { :state => 'closed' }, - :order => 'ends DESC' + named_scope :open, :conditions => {:state => 'open'}, :order => 'ends DESC' + named_scope :finished, :conditions => "state = 'finished' OR state = 'closed'", :order => 'ends DESC' + named_scope :finished_not_closed, :conditions => {:state => 'finished'}, :order => 'ends DESC' + named_scope :closed, :conditions => {:state => 'closed'}, :order => 'ends DESC' + named_scope :stockit, :conditions => {:supplier_id => 0}, :order => 'ends DESC' + + def stockit? + supplier_id == 0 + end + + def name + stockit? ? "Lager" : supplier.name + end + + def articles_for_ordering + if stockit? + Article.in_stock.all(:include => :article_category, + :order => 'article_categories.name, articles.name').group_by { |a| a.article_category.name } + else + supplier.articles.available.all.group_by { |a| a.article_category.name } + end + end + + # Fetch last orders from same supplier, to generate an article selection proposal + def templates + if stockit? + Order.stockit :limit => 5 + else + supplier.orders.finished :limit => 5 + end + end # Create or destroy OrderArticle associations on create/update def article_ids=(ids) @@ -163,7 +186,7 @@ class Order < ActiveRecord::Base # Sets order.status to 'close' and updates all Ordergroup.account_balances def close!(user) raise "Bestellung wurde schon abgerechnet" if closed? - transaction_note = "Bestellung: #{supplier.name}, bis #{ends.strftime('%d.%m.%Y')}" + transaction_note = "Bestellung: #{name}, bis #{ends.strftime('%d.%m.%Y')}" gos = group_orders.all(:include => :ordergroup) # Fetch group_orders gos.each { |group_order| group_order.update_price! } # Update prices of group_orders diff --git a/app/models/stock_change.rb b/app/models/stock_change.rb index 54f34746..029812a0 100644 --- a/app/models/stock_change.rb +++ b/app/models/stock_change.rb @@ -20,15 +20,11 @@ class StockChange < ActiveRecord::Base validates_numericality_of :quantity after_save :update_article_quantity - after_destroy :remove_added_quantity + after_destroy :update_article_quantity protected def update_article_quantity - article.update_quantity(quantity) - end - - def remove_added_quantity - article.update_quantity(quantity * -1) + article.update_quantity! end end diff --git a/app/models/supplier.rb b/app/models/supplier.rb index e23bca38..8823ee76 100644 --- a/app/models/supplier.rb +++ b/app/models/supplier.rb @@ -41,11 +41,6 @@ class Supplier < ActiveRecord::Base # for the sharedLists-App belongs_to :shared_supplier - # Returns all articles for this supplier that are available, grouped by article category and ordered by name. - def get_articles_for_ordering - articles.available.all.group_by { |a| a.article_category.name } - end - # sync all articles with the external database # returns an array with articles(and prices), which should be updated (to use in a form) # also returns an array with outlisted_articles, which should be deleted diff --git a/app/views/finance/balancing/_summary.haml b/app/views/finance/balancing/_summary.haml index 027e6657..3bf3981d 100644 --- a/app/views/finance/balancing/_summary.haml +++ b/app/views/finance/balancing/_summary.haml @@ -1,4 +1,4 @@ -%b=h order.supplier.name +%b=h order.name %br/ = "von #{format_date(order.starts)} bis #{format_date(order.ends)}" %p diff --git a/app/views/finance/balancing/index.haml b/app/views/finance/balancing/index.haml index 220092c8..9a175937 100644 --- a/app/views/finance/balancing/index.haml +++ b/app/views/finance/balancing/index.haml @@ -55,7 +55,7 @@ %tbody - @orders.each do |order| %tr{:class => cycle("even","odd", :name => "order")} - %td= order.supplier.name + %td= order.name %td= format_date(order.ends) %td{:class => "currency"}= number_to_currency(order.sum(:fc)) %td= link_to "abrechnen", :action => "new", :id => order diff --git a/app/views/finance/balancing/list.html.haml b/app/views/finance/balancing/list.html.haml index ae6e4c24..6a7035cf 100644 --- a/app/views/finance/balancing/list.html.haml +++ b/app/views/finance/balancing/list.html.haml @@ -18,7 +18,7 @@ %tbody - @orders.each do |order| %tr{:class => cycle("even","odd", :name => "order")} - %td= link_to truncate(order.supplier.name), :action => "new", :id => order + %td= link_to truncate(order.name), :action => "new", :id => order %td=h format_time(order.ends) unless order.ends.nil? %td= order.closed? ? "abgerechnet (#{number_to_currency order.profit})" : "beendet" %td= order.updated_by.nil? ? '??' : order.updated_by.nick diff --git a/app/views/finance/balancing/new.html.haml b/app/views/finance/balancing/new.html.haml index 44ea93b0..35a889fe 100644 --- a/app/views/finance/balancing/new.html.haml +++ b/app/views/finance/balancing/new.html.haml @@ -1,4 +1,4 @@ -- title "#{@order.supplier.name} abrechnen" +- title "#{@order.name} abrechnen" - if @order.closed? %p diff --git a/app/views/home/_start_nav.haml b/app/views/home/_start_nav.haml index 8fb43efb..bf516eaa 100644 --- a/app/views/home/_start_nav.haml +++ b/app/views/home/_start_nav.haml @@ -24,6 +24,7 @@ Artikelverwaltung %ul %li= link_to "Artikel aktualisieren", suppliers_path + %li= link_to "Lagerverwaltung", :controller => 'stockit' %li= link_to "Lieferanten verwalten", suppliers_path // Finance diff --git a/app/views/messages/order_finished.rhtml b/app/views/messages/order_finished.rhtml index 1553efda..43d1fddd 100644 --- a/app/views/messages/order_finished.rhtml +++ b/app/views/messages/order_finished.rhtml @@ -1,6 +1,6 @@ Liebe <%= group.name %>, -die Bestellung für "<%= order.supplier.name %>" wurde am <%= order.ends.strftime('%d.%m.%Y um %H:%M') %> von <%= order.updated_by.nick %> beendet. +die Bestellung für "<%= order.name %>" wurde am <%= order.ends.strftime('%d.%m.%Y um %H:%M') %> von <%= order.updated_by.nick %> beendet. Für Euch wurden die folgenden Artikel bestellt: <% for group_order_article in group_order.group_order_articles.all(:include => :order_article) diff --git a/app/views/ordering/_orders.html.haml b/app/views/ordering/_orders.html.haml index a95ea4fb..235e560e 100644 --- a/app/views/ordering/_orders.html.haml +++ b/app/views/ordering/_orders.html.haml @@ -11,7 +11,7 @@ - group_order = order.group_order(@ordergroup) # Get GroupOrder if possible - order_class = group_order ? "" : "color:grey" %tr{:class=> cycle('even', 'odd', :name => 'orders'), :style => order_class} - %td= link_to order.supplier.name, :action => 'my_order_result', :id => order + %td= link_to order.name, :action => 'my_order_result', :id => order %td= format_time(order.ends) %td{:class => "currency"}= group_order ? number_to_currency(group_order.price) : "--" \ No newline at end of file diff --git a/app/views/ordering/my_order_result.haml b/app/views/ordering/my_order_result.haml index 68a97431..a4dbc3b0 100644 --- a/app/views/ordering/my_order_result.haml +++ b/app/views/ordering/my_order_result.haml @@ -1,10 +1,10 @@ -- title "Dein Bestellergebnis für #{@order.supplier.name}" +- title "Dein Bestellergebnis für #{@order.name}" #element_navigation - = link_to_unless @order.previous == @order, "<< #{@order.previous.supplier.name}", :action => "my_order_result", :id => @order.previous + = link_to_unless @order.previous == @order, "<< #{@order.previous.name}", :action => "my_order_result", :id => @order.previous | = link_to _("Overview"), :controller => 'ordering' | - = link_to_unless @order.next == @order, "#{@order.next.supplier.name} >>", :action => "my_order_result", :id => @order.next + = link_to_unless @order.next == @order, "#{@order.next.name} >>", :action => "my_order_result", :id => @order.next // Order summary .left_column{:style => "width:45em"} @@ -16,7 +16,7 @@ %td{:style => "width:50%"} %p Lieferant: - %b=h @order.supplier.name + %b=h @order.name - unless @order.note.blank? %p Notiz: @@ -43,7 +43,7 @@ %table - for order in Order.open %tr - %td= link_to order.supplier.name, :action => 'order', :id => order + %td= link_to order.name, :action => 'order', :id => order %td= "("+ time_ago_in_words(order.ends) + ")" if order.ends // Article box diff --git a/app/views/ordering/order.rhtml b/app/views/ordering/order.rhtml index 57dbce99..3a0320e3 100644 --- a/app/views/ordering/order.rhtml +++ b/app/views/ordering/order.rhtml @@ -1,33 +1,33 @@

Bestellen

-

<%=h @order.supplier.name %>

+

<%=h @order.name %>

@@ -39,14 +39,14 @@ <%- if !@other_orders.empty? -%>
-

<%=_ "Other orders" %>

+

Andere Bestellungen

-

<%=_ "Supplier" %>: <%=h @order.supplier.name %>

-

<%=_ "End" %>: <%=h format_time(@order.ends) %>

+

Lieferant: <%=h @order.name %>

+

Ende: <%=h format_time(@order.ends) %>

<% if @group_order && @group_order.updated_by -%> -

<%=_ "person ordered at last" %>: <%=h @group_order.updated_by.nick if @group_order.updated_by %> (<%= format_time(@group_order.updated_on) %>)

+

Zuletzt bestellt: <%=h @group_order.updated_by.nick if @group_order.updated_by %> (<%= format_time(@group_order.updated_on) %>)

<% end -%> -

<%=_ "Credit available"%>: <%= number_to_currency(@availableFunds) %>

+

Verfügbares Guthaben: <%= number_to_currency(@availableFunds) %>

<% unless @order.note.empty? %>

- <%=_ "Note" %>: + Notiz:

<%= simple_format(@order.note) %> <% end %> - <% unless @order.supplier.min_order_quantity.nil? || @order.supplier.min_order_quantity.empty? %> + <% unless @order.stockit? || @order.supplier.min_order_quantity.blank? -%>

- <%=_ "Minimum order quantity" %>: + Mindestellmenge: <%=h @order.supplier.min_order_quantity %>

- <% end %> + <% end -%>

- <%=_ "Order quanitity so far" %>: + Gesamtbestellmenge bisher: <%= number_to_currency @order.sum %>

<% for order in @other_orders -%> @@ -61,21 +61,23 @@
<% form_tag(:action => 'saveOrder', :id => @order) do %>
-

<%=_ "Articles" %>

+

Artikel

- <%= link_to_function order.supplier.name, "if (confirmSwitchOrder()) (window.location = '#{ url_for(:action => 'order', :id => order) }' )" %> + <%= link_to_function order.name, "if (confirmSwitchOrder()) (window.location = '#{ url_for(:action => 'order', :id => order) }' )" %> noch <%= time_ago_in_words(order.ends) if order.ends -%>
- + - - - - - - - + + + + + + <% unless @order.stockit? -%> + + <% end -%> + @@ -104,7 +106,7 @@ - +
<%=_ "Name" %>Name <%=_ "Manufacturer" %><%=_ "Package" %><%=_ "Price" %>"><%=_ "Ord."%><%=_ "Quantity" %><%=_ "Tolerance" %><%=_ "Amount" %>Herstellerin<%= @order.stockit? ? "im Lager" : "Gebinde" -%>PreisBestMengeToleranzSumme
<%=h order_article.article.origin %> <%=h truncate order_article.article.manufacturer, :length => 11 %><%= @unit[i] %> * <%=h order_article.article.unit %><%= @order.stockit? ? order_article.article.quantity_available : @unit[i] %> * <%=h order_article.article.unit %> <%= number_to_currency(@price[i]) %> <%= order_article.units_to_order %> diff --git a/app/views/orders/_form.html.haml b/app/views/orders/_form.html.haml index d72ae714..24e7cfde 100644 --- a/app/views/orders/_form.html.haml +++ b/app/views/orders/_form.html.haml @@ -7,7 +7,7 @@ = form.hidden_field :supplier_id %p Lieferant: - = @order.supplier.name + = @order.name %p Notiz %br/ @@ -31,7 +31,7 @@ %option{:value => "-1", :selected => "selected"}=_ "Choose an order..." - i = -1 - for order in @template_orders - %option{:value => (i += 1)}= "#{h(order.supplier.name)} bis #{order.ends.strftime('%d. %b')}" + %option{:value => (i += 1)}= "#{h(order.name)} bis #{order.ends.strftime('%d. %b')}" %table.list %tr %th= check_box_tag 'checkall', "1", false, { :onclick => "checkUncheckAll(this)" } @@ -41,7 +41,7 @@ %th=_ "Manufacturer" %th=_ "Unit quantity" %th=_ "Price" - - for category_name, articles in @order.supplier.get_articles_for_ordering + - for category_name, articles in @order.articles_for_ordering %tr{:style => "background-color:#EFEFEF"} %td %td{:colspan => "6", :style => "text-align:left"} @@ -64,7 +64,4 @@ =_ "Select all" - if (@template_orders && !@template_orders.empty?) - = render :partial => 'template_orders_script' - - - + = render :partial => 'template_orders_script' \ No newline at end of file diff --git a/app/views/orders/_orders.html.haml b/app/views/orders/_orders.html.haml index 22f382e8..555e628b 100644 --- a/app/views/orders/_orders.html.haml +++ b/app/views/orders/_orders.html.haml @@ -12,7 +12,7 @@ %tbody - @orders.each do |order| %tr{:class => cycle('even', 'odd', :name => 'orders')} - %td=h order.supplier.name + %td=h order.name %td=h format_time(order.starts) %td=h format_time(order.ends) %td= order.state diff --git a/app/views/orders/articlesPdf.pdf.prawn b/app/views/orders/articlesPdf.pdf.prawn index b3dde3f9..0a4745cb 100644 --- a/app/views/orders/articlesPdf.pdf.prawn +++ b/app/views/orders/articlesPdf.pdf.prawn @@ -1,5 +1,5 @@ end_date = @order.ends.strftime('%d.%m.%Y') -title = "#{@order.supplier.name} | beendet am #{end_date}" +title = "#{@order.name} | beendet am #{end_date}" # Define header and footer pdf.header [pdf.margin_box.left,pdf.margin_box.top+30] do diff --git a/app/views/orders/faxPdf.pdf.prawn b/app/views/orders/faxPdf.pdf.prawn index 6c6a8b6a..6f056c13 100644 --- a/app/views/orders/faxPdf.pdf.prawn +++ b/app/views/orders/faxPdf.pdf.prawn @@ -25,7 +25,7 @@ end # Recipient pdf.bounding_box [pdf.margin_box.left,pdf.margin_box.top-60], :width => 200 do - pdf.text @order.supplier.name + pdf.text @order.name pdf.move_down 5 pdf.text @order.supplier.address pdf.move_down 5 diff --git a/app/views/orders/groupsPdf.pdf.prawn b/app/views/orders/groupsPdf.pdf.prawn index adec92aa..a6af4d5c 100644 --- a/app/views/orders/groupsPdf.pdf.prawn +++ b/app/views/orders/groupsPdf.pdf.prawn @@ -1,5 +1,5 @@ end_date = @order.ends.strftime('%d.%m.%Y') -title = "Gruppensortierung für #{@order.supplier.name}, beendet am #{end_date}" +title = "Gruppensortierung für #{@order.name}, beendet am #{end_date}" # Define header and footer pdf.header [pdf.margin_box.left,pdf.margin_box.top+20] do diff --git a/app/views/orders/index.haml b/app/views/orders/index.haml index acad1cc8..405e0b8e 100644 --- a/app/views/orders/index.haml +++ b/app/views/orders/index.haml @@ -24,7 +24,7 @@ - for order in @open_orders - active = (order.open? and order.ends < Time.now) ? " active" : "" %tr{:class => cycle('even', 'odd', :name => 'open_orders') + active} - %td=h order.supplier.name + %td=h order.name %td=h format_time(order.ends) unless order.ends.nil? %td=h truncate(order.note) %td= link_to "Beenden", finish_order_path(order), :confirm => _("Are you really sure to finish the order?"), :method => :post diff --git a/app/views/orders/matrixPdf.pdf.prawn b/app/views/orders/matrixPdf.pdf.prawn index 8d9c0e38..7f451634 100644 --- a/app/views/orders/matrixPdf.pdf.prawn +++ b/app/views/orders/matrixPdf.pdf.prawn @@ -1,4 +1,4 @@ -title = "#{@order.supplier.name}, beendet am #{@order.ends.strftime('%d.%m.%Y')}" +title = "#{@order.name}, beendet am #{@order.ends.strftime('%d.%m.%Y')}" # Define header and footer pdf.header [pdf.margin_box.left,pdf.margin_box.top+20] do diff --git a/app/views/orders/new.html.haml b/app/views/orders/new.html.haml index c1ed2d89..ee3cb48a 100644 --- a/app/views/orders/new.html.haml +++ b/app/views/orders/new.html.haml @@ -1,7 +1,7 @@ -- title _("New order") +- title "Neue Bestellung anlegen" - form_for @order do |form| = render :partial => 'form', :locals => { :form => form } - = submit_tag _("Put the order online") + = submit_tag "Bestellung online stellen" | = link_to "Abbrechen", orders_path \ No newline at end of file diff --git a/app/views/orders/show.haml b/app/views/orders/show.haml index 1571a53c..1c8d5cdd 100644 --- a/app/views/orders/show.haml +++ b/app/views/orders/show.haml @@ -1,10 +1,10 @@ -- title _("Show order") +- title "Bestellung: #{@order.name}" #element_navigation - = link_to_unless @order.previous == @order, "<< #{@order.previous.supplier.name}", @order.previous + = link_to_unless @order.previous == @order, "<< #{@order.previous.name}", @order.previous | = link_to _("Overview"), orders_path | - = link_to_unless @order.next == @order, "#{@order.next.supplier.name} >>", @order.next + = link_to_unless @order.next == @order, "#{@order.next.name} >>", @order.next // Order summary .left_column{:style => "width:65em"} @@ -16,7 +16,7 @@ %b{:style => "color:red"}=_ "Order isn't closed yet" %p Lieferant: - %b=h @order.supplier.name + %b=h @order.name - unless @order.note.empty? %p Notiz: diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index 500fe386..9a5db2bf 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -13,7 +13,7 @@ - total = 0 - Order.open.each do |order| %tr{:class => cycle('even', 'odd', :name => 'open_orders')} - %td= link_to h(order.supplier.name), :controller => 'ordering', :action => 'order', :id => order + %td= link_to h(order.name), :controller => 'ordering', :action => 'order', :id => order %td=h format_time(order.ends) unless order.ends.nil? - if group_order = order.group_order(@ordergroup) - total += group_order.price diff --git a/app/views/stockit/index.html.haml b/app/views/stockit/index.html.haml index d13f05a6..fb11b07b 100644 --- a/app/views/stockit/index.html.haml +++ b/app/views/stockit/index.html.haml @@ -7,7 +7,8 @@ options_for_select([" -- Lieferantin wählen --", ""] + | Supplier.find(:all).collect {|s| [ s.name, url_for(new_supplier_delivery_path(s))] }), | :onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;" | - +%p + = link_to "Lagerbestellung online stellen", new_order_path(:supplier_id => 0) %p %table.list %thead diff --git a/config/routes.rb b/config/routes.rb index 98f3fc09..56a93825 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,8 @@ ActionController::Routing::Routes.draw do |map| map.my_tasks '/home/tasks', :controller => 'tasks', :action => 'myTasks' map.resources :orders, :member => { :finish => :post, :add_comment => :post } + map.resources :stock_orders, :member => { :finish => :post, :add_comment => :post }, + :controller => 'orders' map.resources :messages, :only => [:index, :show, :new, :create], :member => { :reply => :get, :user => :get, :group => :get } diff --git a/db/migrate/20090120184410_refactor_order_logic.rb b/db/migrate/20090120184410_refactor_order_logic.rb index 74db2d3c..aea7a8e3 100644 --- a/db/migrate/20090120184410_refactor_order_logic.rb +++ b/db/migrate/20090120184410_refactor_order_logic.rb @@ -77,10 +77,10 @@ class RefactorOrderLogic < ActiveRecord::Migration # # # == GroupOrder # change_column :group_orders, :updated_by_user_id, :integer, :default => nil, :null => true - - # == GroupOrderArticle - # The total order result in ordergroup is now saved! - add_column :group_order_articles, :result, :integer, :default => nil +# +# # == GroupOrderArticle +# # The total order result in ordergroup is now saved! +# add_column :group_order_articles, :result, :integer, :default => nil end def self.down diff --git a/db/schema.rb b/db/schema.rb index d991e26f..c7faa9cd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20090120184410) do +ActiveRecord::Schema.define(:version => 20090119155930) do create_table "article_categories", :force => true do |t| t.string "name", :default => "", :null => false