Initial commit of foodsoft 2
This commit is contained in:
commit
5b9a7e05df
657 changed files with 70444 additions and 0 deletions
27
app/views/articles/_article_row.rhtml
Normal file
27
app/views/articles/_article_row.rhtml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<td>
|
||||
<%= check_box_tag 'selected_articles[]', @article.id.to_s, false, {:id => "checkbox_#{@article.id.to_s}", :onclick => "checkRow('#{@article.id.to_s}')"} %>
|
||||
</td>
|
||||
<td><%=h @article.name %></td>
|
||||
<td><%= @article.origin %></td>
|
||||
<td><%=h truncate(@article.article_category.name, 11) if @article.article_category%></td>
|
||||
<td><%=h @article.unit %></td>
|
||||
<td><%=h truncate(@article.note, 15) %></td>
|
||||
<td><%= @article.unit_quantity %></td>
|
||||
<td class="currency">
|
||||
<acronym title="zuletzt geändert: <%= format_date(@article.updated_at) %>
|
||||
| Brutto: <%= number_to_currency(@article.gross_price) %>">
|
||||
<%= number_to_currency(@article.net_price) %>
|
||||
</acronym>
|
||||
</td>
|
||||
<td><%= number_to_percentage(@article.tax) if @article.tax != 0 %></td>
|
||||
<td><%= number_to_currency(@article.deposit) if @article.deposit != 0 %></td>
|
||||
<td><%= link_to_remote(image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Artikel ändern', :onclick => "checkRow('#{@article.id.to_s}')"),
|
||||
:url => {:action => 'editArticle', :id => @article },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')") %>
|
||||
<%= link_to_remote(image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => 'Artikel löschen', :onclick => "checkRow('#{@article.id.to_s}')"),
|
||||
:url => { :action => 'destroyArticle', :id => @article },
|
||||
:confirm => 'Bist du sicher?',
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')")%></td>
|
||||
|
||||
9
app/views/articles/_destroyActiveArticle.haml
Normal file
9
app/views/articles/_destroyActiveArticle.haml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
%tr.edit_inline{:id=> "edit_"+@article.id.to_s}
|
||||
%td{:colspan=>"10"}
|
||||
=h @article.name
|
||||
wird in laufenden Bestellungen verwendet und kann nicht gelöscht werden.
|
||||
Bitte zuerst den Artikel aus den Bestellungen
|
||||
= link_to "entfernen", :controller => 'orders', :action => 'edit', :id => @order
|
||||
oder
|
||||
= link_to_function 'abbrechen', "Element.remove('edit_#{@article.id.to_s}')"
|
||||
|
||||
14
app/views/articles/_edit.haml
Normal file
14
app/views/articles/_edit.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
%h2
|
||||
Bearbeiten von
|
||||
= @article.name
|
||||
zuletzt aktualisiert am:
|
||||
= format_time(@article.updated_at)
|
||||
|
||||
- form_remote_tag :url => { :action => 'updateArticle', :id => @article}, :html => {:id => "edit"}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
= render :partial => "form"
|
||||
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function "Abbrechen", "Element.hide('edit_article')"
|
||||
69
app/views/articles/_form.rhtml
Normal file
69
app/views/articles/_form.rhtml
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<%= error_messages_for 'article' %>
|
||||
<!--[form:article]-->
|
||||
<p>
|
||||
<b>Verfügbar?</b> <label for="article_availability"><%= check_box 'article', 'availability' %></label>
|
||||
</p>
|
||||
<table style="width: 20em">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Herkunft</th>
|
||||
<th>Herstellerin</th>
|
||||
<th>Einheit</th>
|
||||
<th>Notiz</th>
|
||||
<th>Kategorie</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="article_name"><%= text_field 'article', 'name', :size => 15 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_origin"><%= text_field 'article', 'origin', :size => 5 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_manufacturer"><%= text_field 'article', 'manufacturer', :size => 8 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_unit"><%= text_field 'article', 'unit', :size => 5 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_note"><%= text_field 'article', 'note', :size => 15 %></label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="article_article_category"><%= select('article', 'article_category_id', ArticleCategory.find(:all, :order => 'name').collect {|a| [ a.name, a.id ] }) %></label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
<table style="width:35em">
|
||||
<tr>
|
||||
<th>netto Preis</th>
|
||||
<th>Gebindegröße</th>
|
||||
<th>Artikelnummer</th>
|
||||
<th>Steuer</th>
|
||||
<th>Pfand</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label for="article_net_price">
|
||||
<%= text_field 'article', 'net_price', :size => 5%></label></td>
|
||||
|
||||
<td><label for="article_unit_quantity">
|
||||
<%= text_field 'article', 'unit_quantity', :size => 5%></label></td>
|
||||
|
||||
<td><label for="article_order_number">
|
||||
<%= text_field 'article', 'order_number', :size => 10%></label></td>
|
||||
|
||||
<td><label for="article_tax">
|
||||
<%= text_field 'article', 'tax', :size => 5%></label></td>
|
||||
|
||||
<td><label for="article_deposit">
|
||||
<%= text_field 'article', 'deposit', :size => 5%></label></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= hidden_field 'article', 'shared_updated_on' %>
|
||||
<%= hidden_field 'article', 'supplier_id' %>
|
||||
<!--[eoform:article]-->
|
||||
24
app/views/articles/_import_search_results.haml
Normal file
24
app/views/articles/_import_search_results.haml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
%p= pagination_links_remote @articles, 10, {:import_query => params[:import_query], :lists => params[:lists], :regional => params[:regional]}
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Herkunft
|
||||
%th Hersteller
|
||||
%th Notiz
|
||||
%th{:style => "width:4em"} Preis
|
||||
%th Einheit
|
||||
%th GebGröße
|
||||
%th
|
||||
%tbody
|
||||
- for article in @articles
|
||||
%tr{:class => cycle('even','odd', :name => 'import_search_results')}
|
||||
%td= highlight_phrase article.name, params[:import_query]
|
||||
%td= article.origin
|
||||
%td= article.manufacturer
|
||||
%td= article.note
|
||||
%td= number_to_currency(article.price)
|
||||
%td= article.unit
|
||||
%td= article.unit_quantity
|
||||
%td= link_to_remote 'importieren', :url => {:action => 'new_import', :id => article, :supplier_id => @supplier.id}
|
||||
|
||||
61
app/views/articles/_list.haml
Normal file
61
app/views/articles/_list.haml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
%p
|
||||
=_ 'Number of found articles :'
|
||||
%b= @total
|
||||
|
||||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @articles, @per_page, {:sort => params[:sort]}
|
||||
%td{:style => "text-align:right"}
|
||||
- if @total > 30
|
||||
= items_per_page([30, 100, 500])
|
||||
|
||||
%table#articles_table.list.articles
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th[sort_td_class_helper "name"]
|
||||
= sort_link_helper _("Name"), "name", @supplier.id
|
||||
%th
|
||||
%th[sort_td_class_helper "category"]
|
||||
= sort_link_helper _("Category"), "category", @supplier.id
|
||||
%th[sort_td_class_helper "unit"]
|
||||
= sort_link_helper _("Unit"), "unit", @supplier.id
|
||||
%th[sort_td_class_helper "note"]
|
||||
= sort_link_helper _("Note"), "note", @supplier.id
|
||||
%th{:style => "width: 4em;"}=_ 'UnitQu'
|
||||
%th{:style => "width: 4em;"}=_ 'Price'
|
||||
%th{:style => "width: 3.5em;"}=_ 'Tax'
|
||||
%th{:style => "width: 4em;"}=_ 'Deposit'
|
||||
%th{:style => "width: 3em;"}
|
||||
|
||||
%tbody#listbody
|
||||
|
||||
- if @total > 0
|
||||
- for @article in @articles
|
||||
%tr{ :class => cycle('even','odd') + (!@article.availability ? ' unavailable' : '') + ((@article.recently_updated && @article.availability) ? " just_updated" : ""), |
|
||||
:id => @article.id, :onclick => "checkRow('#{@article.id.to_s}')"} |
|
||||
= render :partial => 'article_row'
|
||||
%tfoot
|
||||
%tr
|
||||
%td{:colspan => '10'}
|
||||
%input{:type => 'checkbox', :name => 'checkall', :onclick => 'checkUncheckAll(this)'}/
|
||||
%select{:name => "selected_action"}
|
||||
%option{:value => '', :selected => 'selected'} Aktion wählen ...
|
||||
%option{:value => "destroy", :onclick => "if (confirm('Willst Du wirklich alle gewählten Artikel löschen?')) { formSubmit(); }; return false;"} Artikel löschen
|
||||
%option{:value => "setNotAvailable", :onclick => 'formSubmit();'} Artikel sind nicht mehr verfügbar
|
||||
%option{:value => "setAvailable", :onclick => 'formSubmit();'} Artikel sind verfügbar
|
||||
|
||||
= hidden_field_tag 'supplier', @supplier.id
|
||||
%p
|
||||
= pagination_links_remote @articles, @per_page, {:sort => params[:sort]}
|
||||
|
||||
:plain
|
||||
<script type="text/javascript">
|
||||
function formSubmit() {
|
||||
$("articlesInListForm").submit()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
5
app/views/articles/_new.haml
Normal file
5
app/views/articles/_new.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%h3 Neuer Artikel
|
||||
- form_remote_tag :url => { :action => 'createArticle'} do
|
||||
= render :partial => 'articles/form'
|
||||
= submit_tag "Speichern"
|
||||
= link_to_function('Abbrechen', 'Element.hide("edit_article")')
|
||||
2
app/views/articles/_new_article_row.haml
Normal file
2
app/views/articles/_new_article_row.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
%tr{:class => cycle('even','odd'), :id => @article.id, :onclick => "checkRow('#{@article.id.to_s}')"}
|
||||
= render :partial => 'article_row'
|
||||
61
app/views/articles/edit_all.rhtml
Normal file
61
app/views/articles/edit_all.rhtml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<h1>Alle Artikel von <%= @supplier.name %> bearbeiten</h1>
|
||||
|
||||
<div class="single_column" style="width:100%">
|
||||
<div class="box_title">
|
||||
<h2>
|
||||
<div id="change_supplier">
|
||||
<% form_tag do -%>
|
||||
<select onchange="redirectTo(this)" style="font-size: 0.9em;margin-left:1em;">
|
||||
<%= options_for_select(Supplier.find(:all).collect {|s| [ s.name, url_for(:action => "edit_all", :id => s)] }, url_for(:action => "edit_all", :id => @supplier.id)) %>
|
||||
</select>
|
||||
<% end %>
|
||||
</div>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="box column_content">
|
||||
<div id="links"><%= link_to 'zurück zur Liste', :action => 'list', :id => @supplier.id %></div>
|
||||
<p>
|
||||
<i>
|
||||
Pflichtfelder sind: Name, Einheit, (netto) Preis und Bestellnummer.
|
||||
</i>
|
||||
</p>
|
||||
<% form_tag(:action => 'update_all', :id => @supplier) do %>
|
||||
<table id="articles_table" class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><acronym title="verfügbar">verf.</acronym></th>
|
||||
<th>Name</th>
|
||||
<th>Einheit</th>
|
||||
<th><acronym title="Netto!">Preis</acronym></th>
|
||||
<th><acronym title="Gebindegröße">GebGr</acronym></th>
|
||||
<th>Best.Nr.</th>
|
||||
<th>Notiz</th>
|
||||
<th>Kategorie</th>
|
||||
<th>MwSt.</th>
|
||||
<th>Pfand</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<% @supplier.articles.find(:all, :order => 'article_categories.name, articles.name', :include => [:article_category]).each do |@article| %>
|
||||
<tr class="<%= cycle('even', 'odd') %>"<%= ' style="background-color: yellow"' if @failedArticle == @article %>>
|
||||
<td colspan="2"><label for="article_availability"><%= check_box 'article[]', 'availability' %></label>
|
||||
<label for="article_name"><%= text_field( 'article[]', 'name', :size => 0) %></label></td>
|
||||
<td><label for="article_unit"><%= text_field 'article[]', 'unit', :size => 5 %></label></td>
|
||||
<td><label for="article_net_price"><%= text_field 'article[]', 'net_price', :size => 4 %></label></td>
|
||||
<td><label for="article_unit_quantity"><%= text_field 'article[]', 'unit_quantity', :size => 4 %></label></td>
|
||||
<td><label for="article_order_number"><%= text_field 'article[]', 'order_number', :size => 6 %></label></td>
|
||||
<td><label for="article_note"><%= text_field 'article[]', 'note', :size => 15 %></label></td>
|
||||
<td><label for="article_article_category"><%= select('article[]', 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] }, { :include_blank => true })%></label></td>
|
||||
<td><label for="article_tax"><%= text_field 'article[]', 'tax', :size => 4 %></label></td>
|
||||
<td><label for="article_deposit"><%= text_field 'article[]', 'deposit', :size => 4 %></label></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<!--[eoform:article]-->
|
||||
</tbody>
|
||||
</table><br />
|
||||
<i>Achtung, alle Artikel werden aktualisiert!</i><br />
|
||||
<%= hidden_field 'supplier', 'id' %>
|
||||
<%= submit_tag 'Alle aktualisieren'%>
|
||||
| <%= link_to 'Abbrechen', :action => 'list', :id => @supplier.id %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
29
app/views/articles/index.haml
Normal file
29
app/views/articles/index.haml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
%h1 Manage die Artikeldatenbank
|
||||
.left_column{:style => "width:44%"}
|
||||
.box_title
|
||||
%h2 Artikel anzeigen
|
||||
.column_content
|
||||
%p
|
||||
%i
|
||||
Hier kannst du Artikel anzeigen, ändern und neue erstellen
|
||||
%br/
|
||||
Wähle einen Lieferanten:
|
||||
%ul
|
||||
- @suppliers.each do |supplier|
|
||||
%li
|
||||
%b= link_to supplier.name, :action => "list", :id => supplier.id
|
||||
(
|
||||
= supplier.articles.count
|
||||
Artikel )
|
||||
%hr/
|
||||
%p
|
||||
%i
|
||||
hier kannst du neue Artikel aus einer csv-Datei in die Datenbank
|
||||
= link_to 'hochladen', :action => 'upload_articles'
|
||||
|
||||
.right_column{:style => "width:53%"}
|
||||
.box_title
|
||||
%h2 Artikelkategorien
|
||||
.column_content#categories
|
||||
#category_form.box.edit_form{:style => "display:none;margin-bottom:1em;"}
|
||||
#category_list= render :partial => 'article_categories/list'
|
||||
70
app/views/articles/list.haml
Normal file
70
app/views/articles/list.haml
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
%h1
|
||||
=_ 'Articles from'
|
||||
= @supplier.name
|
||||
|
||||
// import menu
|
||||
- unless @supplier.shared_supplier.nil?
|
||||
.menu{:style => 'width: 14em'}
|
||||
%ul
|
||||
%li
|
||||
=_ 'External database'
|
||||
%ul
|
||||
%li= link_to_function _('search/import'), "Element.toggle('import')"
|
||||
%li= link_to _('sync'), :action => 'sync_articles', :id => @supplier
|
||||
|
||||
|
||||
#change_supplier{:style => "padding:0 0 0.5em 0.7em;"}
|
||||
%span{:style => "float:left"}
|
||||
=_ 'Change supplier:'
|
||||
- form_tag do
|
||||
%select{:onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;"}
|
||||
= options_for_select(@suppliers.collect {|s| [ s.name, url_for(:action => "list", :id => s)] }, url_for(:action => "list", :id => @supplier.id))
|
||||
|
||||
- unless @supplier.shared_supplier.nil?
|
||||
#import.single_column{:style => "display:none; clear:both"}
|
||||
.box_title
|
||||
%h2=_ 'Import articles'
|
||||
.column_content
|
||||
#search{:style => "padding-bottom:3em"}
|
||||
- form_remote_tag :url => {:action => "list_shared_articles", :id => @supplier}, :before => "Element.show('loader')", :success => "Element.hide('loader')" do
|
||||
= text_field_tag :import_query, params['import_query'], :size => 10
|
||||
= submit_tag _('Search articles')
|
||||
- if @supplier.shared_supplier.lists
|
||||
=_ "Search in following lists: "
|
||||
- @supplier.shared_supplier.lists.each do |token, name|
|
||||
= check_box_tag "lists[#{token}]", "1", true
|
||||
= name
|
||||
|
|
||||
=_ "only regional:"
|
||||
= check_box_tag "regional", "1", false
|
||||
#search_results
|
||||
// "import_search_results" will be rendered
|
||||
= link_to_function _('Close'), "Element.hide('import')"
|
||||
|
||||
.single_column{:style => 'width:100%; clear:both'}
|
||||
.box_title
|
||||
.column_content
|
||||
#links
|
||||
%b= link_to_remote( _('New article'), :url => {:action => 'newArticle', :supplier => @supplier}, :before => "Element.show('loader')", :success => "Element.hide('loader')")
|
||||
|
|
||||
= link_to _('Edit all'), :action => 'edit_all', :id => @supplier
|
||||
|
|
||||
= link_to _('Upload articles'), :action => 'upload_articles'
|
||||
|
|
||||
= link_to_if @current_user.role_orders?, _('Create order'), {:controller => 'orders', :action => 'new', :id => @supplier }
|
||||
|
||||
#article_filter
|
||||
#article_search_form{:style=>"display:inline;"}
|
||||
- form_remote_tag :url => {:action => "list", :id => @supplier}, :before => "Element.show('loader')", :success => "Element.hide('loader')" do
|
||||
%label{:for => 'article_name'}=_ "Search in article name: "
|
||||
= text_field_tag("query", params['query'], :size => 10 )
|
||||
= submit_tag _('Search')
|
||||
|
||||
%form{ :method => 'post', :action => url_for(:action => 'update_selected_articles', :only_path => true), :id => 'articlesInListForm'}
|
||||
#table
|
||||
= render :partial => 'list'
|
||||
%br/
|
||||
= link_to _('Back'), :action => 'index'
|
||||
#edit_article{:style => "display:none"}
|
||||
|
||||
|
||||
40
app/views/articles/parse_articles.haml
Normal file
40
app/views/articles/parse_articles.haml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
%h1=_ "Upload Articles"
|
||||
%p
|
||||
%i
|
||||
=_ "Please check the parsed articles and choose a supplier at the end of page."
|
||||
%br/
|
||||
=_ "At the moment there is now checking of dublicate articles."
|
||||
|
||||
- form_tag(:action => 'create_articles_from_file') do
|
||||
%table.list
|
||||
%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
|
||||
%tr{:class => cycle('even', 'odd')}
|
||||
%td= text_field 'article[]', 'order_number', :size => 6
|
||||
%td= text_field 'article[]', 'name', :size => 0
|
||||
%td= text_field 'article[]', 'note', :size => 15
|
||||
%td= text_field 'article[]', 'manufacturer', :size => 6
|
||||
%td= text_field 'article[]', 'origin', :size => 6
|
||||
%td= text_field 'article[]', 'unit', :size => 5
|
||||
%td= text_field 'article[]', 'net_price', :size => 4
|
||||
%td= text_field 'article[]', 'tax', :size => 4
|
||||
%td= text_field 'article[]', 'deposit', :size => 4
|
||||
%td= text_field 'article[]', 'unit_quantity', :size => 4
|
||||
%td= select('article[]', 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] })
|
||||
%p
|
||||
=_ "Choose a supplier:"
|
||||
= select('supplier', 'id', Supplier.find(:all).collect {|s| [ s.name, s.id ] }, :selected => nil)
|
||||
= submit_tag _("Save articles")
|
||||
%p= link_to _("Back"), :action => 'upload_articles'
|
||||
|
||||
70
app/views/articles/sync_articles.haml
Normal file
70
app/views/articles/sync_articles.haml
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
%h1 Artikel mit externer Datenbank synchronisieren
|
||||
|
||||
- form_tag :action => 'update_all', :id => @supplier, :sync => "1" do
|
||||
%h2 Auslisten ...
|
||||
%p
|
||||
- unless @outlisted_articles.empty?
|
||||
Folgende Artikel wurden ausgelistet und werden
|
||||
%b gelöscht:
|
||||
%ul
|
||||
- for article in @outlisted_articles
|
||||
%li
|
||||
= hidden_field_tag "outlisted_articles[#{article.id}]", '1'
|
||||
= article.name
|
||||
- else
|
||||
%i Es müssen keine Artikel gelöscht werden.
|
||||
%hr/
|
||||
%h2 Aktualisieren ...
|
||||
%p
|
||||
%i
|
||||
%b= @updated_articles.size
|
||||
Artikel müssen aktualisiert werden:
|
||||
%p
|
||||
%i
|
||||
Jeder Artikel wird doppelt angezeigt. Die alten Werte sind grau und die Textfelder sind mit den aktuellen
|
||||
Werten vorausgefüllt.
|
||||
%br/
|
||||
Abweichungen zu den alten Artikeln sind gelb markiert.
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Notiz
|
||||
%th Hersteller
|
||||
%th Herkunft
|
||||
%th Einheit
|
||||
%th GebGr
|
||||
%th Preis
|
||||
%th MwSt.
|
||||
%th Pfand
|
||||
%th Kategorie
|
||||
- @updated_articles.each do |@article, unequal_attributes|
|
||||
- article = Article.find(@article.id)
|
||||
%tr{:style => 'color:grey'}
|
||||
%td= article.name
|
||||
%td= article.note
|
||||
%td= article.manufacturer
|
||||
%td= article.origin
|
||||
%td= article.unit
|
||||
%td= article.unit_quantity
|
||||
%td= article.net_price
|
||||
%td= article.tax
|
||||
%td= article.deposit
|
||||
%td= article.article_category.name if article.article_category
|
||||
%tr
|
||||
%td{:style => highlight_new(unequal_attributes, :name)}
|
||||
= text_field 'article[]', 'name', :size => 0
|
||||
= hidden_field 'article[]', 'shared_updated_on'
|
||||
%td{:style => highlight_new(unequal_attributes, :note)}= text_field 'article[]', 'note', :size => 15
|
||||
%td{:style => highlight_new(unequal_attributes, :manufacturer)}= text_field 'article[]', 'manufacturer', :size => 10
|
||||
%td{:style => highlight_new(unequal_attributes, :origin)}= text_field 'article[]', 'origin', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :unit)}= text_field 'article[]', 'unit', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :unit_quantity)}= text_field 'article[]', 'unit_quantity', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :net_price)}= text_field 'article[]', 'net_price', :size => 5
|
||||
%td{:style => highlight_new(unequal_attributes, :tax)}= text_field 'article[]', 'tax', :size => 4
|
||||
%td{:style => highlight_new(unequal_attributes, :deposit)}= text_field 'article[]', 'deposit', :size => 4
|
||||
%td= select 'article[]', 'article_category_id', ArticleCategory.find(:all).collect {|a| [ a.name, a.id ] }, { :include_blank => true }
|
||||
%hr/
|
||||
= hidden_field 'supplier', 'id'
|
||||
= submit_tag 'Alle löschen/aktualisieren'
|
||||
|
|
||||
= link_to 'Abbrechen', :action => 'list', :id => @supplier
|
||||
18
app/views/articles/upload_articles.haml
Normal file
18
app/views/articles/upload_articles.haml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
%h1=_ "Upload articles"
|
||||
%p
|
||||
%i
|
||||
=_ 'The file-type must be "csv" (textfile). Use a semicolon (";") to seperate the fields and double quotes ("Bananas...") for the text.'
|
||||
%br/
|
||||
=_ 'The character-set has to be "UTF-8". The first row, maybe used for headers, will be ignored.'
|
||||
%p
|
||||
%i
|
||||
=_ "Correct order of the columns:"
|
||||
%br/
|
||||
= [_("Status (x=outlistet)"), _("Number"), _("Name"), _("Note"), _("Manufacturer"), _("Origin"), |
|
||||
_("Unit"), _("Net price"), _("Tax"), _("Deposit"), _("Unit quantity"), |
|
||||
_("Scale quantity"), _("Scale price"), _("Category")].join(" | ") |
|
||||
|
||||
#uploadArticles.uploadForm
|
||||
- form_for(:articles, :url => {:action => 'parse_articles'}, :html => { :multipart => true }) do |form|
|
||||
%p= form.file_field("file")
|
||||
%p= submit_tag _("Upload articles")
|
||||
Loading…
Add table
Add a link
Reference in a new issue