inventory
This commit is contained in:
17
app/controllers/base_inventory_controller.rb
Normal file
17
app/controllers/base_inventory_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class BaseInventoryController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "inventory"
|
||||
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
def current_user
|
||||
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
|
||||
end
|
||||
|
||||
end
|
||||
6
app/controllers/inventory/inventory_controller.rb
Normal file
6
app/controllers/inventory/inventory_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Inventory::InventoryController < BaseInventoryController
|
||||
|
||||
def index
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
class InventoryDefinitionsController < ApplicationController
|
||||
class Inventory::InventoryDefinitionsController < BaseInventoryController
|
||||
before_action :set_inventory_definition, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /inventory_definitions
|
||||
|
||||
@@ -55,6 +55,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card" id="backend" onclick="location.href='<%= inventory_inventory_path %>'">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Inventory</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 col-lg-8">
|
||||
@@ -274,4 +285,3 @@
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
17
app/views/inventory/inventory/index.html.erb
Normal file
17
app/views/inventory/inventory/index.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
# Hello Inventory
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||
<button id="refreshbutton" type="button" class="btn btn-block"> Inventory Product Lists</button>
|
||||
<button id="cash_in" type="button" class="btn btn-block btn-primary"> Stock Taking </button>
|
||||
<button id="cash_out" type="button" class="btn btn-block btn-primary"> Stock Check Report</button>
|
||||
|
||||
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
|
||||
<button id="back" type="button" class="btn btn-block btn-primary"><i class="fa fa-home fa-lg"></i> Back
|
||||
</button>
|
||||
<%end%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
34
app/views/layouts/inventory.html.erb
Normal file
34
app/views/layouts/inventory.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="author" content=""/>
|
||||
|
||||
<title>SmartSales : Restaurant</title>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<%= stylesheet_link_tag 'inventory', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
<%= stylesheet_link_tag 'jquery-confirm', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'jquery-confirm', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= render 'layouts/header_orgiami' %>
|
||||
<div class="container-fluid">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if !flash["errors"]%>
|
||||
<div class="alert fade in">
|
||||
<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
|
||||
<%=message%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -318,6 +318,7 @@ Rails.application.routes.draw do
|
||||
# ----------- Inventory ---------------------------
|
||||
|
||||
namespace :inventory do
|
||||
get 'inventory' => 'inventory#index'
|
||||
resources :stock_check_items
|
||||
resources :stock_checks
|
||||
resources :stock_journals
|
||||
|
||||
Reference in New Issue
Block a user