浏览代码

added session variable when manager login

Jose Miguel Ledon Nieblas 9 年之前
父节点
当前提交
f044207f40
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      app/controllers/dashboard_controller.rb

+ 1 - 0
app/controllers/dashboard_controller.rb

@@ -29,6 +29,7 @@ class DashboardController < ApplicationController
         @product_ranking << obj
       end
       @product_ranking = ActionController::Base.helpers.sanitize(@product_ranking.to_json)
+      session[:open_cash_register_id] = current_user.pointsale.get_open_cash_register.id if current_user.pointsale.get_open_cash_register.present?
     elsif current_user.usertype == 'C'
       @need_to_open_cash = current_user.pointsale.can_open_cash_register?
       session[:open_cash_register_id] = current_user.pointsale.get_open_cash_register.id unless @need_to_open_cash