update confirm box
This commit is contained in:
@@ -72,34 +72,7 @@ function showConfirmMessage() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$(function(){
|
||||
$('.delete').click(function(){
|
||||
var currentForm = $(this).closest("form");
|
||||
console.log(currentForm);
|
||||
swal({
|
||||
title: "Are you sure?",
|
||||
text: "You will not be able to recover this imaginary file!",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, delete it!",
|
||||
cancelButtonText: "No, cancel plx!",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false
|
||||
}, function (isConfirm) {
|
||||
console.log(isConfirm);
|
||||
if (isConfirm) {
|
||||
console.log("hi")
|
||||
currentForm.submit();
|
||||
} else {
|
||||
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('body').bootstrapMaterialDesign();
|
||||
var height = ($(window).height() - ($('.legal').outerHeight() + $('.user-info').outerHeight() + $('.navbar').innerHeight()));
|
||||
@@ -162,6 +135,56 @@ $(function(){
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
|
||||
$('.delete').click(function(){
|
||||
var method = $(this).attr('data-method');
|
||||
var url = $(this).attr('data-ref');
|
||||
var html = $(this).siblings.html();
|
||||
console.log(html);
|
||||
swal({
|
||||
title: "Confirmation",
|
||||
text: $(this).children().children('#delete_text').html(),
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
html: true
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
type: method,
|
||||
url: url ,
|
||||
success: function(data) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.dddddddd').click(function(){
|
||||
var currentForm = $(this).closest("form");
|
||||
bootbox.confirm({
|
||||
title: 'Confirmation',
|
||||
message: $('#delete_text').html(),
|
||||
buttons: {
|
||||
'cancel': {
|
||||
label: 'No',
|
||||
className: 'btn green col-md-4 pull-left'
|
||||
},
|
||||
'confirm': {
|
||||
label: 'Yes',
|
||||
className: 'btn red col-md-4 pull-right'
|
||||
}
|
||||
},
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
currentForm.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
||||
|
||||
@@ -131,7 +131,6 @@ $(function() {
|
||||
var code = "";
|
||||
setTimeout(function(){
|
||||
var hi=getQRCode();
|
||||
alert(hi);
|
||||
},100);
|
||||
});
|
||||
|
||||
@@ -231,19 +230,15 @@ $(document).on('click',".customer_tr",function(){
|
||||
})
|
||||
|
||||
function update_sale(customer_id,sale_id) {
|
||||
$.confirm({
|
||||
title: 'Confirm!',
|
||||
content: 'Are You Sure to assign this customer!',
|
||||
buttons: {
|
||||
|
||||
cancel: function () {
|
||||
|
||||
},
|
||||
confirm: {
|
||||
text: 'Confirm',
|
||||
btnClass: 'btn-green',
|
||||
keys: ['enter', 'shift'],
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Confirmation",
|
||||
text: "Are You Sure to assign this customer!",
|
||||
type: "success",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "green",
|
||||
confirmButtonText: "Yes, delete it!",
|
||||
closeOnConfirm: false
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "update_sale/" ,
|
||||
@@ -254,16 +249,12 @@ $(document).on('click',".customer_tr",function(){
|
||||
{
|
||||
window.location.href = '/origami'
|
||||
}else{
|
||||
alert('Record not found!');
|
||||
swal("Alert!", "Record not found!", "error");
|
||||
location.reload();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -57,35 +57,15 @@ $(document).on('click',".assign_table",function(){
|
||||
if (status == "available") {
|
||||
assign_table(queue_id,table_id,url);
|
||||
} else {
|
||||
$.confirm({
|
||||
title: 'Alert!',
|
||||
content: 'You cannot assign this table',
|
||||
buttons: {
|
||||
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
swal ( "Alert!" , "You cannot assign this table!" , "warning" );
|
||||
}
|
||||
})
|
||||
|
||||
function assign_table(id,table_id,url) {
|
||||
$.confirm({
|
||||
title: 'Confirm!',
|
||||
content: 'Are You Sure to assign this customer!',
|
||||
buttons: {
|
||||
|
||||
cancel: function () {
|
||||
|
||||
},
|
||||
confirm: {
|
||||
text: 'Confirm',
|
||||
btnClass: 'btn-green',
|
||||
keys: ['enter', 'shift'],
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Confirm!",
|
||||
text: "Are You Sure to assign this customer!",
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url ,
|
||||
@@ -96,16 +76,12 @@ function assign_table(id,table_id,url) {
|
||||
{
|
||||
window.location.href = '<%=crm_dining_queues_path%>'
|
||||
}else{
|
||||
alert('Record not found!');
|
||||
swal ( "Alert!" , "Record not found!" , "warning" );
|
||||
location.reload();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -91,17 +91,10 @@ $('#cancel').click(function() {
|
||||
|
||||
|
||||
function cancel_queue(id,url) {
|
||||
$.confirm({
|
||||
title: 'Confirm!',
|
||||
content: 'Are You Sure to cancel this Queue!',
|
||||
buttons: {
|
||||
cancel: function () {
|
||||
},
|
||||
confirm: {
|
||||
text: 'Confirm',
|
||||
btnClass: 'btn-green',
|
||||
keys: ['enter', 'shift'],
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Confirm!",
|
||||
text: "Are You Sure to cancel this Queue!",
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url ,
|
||||
@@ -115,10 +108,6 @@ function cancel_queue(id,url) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- Search Bar -->
|
||||
Search Bar -->
|
||||
<!-- <div class="search-bar">
|
||||
<div class="search-icon">
|
||||
<i class="material-icons">search</i>
|
||||
@@ -20,27 +20,26 @@
|
||||
<span class="navbar-brand-txt">SX Restaurant</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Start Delete confirrm text !-->
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to Logout ?</h6>
|
||||
<!-- <h6>This action can't be undo. </h6> -->
|
||||
</span>
|
||||
|
||||
<div class="navbar-right">
|
||||
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<span>Admin</span>
|
||||
<!-- <i class="material-icons">keyboard_arrow_down</i> -->
|
||||
<% if current_login_employee %>
|
||||
<span><%= current_login_employee.name %></span>
|
||||
<% end %>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- For Translation
|
||||
<li>
|
||||
<div class="switch">
|
||||
<label>
|
||||
<input type="checkbox" id="localize">
|
||||
မြန်မာ
|
||||
</label>
|
||||
</div>
|
||||
</li> -->
|
||||
<li>
|
||||
<%if current_login_employee.role !="waiter" %>
|
||||
<%= link_to (t :logout),logout_path, method: :delete, data: {confirm: 'Are you sure?'} %>
|
||||
<!-- <form action="<%=logout_path%>" method="DELETE">
|
||||
<button type="text" class="delete" value="x" >DELETE</button>
|
||||
</form> -->
|
||||
<!-- <a href="<%= logout_path %>"><i class="material-icons">input</i>Sign Out</a> -->
|
||||
<%end%>
|
||||
|
||||
<p class="delete" style="" data-ref="<%=logout_path%>" data-method="delete">Logout</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<a href="javascript:void(0);" class="js-right-sidebar" data-close="true">
|
||||
@@ -51,3 +50,7 @@
|
||||
</nav>
|
||||
<!-- #Top Bar
|
||||
|
||||
<!-- <form action="<%=logout_path%>" method="DELETE">
|
||||
<button type="text" class="delete" value="x" >DELETE</button>
|
||||
</form> -->
|
||||
<!-- <a href="<%= logout_path %>"><i class="material-icons">input</i>Sign Out</a>
|
||||
@@ -169,13 +169,18 @@
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: "Payment Success",
|
||||
type: "success"
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("Paid Amount is over!");
|
||||
swal("Alert","Paid Amount is over!","error");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-12">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
<input type="hidden" name="type" id="type" value="<%= @dining_facility.type %>">
|
||||
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
|
||||
@@ -403,20 +403,15 @@
|
||||
if(customer_name != ""){
|
||||
customer = '(' + customer_name + ')';
|
||||
}
|
||||
|
||||
$.confirm({
|
||||
title: 'Confirm!',
|
||||
content: 'Are You Sure to assign this customer' + customer + '!',
|
||||
buttons: {
|
||||
|
||||
cancel: function () {
|
||||
|
||||
},
|
||||
confirm: {
|
||||
text: 'Confirm',
|
||||
btnClass: 'btn-green',
|
||||
keys: ['enter', 'shift'],
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Confirmation !",
|
||||
text: 'Are You Sure to assign this customer' + customer + '!',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "green",
|
||||
confirmButtonText: "Yes!",
|
||||
cancelButtonClass: 'btn btn-danger',
|
||||
closeOnConfirm: false,
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "update_sale" ,
|
||||
@@ -432,17 +427,12 @@
|
||||
}else{
|
||||
window.location.href = '/origami/room/'+id
|
||||
}
|
||||
|
||||
}else{
|
||||
alert('Record not found!');
|
||||
swal("Alert!", "Record not found!", "error");
|
||||
location.reload();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row bottom">
|
||||
<div class="col-md-3">
|
||||
<div class="fluid cashier_number" data-value="30" data-type="add">30%</div>
|
||||
</div>
|
||||
@@ -379,23 +379,16 @@
|
||||
url: ajax_url,
|
||||
data: params,
|
||||
success:function(result){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: result.status,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: result.status,
|
||||
}, function () {
|
||||
if(result.table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + result.table_id
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + result.table_id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -410,19 +403,8 @@
|
||||
// Selected Items
|
||||
var sale_items = get_selected_sale_items();
|
||||
if(sale_items.length == 0){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: "You have no selected item!",
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//swal("Infomation!", "You have no selected item!");
|
||||
swal ( "Oops" , "You have no selected item!" , "error" );
|
||||
}
|
||||
|
||||
for(var i=0;i < sale_items.length;i++){
|
||||
@@ -430,19 +412,7 @@
|
||||
discount_items.push(sale_items[i]);
|
||||
}
|
||||
else {
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: "You have selected no discount item!!",
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
swal ("Oops" , "You have no selected item!" , "error" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,23 +422,17 @@
|
||||
url: "/origami/" + sale_id + "/remove_discount_items",
|
||||
data: params,
|
||||
success: function(result){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: result.status,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: result.status,
|
||||
type: "success",
|
||||
}, function () {
|
||||
if(result.table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + result.table_id
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + result.table_id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -481,23 +445,17 @@
|
||||
type: "GET",
|
||||
url: "/origami/" + sale_id + "/remove_all_discount",
|
||||
success: function(result){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: result.status,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: result.status,
|
||||
type: "success",
|
||||
}, function () {
|
||||
if(result.table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + result.table_id
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + result.table_id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -524,51 +482,29 @@
|
||||
url: ajax_url,
|
||||
data: params,
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
if (result.status == "Success") {
|
||||
type = 'green'
|
||||
btn_color = 'btn-green'
|
||||
type = 'success'
|
||||
btn_color = 'green'
|
||||
}else{
|
||||
type = 'red'
|
||||
btn_color = 'btn-red'
|
||||
|
||||
type = 'error'
|
||||
btn_color = 'red'
|
||||
}
|
||||
|
||||
$.confirm({
|
||||
title: result.title,
|
||||
content: result.status,
|
||||
columnClass: 'small',
|
||||
type: type,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: btn_color,
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: result.status,
|
||||
confirmButtonText: 'OK',
|
||||
confirmButtonColor: btn_color,
|
||||
}, function () {
|
||||
if(result.table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + result.table_id
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + result.table_id
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
// else{
|
||||
// $.alert({
|
||||
// title: 'Alert!',
|
||||
// content: 'Please Select Account',
|
||||
// type: 'red',
|
||||
// typeAnimated: true,
|
||||
// btnClass: 'btn-danger',
|
||||
// });
|
||||
|
||||
// }
|
||||
|
||||
});//end member discount
|
||||
});
|
||||
|
||||
@@ -663,18 +599,12 @@ function calculate_overall_discount(type, amount){
|
||||
// For Percentage Pay
|
||||
if(type == 1){
|
||||
if(amount > 100 ){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: "Percentage Value over 100!",
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
swal({
|
||||
title:"Oops!",
|
||||
text:'Percentage Value over 100!',
|
||||
type: "error",
|
||||
confirmButtonText: 'OK',
|
||||
confirmButtonColor:"red"
|
||||
});
|
||||
}
|
||||
else{
|
||||
@@ -740,18 +670,12 @@ function calculate_item_discount(type, amount, sale_items, account_types){
|
||||
// For Percentage Pay
|
||||
if(type == 1){
|
||||
if(amount > 100 ){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: "Percentage Value over 100!",
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
swal({
|
||||
title:"Oops!",
|
||||
text:'Percentage Value over 100!',
|
||||
type: "error",
|
||||
confirmButtonText: 'OK',
|
||||
confirmButtonColor:"red"
|
||||
});
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -494,22 +494,7 @@
|
||||
// data: 'order_id='+ order_id,
|
||||
success: function (result) {
|
||||
if (!result.status) {
|
||||
/*$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: result.error_message,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function () {
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
}
|
||||
}
|
||||
});*/
|
||||
|
||||
swal("Good job!", "You clicked the button!", "success");
|
||||
|
||||
swal("Infomation!", result.error_message);
|
||||
}
|
||||
else {
|
||||
location.reload();
|
||||
@@ -594,20 +579,17 @@
|
||||
});
|
||||
|
||||
$('#void').on('click', function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure want to Void?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, void it!",
|
||||
closeOnConfirm: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#add_order').on('click', function () {
|
||||
|
||||
@@ -172,30 +172,17 @@ $('#jcb_pay').on('click',function(){
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: 'Payment Successfully',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: "Payment Successfully",
|
||||
},function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: "Paid Amount is over!",
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
btnClass: 'btn-danger',
|
||||
});
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -169,30 +169,17 @@
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: 'Payment Successfully',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: "Payment Successfully",
|
||||
},function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: "Paid Amount is over!",
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
btnClass: 'btn-danger',
|
||||
});
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -173,30 +173,17 @@
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: 'Payment Successfully',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: "Payment Successfully",
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: "Paid Amount is over!",
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
btnClass: 'btn-danger',
|
||||
});
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="row bottom">
|
||||
<div class="col-md-3">
|
||||
<div class="fluid cashier_number" data-value="20000" data-type="add">20000</div>
|
||||
</div>
|
||||
@@ -291,13 +291,17 @@
|
||||
url: ajax_url,
|
||||
data: params,
|
||||
success:function(result){
|
||||
alert("Success!");
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: "Success",
|
||||
}, function () {
|
||||
if(result.table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + result.table_id
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + result.table_id
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -360,7 +360,7 @@
|
||||
$( "#loading_wrapper" ).show();
|
||||
|
||||
if($('#balance').text() > 0){
|
||||
alert(" Insufficient Amount!")
|
||||
swal ( "Oops" , "Insufficient Amount!" , "error" );
|
||||
$( "#loading_wrapper" ).hide();
|
||||
}else{
|
||||
var sale_id = $('#sale_id').text();
|
||||
@@ -389,33 +389,19 @@
|
||||
}
|
||||
$( "#loading_wrapper" ).hide();
|
||||
if($('#balance').text() < 0){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: 'Changed amount ' + $('#balance').text() * (-1),
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: 'Changed amount ' + $('#balance').text() * (-1),
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#pay').text("Pay")
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: 'Thank you !',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
$('#pay').text("Pay");
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: 'Thank You !',
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -424,8 +410,10 @@
|
||||
});
|
||||
|
||||
$('#void').on('click',function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: 'Are you sure want to Void !',
|
||||
}, function () {
|
||||
var sale_id = $('#sale_id').text();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
@@ -435,9 +423,7 @@
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -472,18 +458,11 @@
|
||||
$( "#loading_wrapper" ).hide();
|
||||
|
||||
if (cash > 0) {
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: 'Thank you !',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: 'Thank You !',
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -153,10 +153,9 @@ $("#redeem").click(function(){
|
||||
membership_id = $("#valid_amount").attr('data-member-value');
|
||||
redeem_amount = parseFloat($("#used_amount").text());
|
||||
if(redeem_amount<=0 ){
|
||||
alert("Please type valid amount");
|
||||
|
||||
swal ( "Oops" , "Please type valid amount!" , "warning" );
|
||||
}else if(valid_amount< redeem_amount){
|
||||
alert(" Insufficient Amount!")
|
||||
swal ( "Oops" , "Insufficient Amount!" , "warning" );
|
||||
}else{
|
||||
if(redeem_amount <= "<%= @redeem_prices %>"){
|
||||
$.ajax({
|
||||
@@ -165,14 +164,20 @@ $("#redeem").click(function(){
|
||||
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: result.status,
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
});
|
||||
|
||||
}else{
|
||||
alert(result.message);
|
||||
swal ( "Information" , result.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
alert("Redeem Amount is over!");
|
||||
swal ( "Oops" , "Redeem Amount is over!" , "warning" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -142,21 +142,12 @@
|
||||
url: ajax_url,
|
||||
data: 'sale_item_id=' + sale_item_id + "&update_qty=" + qty + "&update_price=" + price,
|
||||
success: function (result) {
|
||||
$.confirm({
|
||||
title: 'Alert!',
|
||||
content: 'Qty and Price was successfully Updated',
|
||||
buttons: {
|
||||
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green btn-lg',
|
||||
action: function () {
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: "Qty and Price was successfully Updated",
|
||||
}, function () {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -169,30 +169,17 @@
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: 'Payment Successfully',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
swal({
|
||||
title: "Infomation!",
|
||||
text: "Payment Successfully",
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: "Paid Amount is over!",
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
btnClass: 'btn-danger',
|
||||
});
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="m-b-10 clearfix">
|
||||
<%= link_to t("views.btn.new"),new_print_setting_path,:class => 'btn btn-primary btn-lg float-right waves-effect"' %>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -27,9 +27,9 @@
|
||||
<th>Page width</th>
|
||||
<th>Page height</th>
|
||||
<th>Print copies</th>
|
||||
<th>Precision</th>
|
||||
<th>Delimiter</th>
|
||||
<th>Heading_space</th>
|
||||
<!-- <th>Precision</th> -->
|
||||
<!-- <th>Delimiter</th> -->
|
||||
<!-- <th>Heading space</th> -->
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -46,9 +46,9 @@
|
||||
<td><%= print_setting.page_width %></td>
|
||||
<td><%= print_setting.page_height %></td>
|
||||
<td><%= print_setting.print_copies %></td>
|
||||
<td><%= print_setting.precision %></td>
|
||||
<td><%= print_setting.delimiter %></td>
|
||||
<td><%= print_setting.heading_space %></td>
|
||||
<!-- <td><%= print_setting.precision %></td> -->
|
||||
<!-- <td><%= print_setting.delimiter %></td> -->
|
||||
<!-- <td><%= print_setting.heading_space %></td> -->
|
||||
<td>
|
||||
<%= link_to t("views.btn.show"), print_setting,:class => 'btn btn-primary btn-sm waves-effect' %>
|
||||
<%= link_to t("views.btn.edit"), edit_print_setting_path(print_setting),:class => 'btn btn-info btn-sm waves-effect' %></td>
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
<th>Active</th>
|
||||
<th>Login?</th>
|
||||
<th>Auto print</th>
|
||||
<th>Printer name</th>
|
||||
<!-- <th>Printer name</th> -->
|
||||
<th>Show tax</th>
|
||||
<th>Show cashier</th>
|
||||
<th>Show guest info</th>
|
||||
<!-- <th>Show guest info</th> -->
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -35,12 +35,12 @@
|
||||
<td><%= settings_cashier_terminal.is_active %></td>
|
||||
<td><%= settings_cashier_terminal.is_currently_login %></td>
|
||||
<td><%= settings_cashier_terminal.auto_print_receipt %></td>
|
||||
<td><%= settings_cashier_terminal.printer_name %></td>
|
||||
<!-- <td><%= settings_cashier_terminal.printer_name %></td> -->
|
||||
<td><%= settings_cashier_terminal.show_tax %></td>
|
||||
<td><%= settings_cashier_terminal.show_cashier %></td>
|
||||
<td><%= settings_cashier_terminal.show_guest_info %></td>
|
||||
<td><%= link_to t("views.btn.edit"), edit_settings_cashier_terminal_path(settings_cashier_terminal),:class => 'btn btn-info btn-lg waves-effect' %>
|
||||
<%= link_to t("views.btn.delete"), settings_cashier_terminal_path(settings_cashier_terminal), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-danger btn-lg waves-effect' %></td>
|
||||
<!-- <td><%= settings_cashier_terminal.show_guest_info %></td> -->
|
||||
<td><%= link_to t("views.btn.edit"), edit_settings_cashier_terminal_path(settings_cashier_terminal),:class => 'btn btn-info btn-sm waves-effect' %>
|
||||
<%= link_to t("views.btn.delete"), settings_cashier_terminal_path(settings_cashier_terminal), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-danger btn-sm waves-effect' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
<!-- <div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Menu Item Attributes</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t("views.btn.new"),new_settings_menu_item_attribute_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div> -->
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
||||
@@ -55,6 +46,14 @@
|
||||
<td>
|
||||
<%= link_to t("views.btn.edit"), edit_settings_menu_item_attribute_path(settings_menu_item_attribute),:class => 'btn btn-primary btn-sm waves-effect' %>
|
||||
<%= link_to t("views.btn.delete"), settings_menu_item_attribute_path(settings_menu_item_attribute), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-danger btn-sm waves-effect' %>
|
||||
<button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%=settings_menu_item_attribute_path(settings_menu_item_attribute)%>" data-method="delete">
|
||||
<%= t("views.btn.delete") %>
|
||||
</button>
|
||||
<!-- Start Delete confirrm text !-->
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to delete this row ?</h6>
|
||||
<h6>This action can't be undo. </h6>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
<th>Is active</th>
|
||||
<th>Auto Print</th>
|
||||
<th>Print copy</th>
|
||||
<th>Cut per item</th>
|
||||
<!-- <th>Cut per item</th> -->
|
||||
<th>Alternate name</th>
|
||||
<th>Created by</th>
|
||||
<!-- <th>Created by</th> -->
|
||||
<th> Created At</th>
|
||||
<th>Updated At</th>
|
||||
<th>Action</th>
|
||||
@@ -43,13 +43,12 @@
|
||||
<td><%= settings_order_queue_station.auto_print %></td>
|
||||
<td><%= settings_order_queue_station.print_copy %></td>
|
||||
|
||||
<td><%= settings_order_queue_station.cut_per_item %></td>
|
||||
<!-- <td><%= settings_order_queue_station.cut_per_item %></td> -->
|
||||
<td><%= settings_order_queue_station.use_alternate_name %></td>
|
||||
<td><%= settings_order_queue_station.created_by %></td>
|
||||
<!-- <td><%= settings_order_queue_station.created_by %></td> -->
|
||||
<td><%= settings_order_queue_station.created_at.strftime("%m-%d-%Y") %></td>
|
||||
<td><%= settings_order_queue_station.updated_at.strftime("%m-%d-%Y") %></td>
|
||||
<td><%= link_to 'Assign Processing Items', new_settings_order_queue_station_processing_item_path(settings_order_queue_station),:class => ' btn-success btn-sm waves-effect' %></td>
|
||||
<td><%= link_to t("views.btn.edit"), edit_settings_order_queue_station_path(settings_order_queue_station),:class => 'btn btn-info btn-lg waves-effect' %></td>
|
||||
<td><%= link_to 'Assign Processing Items', new_settings_order_queue_station_processing_item_path(settings_order_queue_station),:class => ' btn-success btn-sm waves-effect' %><%= link_to t("views.btn.edit"), edit_settings_order_queue_station_path(settings_order_queue_station),:class => 'btn btn-info btn-sm waves-effect' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user