Compare commits
1 Commits
e9627e69fd
...
2ee8bde397
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ee8bde397 |
@ -809,25 +809,19 @@ PARAMS is a property list of the following parameters:
|
|||||||
;; Compute workload report for each date and record the total time;
|
;; Compute workload report for each date and record the total time;
|
||||||
;; XXX: this might be slow, try to reduce the calls to `db/org-planned-tasks-in-range'.
|
;; XXX: this might be slow, try to reduce the calls to `db/org-planned-tasks-in-range'.
|
||||||
(let ((days 0))
|
(let ((days 0))
|
||||||
(dolist (interval-end-date date-range)
|
(dolist (interval-end-date date-range)
|
||||||
(let ((total-time (car (db/org-planned-tasks-in-range
|
(let ((total-time (car (db/org-planned-tasks-in-range
|
||||||
;; Set start date to nil to also include tasks scheduled or deadlined
|
;; Set start date to nil to also include tasks scheduled or deadlined
|
||||||
;; before `start-date', as those are also still open and need to be
|
;; before `start-date', as those are also still open and need to be
|
||||||
;; done somewhen.
|
;; done somewhen.
|
||||||
nil
|
nil
|
||||||
interval-end-date
|
interval-end-date
|
||||||
org-ql-match))))
|
org-ql-match))))
|
||||||
(let ((utilization (* (/ (org-duration-to-minutes total-time)
|
(let ((utilization (* (/ (org-duration-to-minutes total-time)
|
||||||
(* (cl-incf days)
|
(* (cl-incf days)
|
||||||
(org-duration-to-minutes work-hours)))
|
(org-duration-to-minutes work-hours)))
|
||||||
100)))
|
100)))
|
||||||
(insert (format "| [%s] | %s | %s |\n"
|
(insert (format "| [%s] | %s | %.2f%% |\n" interval-end-date total-time utilization))))))
|
||||||
interval-end-date
|
|
||||||
total-time
|
|
||||||
(if (<= 80 utilization)
|
|
||||||
;; When utilization is above 80%, mark entry in bold
|
|
||||||
(format "*%.2f%%*" utilization)
|
|
||||||
(format "%.2f%%" utilization))))))))
|
|
||||||
(insert "|--|")
|
(insert "|--|")
|
||||||
(org-table-align)))
|
(org-table-align)))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user