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
36610e5a
Commit
36610e5a
authored
Dec 16, 2014
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Hour Intervals:
Modified the trigger function in order to create comments with start and end time
parent
b78e78de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
intranet-timesheet2-interval-create.sql
sql/postgresql/intranet-timesheet2-interval-create.sql
+7
-6
No files found.
sql/postgresql/intranet-timesheet2-interval-create.sql
View file @
36610e5a
...
...
@@ -83,8 +83,7 @@ create index im_hour_intervals_interval_start_idx on im_hour_intervals(interval_
-- Trigger for synchronization between intervals and hours
-- ------------------------------------------------------------
-- Create a new im_hour row for the interval or update
-- an existing one.
-- Create a new im_hour row for the interval or update an existing one.
create
or
replace
function
im_hour_interval_update_im_hours
(
integer
,
integer
,
date
)
returns
integer
as
$
body
$
DECLARE
...
...
@@ -128,11 +127,13 @@ BEGIN
LOOP
v_sum_hours
:
=
v_sum_hours
+
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
||
', '
;
IF
''
!=
v_sum_notes
THEN
v_sum_notes
:
=
v_sum_notes
||
', '
;
END
IF
;
v_sum_notes
:
=
v_sum_notes
||
to_char
(
interval_start
,
'HH24:MI'
)
||
'-'
||
to_char
(
interval_end
,
'HH24:MI'
)
||
': '
||
coalesce
(
row
.
note
,
'
'
);
to_char
(
row
.
interval_start
,
'HH24:MI'
)
||
'-'
||
to_char
(
row
.
interval_end
,
'HH24:MI'
)
||
': '
||
translate
(
coalesce
(
row
.
note
,
''
),
',:'
,
'.;
'
);
END
LOOP
;
-- 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