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; background-color: #fff;
border-top: none; border-top: none;
} }
.p-card{
margin: 20px 0;
text-align: center;
}
.p-name{
padding-bottom: 20px;
font-size: 14px;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -399,9 +399,4 @@ end
:date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type) :date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type)
end end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -81,9 +81,4 @@ class Origami::HomeController < ApplicationController
end end
end end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
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) params.require(:in_duty).permit(:id, :dinning_id, :commissioner_ids, :in_time, :out_time)
end end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -138,9 +138,4 @@ class Origami::SurveysController < BaseOrigamiController
params.require(:survey).permit(:child, :adult,:male,:female,:local,:foreigner, :dining_name,:receipt_no,:shift_id,:created_by,:total_customer,:total_amount,:survey_id) 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 end
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.first
end
end end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,6 +2,8 @@ class PrintSettingsController < ApplicationController
load_and_authorize_resource except: [:create] load_and_authorize_resource except: [:create]
before_action :set_print_setting, only: [:show, :edit, :update, :destroy] before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
helper_method :shop_detail
# GET /print_settings # GET /print_settings
# GET /print_settings.json # GET /print_settings.json
def index def index
@@ -72,4 +74,9 @@ class PrintSettingsController < ApplicationController
def print_setting_params 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) 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 end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -57,15 +57,15 @@
<!-- #END# Page Loader --> <!-- #END# Page Loader -->
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center"> <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"> <img src="/image/SX-logo.png" width="150px" height="150px">
<p> <p>
<small>Version - 1.0.1</small> <small>Version - 1.0.1</small>
</p> </p>
</div> </div>
</div> </div>
<div class="row bg-white"> <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="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"> <div class="row justify-content-center form-group">
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID"> <input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
@@ -102,111 +102,111 @@
</div> </div>
</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="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"> <ul class="nav nav-tabs" role="tablist">
<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">
<% @employees.each do |employee| %> <% @employees.each do |employee| %>
<%if employee.role == "supervisor" %> <%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 %>" > <li class="nav-item">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH"> <a class="nav-link" data-toggle="tab" href="#supervisor" role="tab"><b>Supervisor</b></a>
</form> <% break %>
<div class="card emp-body"> </li>
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<% end %> <% end %>
<% 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| %> <% @employees.each do |employee| %>
<%if employee.role == "cashier" %> <%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 %>" > <li class="nav-item">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH"> <a class="nav-link" data-toggle="tab" href="#cashier" role="tab"><b>Cashier</b></a>
</form> <% break %>
<div class="card emp-body"> </li>
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<% end %> <% end %>
<% 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| %> <% @employees.each do |employee| %>
<%if employee.role == "account" %> <%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 %>" > <li class="nav-item">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH"> <a class="nav-link" data-toggle="tab" href="#accountant" role="tab"><b>Accountant</b></a>
</form> <% break %>
<div class="card emp-body"> </li>
<div class="body bg-teal"> <% end %>
<%= employee.name%> <% end %>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<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| %> <% @employees.each do |employee| %>
<%if employee.role == "waiter" %> <%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 %>" > <li class="nav-item">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH"> <a class="nav-link" data-toggle="tab" href="#waiter" role="tab"><b>Waiter</b></a>
</form> <% break %>
<div class="card emp-body"> </li>
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<% end %> <% end %>
<% end %> <% end %>
</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> </div>
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> --> <!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
@@ -237,6 +237,10 @@
$(item).submit(); $(item).submit();
}); });
$('ul.nav.nav-tabs li a').click(function() {
$(this).parent().addClass('login_dashboard').siblings().removeClass('login_dashboard');
});
$("#emp_id").focus(); $("#emp_id").focus();
$(".pin_pad").click(function (event) { $(".pin_pad").click(function (event) {
event.preventDefault(); event.preventDefault();

View File

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