From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: =?UTF-8?B?UmU6IEJ1ZzogTm8gcHJvcGVydHkgY2hhbmdlIGZyb20g4oCYb3Jn?= =?UTF-8?B?LWNsb2NrLXN1beKAmQ==?= Date: Fri, 06 May 2011 12:32:52 -0400 Message-ID: <87d3jviybv.fsf@norang.ca> References: <8739ltg26r.fsf@benfinney.id.au> <8762pofzx8.fsf@benfinney.id.au> <87liyk7gea.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QINz0-0007yl-Us for emacs-orgmode@gnu.org; Fri, 06 May 2011 12:34:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QINyz-0003Fk-MR for emacs-orgmode@gnu.org; Fri, 06 May 2011 12:34:26 -0400 Received: from mho-04-ewr.mailhop.org ([204.13.248.74]:38922 helo=mho-02-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QINyz-0003Fe-Im for emacs-orgmode@gnu.org; Fri, 06 May 2011 12:34:25 -0400 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Peter Jones Cc: Carsten Dominik , Ben Finney , emacs-orgmode@gnu.org Peter Jones writes: > Bernt Hansen writes: >> The org-invoice.el contributed file created by Peter Jones uses a >> CLOCKSUM property but I'm not sure if this is intended to be updated >> manually or automatically from the clocking lines in org. I've CC-ed >> Peter in case he can shed any light on this. > > IIRC, when I wrote org-invoice.el the function (org-clock-sum) updated > the CLOCKSUM entry in the property drawer. I don't remember anything > about text properties being updated, and that doesn't seem very useful > to me. Hi Peter, Carsten just pushed a fix so org-invoice.el can again access the CLOCKSUM special property. I've mocked up a sample task tree with clock times and dates and tried to generate an invoice using a rate of $60 - which makes each clock minute $1. The total time in the tree is 55 minutes so this invoice should be $55 but the total is $115. Please let me know if I'm doing this completely wrong. org-invoice.el has a number of problems on a sample tree I ran this against. The clocked time in this file is as follows: #+BEGIN: columnview :hlines 1 :id: local | Task | Estimated Effort | CLOCKSUM | |----------------------------+------------------+----------| | ** DONE Project Foo | | 0:55 | | *** DONE Task 1 for foo | | 0:05 | | *** DONE Task 2 for foo | | 0:20 | | **** DONE Task 2.1 for foo | | 0:05 | | *** DONE Task 3 for foo | | 0:20 | | **** DONE Task 3.1 for foo | | 0:05 | | *** DONE Task 4 for foo | | 0:05 | #+END: There are 5 minutes clocked in the Project Foo task and all other clocked times are in the subtasks. There are 55 minutes total clocked on this project. The clock detail per task is | Task | Clocked Minutes | |----------------------------+-----------------| | ** DONE Project Foo | 0:05 | | *** DONE Task 1 for foo | 0:05 | | *** DONE Task 2 for foo | 0:15 | | **** DONE Task 2.1 for foo | 0:05 | | *** DONE Task 3 for foo | 0:15 | | **** DONE Task 3.1 for foo | 0:05 | | *** DONE Task 4 for foo | 0:05 | and the resulting invoice looks like this: | Task / Date | Time | Price | |---------------------------+------+--------| | Tuesday, April 19, 2011 | 0:55 | 55.00 | | DONE Project Foo | 0:55 | 55.00 | |---------------------------+------+--------| | Monday, April 18, 2011 | 0:05 | 5.00 | | DONE Task 1 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Tuesday, April 19, 2011 | 0:25 | 25.00 | | DONE Task 2 for foo | 0:20 | 20.00 | | DONE Task 2.1 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Wednesday, April 20, 2011 | 0:25 | 25.00 | | DONE Task 3 for foo | 0:20 | 20.00 | | DONE Task 3.1 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Tuesday, April 19, 2011 | 0:05 | 5.00 | | DONE Task 3 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Total: | 1:55 | 115.00 | There is double accounting of clock times in the invoice. 1) Trees with subtasks are double accounted for time. This inflates the invoice and is incorrect. 2) The total time at the bottom of the invoice also includes double accounted for clock times. The 3rd entry |-------------------------+------+-------| | Tuesday, April 19, 2011 | 0:25 | 25.00 | | DONE Task 2 for foo | 0:20 | 20.00 | | DONE Task 2.1 for foo | 0:05 | 5.00 | |-------------------------+------+-------| is really only 20 minutes long with 15 minutes clocked in the Task 2 parent task and 5 minutes clocked in the Task 2.1 subtask. The total for the day should be 0:20 not 0:25 which also affects the invoice total at the bottom. Ditto for the 4th entry. The Project Foo entry includes all 55 minutes for the project and is added to all of the subtask entries which inflates the total for the invoice. Regards, Bernt --8<---------------cut here---------------start------------->8--- * Invoices ** DONE Project Foo CLOSED: [2011-04-19 Tue 13:57] :LOGBOOK: - State "DONE" from "STARTED" [2011-04-19 Tue 13:57] CLOCK: [2011-04-18 Mon 16:13]--[2011-04-18 Mon 16:18] => 0:05 :END: :PROPERTIES: :RATE: 60 :END: [2011-04-18 Mon 15:36] #+BEGIN: columnview :hlines 1 :id: local | Task | Estimated Effort | CLOCKSUM | |----------------------------+------------------+----------| | ** DONE Project Foo | | 0:55 | | *** DONE Task 1 for foo | | 0:05 | | *** DONE Task 2 for foo | | 0:20 | | **** DONE Task 2.1 for foo | | 0:05 | | *** DONE Task 3 for foo | | 0:20 | | **** DONE Task 3.1 for foo | | 0:05 | | *** DONE Task 4 for foo | | 0:05 | #+END: #+BEGIN: invoice | Task / Date | Time | Price | |---------------------------+------+--------| | Tuesday, April 19, 2011 | 0:55 | 55.00 | | DONE Project Foo | 0:55 | 55.00 | |---------------------------+------+--------| | Monday, April 18, 2011 | 0:05 | 5.00 | | DONE Task 1 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Tuesday, April 19, 2011 | 0:25 | 25.00 | | DONE Task 2 for foo | 0:20 | 20.00 | | DONE Task 2.1 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Wednesday, April 20, 2011 | 0:25 | 25.00 | | DONE Task 3 for foo | 0:20 | 20.00 | | DONE Task 3.1 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Tuesday, April 19, 2011 | 0:05 | 5.00 | | DONE Task 4 for foo | 0:05 | 5.00 | |---------------------------+------+--------| | Total: | 1:55 | 115.00 | #+END: *** DONE Task 1 for foo SCHEDULED: <2011-04-18 Mon> CLOSED: [2011-04-18 Mon 12:09] :LOGBOOK: - State "DONE" from "TODO" [2011-04-18 Mon 12:09] CLOCK: [2011-04-18 Mon 10:17]--[2011-04-18 Mon 10:22] => 0:05 :END: [2011-04-17 Sun 06:33] *** DONE Task 2 for foo CLOSED: [2011-04-19 Tue 13:56] :LOGBOOK: - State "DONE" from "TODO" [2011-04-19 Tue 13:56] CLOCK: [2011-04-18 Mon 18:20]--[2011-04-18 Mon 18:35] => 0:15 :END: [2011-04-18 Mon 18:12] **** DONE Task 2.1 for foo CLOSED: [2011-04-19 Tue 13:56] :LOGBOOK: - State "DONE" from "STARTED" [2011-04-19 Tue 13:56] CLOCK: [2011-04-19 Tue 13:56]--[2011-04-19 Tue 14:01] => 0:05 :END: [2011-04-19 Tue 12:05] *** DONE Task 3 for foo CLOSED: [2011-04-20 Wed 13:56] :LOGBOOK: - State "DONE" from "TODO" [2011-04-20 Wed 13:56] CLOCK: [2011-04-19 Tue 18:20]--[2011-04-19 Tue 18:35] => 0:15 :END: [2011-04-19 Tue 18:12] **** DONE Task 3.1 for foo CLOSED: [2011-04-20 Wed 13:56] :LOGBOOK: - State "DONE" from "STARTED" [2011-04-20 Wed 13:56] CLOCK: [2011-04-20 Wed 13:56]--[2011-04-20 Wed 14:01] => 0:05 :END: [2011-04-20 Wed 12:05] *** DONE Task 4 for foo CLOSED: [2011-04-19 Tue 17:01] :LOGBOOK: - State "DONE" from "STARTED" [2011-04-19 Tue 17:01] CLOCK: [2011-04-19 Tue 16:58]--[2011-04-19 Tue 17:03] => 0:05 :END: [2011-04-19 Tue 16:58] --8<---------------cut here---------------end--------------->8---