For add alert box for Close Cashier

This commit is contained in:
San Wai Lwin
2018-02-07 13:23:01 +06:30
parent 3f247f731e
commit 625ee9bd34

View File

@@ -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>