Business report: only open projects in the project filter

Closed and archived projects aren't listed. A saved project that has since closed is dropped from the
filter (and from "Opens with"), so the report never filters by a project the picker can't show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-01 17:02:24 -05:00
1 parent 6a638fe7bb
commit 64e4a149ab
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -19,8 +19,8 @@ class QboReportsController < ApplicationController
PROJECTS_PREF = :qbo_report_project_ids
def index
# Projects for the issues and spent time: the projects picker can choose some
@projects = Project.visible.to_a
# Projects for the issues and spent time: the projects picker can choose some of the open ones
@projects = Project.visible.active.to_a
@project_ids = report_project_ids
@report = RedmineQboBilling::BusinessReport.new(period: params[:period].presence || 'this_year',
from: params[:from], to: params[:to], today: User.current.today,
@@ -35,7 +35,7 @@ class QboReportsController < ApplicationController
private
# The form's projects (none picked is every project), or the user's saved ones when the address has none.
# "Remember these projects" saves the form's choice. Only projects the user can see are kept.
# "Remember these projects" saves the form's choice. Only open projects the user can see are kept.
def report_project_ids
visible = @projects.map(&:id)
if params.key?(:project_ids)