Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
T
time-slime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Michael Rouse
time-slime
Commits
f937eb1a
Commit
f937eb1a
authored
Aug 25, 2018
by
Michael Rouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added total hours to the result of a report.
parent
e168a515
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
0 deletions
+4
-0
shell/shell.c
shell/shell.c
+1
-0
timeslime.c
timeslime.c
+2
-0
timeslime.h
timeslime.h
+1
-0
No files found.
shell/shell.c
View file @
f937eb1a
...
...
@@ -194,6 +194,7 @@ static void perform_report_action(args_t args)
printf
(
"
\t
%s: %0.2f
\n
"
,
report
->
Entries
[
i
].
Date
,
report
->
Entries
[
i
].
Hours
);
}
printf
(
"
\n
Total Hours: %0.2f
\n
"
,
report
->
TotalHours
);
printf
(
"
\n
"
);
TimeSlime_FreeReport
(
&
report
);
}
...
...
timeslime.c
View file @
f937eb1a
...
...
@@ -262,11 +262,13 @@ TIMESLIME_STATUS_t TimeSlime_GetReport(TIMESLIME_DATE_t start, TIMESLIME_DATE_t
if
(
report
==
NULL
)
return
TIMESLIME_UNKOWN_ERROR
;
report
->
TotalHours
=
0
;
report
->
NumberOfEntries
=
number_of_results
;
for
(
i
=
0
;
i
<
number_of_results
;
i
++
)
{
// Build report entries
report
->
Entries
[
i
].
Hours
=
database_results
[
i
]
->
TotalHours
;
report
->
TotalHours
+=
report
->
Entries
[
i
].
Hours
;
strcpy
(
report
->
Entries
[
i
].
Date
,
database_results
[
i
]
->
TimeSheetDate
);
}
...
...
timeslime.h
View file @
f937eb1a
...
...
@@ -81,6 +81,7 @@ typedef struct TIMESLIME_REPORT_ENTRY_STRUCT TIMESLIME_REPORT_ENTRY_t;
struct
TIMESLIME_REPORT_STRUCT
{
int
NumberOfEntries
;
float
TotalHours
;
TIMESLIME_REPORT_ENTRY_t
Entries
[];
};
typedef
struct
TIMESLIME_REPORT_STRUCT
TIMESLIME_REPORT_t
;
...
...
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