sale edit prevent multiple action
This commit is contained in:
@@ -88,7 +88,7 @@
|
|||||||
</td> -->
|
</td> -->
|
||||||
<td class="p-1" width="25%">
|
<td class="p-1" width="25%">
|
||||||
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-danger waves-effect cancel'>Cancel
|
<button data-id="<%= sale_item.id %>" class='btn btn-lg bg-danger waves-effect cancel'>Cancel
|
||||||
Void/Update
|
<%= sale_item.status %>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
<button type="button" class="btn btn-block btn-lg bg-default waves-effect" id='back'><i class="material-icons">reply</i>Back</button>
|
<button type="button" class="btn btn-block btn-lg bg-default waves-effect" id='back'><i class="material-icons">reply</i>Back</button>
|
||||||
<button type="button" class="btn btn-danger btn- action-btn" id='cancel_all_void'>Cancel All Void</button>
|
<button type="button" class="btn btn-block btn-lg btn-danger action-btn waves-effect" id='cancel_all_void'>Cancel All</button>
|
||||||
<button type="button" class="btn btn-block btn-lg bg-blue waves-effect" id='apply'>Apply</button>
|
<button type="button" class="btn btn-block btn-lg bg-blue waves-effect" id='apply'>Apply</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -196,7 +196,7 @@ var access_code = localStorage.getItem("access_code");
|
|||||||
$("#action").attr('data-type', $(this).attr('data-type'));
|
$("#action").attr('data-type', $(this).attr('data-type'));
|
||||||
$("#action").attr('data-id', $(this).attr('data-id'));
|
$("#action").attr('data-id', $(this).attr('data-id'));
|
||||||
$("#action").text($(this).attr('data-type'))
|
$("#action").text($(this).attr('data-type'))
|
||||||
})
|
});
|
||||||
|
|
||||||
$(".update").on('click', function () {
|
$(".update").on('click', function () {
|
||||||
var sale_item_id = $(this).attr('data-id');
|
var sale_item_id = $(this).attr('data-id');
|
||||||
@@ -253,34 +253,8 @@ var access_code = localStorage.getItem("access_code");
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*$('.void').on('click', function () {
|
|
||||||
var sale_item_id = $(this).attr('data-id');
|
|
||||||
var remark = $("#remark").val();
|
|
||||||
var ajax_url = "/origami/item_void";
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: ajax_url,
|
|
||||||
data: 'sale_item_id=' + sale_item_id + "&remark=" + remark,
|
|
||||||
success: function (result) {
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
$('.foc').on('click', function () {
|
|
||||||
var sale_item_id = $(this).attr('data-id');
|
|
||||||
var ajax_url = "/origami/item_foc";
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: ajax_url,
|
|
||||||
data: 'sale_item_id=' + sale_item_id + "&remark=" + remark,
|
|
||||||
success: function (result) {
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})*/
|
|
||||||
|
|
||||||
$('#action').on('click', function () {
|
$('#action').on('click', function () {
|
||||||
|
$(this).attr("disabled", true);
|
||||||
var access_code = localStorage.getItem("access_code");
|
var access_code = localStorage.getItem("access_code");
|
||||||
var sale_item_id = $(this).attr('data-id');
|
var sale_item_id = $(this).attr('data-id');
|
||||||
var type = $(this).attr('data-type');
|
var type = $(this).attr('data-type');
|
||||||
@@ -329,6 +303,7 @@ var access_code = localStorage.getItem("access_code");
|
|||||||
})
|
})
|
||||||
|
|
||||||
$('#cancel_all_void').on('click', function () {
|
$('#cancel_all_void').on('click', function () {
|
||||||
|
$(this).attr('disabled', true);
|
||||||
var sale_id = "<%= @saleobj.sale_id %>"
|
var sale_id = "<%= @saleobj.sale_id %>"
|
||||||
var ajax_url = "/origami/cancel_all_void";
|
var ajax_url = "/origami/cancel_all_void";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -342,6 +317,7 @@ var access_code = localStorage.getItem("access_code");
|
|||||||
})
|
})
|
||||||
|
|
||||||
$('#apply').on('click', function () {
|
$('#apply').on('click', function () {
|
||||||
|
$(this).attr('disabled', true)
|
||||||
var sale_id = "<%= @saleobj.sale_id %>"
|
var sale_id = "<%= @saleobj.sale_id %>"
|
||||||
var ajax_url = "/origami/apply_void";
|
var ajax_url = "/origami/apply_void";
|
||||||
var table_id = '<%= @table_id %>'
|
var table_id = '<%= @table_id %>'
|
||||||
@@ -355,7 +331,6 @@ var access_code = localStorage.getItem("access_code");
|
|||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/table/' + table_id;
|
window.location.href = '/origami/table/' + table_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -367,7 +342,6 @@ var access_code = localStorage.getItem("access_code");
|
|||||||
|
|
||||||
$(".cashier_number").on('click', function(event){
|
$(".cashier_number").on('click', function(event){
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
|
|
||||||
var original_value='';
|
var original_value='';
|
||||||
original_value = $('.addfocus').val();
|
original_value = $('.addfocus').val();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user