Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes

This commit is contained in:
phyusin
2017-11-15 13:28:18 +06:30
80 changed files with 1225 additions and 469 deletions

View File

@@ -66,28 +66,28 @@ $(document).on('turbolinks:load', function() {
}
var date = new Date(data[field]["created_at"]);
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
row ='<div class="card queue_station animated " data-date="'+data[field]["order_id"]+'">'
+'<div class="card-block">'
// +'<h6 class="card-">'
+'<span class="order-zone-type font-14">'+data[field]["table_type"]+'- '+ data[field]["zone"] +' </span>'
// +'<span class="order-zone font-14">'+ data[field]["zone"] +'</span>'
+'<small class="float-right font-14">'+ data[field]["order_id"] +'</small>'
// +'</h6>'
+'<div class="row">'
+'<span class="col-md-4 order-zone-type font-13">'+data[field]["table_type"]+'-'+ data[field]["zone"] +'</span>'
+'<span class="order-zone hidden font-14">'+ data[field]["zone"] +'</span>'
+'<span class="col-md-8"><small class="float-right font-13">'+data[field]["order_id"]+'</small></span>'
+'</div>'
// +'<h6>'
+'<span class="order-item font-16">'+ data[field]["item_name"] +'- </span>'
+'<span class="order-qty">'+ data[field]["qty"] +' </span>'
// +'</h6>'
+'<p class="m-b--10">'
+'<span class="order-item font-15">'+ data[field]["item_name"] +'- </span>'
+'<span class="order-qty"> [x'+ data[field]["qty"] +'] </span>'
+'</p>'
+'<p class="card-text item-options">'+ options +'</p>'
+'<span class="card-text">'
+'<span class="text-muted">Order at'
+'<span class="order-at">'+ show_date +'</span> - '
+'<span class="text-muted">Order at - '
+'<span class="order-at">'+ show_date +'</span> <br>'
+'<span class="order-by">'+ data[field]["item_order_by"] +'</span> '
+'Order By - <span class="order-by">'+ data[field]["item_order_by"] +'</span> '
+'</span> '
+'</span>'
@@ -114,6 +114,7 @@ $(document).on('turbolinks:load', function() {
$(document).on('click', '.queue_station', function(event){
var orderZone=$(this).children().children().children('.order-zone').text().trim();
var orderZoneType=$(this).children().children().children('.order-zone-type').text().trim();
// var orderItem=$(this).children().children().children('.order-item').text();
var assigned_item_id = $(this).children().find(".assigned-order-item").text();
var orderQty = $(this).children().children().children('.order-qty').text();
@@ -121,8 +122,8 @@ $(document).on('turbolinks:load', function() {
var orderAt = $(this).children().children().children().children('.order-at').text();
var orderCustomer = $(this).children().children('.order-customer').text();
var order_status = $(this).children().children('.order-status').text();
$('#order-title').text("ORDER DETAILS - " + orderZone);
$('.cus_name').removeClass('hidden');
$('#order-title').text("ORDER DETAILS - " + orderZoneType);
$('#order-by').text(orderBy);
$('#order-at').text(orderAt);
$('#order-customer').text(orderCustomer);
@@ -134,7 +135,8 @@ $(document).on('turbolinks:load', function() {
type: 'GET',
url: '/oqs/' + orderZone,
data: { 'status' : order_status },
success: function(res){
success: function(res){
for (i = 0; i < res.length; i++) {
var data = JSON.stringify(res[i]);
var parse_data = JSON.parse(data);

View File

@@ -16,7 +16,6 @@
//= require bootstrap/js/popper.min
//= require bootstrap/js/bootstrap-material-design.min
//= require jquery_nested_form
//= require cable
//= require momentjs/moment
//= require bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker
//= require multi-select/js/jquery.multi-select.js
@@ -344,6 +343,7 @@ $(document).ready(function(){
}
});
});
});

View File

@@ -37,26 +37,27 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
row ='<div class="card queue_station animated shake queue_station_box" data-date="'+items[field]["order_id"]+'">'
+'<strong class="hidden">'+items[field]["order_id"]+'</strong>'
+'<div class="card-block">'
// +'<h4 class="card-title">'
+'<span class="order-zone-type font-14">'+items[field]["table_type"]+'- </span>'
+'<span class="order-zone font-14">'+ items[field]["zone"] +'</span>'
+'<small class="pull-right font-14">'+ items[field]["order_id"] +'- </small>'
// +'</h4>'
// +'<h4>'
+'<span class="order-item font-16">'+ items[field]["item_name"] +'- </span>'
+'<span class="order-qty">'+ items[field]["qty"] +'- </span>'
// +'</h4>'
+'<div class="row">'
+'<span class="col-md-4 order-zone-type font-13">'+items[field]["table_type"]+'-'+ items[field]["zone"] +'</span>'
+'<span class="order-zone hidden font-14">'+ items[field]["zone"] +'</span>'
+'<span class="col-md-8"><small class="float-right font-13">'+items[field]["order_id"]+'</small></span>'
+'</div>'
+'<p class="m-b--10">'
+'<span class="order-item font-15">'+ items[field]["item_name"] +'- </span>'
+'<span class="order-qty"> [x'+ items[field]["qty"] +'] </span>'
+'</p>'
+'<p class="card-text item-options">'+ options +'</p>'
+'<span class="card-text">'
+'<span class="text-muted">Order at'
+'<span class="order-at">'+ show_date +'</span> - '
+'<span class="text-muted">Order at - '
+'<span class="order-at">'+ show_date +'</span> <br>'
+'<span class="order-by">'+ items[field]["item_order_by"] +'</span> '
+'</span> '
+'</span>'
+'Order By - <span class="order-by">'+ items[field]["item_order_by"] +'</span> '
+'</span> '
+'</span>'
+'<p class="hidden order-customer">'+ items[field]["customer_name"] +'</p> '
+'<p class="hidden assigned-order-item">'+ items[field]["assigned_order_item_id"] +'</p> '
@@ -73,8 +74,12 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
var $divs = $("div.queue_station");
var SortListDivs = $divs.sort(function (a, b) {
first = $(a).attr('data-date');
next = $(b).attr('data-date');
console.log(first);
console.log("hi")
console.log(next);
return parseInt(next.substring(4, 16)) - parseInt(first.substring(4, 16));
});
$("#oqs_container").html(SortListDivs);

View File

@@ -21,6 +21,51 @@
color: #fff !important;
background-color: blue;
}
.cashier_number{
width: 33%;
height:58px;
line-height:58px;
text-align:center;
background:#54A5AF;
// float:left;
// margin:2px;
font-size:20px;
color:white;
// cursor:pointer;
}
.del_cashier_number{
opacity:0.6,
}
.pay{
width: 86%;
height:174px;
line-height:174px;
text-align:center;
font-size:20px;
color:white;
}
.long{
width:43%;
}
.orange{
background-color:#FF7F50;
}
.red {
background-color:#F44336;
}
.green{
background-color: #009900;
}
.left{
margin-left:1px;
}
.bottom{
margin-bottom:1px;
}
.border-left{
border-left:1px solid #fff;
}

View File

@@ -63,4 +63,33 @@ select:focus {
border-top: .375em solid #111;
pointer-events: none;
}
}
}
/*Pagination*/
nav.pagination {
margin:10px;
}
nav.pagination .current{
background-color:#1f91f3;
color:#fff;
padding:4px 10px;
margin-top:-4px;
}
nav.pagination .page a,.next a,.last a,.prev a,.first a{
padding:6.5px 10px;
margin-left: 3px;
}
nav.pagination .page a:hover,
a:focus {
background-color: #ccc;
text-decoration: none;
}
nav.pagination .page a:hover,
.first a:hover,.last a:hover,.prev a:hover,.next a:hover{
background-color: #ccc;
text-decoration: none;
}

View File

@@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
# lookup domain for db from provision
before_action :check_license, :lookup_domain, :set_locale
before_action :lookup_domain, :set_locale
helper_method :current_company,:current_login_employee,:current_user
# alias_method :current_user, :current_login_employee,:current_user
@@ -24,7 +24,7 @@ class ApplicationController < ActionController::Base
def lookup_domain
if request.subdomain.present? && request.subdomain != "www"
@license = current_license(ENV["SX_PROVISION_URL"], request.subdomain.downcase)
@license = cache_license(ENV["SX_PROVISION_URL"], request.subdomain.downcase) # request.subdomain.downcase
if (!@license.nil?)
# logger.info "Location - " + @license.name
ActiveRecord::Base.establish_connection(website_connection(@license))
@@ -35,19 +35,31 @@ class ApplicationController < ActionController::Base
# redirect_to root_url(:host => request.domain) + "store_error"
render :json => [{ status: false, message: 'Invalid Access!'}]
end
else
# check for license file
if check_license
current_license(ENV["SX_PROVISION_URL"])
end
end
end
def current_license(url, subdomain)
@license = License.new(url, subdomain)
def current_license(url)
@license = License.new(url)
##creating md5 hash
# md5_hostname = Digest::MD5.new
# md5key = md5_hostname.update(request.host)
if (@license.detail_with_local_file() == true)
puts "RUN SAY BYAR"
else
return nil
end
end
# if (@license.detail_with_local_cache(subdomain, md5key.to_s) == true)
#if (@license.detail == true)
if (@license.detail_with_local_cache(subdomain) == true)
def cache_license(url, lookup)
@license = License.new(url, lookup)
# Export for Key
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_key(lookup)
if (@license.detail_with_local_cache(lookup, aes_key, aes_iv) == true)
return @license
else
return nil
@@ -96,9 +108,7 @@ class ApplicationController < ActionController::Base
private
def check_license
if License.check_license_file
# if !License.check_license_valid
# redirect_to install_path
# end
return true
else
redirect_to install_path
end

View File

@@ -137,7 +137,7 @@ class Crm::CustomersController < BaseCrmController
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
},
:timeout => 10
)
@@ -241,9 +241,10 @@ end
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
member_params = { name: name,phone: phone,email: email,
dob: dob,address: address,nrc:nrc,card_no:card_no,
member_group_id: member_group_id,
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
dob: dob,address: address,nrc:nrc,card_no:card_no,
member_group_id: member_group_id,
id:id,
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
# Check for paypar account exists
# if paypar_account_no != nil || paypar_account_no != ''
@@ -252,6 +253,7 @@ end
dob: dob,address: address,nrc:nrc,card_no:card_no,
paypar_account_no: paypar_account_no,
member_group_id: member_group_id,
id:id,
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
end
@@ -260,7 +262,7 @@ end
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
},
:timeout => 10
)
@@ -273,7 +275,8 @@ end
rescue SocketError
response = { status: false}
end
puts "ssssssss"
puts response.to_json
customer = Customer.find(@crm_customer.customer_id)
if response["status"] == true
@@ -299,9 +302,10 @@ end
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
member_params = { name: name,phone: phone,email: email,
dob: dob,address: address,nrc:nrc,card_no:card_no,
member_group_id: member_group_id,
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
dob: dob,address: address,nrc:nrc,card_no:card_no,
member_group_id: member_group_id,
id:id,
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
# Check for paypar account exists
if paypar_account_no.present?
@@ -309,6 +313,7 @@ end
dob: dob,address: address,nrc:nrc,card_no:card_no,
paypar_account_no: paypar_account_no,
member_group_id: member_group_id,
id:id,
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
end
@@ -317,7 +322,7 @@ end
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
},
:timeout => 10
)
@@ -331,7 +336,17 @@ end
response = { status: false}
end
puts "ssssssss"
puts response.to_json
if response["status"] == true
customer = Customer.find(@crm_customer.customer_id)
# Check membership id and bind to user
if response["membership_id"] != nil
status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id )
else
status = customer.update_attributes(membership_type:member_group_id )
end
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' }
format.json { render :show, status: :ok, location: @crm_customer }
else

View File

@@ -67,7 +67,7 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
@order.guest = params[:guest_info]
@order.table_id = params[:table_id] # this is dining facilities's id
@order.new_booking = true
@order.employee_name = current_login_employee.name
@order.waiters = current_login_employee.name
#Create Table Booking or Room Booking
if !params["booking_id"].nil?
# check booking id is already completed.

View File

@@ -6,7 +6,9 @@ class Origami::DiscountsController < BaseOrigamiController
sale_id = params[:id]
if Sale.exists?(sale_id)
@sale_data = Sale.find(sale_id)
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
end
@member_discount = MembershipSetting.find_by_discount(1)
@accounts = Account.all
end
@@ -197,7 +199,7 @@ class Origami::DiscountsController < BaseOrigamiController
auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10)
rescue HTTParty::Error
response = {"status": false, "message": "Can't open membership server " }
@@ -213,7 +215,8 @@ class Origami::DiscountsController < BaseOrigamiController
else
response = {"status": false, "message": "You have no selected discount item" }
end
puts "discount"
puts response.to_json
# Re-calc All Amount in Sale
if response["status"] == true
discount_amount = response["discount_earned"]
@@ -227,7 +230,7 @@ class Origami::DiscountsController < BaseOrigamiController
else
result = {:status=> response["message"],:title=>"Alert", :table_id => table_id,:table_type => table_type }
end
render :json => result.to_json
end #end Is Card Payment

View File

@@ -24,6 +24,7 @@ class Origami::HomeController < BaseOrigamiController
@dining.bookings.active.each do |booking|
if booking.sale_id.nil? && booking.booking_status != 'moved'
@order_items = Array.new
booking.booking_orders.each do |booking_order|
order = Order.find(booking_order.order_id)
@@ -31,26 +32,42 @@ class Origami::HomeController < BaseOrigamiController
@obj_order = order
@customer = order.customer
@date = order.created_at
@booking= booking
order.order_items.each do |item|
@order_items.push(item)
end
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
end
end
@status_order = 'order'
else
sale = Sale.find(booking.sale_id)
if sale.sale_status != "completed" && sale.sale_status != 'void'
@sale_array.push(sale)
if @status_order == 'order'
@status_order = 'sale'
end
@booking= booking
@date = sale.created_at
@status_sale = 'sale'
@obj_sale = sale
@customer = sale.customer
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
end
end
end
end
private

View File

@@ -5,6 +5,7 @@ class Origami::OtherChargesController < BaseOrigamiController
sale_id = params[:sale_id]
if Sale.exists?(sale_id)
@sale_data = Sale.find(sale_id)
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
end
end

View File

@@ -81,7 +81,7 @@ class Origami::PaymentsController < BaseOrigamiController
# get member information
rebate = MembershipSetting.find_by_rebate(1)
if customer.membership_id != nil && rebate
member_info = Customer.get_member_account(customer)
member_info = Customer.get_member_account(customer)
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
end
@@ -116,12 +116,20 @@ class Origami::PaymentsController < BaseOrigamiController
#get customer amount
@customer = Customer.find(@sale_data.customer_id)
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
rebate = MembershipSetting.find_by_rebate(1)
# get member information
if @customer.membership_id != nil && rebate
response = Customer.get_member_account(@customer)
puts response.to_json
if response["status"]==true
response["data"].each do |res|
response["account_data"].each do |res|
if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount"
@balance += res["balance"]
# @accountable_type = res["accountable_type"]
@@ -136,6 +144,7 @@ class Origami::PaymentsController < BaseOrigamiController
@sale_data.bookings.each do |sbk|
df = DiningFacility.find(sbk.dining_facility_id)
@table_no = df.type + ' ' + df.name
@checkin_time = sbk.checkin_at
break
end

View File

@@ -24,10 +24,12 @@ class Origami::RoomsController < BaseOrigamiController
@order_items = Array.new
booking.booking_orders.each do |booking_order|
order = Order.find(booking_order.order_id)
@customer = order.customer
if (order.status == "new")
@obj_order = order
@customer = order.customer
@date = order.created_at
@booking = booking
order.order_items.each do |item|
@order_items.push(item)
end
@@ -42,6 +44,7 @@ class Origami::RoomsController < BaseOrigamiController
if @status_order == 'order'
@status_order = 'sale'
end
@booking = booking
@date = sale.created_at
@status_sale = 'sale'
@obj_sale = sale

View File

@@ -45,7 +45,7 @@ class Origami::VoucherController < BaseOrigamiController
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10
)
rescue Net::OpenTimeout

View File

@@ -0,0 +1,59 @@
class Transactions::BookingsController < ApplicationController
load_and_authorize_resource except: [:create]
before_action :set_transactions_booking, only: [:show, :edit, :update, :destroy]
def index
filter = params[:filter]
from = params[:from]
to = params[:to]
if filter.nil? && from.nil? && to.nil?
@bookings = Booking.all.order("sale_id desc")
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
else
sale = Sale.search(filter,from,to)
if sale.count > 0
@bookings = sale
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
else
@bookings = 0
end
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @bookings }
end
end
# GET /transactions/bookings/1
# GET /transactions/bookings/1.json
def show
@booking = Booking.find(params[:id])
@order_items = []
@booking.booking_orders.each do |booking_order|
@order = Order.find(booking_order.order_id)
#if (order.status == "new")
@order_items = @order_items + @order.order_items
#end
end
if @booking.sale_id.present?
@sale = Sale.find(@booking.sale_id)
end
respond_to do |format|
format.html # show.html.erb
format.json { render json: @booking }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_transactions_booking
@transactions_booking = Booking.find(params[:id])
end
end

View File

@@ -15,12 +15,11 @@ class Transactions::CreditNotesController < ApplicationController
if filter.nil? && from.nil? && to.nil? && customer.nil?
@sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
puts "cccccccccccc"
else
sale = Sale.search_credit_sales(customer,filter,from,to)
if sale.count > 0
@sales = sale
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50)
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
else
@sales = 0
end

View File

@@ -9,19 +9,18 @@ class Transactions::OrdersController < ApplicationController
if filter.nil? && from.nil? && to.nil? && count.nil?
orders = Order.order("order_id desc")
puts "ssssss"
else
orders = Order.search(filter,from,to,count)
puts "aaaaa"
end
if !orders.nil?
@orders = Kaminari.paginate_array(orders).page(params[:page]).per(50)
@orders = Kaminari.paginate_array(orders).page(params[:page]).per(20)
else
@orders = []
end
puts @orders.to_json
respond_to do |format|
format.html # index.html.erb
format.json { render json: @orders }

View File

@@ -11,13 +11,13 @@ class Transactions::SalesController < ApplicationController
to = params[:to]
if receipt_no.nil? && from.nil? && to.nil?
@sales = Sale.where("NOT sale_status = 'void' " ).order("sale_id desc").limit(500)
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50)
@sales = Sale.where("NOT sale_status = 'void' " ).order("sale_id desc")
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
else
sale = Sale.search(receipt_no,from,to)
if sale.count > 0
@sales = sale
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50)
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
else
@sales = 0
end

View File

@@ -1,31 +0,0 @@
require 'openssl'
require 'base64'
require 'uri'
class AESEncDec {
cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
def self.export_key
ENV['aes_key'] = cipher.key = cipher.random_key # stores the key in key, and also sets the generated key on the cipher
ENV['aes_iv'] = cipher.iv = cipher.random_iv # stores the iv in iv, and also sets the generated iv on the cipher
end
def self.encrypt(data)
cipher.encrypt
cipher.key = ENV["aes_key"]
cipher.iv = ENV["aes_iv"]
encrypted = cipher.update(data) + cipher.final
encrypted = Base64.urlsafe_encode64(encrypted)
return encrypted
end
def self.decrypt(data)
cipher.decrypt
cipher.key = ENV["aes_key"]
cipher.iv = ENV["aes_iv"]
# Start the decryption
decoded = Base64.urlsafe_decode64(data)
decrypted = cipher.update(decoded) + cipher.final
end
}

View File

@@ -32,6 +32,7 @@ class Ability
can :manage, Order
can :manage, Booking
can :manage, Sale
@@ -84,7 +85,7 @@ class Ability
can :read, Order
can :update, Order
can :menage, Booking
can :read, Sale
can :update, Sale
can :get_customer, Customer

View File

@@ -41,6 +41,22 @@ class Booking < ApplicationRecord
return new_dining.type
end
def self.search(filter,from,to)
if filter.blank?
keyword = ''
else
keyword = "booking_id LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%"
end
if from.present? && to.present?
sale = Sale.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and NOT sale_status = 'void' ", from,to)
query = sale.where(keyword)
else
where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%",)
end
end
private
def generate_custom_id
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")

View File

@@ -23,13 +23,17 @@ class Customer < ApplicationRecord
# urltest =self.url_exist?(url)
begin
response = HTTParty.get(url, :body => { membership_id: customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
},
:timeout => 10
)
response = HTTParty.get(url, :body => {
membership_id: customer.membership_id,
merchant_uid:merchant_uid,
type: "summary",
auth_token:auth_token
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json; version=2'
},
:timeout => 10)
rescue HTTParty::Error
response = {status: false, message: "Server Error"}
@@ -63,7 +67,7 @@ class Customer < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
},
:timeout => 10
)
@@ -91,7 +95,7 @@ class Customer < ApplicationRecord
auth_token = memberaction.auth_token.to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
@customers = Customer.where("membership_type IS NOT NULL AND membership_id IS NULL")
@customers = Customer.where("membership_type IS NOT NULL AND membership_id IS NULL")
@customers.each do |customer|
member_params = { name: customer.name,phone: customer.contact_no,
@@ -102,7 +106,7 @@ class Customer < ApplicationRecord
# Check for paypar account exists
# if paypar_account_no != nil || paypar_account_no != ''
if paypar_account_no.present?
if customer.paypar_account_no.present?
member_params = { name: customer.name,phone: customer.contact_no,
email: customer.email,dob: customer.date_of_birth,
address: customer.address,nrc:customer.nrc_no,
@@ -116,7 +120,7 @@ class Customer < ApplicationRecord
:body => member_params,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
})
rescue Net::OpenTimeout
response = { status: false, message: "Server Time out" }
@@ -127,7 +131,6 @@ class Customer < ApplicationRecord
rescue SocketError
response = { status: false, message: "Can't connect server"}
end
if response["status"] == true
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
end
@@ -161,10 +164,12 @@ class Customer < ApplicationRecord
credit = 1
end
end
# overall_dis = SaleItem.get_overall_discount(sObj.id)
overall_dis = sObj.total_discount
total_amount = rebate_prices - payparcost - overall_dis
if credit == 1
total_amount = 0
end
@@ -183,7 +188,7 @@ class Customer < ApplicationRecord
receipt_no: receipt_no,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10)
rescue Net::OpenTimeout
response = { "status": false , "message": "Connect To" }
@@ -215,7 +220,7 @@ class Customer < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
},
:timeout => 10
)

View File

@@ -1,7 +1,7 @@
class License
include HTTParty
base_uri "secure.smartsales.asia/api"
base_uri "provision.zsai.ws/api"
attr_accessor :name, :address_1, :address_2, :township, :city, :country, :email, :phone, :fax, :logo, :subdomain,
:plan_activation_date, :plan_next_renewal_date, :plan_max_products,:plan_max_customers, :plan_active_connections,
@@ -13,17 +13,14 @@ class License
def initialize(server = "", lookup = "")
#this code is hard-code to reflect server mode - Very important.
self.server_mode = ENV["server_mode"]
self.server_mode = ENV["SERVER_MODE"]
if (server != "")
self.class.base_uri server
end
# generate key for license file encrypt
AESCrypt.export_key()
@secret = ENV["aes_key"]
@params = { query: { device: "SX", token: SECRETS_CONFIG['provision_key'] } }
# @secret = ENV["aes_key"]
# @params = { query: { device: "SX", token: SECRETS_CONFIG['provision_key'] } }
end
def shop_code
@@ -32,15 +29,11 @@ class License
else
return self.subdomain.upcase
end
end
end
def self.check_license_file
return File.exist?("config/license.yml")
end
def detail_with_local_cache(lookup)
def detail_with_local_cache(lookup, key, iv)
##Check from local redis - if available load local otherwise get from remote
cache_key = "store:license:#{@secret}:hostname"
cache_key = "#{lookup}:license:#{key}:hostname"
# No Needs for current
# @secret = key
@@ -53,12 +46,11 @@ class License
end
Rails.logger.info "Cache key - " + cache_key.to_s
if cache_license.nil?
##change the d/e key
@params = { query: { lookup_type: "cloud", lookup: lookup, encrypted_key: @secret } }
response = self.class.get("/request_license", @params)
# @options = { query: {device: "SXlite", lookup: lookup, skey: @secret, token: SECRETS_CONFIG['provision_key']} }
@params = { query: { lookup_type: self.server_mode, lookup: lookup, encrypted_key: key, iv_key: iv} }
response = self.class.get("/subdomain", @params)
@license = response.parsed_response
if (@license["status"] == true)
@@ -78,23 +70,56 @@ class License
end
Rails.logger.info 'API License'
else
@license = Marshal.load(cache_license) if cache_license
Rails.logger.info 'Cache License'
if (@license["status"] == true)
assign()
return true
end
end
return false
end
def detail_with_local_file()
has_license = true #verify_license()
if has_license
puts "VERIFIED"
end
# if cache_license.nil?
# ##change the d/e key
# @params = { query: { lookup_type: self.server_mode, lookup: lookup, encrypted_key: key, iv_key: iv} }
# response = self.class.get("/request_license", @params)
# @license = response.parsed_response
# if (@license["status"] == true)
# assign()
# Rails.logger.info "License - " + response.parsed_response.to_s
# Redis.current do |conn|
# ##Remote - store the remote response in local redis cache
# conn.set(cache_key, Marshal.dump(@license))
# ##ADD to List to remove later
# conn.sadd("License:cache:keys", cache_key)
# end
# return true
# end
# Rails.logger.info 'API License'
# else
# @license = Marshal.load(cache_license) if cache_license
# Rails.logger.info 'Cache License'
# if (@license["status"] == true)
# assign()
# return true
# end
# end
# return false
end
def detail
response = self.class.get("/subdomain", @options)
@license = response.parsed_response
@@ -110,6 +135,23 @@ class License
return false
end
def verify_license
api_token = read_license("api_token")
@options = { query: {lookup_type: "application", token: api_token} }
response = self.class.get("/verify", @options)
@varified = response.parsed_response
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
if (@varified["status"])
if (!check_expired(@varified["plan_next_renewal_date"]))
return true
end
else
delete_license_file
end
return false
end
def check_remote_license(license_key)
# @options = { query: {device: "cloud", key: license_key, skey: @secret, token: Rails.application.secrets.provision_key} }
@options = { query: {lookup_type: "application", encrypted_key: @secret, token: SECRETS_CONFIG['provision_key']} }
@@ -141,15 +183,32 @@ class License
#Load License is remove from the cloud license because - this license is must be validated against subdmain instead of license.data from file.
def expired?
if (self.plan_next_renewal_date < Date.today)
def check_expired(renewal_date)
if (renewal_date < Date.today)
return true
else
return false
end
end
def self.check_license_file
return File.exist?("config/license.yml")
end
private
# read line by key for license file
def read_license(key)
decrypted_line = ""
if File.exist?("config/license.yml")
File.open("config/license.yml").each do |line|
if line.include? (key)
decrypted_line_array = line.split(":")
decrypted_line = AESCrypt.decrypt(decrypted_line_array[1])
end
end
end
end
private
def assign
# self.name = @license["name"]
# self.address_1 = @license["address_1"]

View File

@@ -0,0 +1,38 @@
class MyAesCrypt
@cipher = ""
def initialize
@cipher = OpenSSL::Cipher::Cipher.new(ENV["CIPHER_TYPE"])
end
def export_key(passphrase)
# We want a 256 bit key symetric key based on passphrase
digest = Digest::SHA256.new
key = digest.update(passphrase)
key = digest.digest
ENV['AES_KEY'] = cipher_key = key # stores the key in key, and also sets the generated key on the @cipher
ENV['AES_IV'] = cipher_iv = @cipher.random_iv # stores the iv in iv, and also sets the generated iv on the @cipher
return cipher_key, cipher_iv
end
private
def encrypt(data)
cipher.encrypt
cipher.key = ENV["aes_key"]
cipher.iv = ENV["aes_iv"]
encrypted = cipher.update(data) + cipher.final
encrypted = Base64.encode64(encrypted)
return encrypted
end
def decrypt(data)
cipher.decrypt
cipher.key = ENV["aes_key"]
cipher.iv = ENV["aes_iv"]
# Start the decryption
decoded = Base64.decode64(data)
decrypted = cipher.update(decoded) + cipher.final
return decrypted
end
end

View File

@@ -85,7 +85,7 @@ class SalePayment < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10
)
rescue Net::OpenTimeout
@@ -120,17 +120,18 @@ class SalePayment < ApplicationRecord
# Control for Paypar Cloud
begin
response = HTTParty.post(url,
:body => { generic_customer_id:membership_id,
:body => { membership_id:membership_id,
total_amount: redeem_prices,
total_sale_transaction_amount: sale_data.grand_total,
redeem_amount:received_amount,
receipt_no:sale_data.receipt_no,
campaign_type_id:campaign_type_id,
account_no:"",merchant_uid:merchant_uid,
account_no:"",
merchant_uid:merchant_uid,
auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
},
:timeout => 10
)
@@ -399,7 +400,7 @@ class SalePayment < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10)
rescue Net::OpenTimeout
response = { "status": false , "message": "Connect To" }
@@ -468,7 +469,7 @@ class SalePayment < ApplicationRecord
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10)
rescue Net::OpenTimeout
response = { "status": false , "message": "Connect To" }

View File

@@ -295,14 +295,14 @@ class ReceiptBillPdf < Prawn::Document
total = total + res["balance"]
#total redeem amount
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Redeem"
redeem = redeem + res["redeem"]
redeem = redeem + res["withdraw"]
balance = balance + res["balance"]
end
#end Total redem
#total Rebate Earn
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateAccount" && res["status"]== "Rebate"
rebate_balance = rebate_balance + res["rebate"]
rebate_balance = rebate_balance + res["deposit"]
move_down 5
y_position = cursor
@@ -310,20 +310,20 @@ class ReceiptBillPdf < Prawn::Document
text "Rebate Earn", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_with_precision(res["rebate"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
text "#{number_with_precision(res["deposit"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
end
end
# Total Rebate Amount if birthday
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateBonusAccount" && res["status"]== "Rebate"
rebate_balance = rebate_balance + res["rebate"]
rebate_balance = rebate_balance + res["deposit"]
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Rebate Earn Bonus", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_with_precision(res["rebate"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
text "#{number_with_precision(res["deposit"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
end
end
#end Total rebate if birthday

View File

@@ -77,6 +77,11 @@
<span><%= t :transactions %></span>
</a>
<ul class="ml-menu">
<% if can? :menage, Booking %>
<li>
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
</li>
<% end %>
<% if can? :menage, Order %>
<li>
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
@@ -89,7 +94,7 @@
<% end %>
<% if can? :menage, Sale %>
<li>
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) + " " + (t :reports) %></a>
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) %></a>
</li>
<% end %>
</ul>

View File

@@ -1,5 +1,5 @@
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">OQS</li>
@@ -7,9 +7,9 @@
<%= link_to 'Back', oqs_root_path %>
</span>
</ol>
</div>
</div> -->
<div class="row">
<div class="col-md-12">
<div class="col-md-5">
<div class="card">
<div class="card-header">Update Quantity</div>
<div class="card-body">
@@ -32,36 +32,74 @@
</div>
</div> -->
<div class="row clearfix">
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-5 form-control-label">
<label for="">Quantity :</label>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-6 form-control-label">
<label for="">QTY :</label>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-6">
<input type="text" name="qty_weight" class="text-right form-control" value="<%= @order_item[0].qty %>" />
<input type="text" name="qty_weight" class="text-center form-control qty" id="qty" value="<%= @order_item[0].qty %>" />
<!-- <input type="text" id="email_address_2" class="form-control" placeholder="Enter your email address"> -->
</div>
</div>
<div class="row clearfix">
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-5 form-control-label">
<label for="">Remark :</label>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 form-control-label">
<label class ="m-t-20">Remark :</label>
</div>
<div class="col-lg-10 col-md-10 col-sm-8 col-xs-7">
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-7">
<textarea name="remarks" class="form-control"></textarea>
<!-- <input type="text" id="email_address_2" class="form-control" placeholder="Enter your email address"> -->
</div>
</div>
<button id="qty-update" class="btn btn-info" data-id="<%= @order_item[0].order_items_id %>">Update</button>
<br><br>
<button id="qty-update" class="btn btn-info float-right" data-id="<%= @order_item[0].order_items_id %>">Update</button>
</div>
</div>
</div>
<div class="col-md-5">
<div class="m-t- p-l-20">
<div class="row">
<div class="col-lg-11 col-md-11 col-sm-11">
<div class="row bottom">
<div class="col-md-4 cashier_number border-left" data-value="1" data-type="num">1</div>
<div class="col-md-4 cashier_number border-left" data-value="2" data-type="num">2</div>
<div class="col-md-4 cashier_number border-left" data-value="3" data-type="num">3</div>
</div>
<div class="row bottom">
<div class="col-md-4 cashier_number border-left" data-value="4" data-type="num">4</div>
<div class="col-md-4 cashier_number border-left" data-value="5" data-type="num">5</div>
<div class="col-md-4 cashier_number border-left" data-value="6" data-type="num">6</div>
</div>
<div class="row bottom">
<div class="col-md-4 cashier_number border-left" data-value="7" data-type="num">7</div>
<div class="col-md-4 cashier_number border-left" data-value="8" data-type="num">8</div>
<div class="col-md-4 cashier_number border-left" data-value="9" data-type="num">9</div>
</div>
<div class="row bottom">
<div class="col-md-4 cashier_number border-left" data-value="0" data-type="num">0</div>
<div class="col-md-4 cashier_number red border-left" data-type="del">Del</div>
<div class="col-md-4 cashier_number orange border-left" data-type="clr">Clr</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-1">
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons m-t--10">reply</i>
Back
</button>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
// Qty update for OQS Edit Controller
original_value = $('#qty').val();
$('#qty-update').on('click', function(){
var qty_weight = $("input[name='qty_weight']").val();
var remarks = $("textarea[name='remarks']").val();
@@ -77,6 +115,35 @@ $(document).ready(function(){
}
});
});
$('#back').on('click', function () {
window.location.href = '/oqs/';
})
// number key pad
$(document).on('click', '.cashier_number', function(event){
qty = $('#qty').val();
var input_value = $(this).attr("data-value");
var input_type = $(this).attr("data-type");
switch (input_type) {
case 'num':
if (original_value == qty){
$('#qty').val(input_value);
}else{
$('#qty').val(qty+input_value);
}
break;
break;
case 'clr':
$('#qty').val(original_value);
break;
case 'del' :
$('#qty').val(original_value);
break;
}
});
});
</script>

View File

@@ -1,14 +1,14 @@
<div class="page-header">
<!-- <div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :OQS %></li>
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ul>
</div>
</div> -->
<!-- Column One -->
<div class="row clearfix">
@@ -83,32 +83,33 @@
%>
<div class="card queue_station">
<div class="card-block">
<!-- <h5 class="card-"> -->
<span class="order-zone-type font-14"><%= qid.type %> - </span>
<span class="order-zone font-14"><%= qid.zone %></span>
<small class="pull-right font-14"><%= qid.order_id %></small>
<!-- </h5> -->
<!-- <h5> -->
<div class="row">
<span class="col-md-4 order-zone-type font-13"><%= qid.type %>-<%= qid.zone %></span>
<span class="order-zone hidden font-13"><%= qid.zone %></span>
<span class="col-md-8"><small class="float-right font-13"><%= qid.order_id %></small></span>
</div>
<p class="m-b--10">
<span class="order-item font-16">
<%= qid.item_name %>
</span> [x
<span class="order-qty">
<%= qid.qty %>
</span> ]
<!-- </h5> -->
</p>
<p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
<p class="card-text">
<span class="text-muted">Order at
<span class="order-at">
<span class="card-text">
<span class="text-muted">Order at -
<span class="order-at font-13">
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
</span> -
<span class="order-by">
<%= qid.item_order_by %>
</span> <br>
Order By - <span class="order-by font-13">
<%= qid.item_order_by %>
</span>
</span>
</p>
</span>
<p class="hidden order-status">completed</p>
<p class="hidden order-customer"><%= qid.customer_name %></p>
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
@@ -133,27 +134,27 @@
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="card" >
<div class="card-header">
<div><strong id="order-title">ORDER DETAILS - Table</strong></div>
<div><strong id="order-title">ORDER DETAILS</strong></div>
</div>
<div class="card-block">
<div class="card-title">
<table class="table">
<table class="">
<thead>
<tr>
<th style="width:; text-align:left">Order By</th>
<th style="width:; text-align:right">Order At</td>
<th style="width:; text-align:right">Customer</td>
</tr>
</thead>
<tbody>
<tr>
<td id="order-by" style="width:33%; text-align:left"></td>
<td id="order-at" style="width:33%; text-align:right"></td>
<td id="order-customer" style="width:33%; text-align:right"></td>
<th style="width:33%; text-align:">Order By</th>
<th style="width:33%; text-align:">Order At</th>
<!-- <th style="width:33%; text-align:">Customer</th> -->
</tr>
</thead>
<tbody>
<tr>
<td id="order-by" style="width:33%; text-align:"></td>
<td id="order-at" style="width:33%; text-align:"></td>
<!-- <td id="order-customer" style="width:33%; text-align:"></td> -->
</tr>
<tr>
<td><strong>Table/Room</strong></td>
<td id="order-from" colspan="2"></td>
<td><strong class="hidden cus_name">Customer</strong></td>
<td id="order-customer" colspan="2"></td>
</tr>
</tbody>
</table>

View File

@@ -62,7 +62,7 @@
<td class="item-attr"><strong id="sub_total">0.00</strong></td>
</tr>
</table>
<button type="button" class="btn btn-success create" id="create_order" disabled="disabled">Create Order</button>
<button type="button" class="btn btn-success btn-block create" id="create_order" disabled="disabled">Create Order</button>
</div>
</div>
</div>

View File

@@ -1,14 +1,15 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
<!-- <li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li> -->
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.details.credit") %></li>
<span class="float-right">
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id +'/payment'%>
</span>
</ol>
</div>
</div> -->
<h5>Credit Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<div class="card m-t-10 p-l-20" style="padding-top:20px;">
@@ -64,7 +65,7 @@
</div>
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:;">
<div class=" m-t-10 p-l-20">
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="row bottom">
@@ -107,12 +108,12 @@
</div>
</div>
</div>
</div>
<!--
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-l-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
</div> -->
</div>
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>
<script>

View File

@@ -1,15 +1,14 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li>
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<span class="float-right">
<a href="#" id="back">Back</a>
<!-- <%= link_to 'Back', dashboard_path %> -->
</span>
</ul>
</div>
</div> -->
<div class="row">
@@ -101,7 +100,7 @@
</div>
<!-- <div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll"> -->
<div class="col-lg-4 col-md-4 col-sm-4" >
<div class="col-lg-3 col-md-3 col-sm-3" >
<div id="custom-slimscroll">
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
@@ -113,14 +112,14 @@
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group">
<label>Salutation :</label><br>
<label>Mr</label>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr", :style=>"width: 30px"%>
<label>Miss</label>
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs", :style=>"width: 30px"%>
<label>Mrs</label>
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss", :style=>"width: 30px"%>
<label>Mdm</label>
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm", :style=>"width: 30px"%>
<label class="font-13">Mr</label>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr"%>
<label class="m-l--20">Miss</label>
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs"%>
<label class="m-l--20">Mrs</label>
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss"%>
<label class="m-l--20">Mdm</label>
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm"%>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
@@ -238,7 +237,10 @@
</div>
<%end%>
</div>
<!-- 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>
</div>
</div>
<div id="sxModal">

View File

@@ -13,6 +13,8 @@
<div class="card-block">
<div class="card-title row">
<div class="col-lg-6 col-md-6 col-sm-6">
<span class="hidden" id ="table_id" value="<%=@table.id%>"><%=@table.id%></span>
<span class="hidden" id="table_type" value="<%=@table.type%>"><%=@table.type%></span>
<p id="sale-id" class="hidden"><%=@sale_data.sale_id %></p>
<p class="m-l-10">Receipt No: <span id="receipt_no"><%=@sale_data.receipt_no rescue ' '%></span></p>
<!-- <p>Cashier: <span id="cashier"><%=@sale_data.cashier_name rescue ' '%></span></p> -->
@@ -209,7 +211,7 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Action Panel -->
<div>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami';"><i class="material-icons">reply</i> Back </button>
<button type="button" class="btn bg-default btn-block" id="back" ><i class="material-icons">reply</i> Back </button>
<button id="remove-item-discount" class="btn btn-primary btn- action-btn">Remove Item Discount</button>
<button id="remove-all" class="btn bg-primary btn-block action-btn">Remove All</button>
<button id="pay-discount" class="btn bg-primary btn-block action-btn">Enter</button>
@@ -225,6 +227,19 @@
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
var id = $("#table_id").text();
var type = $("#table_type").text();
console.log(id);
console.log(type);
if (type=="Table") {
window.location.href = '/origami/table/'+id
}else{
window.location.href = '/origami/room/'+id
}
})
$(".cashier_number").on('click', function(event){
if(event.handled !== true) {
var original_value=0;

View File

@@ -42,16 +42,14 @@
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card-block">
<%= table.get_booking %>
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% else %>
<div class="card tables blue text-white" data-id="<%= table.id %>">
<div class="card-block">
<%= table.get_booking %>
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
@@ -109,17 +107,16 @@
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<!-- <button id="refreshbutton" type="button" class="btn btn-block radius-btn"> Refresh off </button> -->
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
<button id="back" type="button" class="btn btn-block btn-lg bg-default"> <i class="material-icons">reply</i> <%= t("views.btn.back") %>
</button>
<%end%>
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
<!-- Temporary Disabled -->
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
<button id="back" type="button" class="btn btn-block btn-lg bg-default"><i class="fa fa-home fa-lg"></i> <%= t("views.btn.back") %>
</button>
<%end%>
</div>
</div>
</div>

View File

@@ -120,9 +120,13 @@
<div class="card-header">
<% if @status_order == 'order' && @status_sale != 'sale' %>
<div id="save_order_id" data-order="<%= @obj_order.order_id %>">
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
</div>
<% elsif @status_sale == 'sale' %>
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
</div>
<% end %>
</div>
<div class="card-block">
@@ -154,7 +158,7 @@
</div>
</div>
</div>
<div id="order-detail-slimscroll" data-height="160">
<div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 200 : 160%>">
<div class="card-text order-info" >
<table class="table table-striped" id="order-items-table">
<thead>
@@ -236,9 +240,17 @@
<td class="item-attr"><strong id="order-discount">(<%= @obj_sale.total_discount rescue 0 %>)</strong></td>
</tr>
<% if @status_sale == "sale" %>
<% if @status_sale == "sale" && @status_order == 'order' %>
<tr>
<td class="charges-name"><strong>Tax:</strong></td>
<td class="charges-name"><strong>Tax:
(<% @i = 0
@account_arr.each do |ct| %>
<%=ct.name%>
<% if @account_arr.count != @i+1%>
+ <% @i =+1 %>
<%end%>
<%end %>)
</strong></td>
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0 %></strong></td>
</tr>
<tr>
@@ -322,15 +334,15 @@
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
<% if @dining.status != "available" %>
<% if @status_order == 'order' %>
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" disabled>Customer</button>
<button type="button" class="btn btn-block bg-blue waves-effect" disabled>Edit</button>
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" disabled>Discount</button>
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect" disabled>Charges</button>
<!-- <button type="button" id="customer" class="btn btn-block bg-blue waves-effect" disabled>Customer</button> -->
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" disabled>Edit</button> -->
<!-- <button type="button" id="discount" class="btn btn-block bg-blue waves-effect" disabled>Discount</button> -->
<!-- <button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect" disabled>Charges</button> -->
<button type="button" class="btn btn-block bg-blue waves-effect" id='move'>Move</button>
<button type="button" id="request_bills" class="btn btn-block bg-blue waves-effect">Req.Bill</button>
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect" disabled>First Bill</button>
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect" disabled>Pay</button>
<button type="button" class="btn btn-block bg-blue waves-effect" disabled> Void</button>
<!-- <button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect" disabled>First Bill</button> -->
<!-- <button type="button" id="pay" class="btn btn-block bg-blue waves-effect" disabled>Pay</button> -->
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" disabled> Void</button> -->
<% end %>
<% if @status_sale == 'sale' %>
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect">Customer</button>
@@ -339,8 +351,8 @@
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
<button type="button" class="btn btn-block bg-blue waves-effect" id='move' disabled="">Move</button>
<button type="button" id="request_bills" class="btn btn-block bg-blue waves-effect" disabled> Req.Bill</button>
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" id='move' disabled="">Move</button> -->
<!-- <button type="button" id="request_bills" class="btn btn-block bg-blue waves-effect" disabled> Req.Bill</button> -->
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
<button type="button" id="void" class="btn btn-block bg-blue waves-effect"> Void</button>

View File

@@ -16,7 +16,7 @@
<%= f.button :submit, "Update", :class => 'btn btn-primary ', :disabled => '', :id => 'update' %>
<%= f.button :button, "Reset", :class => 'btn btn-danger ', :id => 'reset' %>
<button type="button" class="btn btn-inverse pull-right" id='back'><i class="fa fa-arrow-left"></i> Back</button>
<button type="button" class="btn btn-inverse pull-right" id='back'> <button type="button" class="btn bg-default btn-block" onclick="window.location.href = "origami_index_in_duty_path(@table.id)"><i class="material-icons">reply</i> Back </button>Back</button>
</div>
<% end %>

View File

@@ -49,14 +49,14 @@
<%= paginate @duties_in %>
</div>
</div>
<div class="col-md-3 partial">
<%= render 'form', in_duty: @in_duty, table: @table %>
</div>
<div class="col-md-1">
<br>
<button type="button" class="form-control btn btn-default btn-block" id='back'>Back</button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons m-t--5">reply</i> Back </button>
<button class="form-control btn btn-info btn-block" id="reset">New</button>
</div>
</div>
@@ -103,9 +103,9 @@
});
});
$('#back').on('click', function () {
window.location.href = '/origami/table/' + "<%= @table.id %>";
});
// $('#back').on('click', function () {
// window.location.href = '/origami/table/' + "<%= @table.id %>";
// });
$('#reset').click(function () {
location.reload();
/*var url = "<%= origami_index_in_duty_path %>";

View File

@@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
@@ -8,7 +8,8 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment/others_payment'%>
</span>
</ol>
</div>
</div> -->
<h5>JCB Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -97,9 +98,9 @@
</div>
</div>
<!-- <div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default m-l-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
</div> -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>
<script>

View File

@@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
@@ -8,7 +8,8 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment/others_payment'%>
</span>
</ol>
</div>
</div> -->
<h5>Master Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -97,9 +98,9 @@
</div>
</div>
<!-- <div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default m-l-3 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
</div> -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>
</div>
<script>

View File

@@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
@@ -8,7 +8,8 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment/others_payment'%>
</span>
</ol>
</div>
</div> -->
<h5>MPU Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -99,7 +100,10 @@
</div>
</div>
<div class="col-md-1 col-lg-1 col-sm-1">
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>
</div>
<script>

View File

@@ -142,7 +142,7 @@
</div>
</div>
<div id="order-detail-slimscroll" data-height="160">
<div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 200 : 160%>">
<div class="card-text" style="">
<table class="table table-striped" id="order-items-table">
<thead>
@@ -172,8 +172,8 @@
</table>
</div>
</div>
<div class="card-footer">
<table class="table" id="order-charges-table" border="0">
<div class="card-footer ">
<table class="m-b--20" id="order-charges-table" border="0">
<tr>
<td class="charges-name"><strong>Sub Total:</strong></td>
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
@@ -193,7 +193,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default btn-block" id='back'>Back</button>
<button type="button" class="btn bg-default btn-block " id='back'><i class="material-icons">reply</i>Back</button>
<% if @sale_status != 'completed' %>
<button type="button" class="btn bg-blue btn-block" id='move'>MOVE</button>
<% end %>

View File

@@ -192,7 +192,7 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Action Panel -->
<div>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami';"><i class="material-icons">reply</i> Back </button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons">reply</i> Back </button>
<button id="charge_other" class="btn bg-success btn-block action-btn">Enter</button>
</div>
</div>

View File

@@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.other_payment") %></li>
@@ -8,8 +8,8 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment'%>
</span>
</ol>
</div>
</div> -->
<div class="row">
<div class="col-lg-11col-md-11 col-sm-11">
<div >
@@ -20,6 +20,9 @@
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>
<script type="text/javascript">

View File

@@ -10,7 +10,7 @@
<div id="order-title">
<div class="row p-l-5 p-r-5">
<div class="col-lg-6 col-md-6 col-sm-6"><strong>Receipt No :</strong> <span id="receipt_no"><%=@sale_data.receipt_no rescue ' '%></span></div>
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Receipt Date :</strong> <span id="receipt_date"><%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></span></div>
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Receipt Date :</strong> <span id="receipt_date"><%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y-%I:%M %p") rescue '-' %></span></div>
</div>
<div class="row p-l-5 p-r-5">
<div class="col-lg-6 col-md-6 col-sm-6"><strong>Table No :</strong> <%=@table_no%></div>
@@ -20,7 +20,7 @@
<div class="row p-l-5 p-r-5">
<div class="col-lg-6 col-md-6 col-sm-6"><strong>Customer :</strong> <%= @sale_data.customer.name%> <span class="hidden" id="membership_id"><%= @sale_data.customer.membership_id%></span>
<span class="hidden" id="member_discount"><%= @member_discount%></span></div>
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Customer ID :</strong> <%= @sale_data.customer.customer_id%></div>
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Checkin Time : </strong> <%= @checkin_time.utc.getlocal.strftime("%I:%M %p") %></div>
</div>
</div>
</div>
@@ -40,7 +40,7 @@
</table>
</div>
</div>
<div id="order-detail-slimscroll" data-height="280">
<div id="order-detail-slimscroll" data-height="300">
<!-- <div id="table-details" class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll"> -->
<div id="table-details" class="card-text m-t--10" >
<table class="table" id="append-table">
@@ -81,7 +81,15 @@
<td class="item-attr"><strong><span>(<%=@sale_data.total_discount rescue 0%>)</span></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Tax</strong></td>
<td class="charges-name"><strong>Tax
(<% @i = 0
@account_arr.each do |ct| %>
<%=ct.name%>
<% if @account_arr.count != @i+1%>
+ <% @i =+1 %>
<%end%>
<%end %>)
</strong></td>
<td class="item-attr"><strong><span><%=@sale_data.total_tax rescue 0%></span></strong></td>
</tr>
<tr>

View File

@@ -9,5 +9,8 @@
<% end %>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
</div>
<div>

View File

@@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
@@ -8,7 +8,8 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment/others_payment'%>
</span>
</ol>
</div>
</div> -->
<h5>Reedem Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
@@ -100,9 +101,9 @@
</div>
<!-- <div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
</div> -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>
<script type="text/javascript">

View File

@@ -123,9 +123,15 @@
<div class="card" >
<div class="card-header">
<% if @status_order == 'order' %>
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %></div>
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %>
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
</div>
<% elsif @status_sale == 'sale' %>
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %></div>
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %>
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
</div>
<% end %>
</div>
@@ -140,22 +146,22 @@
</span>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
Date: <span id="receipt_date"><%= @obj_sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span>
Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span>
</div>
</div>
<div class="card-title row customer_detail p-l-5 p-r-5" >
<div class="col-lg-6 col-md-6 col-sm-6">
<% if @status_sale == 'sale' %>
<p class="hidden customer-id"><%= @obj_sale_sale.customer_id rescue '' %></p>
Customer : <%= @obj_sale_sale.customer.name rescue '-' %>
Customer : <%= @obj_sale.customer.name rescue '-' %>
<%else%>
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
<p class="hidden customer-id"><%= @obj_order.customer_id rescue "-" %></p>
Customer : <%= @customer.name rescue "-" %>
<%end%>
</div>
</div>
<div id="order-detail-slimscroll" data-height="160">
<div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 240 : 160%>">
<div class="card-text order-info">
<table class="table table-striped" id="order-items-table">
<thead>
@@ -306,29 +312,31 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Waiter Buttons -->
<button type="button" class="btn btn-default btn-block" id='back'><i class="fa fa-arrow-left"></i> Back</button>
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i> Back</button>
<button type="button" id="add_order" class="btn btn-block btn- bg-blue waves-effect">Add Order</button>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
<% if @room.bookings.length >= 1 %>
<% if @status_order == 'order' && @status_sale != 'sale' %>
<!-- <button type="button" class="btn bg-blue btn-block" >Add Order</button> -->
<button type="button" id="customer" class="btn bg-blue btn-block" disabled>Customer</button>
<button type="button" class="btn bg-blue btn-block" disabled >Edit</button>
<button type="button" id="discount" class="btn bg-blue btn-block" disabled >Discount</button>
<button type="button" id="other-charges" class="btn bg-blue btn-block" disabled>Charges</button>
<!-- <button type="button" id="customer" class="btn bg-blue btn-block" disabled>Customer</button> -->
<!-- <button type="button" class="btn bg-blue btn-block" disabled >Edit</button> -->
<!-- <button type="button" id="discount" class="btn bg-blue btn-block" disabled >Discount</button> -->
<!-- <button type="button" id="other-charges" class="btn bg-blue btn-block" disabled>Charges</button> -->
<button type="button" class="btn bg-blue btn-block" id='move'>Move</button>
<button type="button" id="request_bills" class="btn bg-blue btn-block">Req.Bill</button>
<button type="button" id="first_bill" class="btn bg-blue btn-block" disabled>First Bill</button>
<button type="button" id="pay" class="btn bg-blue btn-block" disabled>Pay</button>
<button type="button" class="btn bg-blue btn-block" disabled=""> Void </button>
<!-- <button type="button" id="first_bill" class="btn bg-blue btn-block" disabled>First Bill</button> -->
<!-- <button type="button" id="pay" class="btn bg-blue btn-block" disabled>Pay</button> -->
<!-- <button type="button" class="btn bg-blue btn-block" disabled=""> Void </button> -->
<% else %>
<!-- <button type="button" class="btn bg-blue btn-block" disabled>Add Order</button> -->
<button type="button" id="customer" class="btn bg-blue btn-block" >Customer</button>
<button type="button" class="btn bg-blue btn-block" id='edit'>Edit</button>
<button type="button" id="discount" class="btn bg-blue btn-block" >Discount</button>
<button type="button" id="other-charges" class="btn bg-blue btn-block" >Charges</button>
<button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button>
<button type="button" id="request_bills" class="btn bg-blue btn-block" disabled> Req.Bill</button>
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
<!-- <button type="button" id="request_bills" class="btn bg-blue btn-block" disabled> Req.Bill</button> -->
<button type="button" id="first_bill" class="btn bg-blue btn-block">First Bill</button>
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
<button type="button" id="void" class="btn bg-blue btn-block" > Void </button>
@@ -412,19 +420,17 @@ $(document).ready(function(){
window.location.href = '/origami/order/' + order_id;
});
// bind survey to order or sale
$("#survey").on('click', function () {
var sale = $('#sale_id').val();
if (sale) {
var sale_id = sale
} else {
var sale_id = $('#save_order_id').attr('data-order');
}
var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/survey"
});
// bind survey to order or sale
$("#survey").on('click', function () {
var sale = $('#sale_id').val();
if (sale) {
var sale_id = sale
} else {
var sale_id = "<%= @room.id %>";
}
//var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/surveys"
});
// bind customer to order or sale
$("#customer").on('click', function(){
var sale = $('#sale_id').val();
@@ -659,6 +665,17 @@ $('#add_invoice').on('click',function(){
}
});
$('#commissions').on('click', function () {
var dining_id = "<%= @room.id %>"
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/load_commissioners";
});
$('#in_duties').on('click', function () {
var dining_id = "<%= @room.id %>"
window.location.href = '/origami/assign_in_duty/'+ dining_id;
});
// Ordering
$('#add_order').on('click', function () {
var dining_id = "<%= @room.id %>"

View File

@@ -197,7 +197,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'>Back</button>
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
<% if @sale.sale_status != 'void' %>
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
<% end %>

View File

@@ -1,72 +1,91 @@
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<%= f.input :child%>
<%= f.input :adult %>
<%= f.input :male %>
<%= f.input :female %>
<%= f.input :local %>
<%= f.input :child%>
<%= f.input :adult %>
<%= f.input :male %>
<%= f.input :female %>
<%= f.input :local %>
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Foreigner</label>
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][][]" style="height: " >
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][][]" style="height: " >
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
<option value="<%= ct.value %>">
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
<%end %>
</select>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Number</label>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Number</label>
<input type="number" name="survey[foreigner][][]" class="form-control">
</div>
</div>
</div>
<%= f.input :total_customer %>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
</div>
<%= f.input :total_customer %>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<p>
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.title_txt") %> <br>
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.account_type_txt") %> <br>
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.title_txt") %> <br>
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.account_type_txt") %> <br>
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<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>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table_id = '<%=@dining_facility.id%>';
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
})
});
</script>

View File

@@ -9,7 +9,7 @@
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<div class="card">
<table class="table table-striped">
<thead>
@@ -70,5 +70,22 @@
</div>
</div>
</div>
<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>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table = '<%=@dining_facility.id%>';
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
})
});
</script>

View File

@@ -1,4 +1,4 @@
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= '/origami/table/@dining_facility.id' %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.survey") %></li>
@@ -7,6 +7,6 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/table/'+@dining_facility.id.to_s %>
</span>
</ol>
</div>
</div> -->
<%= render 'form', survey: @survey %>

View File

@@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
@@ -8,7 +8,8 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment/others_payment'%>
</span>
</ol>
</div>
</div> -->
<h5>VISA Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -97,9 +98,9 @@
</div>
</div>
<!-- <div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-l-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
</div> -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>
</div>
<script>

View File

@@ -83,17 +83,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -141,20 +141,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
console.log(from);
console.log(to);
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;
if(to != '' && from != ''){

View File

@@ -147,17 +147,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -211,17 +211,19 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -145,17 +145,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -105,17 +105,19 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -0,0 +1,95 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :booking %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
<div class="table-responsive">
<table class="table table-">
<tbody>
<tr>
<td colspan="8">
<%= form_tag transactions_orders_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from date" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to date" type="text" placeholder="To date">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
</div>
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th><%= t("views.right_panel.detail.booking_id") %></th>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.table") %></th>
<th><%= t("views.right_panel.detail.checkin_time") %></th>
<th><%= t("views.right_panel.detail.checkout_time") %></th>
<th><%= t("views.right_panel.detail.checkin_by") %></th>
<th> <%= t("views.right_panel.detail.checkout_by") %></th>
<th><%= t("views.right_panel.detail.booking_status") %></th>
<th><%= t("views.right_panel.detail.booking_date") %></th>
</tr>
</thead>
<tbody>
<% if @bookings != 0 %>
<% @bookings.each do |booking| %>
<tr>
<td><%= link_to booking.booking_id, transactions_booking_path(booking) %></td>
<td><%= link_to booking.sale_id, transactions_sale_path(booking.sale_id) rescue '-' %></td>
<td><%= booking.dining_facility.name %></td>
<td><%= booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></td>
<td><%= booking.checkout_at.utc.getlocal.strftime("%I:%M %p") rescue '-' %></td>
<td><%= booking.checkin_by rescue '-' %></td>
<td><%= booking.checkout_by rescue '-' %></td>
<td> <%= booking.booking_status %> </td>
<td> <%= booking.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% end %>
<% else %>
<tr><td colspan="8"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
<% end %>
</tbody>
</table>
<br>
<% if @bookings != 0 %>
<%= paginate @bookings %>
<% end %>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
json.array! @transactions_sales, partial: 'transactions_sales/transactions_sale', as: :transactions_sale

View File

@@ -0,0 +1,59 @@
<p id="notice"><%= notice %></p>
<h1><%= t("views.right_panel.header.transactions_sales") %></h1>
<table>
<thead>
<tr>
<th><%= t :cashier %></th>
<th><%= t :cashier %> <%= t("views.right_panel.detail.name_txt2") %></th>
<th><%= t("views.right_panel.detail.requested_by") %></th>
<th><%= t("views.right_panel.detail.requested_at") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
<th><%= t :customer %></th>
<th><%= t("views.right_panel.detail.payment_status") %></th>
<th><%= t("views.right_panel.detail.sale_status") %></th>
<th><%= t("views.right_panel.detail.total_amount") %></th>
<th><%= t("views.right_panel.detail.total_discount") %></th>
<th><%= t("views.right_panel.detail.total_tax") %></th>
<th><%= t("views.right_panel.detail.tax_type") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t("views.right_panel.detail.rnd_adj") %></th>
<th><%= t("views.right_panel.detail.amt_received") %></th>
<th><%= t("views.right_panel.detail.amt_changed") %></th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @transactions_sales.each do |transactions_sale| %>
<tr>
<td><%= transactions_sale.cashier %></td>
<td><%= transactions_sale.cashier_name %></td>
<td><%= transactions_sale.requested_by %></td>
<td><%= transactions_sale.requested_at %></td>
<td><%= transactions_sale.receipt_no %></td>
<td><%= transactions_sale.receipt_date %></td>
<td><%= transactions_sale.customer %></td>
<td><%= transactions_sale.payment_status %></td>
<td><%= transactions_sale.sale_status %></td>
<td><%= transactions_sale.total_amount %></td>
<td><%= transactions_sale.total_discount %></td>
<td><%= transactions_sale.total_tax %></td>
<td><%= transactions_sale.tax_type %></td>
<td><%= transactions_sale.grand_total %></td>
<td><%= transactions_sale.rounding_adjustment %></td>
<td><%= transactions_sale.amount_received %></td>
<td><%= transactions_sale.amount_changed %></td>
<td><%= link_to t("views.btn.show"), transactions_sale %></td>
<td><%= link_to t("views.btn.edit"), edit_transactions_sale_path(transactions_sale) %></td>
<td><%= link_to t("views.btn.delete"), transactions_sale, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Transactions Sale', new_transactions_sale_path %>

View File

@@ -0,0 +1,140 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= transactions_bookings_path %>"><%= t :booking %></a></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">
<%= link_to 'Back', transactions_bookings_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#booking" role="tab"><%= t :booking_details %></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#order" role="tab"><%= t :order_details %></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#sale" role="tab"><%= t :sale_details %></a>
</li>
</ul>
<!-- Nav tabs - End -->
<div class="tab-content" style="min-height:670px; max-height:670px;">
<div class="tab-pane active" id="booking" role="tabpanel">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.booking_id") %></th>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.table") %></th>
<th><%= t("views.right_panel.detail.checkin_time") %></th>
<th><%= t("views.right_panel.detail.checkout_time") %></th>
<th><%= t("views.right_panel.detail.checkin_by") %></th>
<th> <%= t("views.right_panel.detail.checkout_by") %></th>
<th><%= t("views.right_panel.detail.booking_status") %></th>
<th><%= t("views.right_panel.detail.booking_date") %></th>
</tr>
</thead>
<tbody>
<tr>
<td><%= @booking.booking_id%></td>
<td><%= link_to @booking.sale_id, transactions_sale_path(booking.sale_id) rescue '-' %></td>
<td><%= @booking.dining_facility.name %></td>
<td><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></td>
<td><%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") rescue '-' %></td>
<td><%= @booking.checkin_by rescue '-' %></td>
<td><%= @booking.checkout_by rescue '-' %></td>
<td><%= @booking.booking_status %> </td>
<td><%= @booking.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="order" role="tabpanel">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.order_id") %></th>
<th><%= t("views.right_panel.header.menu_item") %></th>
<th><%= t("views.right_panel.detail.qty") %></th>
<th><%= t("views.right_panel.detail.unit_price") %></th>
<th><%= t("views.right_panel.detail.option") %></th>
<th><%= t("views.right_panel.detail.status") %></th>
<th><%= t("views.right_panel.detail.waiter") %></th>
<th><%= t("views.right_panel.detail.created_at") %></th>
</tr>
</thead>
<tbody>
<% @order_items.each do |order_item| %>
<tr>
<td><%= link_to order_item.order_id, transactions_order_path(order_item.order_id) %><%= %></td>
<td><%= order_item.item_name %></td>
<td><%= order_item.qty %></td>
<td><%= order_item.price %></td>
<td><%= order_item.options %></td>
<td><%= order_item.order_item_status %></td>
<td><%= order_item.item_order_by %> </td>
<td><%= order_item.created_at.strftime("%d-%m-%y %I:%M %p") %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="sale" role="tabpanel">
<div class="table-responsive">
<table class="table table- table-striped table-hover js-basic- ">
<thead>
<tr>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t("views.right_panel.detail.total_discount") %></th>
<th><%= t("views.right_panel.detail.tax_amount") %></th>
<th><%= t("views.right_panel.detail.sub_total") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t :cashier %></th>
<th><%= t("views.right_panel.detail.sales_status") %></th>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
</tr>
</thead>
<tbody>
<% if @sale %>
<tr>
<td><%= link_to @sale.sale_id, transactions_sale_path(@sale) %></td>
<td><%= @sale.receipt_no %></td>
<td><%= @sale.total_discount %></td>
<td><%= @sale.total_tax %></td>
<td><%= @sale.total_amount %></td>
<td><%= @sale.grand_total rescue '-' %></td>
<td><%= @sale.cashier_name rescue '-' %></td>
<td> <%= @sale.sale_status %> </td>
<td> <%= @sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% else %>
<tr><td colspan="9"><strong><p style="text-align: center">There is no data ....</p></strong></td></tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
json.partial! "transactions_sales/transactions_sale", transactions_sale: @transactions_sale

View File

@@ -91,7 +91,7 @@
</td>
<td><%= sale.cashier_name rescue '-' %></td>
<td><%= link_to sale.customer.name, crm_customer_path(sale.customer_id) %></td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% end %>
<% else %>
@@ -100,7 +100,9 @@
</tbody>
</table>
<br>
<% if @sales != 0 %>
<%= paginate @sales %>
<% end %>
</div>
</div>
</div>

View File

@@ -64,7 +64,7 @@
<td><%= order.order_type %></td>
<td><%= order.customer.name rescue '-' %></td>
<td><%= order.status %></td>
<td> <%= order.date.strftime("%d-%m-%Y") %> </td>
<td> <%= order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
<td> <%= order.item_count %> </td>
</tr>
@@ -73,7 +73,7 @@
</table>
<br>
<%if !@order.nil?%>
<%if !@orders.nil?%>
<%= paginate @orders %>
<%end%>
</div>

View File

@@ -11,7 +11,7 @@
<hr>
<div class="row">
<div class="col-lg-11 col-md-11 col-sm-11">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="main-box-body clearfix p-l-5 p-r-5">
<div class="table-responsive">
<table class="table table-striped">
@@ -30,12 +30,12 @@
<td><%= @order.order_type %></td>
<td><%= @order.customer.name rescue '-' %></td>
<td><%= @order.status %></td>
<td> <%= @order.date.strftime("%d-%m-%Y") %> </td>
<td> <%= @order.waiter rescue '-' %> </td>
<td> <%= @order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
<td> <%= @order.waiters rescue '-' %> </td>
</tr>
</tbody>
</table>
<h3><%= t("views.right_panel.detail.order_items") %></h3>
<h5><%= t("views.right_panel.detail.order_items") %></h5>
<table class="table table-striped">
<thead>
<tr>
@@ -45,7 +45,7 @@
<th><%= t("views.right_panel.detail.total_price") %></th>
<!-- <th>Option</th> -->
<th><%= t("views.right_panel.detail.status") %></th>
<th><%= t("views.right_panel.detail.order_by") %></th>
<!-- <th><%= t("views.right_panel.detail.order_by") %></th> -->
<th><%= t("views.right_panel.detail.created_at") %></th>
</tr>
@@ -61,7 +61,7 @@
<td><%= order.qty * order.price %></td>
<!-- <td> <%= order.options %> </td> -->
<td> <%= order.order_item_status %> </td>
<td> <%= order.item_order_by %> </td>
<!-- <td> <%= order.item_order_by %> </td> -->
<td> <%= order.created_at.strftime("%d-%m-%Y") %> </td>
</tr>
<% end %>

View File

@@ -1,27 +0,0 @@
<%= simple_form_for(@transactions_sale) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.association :cashier %>
<%= f.input :cashier_name %>
<%= f.input :requested_by %>
<%= f.input :requested_at %>
<%= f.input :receipt_no %>
<%= f.input :receipt_date %>
<%= f.association :customer %>
<%= f.input :payment_status %>
<%= f.input :sale_status %>
<%= f.input :total_amount %>
<%= f.input :total_discount %>
<%= f.input :total_tax %>
<%= f.input :tax_type %>
<%= f.input :grand_total %>
<%= f.input :rounding_adjustment %>
<%= f.input :amount_received %>
<%= f.input :amount_changed %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -1,2 +0,0 @@
json.extract! transactions_sale, :id, :cashier_id, :cashier_name, :requested_by, :requested_at, :receipt_no, :receipt_date, :customer_id, :payment_status, :sale_status, :total_amount, :total_discount, :total_tax, :tax_type, :grand_total, :rounding_adjustment, :amount_received, :amount_changed, :created_at, :updated_at
json.url transactions_sale_url(transactions_sale, format: :json)

View File

@@ -1,6 +0,0 @@
<h1>Editing Transactions Sale</h1>
<%= render 'form', transactions_sale: @transactions_sale %>
<%= link_to t("views.btn.show"), @transactions_sale %> |
<%= link_to 'Back', transactions_sales_path %>

View File

@@ -53,8 +53,10 @@
<tr>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t("views.right_panel.detail.total_discount") %></th>
<th><%= t("views.right_panel.detail.tax_amount") %></th>
<th><%= t("views.right_panel.detail.sub_total") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t :cashier %></th>
<th><%= t("views.right_panel.detail.sales_status") %></th>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
@@ -67,11 +69,13 @@
<tr>
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.grand_total rescue '-' %></td>
<td><%= sale.total_discount %></td>
<td><%= sale.total_tax %></td>
<td><%= sale.total_amount %></td>
<td><%= sale.grand_total rescue '-' %></td>
<td><%= sale.cashier_name rescue '-' %></td>
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% end %>
<% else %>

View File

@@ -1,5 +0,0 @@
<h1>New Transactions Sale</h1>
<%= render 'form', transactions_sale: @transactions_sale %>
<%= link_to 'Back', transactions_sales_path %>

View File

@@ -142,14 +142,14 @@
<tbody>
<% @order_items.each do |order_item| %>
<tr>
<td><%= order_item.order_id %></td>
<td><%= link_to order_item.order_id, transactions_order_path(order_item.order_id) %><%= %></td>
<td><%= order_item.item_name %></td>
<td><%= order_item.qty %></td>
<td><%= order_item.price %></td>
<td><%= order_item.options %></td>
<td><%= order_item.order_item_status %></td>
<td><%= order_item.item_order_by %> </td>
<td><%= order_item.created_at.strftime("%d-%m-%y") %></td>
<td><%= order_item.created_at.strftime("%d-%m-%y %I:%M %p") %></td>
</tr>
<% end %>
</tbody>
@@ -185,9 +185,10 @@
<td><%= @customer.address%></td>
<td><%= @customer.date_of_birth %></td>
</tr>
<tr></tr>
<tr><td></td></tr>
<% if @customer.membership_id %>
<tr>
<th colspan="5"><%= t("views.right_panel.detail.membership_transactions") %></th>
<th colspan="8"><%= t("views.right_panel.detail.membership_transactions") %></th>
</tr>
<tr>
<th><%= t("views.right_panel.detail.date") %></th>
@@ -197,6 +198,7 @@
<th><%= t("views.right_panel.detail.from_account") %></th>
<th><%= t("views.right_panel.detail.status") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th></th>
</tr>
<%
@@ -210,10 +212,11 @@
<td><%= transaction["account_status"] %></td>
<td><%= transaction["status"] %></td>
<td><%= transaction["receipt_no"] %></td>
<td></td>
</tr>
<% end %>
<% end %>
<% end %>
</tbody>
</table>
</div>

6
config/initializers/secrets.rb Executable file
View File

@@ -0,0 +1,6 @@
config = YAML.load_file("#{Rails.root}/config/secrets.yml")
config.fetch(Rails.env, {}).each do |key, value|
ENV[key.upcase] = value.to_s
end
# SECRETS_CONFIG = YAML.load_file("#{Rails.root}/config/secrets.yml")[Rails.env]

View File

@@ -1,10 +1,10 @@
development:
server_mode: local
server_mode: cloud
license_key: IAAXHpbSWAfvlWGYpDoXvZdmuRABNGk
test:
sx_provision_url: secure.smartsales.asia/api
sx_provision_url: "provision.test.ws/api"
# Do not keep production secrets in the repository,
# instead read values from the environment.

View File

@@ -29,6 +29,7 @@ en:
top: "Top"
orders: "Orders"
credit: "Credit"
bookings: "Booking"
home: "Home"
simple_menu_item: "Simple Menu Item"
set_menu_item: "Set Menu Item"
@@ -63,6 +64,7 @@ en:
customer_details: "Customer Details"
order_details: "Order Details"
sale_details: "Sale Details"
booking_details: "Booking Details"
inventory_definitions: "Inventory Definitions"
sale_audits: "Sale Audits"

View File

@@ -28,6 +28,7 @@ mm:
hourly: "နာရီအလိုက်"
top: "အရောင်းရဆုံး"
orders: "အော်ဒါများ"
bookings: "အော်ဒါများ"
credit: "အကြွေး"
home: "မူလစာမျက်နှာ"
simple_menu_item: "ဟင်းလျာများ"
@@ -63,6 +64,7 @@ mm:
customer_details: "စားသုံးသူကိုယ်ရေးအသေးစိတ်"
order_details: "မှာကြားမှုအသေးစိတ်"
sale_details: "ရောင်းရငွေအသေးစိတ်"
booking_details: "ရောင်းရငွေအသေးစိတ်"
inventory_definitions: "ကုန်လှောင်ရုံပစ္စည်းဖွင့်ဆိုချက်များ"
sale_audits: "အရောင်းပြင်ဆင်ခြင်းများ"

View File

@@ -335,6 +335,7 @@ scope "(:locale)", locale: /en|mm/ do
resources :sales
resources :orders
resources :credit_notes
resources :bookings
get "/sales/:sale_id/manual_complete_sale" => "manual_sales#manual_complete_sale", :as => "manual_complete_sale"
get "/sales/:sale_id/void" => "manual_sales#void", :as => "void"

View File

@@ -12,9 +12,11 @@
development:
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
sx_provision_url: secure.smartsales.asia/api
aes_key: <%= ENV['aes_key'] %>
aes_iv: <%= ENV['aes_iv'] %>
sx_provision_url: provision.zsai.ws/api #192.168.1.94:3002
server_mode: cloud
cipher_type: AES-256-CBC
aes_key: <%= ENV['AES_KEY'] %>
aes_iv: <%= ENV['AES_IV'] %>
test:
secret_key_base: 5c92143fd4a844fdaf8b22aba0cda22ef1fc68f1b26dd3d40656866893718ae5e58625b4c3a5dc86b04c8be0a505ec0ebc0be3bf52249a3d1e0c1334ee591cf0
@@ -23,7 +25,8 @@ test:
# instead read values from the environment.
production:
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
sx_provision_url: secure.smartsales.asia/api
aes_key: <%= ENV['aes_key'] %>
aes_iv: <%= ENV['aes_iv'] %>
sx_provision_url: provision.zsai.ws/api #192.168.1.94:3002
server_mode: cloud
aes_key: <%= ENV['AES_KEY'] %>
aes_iv: <%= ENV['AES_IV'] %>

View File

@@ -251,4 +251,4 @@ zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order
zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone2})
zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone3})
puts " Finished System Default Set Up Data "
puts " Finished System Default Set Up Data vWSsseoZCzxd6xcNf_uS RxzaYyAGzm7VqAZ4hKnv "

View File

@@ -14,7 +14,7 @@ namespace :clear do
ShiftSale.delete_all
PaymentJournal.delete_all
DiningFacility.update_all(status:'available')
CashierTerminal.update_all(is_currently_login: 1)
CashierTerminal.update_all(is_currently_login: 0)
puts "Clear Data Done."
end
end