Refactoring of articles and article_categories. articles are now a nested resource of supplier.

This commit is contained in:
Benjamin Meichsner 2009-01-16 16:19:26 +01:00
parent b38025869a
commit 936e6ef69a
36 changed files with 597 additions and 589 deletions

View file

@ -0,0 +1,40 @@
- title "#{@supplier.name} / Artikel hochladen"
%p
%i
=_ "Please check the parsed articles and choose a supplier at the end of page."
%br/
=_ "At the moment there is no checking of dublicate articles."
- form_tag(create_from_upload_supplier_articles_path(@supplier)) do
%table
%tr
%th=_ "Number"
%th=_ "Name"
%th=_ "Note"
%th=_ "Manufacturer"
%th=_ "Origin"
%th=_ "Unit"
%th=_ "Net price"
%th=_ "Tax"
%th=_ "Deposit"
%th=_ "Unit quantity"
%th=_ "Category"
- for article in @articles
- fields_for "articles[]", article do |form|
%tr{:class => cycle('even', 'odd')}
%td= form.text_field 'order_number', :size => 6
%td= form.text_field 'name', :size => 0
%td= form.text_field 'note', :size => 15
%td= form.text_field 'manufacturer', :size => 6
%td= form.text_field 'origin', :size => 6
%td= form.text_field 'unit', :size => 5
%td= form.text_field 'net_price', :size => 4
%td= form.text_field 'tax', :size => 4
%td= form.text_field 'deposit', :size => 4
%td= form.text_field 'unit_quantity', :size => 4
%td= form.select 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] }
%p
= submit_tag "Save new Articles for #{@supplier.name}"
|
= link_to _("Back"), upload_supplier_articles_path(@supplier)