Re: [Planner Dev] A patch to correct task costs calculations



Hi!

El mar, 06-04-2004 a las 09:49, Alvaro del Castillo escribió:
> Hi guys!
> 
> Thanks to the report in January from Waldemar Augustyn here you have a
> patch that corrects the task cost calculations.
> 

Looking more carefully to cost issues, this patch is plain wrong because
the cost for a resource in a task isn't:

total += priv->work * cost / 3600.0;

A task to be finished needs a work to be done, for example 20h. If we
assing a resource A to the task 100% time, the task will be finished in
2d4h, because the resource works 8 hours each day.

In this simple case, yes, the cost for the resource in the task is the
*total* work for the task multiply by the cost per hour of the resource.

But if we have more than resource, if a resource isn't assigned 100%
(for example X%) to the task, it won't cost "priv->work" but
"priv->work*(X/100)".

Now we have in planner:

total += mrp_assignment_get_units (l->data) * priv->work * cost /
(3600.0 * 100);

that is the correct thing to do, but then, we have the email from
Waldemar that shows some strange things and the problem is using
"priv->work".  The "work" to do the task won't change but if we change
the assignment_units for a resource to a task, the cost using the same
work will be lower, that it is wrong. So to solve the thing, we need to
change "priv->work" for "priv->duration".


total += mrp_assignment_get_units (l->data) * priv->duration * cost /
(3600.0 * 100);

People, think a little about it because it is a hard thing to be sure so
we can commit the change before 0.12.

Cheers

> Cheers
> 
> -- Alvaro
> 
> ______________________________________________________________________
> _______________________________________________
> Planner-dev mailing list
> Planner-dev lists imendio com
> http://lists.imendio.com/mailman/listinfo/planner-dev

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



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