Move StockArticle#history to StockArticle#show
This commit is contained in:
parent
a3e82f5304
commit
fef8c6d99f
8 changed files with 42 additions and 49 deletions
17
app/views/stockit/show.html.haml
Normal file
17
app/views/stockit/show.html.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
- title t('.stock_changes', :article_name => @stock_article.name)
|
||||
|
||||
%table.table.table-hover#stock_changes
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.datetime'
|
||||
%th= t '.reason'
|
||||
%th= t '.change_quantity'
|
||||
%th= t '.new_quantity'
|
||||
%tbody
|
||||
- reversed_history = @stock_article.quantity_history.reverse
|
||||
- @stock_changes.each_with_index do |stock_change, index|
|
||||
%tr
|
||||
%td= l stock_change.created_at
|
||||
%td= link_to_stock_change_reason(stock_change)
|
||||
%td= stock_change.quantity
|
||||
%td= reversed_history[index]
|
||||
Loading…
Add table
Add a link
Reference in a new issue