changed pay button event

This commit is contained in:
yarzar_code
2020-08-10 18:28:03 +06:30
parent d6f6e51e6f
commit 975d0f3ecd

View File

@@ -746,16 +746,6 @@ $(document).ready(function(){
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:customer_mamber_card_no}, data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:customer_mamber_card_no},
success: function(result){ success: function(result){
if(result.status == true){ if(result.status == true){
swal({
title: "Information!",
text: result.message,
type: 'success',
html: true,
closeOnConfirm: true,
closeOnCancel: false,
allowOutsideClick: false
}, function (isConfirm) {
$('.confirm').attr("disabled","disabled");
sub_total = $('#sub-total').text(); sub_total = $('#sub-total').text();
member = $('#membership_id').text(); member = $('#membership_id').text();
@@ -780,7 +770,7 @@ $(document).ready(function(){
$.ajax({type: "POST", $.ajax({type: "POST",
url: url, url: url,
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type + "&tax_type=" + tax_type + "&is_kbz=" + is_kbz+"&account_no="+customer_mamber_card_no, data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type + "&tax_type=" + tax_type + "&is_kbz=" + is_kbz+"&account_no="+customer_mamber_card_no,
success:function(result){ success:function(result) {
/* start delete receipt no in first bill*/ /* start delete receipt no in first bill*/
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){ if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
var receipt_no = ($("#receipt_no").html()).trim(); var receipt_no = ($("#receipt_no").html()).trim();
@@ -788,16 +778,28 @@ $(document).ready(function(){
} }
/* end delete receipt no in first bill*/ /* end delete receipt no in first bill*/
localStorage.removeItem("cash"); localStorage.removeItem("cash");
swal({
title: "Payment Successful!",
text: "Thank You !",
type: 'success',
html: true,
closeOnConfirm: true,
closeOnCancel: false,
allowOutsideClick: false
},
function (isConfirm) {
$('.confirm').attr("disabled","disabled");
window.location.href = "<%= foodcourt_food_court_path %>"; window.location.href = "<%= foodcourt_food_court_path %>";
});
$("#loading_wrapper").hide();
} }
}); });
var second_display_lookup = $("#display_type").val(); var second_display_lookup = $("#display_type").val();
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){ if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){
customer_display_view(null,"reload"); customer_display_view(null,"reload");
} }
}); } else {
}else{
swal({ swal({
title: 'Oops', title: 'Oops',
text: result.message, text: result.message,
@@ -807,11 +809,11 @@ $(document).ready(function(){
closeOnCancel: false, closeOnCancel: false,
allowOutsideClick: false allowOutsideClick: false
}, function () { }, function () {
window.location.href = '/foodcourt/sale/'+ sale_id +"/"+cashier_type + "/payment"; location.reload();
}); });
}
$("#loading_wrapper").hide(); $("#loading_wrapper").hide();
} }
}
}); });
}else{ }else{
swal({ swal({