change split bill ui

This commit is contained in:
phyusin
2018-02-07 15:50:36 +06:30
parent 41aa840eb2
commit 492bf93185
5 changed files with 508 additions and 237 deletions

View File

@@ -344,7 +344,10 @@
end
%>
</table>
<button class='btn bg-blue' id='add_invoice'> Add to existing invoice </button>
<button class='btn bg-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>
@@ -694,11 +697,11 @@ $('#request_bills').click(function() {
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) {
@@ -871,4 +874,22 @@ $('#add_invoice').on('click',function(){
var dining_id = "<%= @room.id %>"
window.location.href = '/origami/addorders/' + dining_id;
});
/* 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 = "<%= @room.id %>";
window.location.href = '/origami/table/' + dining_id + "/split_bills";
}
});
});
</script>