Fixed stockit.
This commit is contained in:
parent
27c719d8da
commit
8f7e21b918
10 changed files with 132 additions and 136 deletions
|
|
@ -1,4 +1,4 @@
|
|||
- simple_form_for stock_article, add_stock_article_stock_takings_path, :remote => true do |f|
|
||||
- simple_form_for stock_article, url: add_stock_article_stock_takings_path, remote: true do |f|
|
||||
= f.association :supplier
|
||||
= f.input :name
|
||||
= f.input :unit
|
||||
|
|
|
|||
19
app/views/stock_takings/_stock_takings.html.haml
Normal file
19
app/views/stock_takings/_stock_takings.html.haml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
- if StockTaking.count > 20
|
||||
= items_per_page
|
||||
= pagination_links_remote @stock_takings
|
||||
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Datum
|
||||
%th Notiz
|
||||
%th
|
||||
%tbody
|
||||
- for stock_taking in @stock_takings
|
||||
%tr
|
||||
%td= link_to format_date(stock_taking.date), stock_taking
|
||||
%td= truncate stock_taking.note
|
||||
%td
|
||||
= link_to 'Bearbeiten', edit_stock_taking_path(stock_taking), class: 'btn btn-mini'
|
||||
= link_to 'Löschen', stock_taking, :confirm => 'Are you sure?', :method => :delete,
|
||||
class: 'btn btn-mini btn-danger'
|
||||
|
|
@ -1,25 +1,9 @@
|
|||
- title "Inventurübersicht"
|
||||
|
||||
%p
|
||||
= link_to "Neue Inventur anlegen", new_stock_taking_path
|
||||
|
|
||||
= link_to "Lager", stock_articles_path
|
||||
.well.well-small
|
||||
.btn-group
|
||||
= link_to "Neue Inventur anlegen", new_stock_taking_path, class: 'btn'
|
||||
|
||||
%table.list{:style => "width:50em"}
|
||||
%thead
|
||||
%tr
|
||||
%th Datum
|
||||
%th Notiz
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
- for stock_taking in @stock_takings
|
||||
%tr
|
||||
%td= link_to format_date(stock_taking.date), stock_taking
|
||||
%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
|
||||
#StockTakingsTable= render 'stock_takings'
|
||||
|
||||
|
||||
|
|
|
|||
1
app/views/stock_takings/index.js.haml
Normal file
1
app/views/stock_takings/index.js.haml
Normal file
|
|
@ -0,0 +1 @@
|
|||
$('#StockTakingsTable').html('#{escape_javascript(render('stock_takings'))}');
|
||||
|
|
@ -1,31 +1,24 @@
|
|||
- title "Neue Inventur anlegen"
|
||||
|
||||
.left_column{:style => "width:50%;"}
|
||||
= simple_form_for(@stock_taking) do |f|
|
||||
.box_title
|
||||
%h2 Inventur anlegen
|
||||
.column_content
|
||||
= f.input :date
|
||||
= f.input :note, :input_html => {:size => "28x7", :value => "#{@current_user.nick}: ..."}
|
||||
%h2 Lagerartikel
|
||||
%p
|
||||
%i
|
||||
Bitte trage hier alle gezählten Abweichungen vom
|
||||
= 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
|
||||
= f.submit
|
||||
= link_to "oder abbrechen", stock_takings_path
|
||||
- content_for :sidebar do
|
||||
%p
|
||||
%i
|
||||
Bitte trage hier alle gezählten Abweichungen vom
|
||||
= link_to "vorläufigen Lagerbestand", stock_articles_path
|
||||
ein. Bei Schwund benutze einfach ein Minus vor der Zahl.
|
||||
%p
|
||||
Einen neuen Lagerartikel musst Du vorher
|
||||
= link_to "anlegen", new_stock_article_path
|
||||
bevor Du Ihn hier verwenden kannst.
|
||||
|
||||
.right_column{:style => "width:45%;"}
|
||||
.box_title
|
||||
%h2 Neuen Lagerartikel anlegen
|
||||
.column_content
|
||||
%p
|
||||
// FIx this!
|
||||
Suche nach Artikeln aus dem allen Katalogen:
|
||||
= text_field_tag :article_name
|
||||
%hr/
|
||||
#stock_article_form
|
||||
= render :partial => 'stock_article_form', :locals => {:stock_article => StockArticle.new}
|
||||
|
||||
= simple_form_for(@stock_taking) do |f|
|
||||
= f.input :date, as: :date_picker
|
||||
= f.input :note, :input_html => {:size => "28x7", :value => "#{@current_user.nick}: ..."}
|
||||
%h2 Lagerartikel
|
||||
|
||||
#stock_changes
|
||||
= render :partial => 'stock_change', :collection => @stock_taking.stock_changes
|
||||
.form-actions
|
||||
= f.submit class: 'btn'
|
||||
= link_to "oder abbrechen", stock_takings_path
|
||||
|
|
@ -1,29 +1,27 @@
|
|||
- title "Inventur anzeigen"
|
||||
|
||||
%p
|
||||
Datum:
|
||||
= format_date @stock_taking.date
|
||||
%p
|
||||
Notiz:
|
||||
= simple_format @stock_taking.note
|
||||
.well.well-small
|
||||
%dl.dl-horizontal
|
||||
%dt Datum
|
||||
%dd= format_date @stock_taking.date
|
||||
%dt Notiz
|
||||
%dd= simple_format @stock_taking.note
|
||||
|
||||
%h2 Artikel
|
||||
%table.list{:style => "width:30em"}
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th Artikel
|
||||
%th Lieferantin
|
||||
%th Einheit
|
||||
%th Menge
|
||||
- for stock_change in @stock_taking.stock_changes.all :include => :stock_article
|
||||
- for stock_change in @stock_taking.stock_changes.all
|
||||
%tr
|
||||
%td= stock_change.stock_article.name
|
||||
%td= stock_change.stock_article.supplier.name
|
||||
%td= stock_change.stock_article.unit
|
||||
%td= stock_change.quantity
|
||||
|
||||
%br/
|
||||
= link_to "Bearbeiten", edit_stock_taking_path(@stock_taking)
|
||||
|
|
||||
= link_to "Inventurübersicht", stock_takings_path
|
||||
|
|
||||
= link_to "Löschen", @stock_taking, :method => :delete, :confirm => "Willst Du wirklich die Inventur löschen?"
|
||||
.btn-group
|
||||
= link_to "Bearbeiten", edit_stock_taking_path(@stock_taking), class: 'btn'
|
||||
= link_to "Inventurübersicht", stock_takings_path, class: 'btn'
|
||||
= link_to "Löschen", @stock_taking, :method => :delete, :confirm => "Willst Du wirklich die Inventur löschen?",
|
||||
class: 'btn btn-danger'
|
||||
Loading…
Add table
Add a link
Reference in a new issue