diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb
index a81c5bf9..f40cb3b3 100755
--- a/app/views/origami/home/index.html.erb
+++ b/app/views/origami/home/index.html.erb
@@ -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;
+ });
+ }