Complete refactoring of orders-workflow.

OrderResult tables are removed. Data consistency is now possible through new article.price-history (ArticlePrice).
Balancing-workflow needs to be updated.
This commit is contained in:
Benjamin Meichsner 2009-01-29 01:57:51 +01:00
parent 80287aeea4
commit 9eb2125f15
98 changed files with 1121 additions and 1717 deletions

View file

@ -3,39 +3,40 @@
- if @current_user.role_orders?
%p
- form_tag do
=_ "New Order"
=_ "for"
Neue Bestellung anlegen für
%select{:onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;"}
%option{:selected => 'selected'}=_ "Choose a supplier..."
= options_for_select(Supplier.find(:all).collect {|s| [ s.name, url_for(:action => "new", :id => s)] })
= options_for_select(Supplier.find(:all).collect {|s| [ s.name, url_for(:action => "new", :supplier_id => s)] })
%br/
.left_column{:style => "width:55em"}
.box_title
%h2=_ "Running orders"
%h2 Laufende Bestellungen
.column_content
- if (@current_orders.length > 0)
- unless @open_orders.empty?
%table.list
%thead
%tr
%th=_ "Name"
%th=_ "Supplier"
%th=_ "End"
%th Lieferant
%th Ende
%th Notiz
%th{:colspan => "2"}
%tbody
- for order in @current_orders
%tr{:class => cycle('even', 'odd', :name => 'current_orders')}
%td= link_to order.name, :controller => 'orders', :action => 'show', :id => order
- 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 format_time(order.ends) unless order.ends.nil?
%td= link_to _("finish"), {:action => 'finish', :id => order}, :confirm => _("Are you really sure to finish the order?"), :method => "post"
%td=h truncate(order.note)
%td= link_to "Beenden", finish_order_path(order), :confirm => _("Are you really sure to finish the order?"), :method => :post
%td
= link_to image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => _("Edit")), :action => 'edit', :id => order
= link_to image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => _("Destroy")), { :action => 'destroy', :id => order }, :confirm => _("Are you really sure you want to destroy the order?"), :method => "post"
= link_to "Anzeigen", order
= link_to icon(:edit), edit_order_path(order)
= link_to icon(:delete), order, :confirm => _("Are you really sure you want to destroy the order?"), :method => :delete
- else
=_ "There aren't current orders at the moment."
=_ "There aren't open orders at the moment."
.left_column{:style => "width:75em"}
.box_title
%h2=_ "Expired/finished orders"
%h2 Beendete Bestellungen
.column_content#orders_table
= render :partial => 'list'
= render :partial => 'orders'