Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into split_bill
This commit is contained in:
@@ -25,9 +25,10 @@ class Api::CheckInProcessController < Api::ApiController
|
|||||||
alert_time_min = checkout_time[1].to_i
|
alert_time_min = checkout_time[1].to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time, :alert_time_min => alert_time_min, :extra_minutes => extra_minutes }
|
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time, :alert_time_min => alert_time_min, :extra_minutes => extra_minutes }
|
||||||
|
else
|
||||||
|
render :json => { :status => true }
|
||||||
|
end
|
||||||
else
|
else
|
||||||
render :json => { :status => false, :error_message => "No current booking!" }
|
render :json => { :status => false, :error_message => "No current booking!" }
|
||||||
end
|
end
|
||||||
@@ -41,17 +42,19 @@ class Api::CheckInProcessController < Api::ApiController
|
|||||||
lookup_checkout_time = Lookup.collection_of("checkout_time")
|
lookup_checkout_time = Lookup.collection_of("checkout_time")
|
||||||
|
|
||||||
if !lookup_checkout_time.empty?
|
if !lookup_checkout_time.empty?
|
||||||
checkout_at = Time.now.utc
|
today = Time.now.utc.getlocal
|
||||||
|
checkout_at = Time.now.utc.getlocal
|
||||||
|
|
||||||
lookup_checkout_time.each do |checkout_time|
|
lookup_checkout_time.each do |checkout_time|
|
||||||
arr_time = checkout_time[0].split("-")
|
arr_time = checkout_time[0].split("-")
|
||||||
start_time = Time.parse(arr_time[0].strip).utc.strftime("%H:%M%p")
|
start_time = Time.parse(arr_time[0].strip).utc.getlocal.strftime("%H:%M%p")
|
||||||
end_time = Time.parse(arr_time[1].strip).utc.strftime("%H:%M%p")
|
end_time = Time.parse(arr_time[1].strip).utc.getlocal.strftime("%H:%M%p")
|
||||||
if start_time <= checkout_at && checkout_at <= end_time
|
if start_time <= checkout_at.strftime("%H:%M%p") && checkout_at.strftime("%H:%M%p") <= end_time
|
||||||
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
|
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if checkout_at.strftime("%Y-%m-%d %H:%M%p") > today.strftime("%Y-%m-%d %H:%M%p")
|
||||||
dining_facility.status = "occupied"
|
dining_facility.status = "occupied"
|
||||||
dining_facility.save!
|
dining_facility.save!
|
||||||
|
|
||||||
@@ -69,6 +72,9 @@ class Api::CheckInProcessController < Api::ApiController
|
|||||||
else
|
else
|
||||||
render :json => { :status => true }
|
render :json => { :status => true }
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
render :json => { :status => true }
|
||||||
|
end
|
||||||
else
|
else
|
||||||
error_message = "#{dining_facility.type} is not available!"
|
error_message = "#{dining_facility.type} is not available!"
|
||||||
render :json => { :status => false, :error_message => error_message }
|
render :json => { :status => false, :error_message => error_message }
|
||||||
|
|||||||
@@ -2,17 +2,19 @@ class Origami::CheckInProcessController < BaseOrigamiController
|
|||||||
|
|
||||||
def check_in_process
|
def check_in_process
|
||||||
lookup_checkout_time = Lookup.collection_of("checkout_time")
|
lookup_checkout_time = Lookup.collection_of("checkout_time")
|
||||||
checkout_at = Time.now.utc
|
today = Time.now.utc.getlocal
|
||||||
|
checkout_at = Time.now.utc.getlocal
|
||||||
if !lookup_checkout_time.empty?
|
if !lookup_checkout_time.empty?
|
||||||
lookup_checkout_time.each do |checkout_time|
|
lookup_checkout_time.each do |checkout_time|
|
||||||
arr_time = checkout_time[0].split("-")
|
arr_time = checkout_time[0].split("-")
|
||||||
start_time = Time.parse(arr_time[0].strip).utc.strftime("%H:%M%p")
|
start_time = Time.parse(arr_time[0].strip).utc.getlocal.strftime("%H:%M%p")
|
||||||
end_time = Time.parse(arr_time[1].strip).utc.strftime("%H:%M%p")
|
end_time = Time.parse(arr_time[1].strip).utc.getlocal.strftime("%H:%M%p")
|
||||||
if start_time <= checkout_at && checkout_at <= end_time
|
if start_time <= checkout_at.strftime("%H:%M%p") && checkout_at.strftime("%H:%M%p") <= end_time
|
||||||
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
|
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
if checkout_at.strftime("%Y-%m-%d %H:%M%p") > today.strftime("%Y-%m-%d %H:%M%p")
|
||||||
@dining_facility = DiningFacility.find(params[:dining_id])
|
@dining_facility = DiningFacility.find(params[:dining_id])
|
||||||
@dining_facility.status = "occupied"
|
@dining_facility.status = "occupied"
|
||||||
@dining_facility.save!
|
@dining_facility.save!
|
||||||
@@ -26,7 +28,8 @@ class Origami::CheckInProcessController < BaseOrigamiController
|
|||||||
@booking = Booking.create({:dining_facility_id => params[:dining_id],:type => type,
|
@booking = Booking.create({:dining_facility_id => params[:dining_id],:type => type,
|
||||||
:checkin_by=>current_login_employee.name,:checkin_at => Time.now.utc,:checkout_at =>checkout_at, :booking_status => "assign", :reserved_at => checkout_at, :reserved_by => current_login_employee.name })
|
:checkin_by=>current_login_employee.name,:checkin_at => Time.now.utc,:checkout_at =>checkout_at, :booking_status => "assign", :reserved_at => checkout_at, :reserved_by => current_login_employee.name })
|
||||||
@booking.save!
|
@booking.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
respond = {:status => 'ok'}
|
respond = {:status => 'ok'}
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json { render json: respond }
|
format.json { render json: respond }
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#for bank integration
|
||||||
|
@checkout_time = Lookup.collection_of('checkout_time')
|
||||||
|
@checkout_alert_time = Lookup.collection_of('checkout_alert_time')
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ class Origami::ShiftsController < BaseOrigamiController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
|
#for bank integration
|
||||||
|
bank_integration = Lookup.collection_of('bank_integration')
|
||||||
|
@bank_integration = 0
|
||||||
|
if !bank_integration[0].nil?
|
||||||
|
@bank_integration = bank_integration[0][1]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
rebate = MembershipSetting.find_by_rebate(1)
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
if customer.membership_id != nil && rebate
|
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)
|
rebate_amount = Customer.get_membership_transactions(customer,sale.receipt_no)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -431,8 +431,10 @@
|
|||||||
|
|
||||||
<!-- <button type="button" id="re-print" class="btn btn-block bg-blue waves-effect" >Re.Print</button> -->
|
<!-- <button type="button" id="re-print" class="btn btn-block bg-blue waves-effect" >Re.Print</button> -->
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<% if !@checkout_time.empty? && !@checkout_alert_time.empty? %>
|
||||||
<button type="button" id="check_in" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.check_in") %></button>
|
<button type="button" id="check_in" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.check_in") %></button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
||||||
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<button type="button" class="btn bg-default btn-block" id='back'><i class="material-icons">reply</i> <%= t("views.btn.back") %> </button>
|
<button type="button" class="btn bg-default btn-block" id='back'><i class="material-icons">reply</i> <%= t("views.btn.back") %> </button>
|
||||||
<button type="button" class="btn bg-blue btn-block green" id='close_cashier'> <%= t("views.btn.close_cashier") %> </button>
|
<button type="button" class="btn bg-blue btn-block green" id='close_cashier'> <%= t("views.btn.close_cashier") %> </button>
|
||||||
|
<% if @bank_integration == '1' %>
|
||||||
<button type="button" class="btn bg-blue btn-block green" id="card_settlement"> <%= t("views.btn.card_settle") %> </button>
|
<button type="button" class="btn bg-blue btn-block green" id="card_settlement"> <%= t("views.btn.card_settle") %> </button>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user