Class: StockTakingsController
Instance Method Summary
collapse
current
Methods included from PathHelper
#finance_group_transactions_path
Instance Method Details
#create ⇒ Object
20
21
22
|
# File 'app/controllers/stock_takings_controller.rb', line 20
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
|
# File 'app/controllers/stock_takings_controller.rb', line 8
def new
@stock_taking = StockTaking.new
StockArticle.undeleted.each { |a| @stock_taking.stock_changes.build(stock_article: a) }
end
|
#new_on_stock_article_create ⇒ Object
See publish/subscribe design pattern in /doc.
13
14
15
16
17
18
|
# File 'app/controllers/stock_takings_controller.rb', line 13
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
24
25
26
|
# File 'app/controllers/stock_takings_controller.rb', line 24
def update
update!(notice: I18n.t('stock_takings.update.notice'))
end
|