Linearize and clean up delivery form

This commit is contained in:
Julius 2013-06-26 15:16:52 +02:00
parent bf32e72414
commit dd70b84ef0
16 changed files with 170 additions and 155 deletions

View file

@ -1,12 +1,6 @@
-# see also the partial 'form' which is used for existing stock_changes when loading the edit!
-# see also the partial 'form' which is used for existing stock_changes when loading the edit!
-# see also the partial 'form' which is used for existing stock_changes when loading the edit!
= simple_fields_for "delivery[new_stock_changes][]", stock_change, validate: true do |f|
- f.object.quantity = '' if 0 == f.object.quantity
%tr{:id => "stock_change_stock_article_#{stock_change.stock_article.id}", :data => {:id => stock_change.stock_article.id}}
%td.sort-by-name
= f.association :stock_article, :as => :hidden
%span.stock_article_name= stock_change.stock_article.name
%td.numeric.price-per-unit #{number_to_currency stock_change.stock_article.price}/#{stock_change.stock_article.unit}
%td= f.input :quantity, :wrapper => :intable, :input_html => {:class => 'stock-change-quantity', :autocomplete => :off}
%td= link_to t('.remove_article'), "#", :class => 'remove_new_stock_change btn btn-small'
- if stock_change.stock_article.new_record?
= simple_fields_for "delivery[new_stock_changes_new_stock_article][]", stock_change do |f|
= render :partial => 'stock_change_fields', :locals => {:f => f}
- else
= simple_fields_for "delivery[new_stock_changes][]", stock_change do |f|
= render :partial => 'stock_change_fields', :locals => {:f => f}