inventory setup

This commit is contained in:
Nweni
2017-08-24 18:04:42 +06:30
parent 688ce932cc
commit 81f430b5c6
97 changed files with 1699 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
class InventoryDefinitionsController < ApplicationController
before_action :set_inventory_definition, only: [:show, :edit, :update, :destroy]
# GET /inventory_definitions
# GET /inventory_definitions.json
def index
@inventory_definitions = InventoryDefinition.all
end
# GET /inventory_definitions/1
# GET /inventory_definitions/1.json
def show
end
# GET /inventory_definitions/new
def new
@inventory_definition = InventoryDefinition.new
end
# GET /inventory_definitions/1/edit
def edit
end
# POST /inventory_definitions
# POST /inventory_definitions.json
def create
@inventory_definition = InventoryDefinition.new(inventory_definition_params)
respond_to do |format|
if @inventory_definition.save
format.html { redirect_to @inventory_definition, notice: 'Inventory definition was successfully created.' }
format.json { render :show, status: :created, location: @inventory_definition }
else
format.html { render :new }
format.json { render json: @inventory_definition.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /inventory_definitions/1
# PATCH/PUT /inventory_definitions/1.json
def update
respond_to do |format|
if @inventory_definition.update(inventory_definition_params)
format.html { redirect_to @inventory_definition, notice: 'Inventory definition was successfully updated.' }
format.json { render :show, status: :ok, location: @inventory_definition }
else
format.html { render :edit }
format.json { render json: @inventory_definition.errors, status: :unprocessable_entity }
end
end
end
# DELETE /inventory_definitions/1
# DELETE /inventory_definitions/1.json
def destroy
@inventory_definition.destroy
respond_to do |format|
format.html { redirect_to inventory_definitions_url, notice: 'Inventory definition was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_inventory_definition
@inventory_definition = InventoryDefinition.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def inventory_definition_params
params.fetch(:inventory_definition, {})
end
end

View File

@@ -0,0 +1,74 @@
class StockCheckItemsController < ApplicationController
before_action :set_stock_check_item, only: [:show, :edit, :update, :destroy]
# GET /stock_check_items
# GET /stock_check_items.json
def index
@stock_check_items = StockCheckItem.all
end
# GET /stock_check_items/1
# GET /stock_check_items/1.json
def show
end
# GET /stock_check_items/new
def new
@stock_check_item = StockCheckItem.new
end
# GET /stock_check_items/1/edit
def edit
end
# POST /stock_check_items
# POST /stock_check_items.json
def create
@stock_check_item = StockCheckItem.new(stock_check_item_params)
respond_to do |format|
if @stock_check_item.save
format.html { redirect_to @stock_check_item, notice: 'Stock check item was successfully created.' }
format.json { render :show, status: :created, location: @stock_check_item }
else
format.html { render :new }
format.json { render json: @stock_check_item.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /stock_check_items/1
# PATCH/PUT /stock_check_items/1.json
def update
respond_to do |format|
if @stock_check_item.update(stock_check_item_params)
format.html { redirect_to @stock_check_item, notice: 'Stock check item was successfully updated.' }
format.json { render :show, status: :ok, location: @stock_check_item }
else
format.html { render :edit }
format.json { render json: @stock_check_item.errors, status: :unprocessable_entity }
end
end
end
# DELETE /stock_check_items/1
# DELETE /stock_check_items/1.json
def destroy
@stock_check_item.destroy
respond_to do |format|
format.html { redirect_to stock_check_items_url, notice: 'Stock check item was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_stock_check_item
@stock_check_item = StockCheckItem.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def stock_check_item_params
params.fetch(:stock_check_item, {})
end
end

View File

@@ -0,0 +1,74 @@
class StockChecksController < ApplicationController
before_action :set_stock_check, only: [:show, :edit, :update, :destroy]
# GET /stock_checks
# GET /stock_checks.json
def index
@stock_checks = StockCheck.all
end
# GET /stock_checks/1
# GET /stock_checks/1.json
def show
end
# GET /stock_checks/new
def new
@stock_check = StockCheck.new
end
# GET /stock_checks/1/edit
def edit
end
# POST /stock_checks
# POST /stock_checks.json
def create
@stock_check = StockCheck.new(stock_check_params)
respond_to do |format|
if @stock_check.save
format.html { redirect_to @stock_check, notice: 'Stock check was successfully created.' }
format.json { render :show, status: :created, location: @stock_check }
else
format.html { render :new }
format.json { render json: @stock_check.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /stock_checks/1
# PATCH/PUT /stock_checks/1.json
def update
respond_to do |format|
if @stock_check.update(stock_check_params)
format.html { redirect_to @stock_check, notice: 'Stock check was successfully updated.' }
format.json { render :show, status: :ok, location: @stock_check }
else
format.html { render :edit }
format.json { render json: @stock_check.errors, status: :unprocessable_entity }
end
end
end
# DELETE /stock_checks/1
# DELETE /stock_checks/1.json
def destroy
@stock_check.destroy
respond_to do |format|
format.html { redirect_to stock_checks_url, notice: 'Stock check was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_stock_check
@stock_check = StockCheck.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def stock_check_params
params.fetch(:stock_check, {})
end
end

View File

@@ -0,0 +1,74 @@
class StockJournalsController < ApplicationController
before_action :set_stock_journal, only: [:show, :edit, :update, :destroy]
# GET /stock_journals
# GET /stock_journals.json
def index
@stock_journals = StockJournal.all
end
# GET /stock_journals/1
# GET /stock_journals/1.json
def show
end
# GET /stock_journals/new
def new
@stock_journal = StockJournal.new
end
# GET /stock_journals/1/edit
def edit
end
# POST /stock_journals
# POST /stock_journals.json
def create
@stock_journal = StockJournal.new(stock_journal_params)
respond_to do |format|
if @stock_journal.save
format.html { redirect_to @stock_journal, notice: 'Stock journal was successfully created.' }
format.json { render :show, status: :created, location: @stock_journal }
else
format.html { render :new }
format.json { render json: @stock_journal.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /stock_journals/1
# PATCH/PUT /stock_journals/1.json
def update
respond_to do |format|
if @stock_journal.update(stock_journal_params)
format.html { redirect_to @stock_journal, notice: 'Stock journal was successfully updated.' }
format.json { render :show, status: :ok, location: @stock_journal }
else
format.html { render :edit }
format.json { render json: @stock_journal.errors, status: :unprocessable_entity }
end
end
end
# DELETE /stock_journals/1
# DELETE /stock_journals/1.json
def destroy
@stock_journal.destroy
respond_to do |format|
format.html { redirect_to stock_journals_url, notice: 'Stock journal was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_stock_journal
@stock_journal = StockJournal.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def stock_journal_params
params.fetch(:stock_journal, {})
end
end