inventory

This commit is contained in:
Nweni
2017-08-25 09:40:59 +06:30
parent 1f7ba42e80
commit b99c503afa
11 changed files with 87 additions and 2 deletions

View 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

View File

@@ -0,0 +1,6 @@
class Inventory::InventoryController < BaseInventoryController
def index
end
end

View File

@@ -1,4 +1,4 @@
class InventoryDefinitionsController < ApplicationController
class Inventory::InventoryDefinitionsController < BaseInventoryController
before_action :set_inventory_definition, only: [:show, :edit, :update, :destroy]
# GET /inventory_definitions

View File

@@ -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>

View 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>

View 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>

View File

@@ -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