Skip to content

Commit

Permalink
Not working time projects do not sum (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Javier Martínez authored Jan 31, 2024
1 parent 98b2809 commit 337ea69
Show file tree
Hide file tree
Showing 25 changed files with 1,714 additions and 1,406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,21 @@
<parameter name="idOrg" isForPrompting="false" class="java.lang.Integer">
<parameterDescription><![CDATA[Hidden]]></parameterDescription>
</parameter>
<queryString><![CDATA[select userName,duration,COALESCE(fact,0) as fact, COALESCE(noFact,0) as noFact,totalHours from (SELECT u.name as userName,a.duration,sum(CASE WHEN a.billable=1
then duration end) as 'fact',
sum(CASE WHEN a.billable=0
then duration end) as 'noFact' ,
sum(duration) as 'totalHours'
<queryString><![CDATA[select userName,duration,COALESCE(fact,0) as fact, COALESCE(noFact,0) as noFact,totalHours from
(SELECT u.name as userName,CASE
WHEN r.isWorkingTime = 0 THEN 0
ELSE a.duration
END
as duration,
SUM(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 1 THEN duration END) as 'fact',
SUM(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 0 THEN duration END) as 'noFact',
SUM(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 THEN duration END) as 'totalHours'
FROM Activity a,Organization o,User u,Project p,ProjectRole r
where u.id=a.userId and r.id=a.roleId and p.organizationId=o.id and p.id=r.projectId
and a.start between $P{Fecha inicio} and $P{Fecha fin} and u.active = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
userName,
roleName,
start,
start + INTERVAL duration MINUTE as endDate,
end as endDate,
duration,
description,
COALESCE(fact/60,0) as fact,
Expand All @@ -66,14 +66,21 @@ from (
u.name as userName,
r.name as roleName,
a.start,
a.duration,
a.end,
CASE
WHEN r.isWorkingTime = 0 THEN 0
ELSE a.duration
END
as duration,
a.description,
a.id,
p.name as proName,
sum(CASE WHEN a.billable=1
then duration end) as 'fact',
sum(CASE WHEN a.billable=0
then duration end) as 'noFact'
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 1 THEN duration END) as 'fact',
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 0 THEN duration END) as 'noFact'
FROM
Activity a, Organization o, User u, Project p, ProjectRole r
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,19 @@ SELECT o.name as orgName,
r.name as roleName,
p.name as projectName,
a.start,
a.duration,
CASE
WHEN r.isWorkingTime = 0 THEN 0
ELSE a.duration
END
as duration,
a.description,
sum(CASE WHEN a.billable=1 then duration end) as 'fact',
sum(CASE WHEN a.billable=0 then duration end) as 'noFact'
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 1 THEN duration END) as 'fact',
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 0 THEN duration END) as 'noFact'
FROM Activity a,Organization o,User u,Project p,ProjectRole r
where u.id=a.userId and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,18 @@ SELECT o.name as orgName,
r.name as roleName,
p.name as projectName,
a.start,
a.duration,
CASE
WHEN r.isWorkingTime = 0 THEN 0
ELSE a.duration
END
as duration,
a.description,
sum(CASE WHEN a.billable=1 then duration end) as 'fact',
sum(CASE WHEN a.billable=0 then duration end) as 'noFact'
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 1 THEN duration END) as 'fact',
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 0 THEN duration END) as 'noFact'
FROM Activity a,Organization o,User u,Project p,ProjectRole r
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,18 @@ SELECT o.name as orgName,
r.name as roleName,
p.name as projectName,
a.start,
a.duration,
CASE
WHEN r.isWorkingTime = 0 THEN 0
ELSE a.duration
END
as duration,
a.description,
sum(CASE WHEN a.billable=1 then duration end) as 'fact',
sum(CASE WHEN a.billable=0 then duration end) as 'noFact'
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 1 THEN duration END) as 'fact',
sum(CASE
WHEN r.isWorkingTime = 0 THEN 0
WHEN r.isWorkingTime = 1 AND a.billable = 0 THEN duration END) as 'noFact'
FROM Activity a,Organization o,User u,Project p,ProjectRole r
Expand Down
Loading

0 comments on commit 337ea69

Please sign in to comment.