diff --git a/app/views/inventory/stock_checks/index.html.erb b/app/views/inventory/stock_checks/index.html.erb index c5a72be1..5577a8df 100644 --- a/app/views/inventory/stock_checks/index.html.erb +++ b/app/views/inventory/stock_checks/index.html.erb @@ -264,7 +264,29 @@ url: '<%= inventory_stock_check_save_path %>', data: 'stock_item=' + jsonStr + '&reason=' + reason, success: function (data) { - window.location.href = '/inventory/stock_checks/' + data['stock_id']; + if (data['stock_id']) { + check_id = data['stock_id']; + $.ajax({ + type: 'post', + url: '<%= inventory_save_to_journal_path %>', + data: 'data=' + check_id, + success: function () { + swal({ + title: "Information!", + text: "Successfully saved to journal", + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false + }, function () { + // window.location.href = '/inventory'; + window.location.href = '/inventory/stock_checks/' + check_id; + }); + } + }) + // window.location.href = '/inventory/stock_checks/' + data['stock_id']; + } + } }) }else{ diff --git a/app/views/inventory/stock_checks/show.html.erb b/app/views/inventory/stock_checks/show.html.erb index 10aa3cc9..feb8f385 100755 --- a/app/views/inventory/stock_checks/show.html.erb +++ b/app/views/inventory/stock_checks/show.html.erb @@ -79,7 +79,7 @@