change split bill equal person flow
This commit is contained in:
@@ -318,7 +318,6 @@
|
||||
<script type="text/javascript">
|
||||
var split_sale_id = "";
|
||||
var split_receipt_no = "";
|
||||
var split_total_amount = 0;
|
||||
$(document).ready(function(){
|
||||
$('#back').on('click',function(){
|
||||
backToOrigami();
|
||||
@@ -396,7 +395,7 @@
|
||||
// orderItemSplitBillProcess(cnt_items);
|
||||
// }
|
||||
}else{
|
||||
swal("Opps","Please select at least one item!","warning");
|
||||
swal("Oops","Please select at least one item!","warning");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -460,7 +459,7 @@
|
||||
// orderSplitBillProcess(cnt_odrs);
|
||||
// }
|
||||
}else{
|
||||
swal("Opps","Please select at least one order!","warning");
|
||||
swal("Oops","Please select at least one order!","warning");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -476,28 +475,12 @@
|
||||
var dining_id = $("#table_id").text();
|
||||
split_sale_id = $("input[type='radio'][name='rdn_receipt']:checked").val();
|
||||
split_receipt_no = $("input[type='radio'][name='rdn_receipt']:checked").parent().parent().attr('id');
|
||||
split_total_amount = $("input[type='radio'][name='rdn_receipt']:checked").parent().parent().attr('data');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/split_bills/get_survey",
|
||||
dataType: 'JSON',
|
||||
data: {'dining_id':dining_id, 'receipt_no':split_receipt_no },
|
||||
success: function (result) {
|
||||
if(result.status){
|
||||
if(parseInt(result.survey.total_customer) > 0){
|
||||
$("#per_person").val(parseInt(result.survey.total_customer));
|
||||
}else{
|
||||
$("#per_person").val("");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(split_sale_id != undefined && split_sale_id != ""){
|
||||
$('#equal_split_modal').modal({backdrop: 'static', keyboard: true, show: true});
|
||||
}
|
||||
else{
|
||||
swal("Opps","Please select one receipt!","warning");
|
||||
swal("Oops","Please select one receipt!","warning");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -508,15 +491,15 @@
|
||||
$("#per_personErr").html('');
|
||||
$('#equal_split_modal').modal('hide');
|
||||
if(person > 1){
|
||||
var ajax_url = "/origami/split_bills/surveys";
|
||||
var dining_id = $("#table_id").text();
|
||||
var ajax_url = "/origami/split_bills/equal_person";
|
||||
var dining_id = $("#table_id").text();
|
||||
var type = $("#table_type").text();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
dataType: 'JSON',
|
||||
data: {'dining_id':dining_id, 'sale_id':split_sale_id, 'receipt_no':split_receipt_no, 'total_customer': person, 'total_amount':split_total_amount },
|
||||
data: { 'sale_id':split_sale_id, 'total_customer': person },
|
||||
success: function (result) {
|
||||
console.log(result);
|
||||
if(result.status){
|
||||
|
||||
Reference in New Issue
Block a user