Преглед на файлове

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