% compCodes = session[:loggedUserCompCode] usersLoginId = session[:autherizedUserId] @alwcompcode = compCodes @MstXComp = MstCompany.select('cmp_logos,cmp_raw_material,cmp_multi_loc,cmp_godam_allowed,cmp_negative_stock').where("cmp_companycode = ? ",compCodes).first @xLogUser = User.where("usercompcode = ? AND id = ? ",compCodes,usersLoginId).first @mstcount = 0 @pdcount = 0 @trncount = 0 @confcount = 0 @rptcount = 0 if @xLogUser @xLogPermission = @xLogUser.userpermission @xRestrictLog = @xLogPermission.split(",") @usersType = @xLogUser.usertype.to_s end if @xLogUser if @xRestrictLog.length >0 @xRestrictLog.each do | chkp | if chkp =='USR' || chkp =='CST' || chkp =='GRP' || chkp =='SLS' || chkp =='LOC' @mstcount = 1 end if chkp =='PRD' || chkp =='BRD' || chkp =='CAT' || chkp =='UOM' || chkp =='PGP' @pdcount = 1 end if chkp =='INV' || chkp =='P' || chkp =='PR' || chkp =='SR' || chkp =='PMT' || chkp =='RCV' @trncount = 1 end if chkp =='RS' || chkp =='RP' || chkp =='RPR' || chkp =='RSR' || chkp =='RPMT' || chkp =='RRCV' || chkp =='RENP' || chkp =='RCHQ' || chkp =='RLG' || chkp =='RLGS' @rptcount = 1 end if chkp =='COP' @confcount = 1 end end end end @xM = 1 %>