Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2
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
1
Merge Requests
1
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
Commits
4963ec46
Commit
4963ec46
authored
Jan 03, 2024
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now calculating the required days of work excluding future and only of the current month
parent
06f1684b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
index.tcl
www/hours/index.tcl
+6
-0
No files found.
www/hours/index.tcl
View file @
4963ec46
...
...
@@ -145,6 +145,7 @@ set julian_date [db_string conv "select to_char(:date::date, 'J')"]
set last_day_of_month_ansi
[
db_string get_last_day_month
"select date_trunc('month',add_months(:date,1))::date - 1"
-default 0
]
set first_day_of_month_ansi
[
db_string get_first_day_month
"select date_trunc('month', '
$date
'::DATE)::date"
-default 0
]
set first_day_of_month_julian
[
db_string fdom_julian
"select to_char(:first_day_of_month_ansi::date, 'J')"
]
set today_ansi
[
db_string today
"select now()::date"
]
set project_id_for_default
[
lindex
$project
_id 0
]
set show_left_functional_menu_p
[
parameter::get_from_package_key -package_key
"intranet-core"
-parameter
"ShowLeftFunctionalMenupP"
-default 0
]
...
...
@@ -446,12 +447,17 @@ for {set current_date $first_julian_date} {$current_date <= $last_julian_date} {
# Hours to be expected for today
set expected_hours
[
im_attendance_daily_attendance_hours -user_id
$current
_user_id -date
$current
_date_ansi
]
if {
$current
_date_ansi <
$first
_day_of_month_ansi} { set expected_hours 0.0 }
if {
$current
_date_ansi >
$last
_day_of_month_ansi} { set expected_hours 0.0 }
if {
$current
_date_ansi >
$today
_ansi} { set expected_hours 0.0 }
# Calculate the monthly sum of all three types of hours
set monthly_work_total
[
expr
$monthly
_work_total +
$work
]
if {"" ne
$break
} { set monthly_break_total
[
expr
$monthly
_break_total +
$break
]
}
set monthly_expected_total
[
expr
$monthly
_expected_total +
$expected
_hours
]
ns_log Notice "
intranet-timesheet2/hours/index: date=$current_date_ansi, expected=$expected_hours, xxx
"
# -------------------------------------------------------------------------
# Comparison at the end of the month
...
...
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