Class: StockTakingsController
Instance Method Summary
collapse
current
Methods included from PathHelper
#finance_group_transactions_path
Instance Method Details
#create ⇒ Object
22
23
24
|
# File 'app/controllers/stock_takings_controller.rb', line 22
def create
create!(notice: I18n.t('stock_takings.create.notice'))
end
|
#index ⇒ Object
4
5
6
|
# File 'app/controllers/stock_takings_controller.rb', line 4
def index
@stock_takings = StockTaking.order('date DESC').page(params[:page]).per(@per_page)
end
|
#new ⇒ Object
8
9
10
11
12
13
|
# File 'app/controllers/stock_takings_controller.rb', line 8
def new
@stock_taking = StockTaking.new
StockArticle.with_latest_versions_and_categories.undeleted.each do |a|
@stock_taking.stock_changes.build(stock_article: a)
end
end
|
#new_on_stock_article_create ⇒ Object
See publish/subscribe design pattern in /doc.
15
16
17
18
19
20
|
# File 'app/controllers/stock_takings_controller.rb', line 15
def new_on_stock_article_create stock_article = StockArticle.find(params[:stock_article_id])
@stock_change = StockChange.new(stock_article: stock_article)
render layout: false
end
|
#update ⇒ Object
26
27
28
|
# File 'app/controllers/stock_takings_controller.rb', line 26
def update
update!(notice: I18n.t('stock_takings.update.notice'))
end
|