Introduced StockTaking. TODO: Dry up the stockit/stock_takings/deliveries controllers/views!

This commit is contained in:
Benjamin Meichsner 2009-02-12 18:32:20 +01:00
parent 2bb4cdb9d6
commit 951d19db6a
30 changed files with 436 additions and 55 deletions

View file

@ -1,5 +1,6 @@
- remote_form_for stock_article, :url => add_stock_article_supplier_deliveries_path(@supplier) do |form|
= form.error_messages
= form.hidden_field :supplier_id
%p
= form.label :name
@ -29,4 +30,4 @@
Kategorie:
= form.select :article_category_id, ArticleCategory.all(:order => 'name').collect { |c| [c.name, c.id] }
%p
= submit_tag "Artikel speichern"
= submit_tag "Lagerartikel speichern"

View file

@ -6,4 +6,3 @@
- article = stock_change.stock_article
%b= article.name
= "(#{number_to_currency(article.price)} / #{article.unit})"
//= link_to_function "Löschen", "$(this).up('p').remove()"

View file

@ -23,18 +23,20 @@
%p
:javascript
function fillNewStockArticle(text, li) {
new Ajax.Updater('new_stock_article', '/deliveries/fill_new_stock_article_form', {
new Ajax.Updater('stock_article_form', '/deliveries/fill_new_stock_article_form', {
method: 'get',
parameters: {article_id: li.id}
});
}
Suche nach Artikeln aus dem Katalog:
Suche nach Artikeln aus dem
%i= @supplier.name
Katalog:
= text_field_with_auto_complete :article, :name, {}, |
{:url => {:action => 'auto_complete_for_article_name', :supplier_id => @supplier.id}, |
:after_update_element => 'fillNewStockArticle'} |
{:url => {:controller => 'stockit', :action => 'auto_complete_for_article_name', :supplier_id => @supplier.id}, |
:after_update_element => 'fillNewStockArticle', :method => :get} |
%hr/
#new_stock_article
= render :partial => 'new_stock_article', :locals => {:stock_article => @supplier.stock_articles.build}
#stock_article_form
= render :partial => 'stock_article_form', :locals => {:stock_article => @supplier.stock_articles.build}
%p{:style => "clear:both"}
= link_to 'Zurück', supplier_deliveries_path(@supplier)