* How to generate CLOCKSUM property from time ranges?
@ 2018-11-02 3:01 Leo Alekseyev
2019-01-12 22:37 ` Kyle Meyer
0 siblings, 1 reply; 2+ messages in thread
From: Leo Alekseyev @ 2018-11-02 3:01 UTC (permalink / raw)
To: Emacs orgmode
[-- Attachment #1: Type: text/plain, Size: 752 bytes --]
Greetings all,
I am looking into using `org-invoice` to generate some invoices. It uses
the CLOCKSUM property, which according to the docs gets auto-generated when
the clock entries are summed in a subtree.
Concretely, docs say: "CLOCKSUM: The sum of CLOCK intervals in the
subtree. ‘org-clock-sum’ must be run first to compute the values in the
current buffer." However, `org-clock-sum` is a non-interactive function,
and evaluating it by hand doesn't do anything for me.
Org-clock-report is able to generate the table with total subtree sums, but
doesn't set the CLOCKSUM property.
Question: how do I get CLOCKSUM property generated and stored in a subtree
with timestamps so that org-invoice functions can pick it up?
--Leo
[-- Attachment #2: Type: text/html, Size: 906 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to generate CLOCKSUM property from time ranges?
2018-11-02 3:01 How to generate CLOCKSUM property from time ranges? Leo Alekseyev
@ 2019-01-12 22:37 ` Kyle Meyer
0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2019-01-12 22:37 UTC (permalink / raw)
To: Leo Alekseyev, Emacs orgmode
Hello,
[sorry for the late response]
Leo Alekseyev <dnquark@gmail.com> writes:
> Greetings all,
> I am looking into using `org-invoice` to generate some invoices. It uses
> the CLOCKSUM property, which according to the docs gets auto-generated when
> the clock entries are summed in a subtree.
>
> Concretely, docs say: "CLOCKSUM: The sum of CLOCK intervals in the
> subtree. ‘org-clock-sum’ must be run first to compute the values in the
> current buffer." However, `org-clock-sum` is a non-interactive function,
> and evaluating it by hand doesn't do anything for me.
> [...]
> Question: how do I get CLOCKSUM property generated and stored in a subtree
> with timestamps so that org-invoice functions can pick it up?
I haven’t used the CLOCKSUM property (or org-invoice), but my
understanding is that it’s a special property that should not actually
be set in the property drawer: ‘(info "(org)Special properties")’.
Running org-clock-sum doesn’t generate a property drawer, but it does
store the value as a text property. Say we have this file:
--8<---------------cut here---------------start------------->8---
* TODO things
:LOGBOOK:
CLOCK: [2019-01-12 Sat 17:33]--[2019-01-12 Sat 17:40] => 0:07
:END:
--8<---------------cut here---------------end--------------->8---
org-invoice retrieves the CLOCKSUM value with org-entry-get. Here’s
what we get if we run that in the above buffer, before and after calling
org-clock-sum:
(org-entry-get nil "CLOCKSUM" nil) ; => nil
(org-clock-sum) ; => 7
(org-entry-get nil "CLOCKSUM" nil) ; => "0:07"
So, running org-clock-sum (or any function that calls org-clock-sum),
does generate and store a value that org-invoice can use; you just can’t
see it easily.
--
Kyle
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-12 22:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-02 3:01 How to generate CLOCKSUM property from time ranges? Leo Alekseyev
2019-01-12 22:37 ` Kyle Meyer
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).