diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb
index 464c845e..ce1815d6 100755
--- a/app/views/origami/home/show.html.erb
+++ b/app/views/origami/home/show.html.erb
@@ -1264,7 +1264,7 @@
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
- $('.confirm').prop("disabled",true);
+ $('.confirm').prop("disabled", true);
var sale_id = $("#sale_id").val();//"<%= @obj_sale.sale_id rescue "" %>"
var ajax_url = "/origami/sale/" + sale_id + '/cashier/void';
var remark = $("#remark").val();
diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb
index c7b72553..c78a58a6 100755
--- a/app/views/origami/sales/show.html.erb
+++ b/app/views/origami/sales/show.html.erb
@@ -478,35 +478,37 @@ $('#back').on('click',function(){
// });
$(document).on('click', '.access_modal', function(event){
- type = $(this).data("type");
- $(".ok").attr("data-action",type);
- $('#AccessCodeModal').modal('show');
- });
- $('#void').on('click', function () {
+ type = $(this).data("type");
+ $(".ok").attr("data-action",type);
+ $('#AccessCodeModal').modal('show');
+});
+
+$('#void').on('click', function () {
var access_code = localStorage.getItem("access_code");
- swal({
- title: "Alert",
- text: "Are you sure want to Void?",
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "Yes, void it!",
- closeOnConfirm: false
- }, function (isConfirm) {
- if (isConfirm) {
- var sale_id = $('#sale_id').val();
- var ajax_url = "/origami/sale/" + sale_id +'/'+'cashier'+ '/void';
- $.ajax({
- type: 'POST',
- url: ajax_url,
- data: {'access_code':access_code},
- success: function () {
- window.location.href = '/origami/sale/'+sale_id;
- }
- });
+ swal({
+ title: "Alert",
+ text: "Are you sure want to Void?",
+ type: "warning",
+ showCancelButton: true,
+ confirmButtonColor: "#DD6B55",
+ confirmButtonText: "Yes, void it!",
+ closeOnConfirm: false
+ }, function (isConfirm) {
+ if (isConfirm) {
+ $('.confirm').prop("disabled", true);
+ var sale_id = $('#sale_id').val();
+ var ajax_url = "/origami/sale/" + sale_id +'/'+'cashier'+ '/void';
+ $.ajax({
+ type: 'POST',
+ url: ajax_url,
+ data: {'access_code':access_code},
+ success: function () {
+ window.location.href = '/origami/sale/'+sale_id;
}
- });
- });
+ });
+ }
+ });
+});
function check_emp_access_code(access_code,type) {
var url = "/origami/check_emp_access_code/" + access_code ;