add order button disable enable
This commit is contained in:
@@ -124,24 +124,31 @@ function update_sale(membership_id, customer_id, customer_name, sale_id) {
|
||||
confirmButtonText: "Yes!",
|
||||
cancelButtonClass: 'btn btn-danger customer_assign_cancel',
|
||||
closeOnConfirm: true,
|
||||
}, function () {
|
||||
$("#oqs_loading_wrapper").show();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/foodcourt/"+sale_id+"/"+cashier_type+"/customers/update_sale" ,
|
||||
data: {customer_id:customer_id,sale_id:sale_id},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.status == true)
|
||||
{
|
||||
//change customer detail
|
||||
$("#customer_name").html(customer_name);
|
||||
$("#membership_id").html(membership_id);
|
||||
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||
}else{
|
||||
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||
}
|
||||
}, function (inputValue) {
|
||||
if (inputValue===false) {
|
||||
if ($("#order-items-table tr").length > 1){
|
||||
$("#create_pay_order").prop("disabled", false);
|
||||
$("#create_order").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$("#oqs_loading_wrapper").show();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/foodcourt/"+sale_id+"/"+cashier_type+"/customers/update_sale" ,
|
||||
data: {customer_id:customer_id,sale_id:sale_id},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.status == true)
|
||||
{
|
||||
//change customer detail
|
||||
$("#customer_name").html(customer_name);
|
||||
$("#membership_id").html(membership_id);
|
||||
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||
}else{
|
||||
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user