change split bill ui
This commit is contained in:
@@ -367,6 +367,9 @@
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice</button>
|
||||
<% if !@spit_bill.nil? && @spit_bill == '1' %>
|
||||
<button class='btn btn-primary' id='split_bill'> Split Bill</button>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @sale_array.size > 1 %>
|
||||
<br><br>
|
||||
@@ -692,11 +695,11 @@
|
||||
var lookup_split_bill = '<%= @spit_bill %>';
|
||||
if(lookup_split_bill == '1'){
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure, you want to Split bill?",
|
||||
type: "warning",
|
||||
title: "Information!",
|
||||
text: "Do you want to Split bill?",
|
||||
type: "success",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonColor: "#009900",
|
||||
confirmButtonText: "Yes, split it!",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
@@ -740,8 +743,8 @@
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -867,4 +870,22 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* split bill in add to existing invoice*/
|
||||
$('#split_bill').on('click', function(){
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure, you want to split bill?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, split it!",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if(isConfirm){
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
window.location.href = '/origami/table/' + dining_id + "/split_bills";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user