Skip to content

Commit 8b9d864

Browse files
committed
add filter to ahow / hide orders without any worktimes
1 parent 3e581da commit 8b9d864

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/controllers/order_reports_controller.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class OrderReportsController < ApplicationController
1515
major_risk_value]
1616

1717
before_action :authorize_class
18-
before_action :show_without_hours
1918

2019
def index
2120
set_period
@@ -36,10 +35,6 @@ def index
3635

3736
private
3837

39-
def show_without_hours
40-
params[:without_hours] = true if params[:status_preselection].presence
41-
end
42-
4338
def set_filter_values
4439
@departments = Department.list
4540
@clients = WorkItem.joins(:client).list

app/domain/order/report.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def build_entry(order, accounting_posts, hours, invoices)
133133
end
134134

135135
def show_without_hours?
136-
params[:without_hours].presence || false
136+
params[:without_hours] == 'true'
137137
end
138138

139139
def booked_hours?(post_hours)

app/views/order_reports/_filters.html.haml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
class: 'searchable',
6060
multiple: true)
6161

62+
= direct_filter_select(:without_hours,
63+
'Aufträge ohne Zeitbuchungen',
64+
[IdValue.new('true', 'anzeigen'), IdValue.new('false', 'verbergen')],
65+
class: 'searchable',
66+
value: params[:without_hours] ||= true)
67+
6268
= direct_filter(:target, 'Ziel') do
6369
- select_tag(:target,
6470
options_for_select([['Orange', 'orange'],

0 commit comments

Comments
 (0)