Change Dashboard, Account in login, Shop name, Reference no for other charges

This commit is contained in:
San Wai Lwin
2018-02-28 15:31:55 +06:30
parent 36511c258f
commit 07c3bcd7a7
73 changed files with 278 additions and 486 deletions

View File

@@ -75,3 +75,13 @@
background-color: #fff;
border-top: none;
}
.p-card{
margin: 20px 0;
text-align: center;
}
.p-name{
padding-bottom: 20px;
font-size: 14px;
}

View File

@@ -1,5 +1,12 @@
class BaseController < ActionController::Base
layout "installation"
protect_from_forgery with: :exception
helper_method :shop_detail
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -5,6 +5,8 @@ class BaseCrmController < ActionController::Base
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
@@ -23,5 +25,10 @@ class BaseCrmController < ActionController::Base
def current_user
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -5,6 +5,8 @@ class BaseInventoryController < ActionController::Base
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
@@ -14,4 +16,9 @@ class BaseInventoryController < ActionController::Base
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -4,6 +4,8 @@ class BaseOqsController < ActionController::Base
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
@@ -24,4 +26,9 @@ class BaseOqsController < ActionController::Base
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -6,6 +6,9 @@ class BaseOrigamiController < ActionController::Base
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
# redirect_to origami_root_path
@@ -24,4 +27,10 @@ class BaseOrigamiController < ActionController::Base
def get_cashier
@cashier = Employee.where("role = 'cashier' AND token_session <> ''")
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -5,6 +5,8 @@ class BaseReportController < ActionController::Base
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
@@ -86,5 +88,10 @@ class BaseReportController < ActionController::Base
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -5,5 +5,11 @@ class BaseWaiterController < ActionController::Base
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -15,9 +15,4 @@ class Crm::BookingsController < BaseCrmController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -398,10 +398,5 @@ end
params.require(:customer).permit(:id, :name, :company, :contact_no, :email,
:date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type)
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -142,10 +142,5 @@ class Crm::DiningQueuesController < BaseCrmController
def dining_queue_params
params.require(:dining_queue).permit(:customer_id, :name, :contact_no, :queue_no,:status,:seater,:remark)
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -56,10 +56,5 @@ class Crm::HomeController < BaseCrmController
# end
# end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -1,6 +1,8 @@
class HomeController < ApplicationController
# layout "application", except: [:index, :show]
skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
helper_method :shop_detail
def index
# @employees = Employee.all_emp_except_waiter.order("name asc")
@@ -126,12 +128,6 @@ class HomeController < ApplicationController
render :json => {:status=> "Success", :url => root_path }.to_json
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
private
# Never trust parameters from the scary internet, only allow the white list through.
@@ -170,4 +166,9 @@ class HomeController < ApplicationController
end
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -2,6 +2,8 @@ class InstallController < BaseController
skip_before_action :verify_authenticity_token
# before_action :check_license
helper_method :shop_detail
def index
end
@@ -74,4 +76,9 @@ class InstallController < BaseController
# return nil
# end
# end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -30,12 +30,6 @@ class Oqs::HomeController < BaseOqsController
@queue_stations_items
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
# Get Order items
def get_order_items
items = []
@@ -129,9 +123,4 @@ class Oqs::HomeController < BaseOqsController
# completed_order = AssignedOrderItem.group(:order_id).where('delivery_status=true');
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -51,9 +51,4 @@ class Oqs::EditController < BaseOqsController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -226,10 +226,4 @@ class Oqs::HomeController < BaseOqsController
.group("order_queue_stations.id")
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -102,9 +102,4 @@ class Oqs::PrintController < ApplicationController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -208,9 +208,4 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
# @dining = DiningFacility.find(params[:id])
# end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -96,9 +96,4 @@ class Origami::BankIntegrationController < ApplicationController #BaseOrigamiCon
render json: response
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -24,9 +24,4 @@ class Origami::CardPaymentsController < BaseOrigamiController
def create
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -14,10 +14,5 @@ class Origami::CashInsController < BaseOrigamiController
shift.cash_in = shift.cash_in + amount.to_i
shift.save
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -8,9 +8,4 @@ class Origami::CashMgmtController < ApplicationController
def create
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -13,9 +13,4 @@ class Origami::CashOutsController < BaseOrigamiController
shift.save
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -36,9 +36,4 @@ class Origami::CheckInProcessController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -47,10 +47,4 @@ class Origami::CreditPaymentsController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -136,10 +136,5 @@ class Origami::CustomersController < BaseOrigamiController
render json: JSON.generate({:status => false, :error_message => "Record not found"})
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -57,8 +57,4 @@ class Origami::DashboardController < BaseOrigamiController
@print_settings = PrintSetting.get_precision_delimiter()
end
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -355,9 +355,5 @@ class Origami::DiscountsController < BaseOrigamiController
# redirect_to origami_path(sale_id)
# end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -131,12 +131,6 @@ class Origami::HomeController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
private
def set_dining

View File

@@ -81,9 +81,4 @@ class Origami::HomeController < ApplicationController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -169,9 +169,4 @@ class Origami::InDutiesController < BaseOrigamiController
params.require(:in_duty).permit(:id, :dinning_id, :commissioner_ids, :in_time, :out_time)
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -58,9 +58,4 @@ class Origami::JcbController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -57,9 +57,4 @@ class Origami::MasterController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -35,11 +35,5 @@ class Origami::MoveroomController < BaseOrigamiController
end
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -70,10 +70,5 @@ class Origami::MovetableController < BaseOrigamiController
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -57,9 +57,4 @@ class Origami::MpuController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -80,10 +80,5 @@ class Origami::OrdersController < BaseOrigamiController
end
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -76,10 +76,5 @@ class Origami::OtherChargesController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -37,9 +37,4 @@ class Origami::OthersPaymentsController < BaseOrigamiController
def create
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -416,10 +416,5 @@ class Origami::PaymentsController < BaseOrigamiController
end
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -29,9 +29,4 @@ class Origami::PayparPaymentsController < BaseOrigamiController
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -17,8 +17,5 @@ class Origami::PendingOrderController < BaseOrigamiController
@dining = nil
end
end
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -137,9 +137,4 @@ class Origami::ProductCommissionsController < BaseOrigamiController
params.fetch(:product_commission, {})
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -68,10 +68,5 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
end
@out = false, 0
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -53,10 +53,5 @@ class Origami::RequestBillsController < ApplicationController
# printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info,shop_details)
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -37,9 +37,4 @@ class Origami::RoomInvoicesController < BaseOrigamiController
@customer = @sale.customer
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -131,9 +131,4 @@ class Origami::RoomsController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -166,10 +166,5 @@ class Origami::SaleEditController < BaseOrigamiController
ProductCommission.remove_product_commission(item)
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -56,9 +56,4 @@ class Origami::SalesController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -108,9 +108,4 @@ class Origami::ShiftsController < BaseOrigamiController
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -360,10 +360,4 @@ class Origami::SplitBillController < BaseOrigamiController
orderItem.save!
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -137,10 +137,5 @@ class Origami::SurveysController < BaseOrigamiController
def survey_params
params.require(:survey).permit(:child, :adult,:male,:female,:local,:foreigner, :dining_name,:receipt_no,:shift_id,:created_by,:total_customer,:total_amount,:survey_id)
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -67,9 +67,4 @@ class Origami::TableInvoicesController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -57,9 +57,4 @@ class Origami::UnionpayController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -57,9 +57,4 @@ class Origami::VisaController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -139,10 +139,5 @@ class Origami::VoidController < BaseOrigamiController
end
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -78,9 +78,4 @@ class Origami::VoucherController < BaseOrigamiController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -2,6 +2,8 @@ class PrintSettingsController < ApplicationController
load_and_authorize_resource except: [:create]
before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
helper_method :shop_detail
# GET /print_settings
# GET /print_settings.json
def index
@@ -72,4 +74,9 @@ class PrintSettingsController < ApplicationController
def print_setting_params
params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :font, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space)
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -16,10 +16,4 @@ class Reports::SaleitemController < BaseReportController
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -49,11 +49,6 @@ class Reports::CommissionController < BaseReportController
format.json { render json: out }
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -60,9 +60,4 @@ authorize_resource :class => false
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -19,10 +19,5 @@ class Reports::DailysaleController < BaseReportController
def show
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -62,9 +62,4 @@ class Reports::PaymentMethodController < BaseReportController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -61,10 +61,5 @@ authorize_resource :class => false
format.json { render json: out }
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -76,10 +76,5 @@ class Reports::SaleitemController < BaseReportController
format.json { render json: out }
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -48,10 +48,5 @@ class Reports::ShiftsaleController < BaseReportController
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -46,11 +46,6 @@ class Reports::StockCheckController < BaseReportController
format.json { render json: out }
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -59,9 +59,4 @@ authorize_resource :class => false
end
end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end

View File

@@ -2,6 +2,8 @@ class SymControlController < BaseController
skip_before_action :verify_authenticity_token
http_basic_authenticate_with name: "vip", password: "!abcABC01"
helper_method :shop_detail
def run
sym_path = File.expand_path("~/symmetric/")
check_sym_proc_str = `#{"sudo service SymmetricDS status"}`
@@ -43,4 +45,9 @@ class SymControlController < BaseController
end
end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end

View File

@@ -135,7 +135,7 @@
<td align="right"><%= @summ_sale.total_receipt %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
@@ -147,7 +147,7 @@
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.grand_total") %> : </td>
<td><%= t("views.right_panel.detail.total_sale") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
</table>
@@ -157,7 +157,11 @@
<% if !@sale_data[0].empty? %>
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' && payment.payment_method != 'unionpay' %>
<tr>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% if payment.payment_method == 'paypar' %>
<td>Redeem Sale : </td>
<% else %>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% end %>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
@@ -172,7 +176,7 @@
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
<% if !total_card.nil? %>
<tr>
<td><%= t("views.right_panel.detail.card_sale") %> : </td>
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
<td align="right">
<%= total_card["card"].to_f %>
</td>
@@ -185,7 +189,7 @@
</div>
</div>
</div>
<% end %>
<% end %>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">

View File

@@ -57,15 +57,15 @@
<!-- #END# Page Loader -->
<div class="container">
<div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
<div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
<img src="/image/SX-logo.png" width="150px" height="150px">
<p>
<small>Version - 1.0.1</small>
</p>
</div>
</div>
<div class="row bg-white">
<p>
<small>Version - 1.0.1</small>
</p>
</div>
</div>
<div class="row bg-white">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<div class="row justify-content-center form-group">
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
@@ -102,112 +102,112 @@
</div>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<div class="row justify-content-center form-group">
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
</div>
<div class="row">
<div class="col-1 col-black">
<span>Supervisor</span>
</div>
<div class="col-11">
<hr />
</div>
</div>
<div class="row m-b-15">
<ul class="nav nav-tabs" role="tablist">
<% @employees.each do |employee| %>
<%if employee.role == "supervisor" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#supervisor" role="tab"><b>Supervisor</b></a>
<% break %>
</li>
<% end %>
<% end %>
</div>
<div class="row">
<div class="col-1 col-black">
<span>Cashier</span>
</div>
<div class="col-11">
<hr />
</div>
</div>
<div class="row m-b-15">
<% @employees.each do |employee| %>
<%if employee.role == "cashier" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#cashier" role="tab"><b>Cashier</b></a>
<% break %>
</li>
<% end %>
<% end %>
</div>
<div class="row">
<div class="col-1 col-black">
<span>Accountant</span>
</div>
<div class="col-11">
<hr />
</div>
</div>
<div class="row m-b-15">
<% @employees.each do |employee| %>
<%if employee.role == "account" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<%if employee.role == "account" %>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#accountant" role="tab"><b>Accountant</b></a>
<% break %>
</li>
<% end %>
<% end %>
<div class="row">
<div class="col-1 col-black">
<span>Waiter</span>
</div>
<div class="col-11">
<hr />
</div>
</div>
<div class="row m-b-15">
<% @employees.each do |employee| %>
<%if employee.role == "waiter" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#waiter" role="tab"><b>Waiter</b></a>
<% break %>
</li>
<% end %>
<% end %>
</div>
</ul>
<div class="tab-content" style="max-height:650px; overflow:auto">
<div class="tab-pane" id="supervisor" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "supervisor" %>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="tab-pane" id="cashier" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "cashier" %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="tab-pane" id="accountant" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "account" %>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="tab-pane" id="waiter" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "waiter" %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
</div>
@@ -237,6 +237,10 @@
$(item).submit();
});
$('ul.nav.nav-tabs li a').click(function() {
$(this).parent().addClass('login_dashboard').siblings().removeClass('login_dashboard');
});
$("#emp_id").focus();
$(".pin_pad").click(function (event) {
event.preventDefault();

View File

@@ -88,69 +88,69 @@
<% if !@summ_sale.nil? %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h6><%= t :sale %></h6>
<table class="table">
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
<td align="right"><%= @summ_sale.total_receipt %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :redeem %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
</table>
<table class="table">
<% if !(@total_payment_methods.nil?) %>
<% @total_payment_methods.each do |payment| %>
<% if !@sale_data[0].empty? %>
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
<tr>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
<%= data[""+pay_mth+""] %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
<% end %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h6><%= t :sale %></h6>
<table class="table">
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
<td align="right"><%= @summ_sale.total_receipt %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
</table>
<table class="table">
<% if !(@total_payment_methods.nil?) %>
<% @total_payment_methods.each do |payment| %>
<% if !@sale_data[0].empty? %>
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
<tr>
<% if payment.payment_method == 'paypar' %>
<td>Redeem Sale : </td>
<% else %>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% end %>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
<%= data[""+pay_mth+""] %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
<% end %>
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
<% if !total_card.nil? %>
<tr>
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
<td align="right">
<%= total_card["card"].to_f %>
</td>
</tr>
<% end %>
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
<% if !total_card.nil? %>
<tr>
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
<td align="right">
<%= total_card["card"].to_f %>
</td>
</tr>
<% end %>
<% end %>
</table>
<% end %>
</table>
</div>
</div>
</div>
</div>
<% end %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">