Refactored stockit, delivery an stock_takings.

This commit is contained in:
benni 2011-05-27 14:09:01 +02:00
parent d4715fef4b
commit fc1d130113
20 changed files with 145 additions and 296 deletions

View file

@ -1,19 +1,12 @@
- title "Neue Inventur anlegen"
.left_column{:style => "width:40em;"}
- form_for(@stock_taking) do |f|
.left_column{:style => "width:50%;"}
= simple_form_for(@stock_taking) do |f|
.box_title
%h2 Inventur anlegen
.column_content
= f.error_messages
%p
%b Datum
%br/
= f.date_select :date
%p
%b Notiz
%br/
= f.text_area :note, :size => "28x7", :value => "#{@current_user.nick}: ..."
= f.input :date
= f.input :note, :input_html => {:size => "28x7", :value => "#{@current_user.nick}: ..."}
%h2 Lagerartikel
%p
%i
@ -21,28 +14,18 @@
= link_to "vorläufigen Lagerbestand", stock_articles_path
ein. Bei Schwund benutze einfach ein Minus vor der Zahl.
#stock_changes
= render :partial => 'stock_change', :collection => @stock_taking.stock_changes
%p
= f.submit "Inventur anlegen"
|
= link_to "Abbrechen", stock_takings_path
= render :partial => 'stock_change', :collection => @stock_taking.stock_changes
= f.submit
= link_to "oder abbrechen", stock_takings_path
.right_column{:style => "width:30em;"}
.right_column{:style => "width:45%;"}
.box_title
%h2 Neuen Lagerartikel anlegen
.column_content
%p
:javascript
function fillNewStockArticle(text, li) {
new Ajax.Updater('stock_article_form', '/stock_takings/fill_new_stock_article_form', {
method: 'get',
parameters: {article_id: li.id}
});
}
// FIx this!
Suche nach Artikeln aus dem allen Katalogen:
= text_field_with_auto_complete :article, :name, {}, |
{:url => {:controller => 'stockit', :action => 'auto_complete_for_article_name' }, |
:after_update_element => 'fillNewStockArticle', :method => :get} |
= text_field_tag :article_name
%hr/
#stock_article_form
= render :partial => 'stock_article_form', :locals => {:stock_article => StockArticle.new}