Refactored stockit, delivery an stock_takings.
This commit is contained in:
parent
d4715fef4b
commit
fc1d130113
20 changed files with 145 additions and 296 deletions
|
|
@ -1,35 +1,10 @@
|
|||
- remote_form_for stock_article, :url => add_stock_article_stock_takings_path do |form|
|
||||
= form.error_messages
|
||||
%p
|
||||
Lieferantin
|
||||
%br/
|
||||
= form.select :supplier_id, Supplier.without_deleted(:order => 'name').collect{ |s| [s.name, s.id] }
|
||||
%p
|
||||
Name
|
||||
%br/
|
||||
= form.text_field :name
|
||||
%p
|
||||
Einheit
|
||||
%br/
|
||||
= form.text_field :unit
|
||||
%p
|
||||
Notiz
|
||||
%br/
|
||||
= form.text_field :note
|
||||
%p
|
||||
Nettopreis
|
||||
%br/
|
||||
= form.text_field :price
|
||||
%p
|
||||
MwSt
|
||||
%br/
|
||||
= form.text_field :tax, :value => (stock_article.tax || 7.0)
|
||||
%p
|
||||
Pfand
|
||||
%br/
|
||||
= form.text_field :deposit
|
||||
%p
|
||||
Kategorie:
|
||||
= form.select :article_category_id, ArticleCategory.all(:order => 'name').collect { |c| [c.name, c.id] }
|
||||
%p
|
||||
= submit_tag "Lagerartikel hinzufügen"
|
||||
- simple_form_for stock_article, add_stock_article_stock_takings_path, :remote => true do |f|
|
||||
= f.association :supplier
|
||||
= f.input :name
|
||||
= f.input :unit
|
||||
= f.input :note
|
||||
= f.input :price
|
||||
= f.input :tax
|
||||
= f.input :deposit
|
||||
= f.association :article_category
|
||||
= f.submit
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
%p
|
||||
- fields_for "stock_taking[stock_change_attributes][]", stock_change do |form|
|
||||
- article = stock_change.stock_article
|
||||
|
||||
= simple_fields_for "stock_taking[stock_change_attributes][]", stock_change do |form|
|
||||
= form.hidden_field :stock_article_id
|
||||
= "Menge (#{article.quantity_available})"
|
||||
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
|
||||
%b=h truncate(article.name)
|
||||
= "(#{number_to_currency(article.price)} / #{article.unit})"
|
||||
= "Menge (#{stock_change.stock_article.quantity_available})"
|
||||
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
|
||||
%b=h truncate(stock_change.stock_article.name)
|
||||
= "(#{number_to_currency(stock_change.stock_article.price)} / #{stock_change.stock_article.unit})"
|
||||
|
|
|
|||
|
|
@ -1,16 +1,7 @@
|
|||
- title "Inventur bearbeiten"
|
||||
|
||||
- form_for(@stock_taking) do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
%b Datum
|
||||
%br/
|
||||
= f.date_select :date
|
||||
%p
|
||||
%b Notiz
|
||||
%br/
|
||||
= f.text_area :note, :size => "28x7"
|
||||
%p
|
||||
= f.submit "Invenur speichern"
|
||||
|
|
||||
= link_to "Abbrechen", stock_takings_path
|
||||
- simple_form_for(@stock_taking) do |f|
|
||||
= f.input :date
|
||||
= f.input :note
|
||||
= f.submit
|
||||
= link_to "oder abbrechen", stock_takings_path
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
- title "Inventurübersicht"
|
||||
|
||||
%p
|
||||
= link_to "Neue Iniventur anlegen", new_stock_taking_path
|
||||
= link_to "Neue Inventur anlegen", new_stock_taking_path
|
||||
|
|
||||
= link_to "Lager", stock_articles_path
|
||||
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
- for stock_taking in @stock_takings
|
||||
%tr
|
||||
%td= link_to format_date(stock_taking.date), stock_taking
|
||||
%td=h truncate stock_taking.note
|
||||
%td= truncate stock_taking.note
|
||||
%td= link_to 'Anzeigen', stock_taking
|
||||
%td= link_to 'Bearbeiten', edit_stock_taking_path(stock_taking)
|
||||
%td= link_to 'Löschen', stock_taking, :confirm => 'Are you sure?', :method => :delete
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
Loading…
Add table
Add a link
Reference in a new issue