From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: How to generate CLOCKSUM property from time ranges? Date: Sat, 12 Jan 2019 17:37:16 -0500 Message-ID: <87ef9hwlib.fsf@kyleam.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:43891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giRu9-0008Jf-MQ for emacs-orgmode@gnu.org; Sat, 12 Jan 2019 17:37:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giRu7-0008UX-SU for emacs-orgmode@gnu.org; Sat, 12 Jan 2019 17:37:24 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:57977) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giRu3-0008RH-8j for emacs-orgmode@gnu.org; Sat, 12 Jan 2019 17:37:20 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Leo Alekseyev , Emacs orgmode Hello, [sorry for the late response] Leo Alekseyev 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 wh= en > the clock entries are summed in a subtree. > > Concretely, docs say: "CLOCKSUM: The sum of CLOCK intervals in the > subtree. =E2=80=98org-clock-sum=E2=80=99 must be run first to compute th= e 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=E2=80=99t used the CLOCKSUM property (or org-invoice), but my understanding is that it=E2=80=99s a special property that should not actua= lly be set in the property drawer: =E2=80=98(info "(org)Special properties")=E2= =80=99. Running org-clock-sum doesn=E2=80=99t generate a property drawer, but it do= es 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] =3D> 0:07 :END: --8<---------------cut here---------------end--------------->8--- org-invoice retrieves the CLOCKSUM value with org-entry-get. Here=E2=80=99s what we get if we run that in the above buffer, before and after calling org-clock-sum: (org-entry-get nil "CLOCKSUM" nil) ; =3D> nil (org-clock-sum) ; =3D> 7 (org-entry-get nil "CLOCKSUM" nil) ; =3D> "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=E2= =80=99t see it easily. --=20 Kyle