For add alert box for Close Cashier
This commit is contained in:
@@ -235,10 +235,25 @@ $('#cash_out').on('click',function(){
|
||||
window.location.href = '/origami/cash_outs/new';
|
||||
})
|
||||
|
||||
$('#close_cashier').on('click',function(){
|
||||
window.location.href = '/origami/shift/close';
|
||||
$('#close_cashier').on('click',function(e){
|
||||
e.preventDefault(); // Prevent the href from redirecting directly
|
||||
var linkURL = '/origami/shift/close';
|
||||
warnBeforeRedirect(linkURL);
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/dashboard';
|
||||
})
|
||||
|
||||
function warnBeforeRedirect(linkURL) {
|
||||
swal({
|
||||
title: "Oops",
|
||||
text: "Are you sure you want to Logout ?",
|
||||
type: "warning",
|
||||
showCancelButton: true
|
||||
}, function() {
|
||||
// Redirect the user
|
||||
window.location.href = linkURL;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user