add dashboard settings and customer create

This commit is contained in:
phyusin
2018-07-13 18:00:49 +06:30
parent 0096c1479d
commit 4783e35942
17 changed files with 106 additions and 45 deletions

View File

@@ -11,7 +11,7 @@
</div>
<div class="row clearfix">
<div class="col-lg-8 col-md-8 col-sm-8">
<div class="<%= @create_flag ? 'col-lg-8 col-md-8 col-sm-8' : 'col-lg-12 col-md-12 col-sm-12' %>">
<div class="card">
<div class="body">
<div class="row p-l-20 p-t-20">
@@ -104,20 +104,22 @@
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="card">
<div class="body" id="custom-slimscroll">
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
<% if @create_flag %>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="card">
<div class="body" id="custom-slimscroll">
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
</div>
</div>
<!-- <div class="col-lg-1 col-md-1 col-sm-1 ">
<br>
<a href="<%= dashboard_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div> -->
</div>
<!-- <div class="col-lg-1 col-md-1 col-sm-1 ">
<br>
<a href="<%= dashboard_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div> -->
</div>
<% end %>
</div>
<script type="text/javascript">

View File

@@ -75,6 +75,7 @@
<!-- CPU Usage -->
<!-- Date range for dashboard -->
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<div class="row clearfix">
<%
if !@from.nil?
@@ -124,6 +125,7 @@
</div>
</div>
<br>
<% end %>
<!-- Date range for dashboard -->
<div class="row">

View File

@@ -17,7 +17,7 @@
<!-- <a href="javascript:void(0);" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"></a> -->
<%if current_login_employee.role !="waiter" %>
<a href="javascript:void(0);" class="bars"></a>
<% if current_login_employee.role != "cashier" %>
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "account" %>
<a class="navbar-brand" href="<%=dashboard_path%>" style="margin-left: 20px;">
<% else %>
<a class="navbar-brand" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">

View File

@@ -30,7 +30,11 @@
<ul class="list">
<li class="header"><%= t :main_navigation %></li>
<li class="active">
<a href="<%= dashboard_path %>">
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "account" %>
<a href="<%= dashboard_path %>">
<% elsif current_login_employee.role == "supervisor" || current_login_employee.role == "cashier" || current_login_employee.role == "waiter" %>
<a href="<%= origami_dashboard_path %>">
<%end%>
<i class="material-icons">home</i>
<span><%= t :dashboard %></span>
</a>

View File

@@ -12,7 +12,7 @@
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8">
<div class="<%= @create_flag ? 'col-lg-8 col-md-8 col-sm-8' : 'col-lg-11 col-md-11 col-sm-11' %>">
<div class="card">
<div class="body">
<div class="row p-t-20 p-l-20">
@@ -109,28 +109,29 @@
</div>
<!-- <div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll"> -->
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%if !@dining_facility.nil?%>
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
<input type="hidden" id="table_type" name="table_type" value="<%= @dining_facility.type %>" />
<% elsif @cashier_type == 'quick_service' %>
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%else%>
<input type="hidden" id="table_id" name="table_id" value="" />
<input type="hidden" id="type" name="type" value="" />
<input type="hidden" id="table_type" name="table_type" value="" />
<%end%>
<% if @create_flag %>
<div class="col-lg-3 col-md-3 col-sm-3" >
<div class="card">
<div class="body" id="custom-slimscroll">
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<span class="patch_method"></span>
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%if !@dining_facility.nil?%>
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
<input type="hidden" id="table_type" name="table_type" value="<%= @dining_facility.type %>" />
<% elsif @cashier_type == 'quick_service' %>
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" />
<%else%>
<input type="hidden" id="table_id" name="table_id" value="" />
<input type="hidden" id="type" name="type" value="" />
<input type="hidden" id="table_type" name="table_type" value="" />
<%end%>
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group">
@@ -276,6 +277,7 @@
</div>
</div>
</div>
<% end %>
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>

View File

@@ -53,7 +53,7 @@
<% end %>
</div>
<!-- #END# Widgets -->
<% if !@current_user.nil? && @current_user.role != 'waiter' %>
<% if !@current_user.nil? && @current_user.role != 'waiter' && @setting_flag %>
<!-- CPU Usage -->
<div class="row clearfix">

View File

@@ -10,6 +10,8 @@
<%= f.input :is_active,:input_html=>{:class=>"col-md-9"} %>
<% if current_user.role == "administrator" %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %>
<% elsif current_user.role == "supervisor" %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] == "cashier" || r[1] == "waiter"},:class=>'form-group' %>
<% else %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] != "administrator"},:class=>'form-group' %>
<% end %>