update payment
This commit is contained in:
@@ -163,6 +163,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@balance = 0.00
|
@balance = 0.00
|
||||||
@accountable_type = ''
|
@accountable_type = ''
|
||||||
@table_no = ''
|
@table_no = ''
|
||||||
|
@dining = ''
|
||||||
|
|
||||||
@shop = Shop::ShopDetail
|
@shop = Shop::ShopDetail
|
||||||
|
|
||||||
@@ -215,6 +216,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
df = DiningFacility.find(sbk.dining_facility_id)
|
df = DiningFacility.find(sbk.dining_facility_id)
|
||||||
@table_no = df.type + ' ' + df.name
|
@table_no = df.type + ' ' + df.name
|
||||||
@checkin_time = sbk.checkin_at
|
@checkin_time = sbk.checkin_at
|
||||||
|
@dining = df
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -534,7 +534,7 @@
|
|||||||
var sale_id = "<%= @dining.id %>";
|
var sale_id = "<%= @dining.id %>";
|
||||||
}
|
}
|
||||||
//var table_id = $('.tables').attr("data-id");
|
//var table_id = $('.tables').attr("data-id");
|
||||||
window.location.href = '/origami/' + sale_id + "/surveys"
|
window.location.href = '/origami/' + sale_id +"/"+cashier_type+ "/surveys"
|
||||||
});
|
});
|
||||||
|
|
||||||
// bind customer to order or sale
|
// bind customer to order or sale
|
||||||
|
|||||||
@@ -313,8 +313,6 @@
|
|||||||
<script>
|
<script>
|
||||||
var cashier_type = "<%= @cashier_type %>";
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
<%= ENV["SERVER_MODE"] %>
|
|
||||||
/* start check first bill or not*/
|
/* start check first bill or not*/
|
||||||
var member_id = $('#membership_id').text();
|
var member_id = $('#membership_id').text();
|
||||||
var member_discount = $('#member_discount').text();
|
var member_discount = $('#member_discount').text();
|
||||||
@@ -353,7 +351,6 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/quick_service';
|
window.location.href = '/origami/quick_service';
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
|
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
|
||||||
@@ -365,6 +362,78 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
update_balance();
|
update_balance();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// bind survey to order or sale
|
||||||
|
$("#survey").on('click', function () {
|
||||||
|
var sale = $('#sale_id').text();
|
||||||
|
if (sale) {
|
||||||
|
var sale_id = sale
|
||||||
|
} else {
|
||||||
|
var sale_id = "<%= @dining.id %>";
|
||||||
|
}
|
||||||
|
//var table_id = $('.tables').attr("data-id");
|
||||||
|
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys"
|
||||||
|
});
|
||||||
|
|
||||||
|
// bind customer to order or sale
|
||||||
|
$("#customer").on('click', function () {
|
||||||
|
var sale = $('#sale_id').text();
|
||||||
|
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 + "/customers"
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add Other Charges
|
||||||
|
$('#other-charges').click(function () {
|
||||||
|
var sale = $('#sale_id').text();
|
||||||
|
if (sale != "") {
|
||||||
|
var sale_id = sale
|
||||||
|
} else {
|
||||||
|
var sale_id = $('#save_order_id').attr('data-order');
|
||||||
|
}
|
||||||
|
if (sale_id != "") {
|
||||||
|
window.location.href = '/origami/' + sale_id + '/other_charges'
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
// Discount for Payment
|
||||||
|
$('#discount').click(function () {
|
||||||
|
if ($(this).attr('active')=== "true") {
|
||||||
|
var sale = $('#sale_id').text();
|
||||||
|
if (sale != "") {
|
||||||
|
var sale_id = sale
|
||||||
|
} else {
|
||||||
|
var sale_id = $('#save_order_id').attr('data-order');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sale_id != "") {
|
||||||
|
window.location.href = '/origami/' + sale_id + '/discount'
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
swal("Opps","You are not authorized for Discount","warning")
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#edit').on('click', function () {
|
||||||
|
var dining_id = "<%= @dining.id %>"
|
||||||
|
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||||
|
if ($(this).attr('active')=== "true") {
|
||||||
|
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit";
|
||||||
|
}else{
|
||||||
|
swal("Opps","You are not authorized for void","warning")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
var original_value;
|
var original_value;
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
|
|
||||||
post '/:sale_id/get_customer' => "customers#get_customer"
|
post '/:sale_id/get_customer' => "customers#get_customer"
|
||||||
|
|
||||||
get '/:id/surveys', to: "surveys#new"
|
get '/:id/:type/surveys', to: "surveys#new"
|
||||||
post '/:id/create_survey' => "surveys#create", :as => "create_surveys"
|
post '/:id/create_survey' => "surveys#create", :as => "create_surveys"
|
||||||
|
|
||||||
get '/addorders/get_menu_category/:id' => "addorders#get_menu_category",:as => "get_menu_category", :defaults => { :format => 'json' }
|
get '/addorders/get_menu_category/:id' => "addorders#get_menu_category",:as => "get_menu_category", :defaults => { :format => 'json' }
|
||||||
|
|||||||
Reference in New Issue
Block a user