Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redmine_v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
redmine_v2
Commits
baaa838d
Commit
baaa838d
authored
Dec 18, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete redundant includes models
parent
950db87a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
plugins/workflow_report/app/models/workflow_report_issue.rb
+1
-1
plugins/workflow_report/lib/workflow_report.rb
+1
-1
No files found.
plugins/workflow_report/app/models/workflow_report_issue.rb
View file @
baaa838d
...
...
@@ -5,7 +5,7 @@ class WorkflowReportIssue < Issue
has_many
:workflow_report_custom_values
,
class_name:
'WorkflowReportCustomValue'
,
foreign_key:
'customized_id'
scope
:raw_tasks_records
,
->
(
year
,
month
,
project_ids
)
{
includes
(
:
project
,
:workflow_report_version
,
:workflow_report_custom_values
,
:time_entries
,
:statu
s
,
project: :enabled_modules
)
includes
(
:
time_entrie
s
,
project: :enabled_modules
)
.
where
.
not
(
projects:
{
status:
CLOSED_STATUS_PROJECT
},
issues:
{
tracker_id:
BUG_TRACKER_ID
})
.
where
(
projects:
{
id:
project_ids
},
enabled_modules:
{
name:
'time_tracking'
})
.
where
([
'((time_entries.spent_on IS NOT NULL AND time_entries.tyear = ? AND time_entries.tmonth = ?) OR (issues.closed_on BETWEEN ? AND ?))'
,
...
...
plugins/workflow_report/lib/workflow_report.rb
View file @
baaa838d
...
...
@@ -42,7 +42,7 @@ module WorkflowReport
result
[
7
].
push
(
root_issue
.
status
&
.
name
.
present?
?
root_issue
.
status
&
.
name
:
''
)
sum_estimated_hours
=
issues
.
map
(
&
:estimated_hours
).
compact
.
sum
result
[
8
]
<<
sum_estimated_hours
.
round
(
2
)
actual_time
=
issues
.
map
{
|
issue
|
issue
.
time_entries
.
sum
(
:hours
)
}.
sum
actual_time
=
TimeEntry
.
where
(
issue_id:
issue_ids
).
sum
(
:hours
)
if
actual_time
.
present?
result
[
9
]
<<
actual_time
.
round
(
2
)
result
[
10
]
<<
(
actual_time
-
sum_estimated_hours
).
round
(
2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment