emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to generate CLOCKSUM property from time ranges?


From: Kyle Meyer
Subject: Re: [O] How to generate CLOCKSUM property from time ranges?
Date: Sat, 12 Jan 2019 17:37:16 -0500

Hello,

[sorry for the late response]

Leo Alekseyev <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]