Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -880,8 +880,19 @@ $(function() {
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
if (result.status) {
|
if (result.status) {
|
||||||
|
console.log(result)
|
||||||
if (result.data == null){
|
if (result.data == null){
|
||||||
|
swal({
|
||||||
|
title: "Please Open Shift !",
|
||||||
|
text: result.status,
|
||||||
|
type: "warning",
|
||||||
|
confirmButtonColor: "#DD6B55",
|
||||||
|
confirmButtonText: "Ok",
|
||||||
|
closeOnConfirm: false
|
||||||
|
}, function () {
|
||||||
window.location.href = '/origami/quick_service/pending_order/' + $('#sale_id').text();
|
window.location.href = '/origami/quick_service/pending_order/' + $('#sale_id').text();
|
||||||
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment"
|
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
:body => member_params,
|
:body => member_params,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
},
|
},
|
||||||
:timeout => 10
|
:timeout => 10
|
||||||
)
|
)
|
||||||
@@ -269,7 +269,7 @@ end
|
|||||||
:body => member_params,
|
:body => member_params,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
},
|
},
|
||||||
:timeout => 10
|
:timeout => 10
|
||||||
)
|
)
|
||||||
@@ -328,7 +328,7 @@ end
|
|||||||
:body => member_params,
|
:body => member_params,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
},
|
},
|
||||||
:timeout => 10
|
:timeout => 10
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ class Origami::DiscountsController < BaseOrigamiController
|
|||||||
auth_token:auth_token}.to_json,
|
auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
}, :timeout => 10)
|
}, :timeout => 10)
|
||||||
rescue HTTParty::Error
|
rescue HTTParty::Error
|
||||||
response = {"status": false, "message": "Can't open membership server " }
|
response = {"status": false, "message": "Can't open membership server " }
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
# get member information
|
# get member information
|
||||||
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)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
# current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
# current_balance = 0
|
current_balance = 0
|
||||||
end
|
end
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
@@ -152,9 +152,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
if customer.membership_id != nil && rebate && credit_data.nil?
|
if customer.membership_id != nil && rebate && credit_data.nil?
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
|
if member_info["status"] == true
|
||||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#for card sale data
|
#for card sale data
|
||||||
card_data = Array.new
|
card_data = Array.new
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
if !ShiftSale.current_shift.nil?
|
if !ShiftSale.current_shift.nil?
|
||||||
order_id = params[:id] # order_id
|
order_id = params[:id] # order_id
|
||||||
bk_order = BookingOrder.find_by_order_id(order_id)
|
bk_order = BookingOrder.find_by_order_id(order_id)
|
||||||
puts params[:id]
|
order = Order.find(order_id)
|
||||||
puts bk_order
|
|
||||||
puts bk_order.booking_id
|
|
||||||
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
|
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
|
||||||
|
|
||||||
if check_booking.sale_id.nil?
|
if check_booking.sale_id.nil?
|
||||||
@@ -29,6 +27,10 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
|
|
||||||
# Promotion Activation
|
# Promotion Activation
|
||||||
Promotion.promo_activate(@sale)
|
Promotion.promo_activate(@sale)
|
||||||
|
if order.source == "quick_service"
|
||||||
|
result = {:status=> @status, :data => @sale.sale_id }
|
||||||
|
render :json => result.to_json
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@status = false
|
@status = false
|
||||||
@error_message = "No Current Open Shift for This Employee"
|
@error_message = "No Current Open Shift for This Employee"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Origami::VoucherController < BaseOrigamiController
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
}, :timeout => 10
|
}, :timeout => 10
|
||||||
)
|
)
|
||||||
rescue Net::OpenTimeout
|
rescue Net::OpenTimeout
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Customer < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
},
|
},
|
||||||
:timeout => 10)
|
:timeout => 10)
|
||||||
rescue HTTParty::Error
|
rescue HTTParty::Error
|
||||||
@@ -71,7 +71,7 @@ class Customer < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
},
|
},
|
||||||
:timeout => 10
|
:timeout => 10
|
||||||
)
|
)
|
||||||
@@ -124,7 +124,7 @@ class Customer < ApplicationRecord
|
|||||||
:body => member_params,
|
:body => member_params,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
})
|
})
|
||||||
rescue Net::OpenTimeout
|
rescue Net::OpenTimeout
|
||||||
response = { status: false, message: "Server Time out" }
|
response = { status: false, message: "Server Time out" }
|
||||||
@@ -201,7 +201,7 @@ class Customer < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
}, :timeout => 10)
|
}, :timeout => 10)
|
||||||
rescue Net::OpenTimeout
|
rescue Net::OpenTimeout
|
||||||
response = { "status": false , "message": "Connect To" }
|
response = { "status": false , "message": "Connect To" }
|
||||||
@@ -277,7 +277,7 @@ class Customer < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
}, :timeout => 10)
|
}, :timeout => 10)
|
||||||
rescue Net::OpenTimeout
|
rescue Net::OpenTimeout
|
||||||
response = { "status": false , "message": "Connect To" }
|
response = { "status": false , "message": "Connect To" }
|
||||||
@@ -312,7 +312,7 @@ class Customer < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
},
|
},
|
||||||
:timeout => 10
|
:timeout => 10
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class SalePayment < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
}, :timeout => 10
|
}, :timeout => 10
|
||||||
)
|
)
|
||||||
rescue Net::OpenTimeout
|
rescue Net::OpenTimeout
|
||||||
@@ -133,7 +133,7 @@ class SalePayment < ApplicationRecord
|
|||||||
auth_token:auth_token}.to_json,
|
auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
},
|
},
|
||||||
:timeout => 10
|
:timeout => 10
|
||||||
)
|
)
|
||||||
@@ -455,7 +455,7 @@ class SalePayment < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
}, :timeout => 10)
|
}, :timeout => 10)
|
||||||
rescue Net::OpenTimeout
|
rescue Net::OpenTimeout
|
||||||
response = { "status": false , "message": " Connection timeout" }
|
response = { "status": false , "message": " Connection timeout" }
|
||||||
@@ -500,7 +500,8 @@ class SalePayment < ApplicationRecord
|
|||||||
end
|
end
|
||||||
rebate_arr.push(data)
|
rebate_arr.push(data)
|
||||||
end
|
end
|
||||||
|
Rails.logger.debug "Rebage Response"
|
||||||
|
Rails.logger.debug rebate_arr.to_json
|
||||||
total_amount = rebate_prices - payparcost - overall_dis
|
total_amount = rebate_prices - payparcost - overall_dis
|
||||||
|
|
||||||
if credit == 1
|
if credit == 1
|
||||||
@@ -531,7 +532,7 @@ class SalePayment < ApplicationRecord
|
|||||||
}.to_json,
|
}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=2'
|
'Accept' => 'application/json; version=3'
|
||||||
}, :timeout => 10)
|
}, :timeout => 10)
|
||||||
rescue Net::OpenTimeout
|
rescue Net::OpenTimeout
|
||||||
response = { "status": false , "message": "Connect To" }
|
response = { "status": false , "message": "Connect To" }
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<!-- #END# Search Bar -->
|
<!-- #END# Search Bar -->
|
||||||
<!-- Top Bar -->
|
<!-- Top Bar -->
|
||||||
|
<%if !request.path_info.include?('second_display') %>
|
||||||
<nav class="navbar">
|
<nav class="navbar">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
<%end%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
if((document.getElementById("otherPayment")!=undefined) && (document.getElementById("otherPayment")!=null) && (document.getElementById("otherPayment")!="")){
|
if((document.getElementById("otherPayment")!=undefined) && (document.getElementById("otherPayment")!=null) && (document.getElementById("otherPayment")!="")){
|
||||||
var otherPayment = location.href.split('/')[location.href.split('/').length -1 ];
|
var otherPayment = location.href.split('/')[location.href.split('/').length -1 ];
|
||||||
|
|||||||
@@ -482,6 +482,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<style type="text/css">
|
||||||
|
.fadeInRight{
|
||||||
|
-webkit-animation-duration: 350ms !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
jQuery(function(){
|
jQuery(function(){
|
||||||
id = "<%=@menu[0].id%>";
|
id = "<%=@menu[0].id%>";
|
||||||
|
|||||||
@@ -189,15 +189,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<button type="button" data-href="<%=origami_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect second_view hidden" style="height: 45px">Customer View</button>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(".cashier_view").on('click', function() {
|
$(".cashier_view").on('click', function() {
|
||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".qs_view").on('click', function() {
|
$(".qs_view").on('click', function() {
|
||||||
|
document.getElementById('second_view').click();
|
||||||
window.location.href = '/origami/quick_service';
|
window.location.href = '/origami/quick_service';
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#second_view").on('click', function () {
|
||||||
|
var url = $(this).attr("data-href");
|
||||||
|
window.open(url,'_blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
<div class="tab-pane dining" id="orders" role="tabpanel">
|
<div class="tab-pane dining" id="orders" role="tabpanel">
|
||||||
<div class="card-columns">
|
<div class="card-columns">
|
||||||
<% @orders.each do |order| %>
|
<% @orders.each do |order| %>
|
||||||
<div class="card orders red text-white" data-id="<%= order.order_id %>">
|
<div class="card orders <%=(order.status=="new") ? 'blue' : 'red'%> text-white" data-id="<%= order.order_id %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%
|
<%
|
||||||
order_status = ""
|
order_status = ""
|
||||||
@@ -424,7 +424,7 @@
|
|||||||
<i class="material-icons">reply</i>
|
<i class="material-icons">reply</i>
|
||||||
<%= t("views.btn.back") %>
|
<%= t("views.btn.back") %>
|
||||||
</button>
|
</button>
|
||||||
<a href="<%=origami_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect" style="height: 45px">Customer View</a>
|
<!-- <a href="<%=origami_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect" style="height: 45px">Customer View</a> -->
|
||||||
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
|
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
|
||||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||||
<% if @dining.status != "available" %>
|
<% if @dining.status != "available" %>
|
||||||
@@ -491,11 +491,11 @@
|
|||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="paymentModalLabel">Choose Payment</h4>
|
<h4 class="modal-title" id="paymentModalLabel">Choose Payment Method</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<select class="form-control show-tick payment_method" multiple="true" id="payment_method" >
|
<select class="form-control show-tick payment_method" multiple="true" id="payment_method" >
|
||||||
<option value="Cash">Cash</option>
|
<!-- <option value="Cash">Cash</option> -->
|
||||||
<option value="Credit">Credit</option>
|
<option value="Credit">Credit</option>
|
||||||
<% @payment_methods.each do |pay| %>
|
<% @payment_methods.each do |pay| %>
|
||||||
<option value="<%= pay.payment_method %>">
|
<option value="<%= pay.payment_method %>">
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
<div class="tab-pane active" id="orders" role="tabpanel" style="">
|
<div class="tab-pane active" id="orders" role="tabpanel" style="">
|
||||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||||
<% @orders.each do |order| %>
|
<% @orders.each do |order| %>
|
||||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
<div class="card orders <%=(order.status=="new") ? 'blue' : 'red'%> text-white" data-id = "<%= order.order_id %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%
|
<%
|
||||||
order_status = ""
|
order_status = ""
|
||||||
|
|||||||
@@ -203,11 +203,12 @@ $(document).ready(function(){
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
// data: 'order_id='+ order_id,
|
// data: 'order_id='+ order_id,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
|
console.log(result)
|
||||||
if (!result.status) {
|
if (!result.status) {
|
||||||
swal("Information!", result.error_message);
|
swal("Information!", result.error_message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
location.reload();
|
window.location.href = '../pending_order/'+ result.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<div class="card-text" >
|
<div class="card-text" >
|
||||||
<div id="order-detail-slimscroll" data-height="150">
|
<div id="order-detail-slimscroll" data-height="160">
|
||||||
<table class="table table-striped second_display_items" id="order-items-table">
|
<table class="table table-striped second_display_items" id="order-items-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid" style="margin-top:-65px;">
|
||||||
<button type="button" class="hidden" id="s_reload">Reload</button>
|
<button type="button" class="hidden" id="s_reload">Reload</button>
|
||||||
<div class="slider" id="second_display_slider">
|
<div class="slider" id="second_display_slider">
|
||||||
<%= render 'slider' %>
|
<%= render 'slider' %>
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ class ActionController::Base
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
# check for license file
|
# check for license file
|
||||||
if check_license
|
# if check_license
|
||||||
current_license(ENV["SX_PROVISION_URL"])
|
# current_license(ENV["SX_PROVISION_URL"])
|
||||||
else
|
# else
|
||||||
redirect_to activate_path
|
# redirect_to activate_path
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class CreateSaleAudits < ActiveRecord::Migration[5.1]
|
|||||||
t.string :action_by, :null => false
|
t.string :action_by, :null => false
|
||||||
t.string :approved_by, :null => true
|
t.string :approved_by, :null => true
|
||||||
t.datetime :approved_at, :null => true
|
t.datetime :approved_at, :null => true
|
||||||
t.string :remark
|
t.text :remark
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user