emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: No property change from ‘org-clock-s um’


From: Bernt Hansen
Subject: Re: [O] Bug: No property change from ‘org-clock-s um’
Date: Fri, 06 May 2011 12:32:52 -0400
User-agent: Gnus/5.110017 (No Gnus v0.17) Emacs/23.2 (gnu/linux)

Peter Jones <address@hidden> writes:

> Bernt Hansen <address@hidden> 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---




reply via email to

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