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
6cb381bc
Commit
6cb381bc
authored
Jan 17, 2024
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now formatting attendances with two decimals
parent
4963ec46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
index.tcl
www/hours/index.tcl
+10
-5
No files found.
www/hours/index.tcl
View file @
6cb381bc
...
...
@@ -170,6 +170,9 @@ if {"" != [parameter::get -package_id [apm_package_id_from_key intranet-timeshee
if {!
[
im_column_exists im_hours conf_object_id
]
} { set confirm_timesheet_hours_p 0 }
# Rounding by two digits
set rounding_factor 100.0
# ---------------------------------------------------------------
# Render the Calendar widget
...
...
@@ -438,11 +441,11 @@ for {set current_date $first_julian_date} {$current_date <= $last_julian_date} {
# Calculate the actual work/break time
set work 0
if {
[
info
exists att_work_hash
(
$current
_date
)]
} {
set work
[
expr
round
(
10.0 *
$att
_work_hash
(
$current
_date
))
/ 10.0
]
set work
[
expr
round
(
$rounding
_factor *
$att
_work_hash
(
$current
_date
))
/
$rounding
_factor
]
}
set break ""
if {
[
info
exists att_break_hash
(
$current
_date
)]
} {
set break
[
expr
round
(
10.0 *
$att
_break_hash
(
$current
_date
))
/ 10.0
]
set break
[
expr
round
(
$rounding
_factor *
$att
_break_hash
(
$current
_date
))
/
$rounding
_factor
]
}
# Hours to be expected for today
...
...
@@ -467,7 +470,7 @@ for {set current_date $first_julian_date} {$current_date <= $last_julian_date} {
} else {
set font_html ""
}
append html "
<br><font
$font
_html>Month work total:
[
expr
round
(
10.0 *
$attendance
_work
)
/ 10.0
]
${hour_l10n}
, expected
$monthly
_expected_total$
{
hour_l10n
}
</font>
"
append html "
<br><font
$font
_html>Month work total:
[
expr
round
(
$rounding
_factor *
$attendance
_work
)
/
$rounding
_factor
]
${hour_l10n}
, expected
$monthly
_expected_total$
{
hour_l10n
}
</font>
"
}
...
...
@@ -486,10 +489,12 @@ for {set current_date $first_julian_date} {$current_date <= $last_julian_date} {
if {"" ne
$work
} {
# Get the URL of a portlet with right julian date to enter attendances
set attendance_portlet_julian_url
[
export_vars -base
$attendance
_portlet_url
{{
julian
$current
_date
}}]
lappend line_items "
<nobr><a href=$attendance_portlet_julian_url target=_>$color_html
$work
_l10n:
${work}${hour_l10n}$color
_html_end</a></nobr>
"
set work_formatted
[
format
"%.2f"
$work
]
lappend line_items "
<nobr><a href=$attendance_portlet_julian_url target=_>$color_html
$work
_l10n:
${work_formatted}${hour_l10n}$color
_html_end</a></nobr>
"
}
if {"" ne
$break
} {
lappend line_items "
<nobr>$break_l10n:
${break}${hour_l10n}
</nobr>
"
set break_formatted
[
format
"%.2f"
$break
]
lappend line_items "
<nobr>$break_l10n:
${break_formatted}${hour_l10n}
</nobr>
"
}
if {
[
llength
$attendance
_errors
]
> 0} {
...
...
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