update payment

This commit is contained in:
Aung Myo
2018-02-05 15:10:35 +06:30
parent 3ac6871a89
commit 76a094972e
4 changed files with 76 additions and 5 deletions

View File

@@ -163,6 +163,7 @@ class Origami::PaymentsController < BaseOrigamiController
@balance = 0.00
@accountable_type = ''
@table_no = ''
@dining = ''
@shop = Shop::ShopDetail
@@ -215,6 +216,7 @@ class Origami::PaymentsController < BaseOrigamiController
df = DiningFacility.find(sbk.dining_facility_id)
@table_no = df.type + ' ' + df.name
@checkin_time = sbk.checkin_at
@dining = df
break
end

View File

@@ -534,7 +534,7 @@
var sale_id = "<%= @dining.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

View File

@@ -313,8 +313,6 @@
<script>
var cashier_type = "<%= @cashier_type %>";
$(document).ready(function(){
<%= ENV["SERVER_MODE"] %>
/* start check first bill or not*/
var member_id = $('#membership_id').text();
var member_discount = $('#member_discount').text();
@@ -353,7 +351,6 @@ var cashier_type = "<%= @cashier_type %>";
}else{
window.location.href = '/origami/quick_service';
}
});
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
@@ -365,6 +362,78 @@ var cashier_type = "<%= @cashier_type %>";
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){
if(event.handled !== true) {
var original_value;

View File

@@ -197,7 +197,7 @@ scope "(:locale)", locale: /en|mm/ do
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"
get '/addorders/get_menu_category/:id' => "addorders#get_menu_category",:as => "get_menu_category", :defaults => { :format => 'json' }