update void alert

This commit is contained in:
Aung Myo
2017-10-31 13:34:01 +06:30
parent cfa819f985
commit 1239b308f9
2 changed files with 38 additions and 92 deletions

View File

@@ -231,20 +231,43 @@ $('#back').on('click',function(){
window.location.href = '/origami/';
})
$('#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 () {
window.location.href = '/origami/';
}
});
}
});
// $('#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 () {
// // window.location.href = '/origami/';
// // }
// // });
// }
// });
$('#void').on('click', function () {
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 + '/void';
$.ajax({
type: 'POST',
url: ajax_url,
success: function () {
window.location.href = '/origami/sale/'+sale_id;
}
});
}
});
});
$('#re-print').click(function() {
var sale_id = $('#sale_id').val();