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';
|
window.location.href = '/origami/cash_outs/new';
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#close_cashier').on('click',function(){
|
$('#close_cashier').on('click',function(e){
|
||||||
window.location.href = '/origami/shift/close';
|
e.preventDefault(); // Prevent the href from redirecting directly
|
||||||
|
var linkURL = '/origami/shift/close';
|
||||||
|
warnBeforeRedirect(linkURL);
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
window.location.href = '/dashboard';
|
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>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user