Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-interval
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-timesheet2-interval
Commits
b78e78de
Commit
b78e78de
authored
Dec 16, 2014
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Timesheet Interval:
Modified trigger to include start and end times
parent
2757a090
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
intranet-timesheet2-interval-create.sql
sql/postgresql/intranet-timesheet2-interval-create.sql
+8
-4
No files found.
sql/postgresql/intranet-timesheet2-interval-create.sql
View file @
b78e78de
...
@@ -79,8 +79,6 @@ create index im_hour_intervals_interval_start_idx on im_hour_intervals(interval_
...
@@ -79,8 +79,6 @@ create index im_hour_intervals_interval_start_idx on im_hour_intervals(interval_
-- ------------------------------------------------------------
-- ------------------------------------------------------------
-- Trigger for synchronization between intervals and hours
-- Trigger for synchronization between intervals and hours
-- ------------------------------------------------------------
-- ------------------------------------------------------------
...
@@ -126,9 +124,15 @@ BEGIN
...
@@ -126,9 +124,15 @@ BEGIN
where
user_id
=
p_user_id
and
where
user_id
=
p_user_id
and
project_id
=
p_project_id
and
project_id
=
p_project_id
and
interval_start
::
date
=
p_day
interval_start
::
date
=
p_day
order
by
interval_id
LOOP
LOOP
v_sum_hours
:
=
v_sum_hours
+
coalesce
(
extract
(
epoch
from
row
.
interval_end
-
row
.
interval_start
)
/
3600
.
0
,
0
.
0
);
v_sum_hours
:
=
v_sum_hours
+
v_sum_notes
:
=
v_sum_notes
||
coalesce
(
row
.
note
,
''
)
||
E
'
\n
'
;
coalesce
(
extract
(
epoch
from
row
.
interval_end
-
row
.
interval_start
)
/
3600
.
0
,
0
.
0
);
IF
''
!=
v_sum_notes
THEN
v_sum_notes
:
=
v_sum_notes
||
', '
;
v_sum_notes
:
=
v_sum_notes
||
to_char
(
interval_start
,
'HH24:MI'
)
||
'-'
||
to_char
(
interval_end
,
'HH24:MI'
)
||
': '
||
coalesce
(
row
.
note
,
''
);
END
LOOP
;
END
LOOP
;
-- Update the im_hours entry with the sum of the values
-- Update the im_hours entry with the sum of the values
...
...
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