Re: [Planner] Cost calculations



Hi!

I am sure you think we have forgotten your email but ... no :)

Here goes the patch to correct the bug you have found. I will send
another email out of this thread in order all the people read it.

Cheers and thanks 

El mié, 14-01-2004 a las 01:12, Waldemar Augustyn escribió:
> I have just noticed, Planner's cost calculation is not quite right.  It 
> appears, it misinterprets the resource "units" value. I thought the 
> "units" figure is really the percentage of time a resource is expected 
> (allowed) to work on a task.  The default is 100, which I think should 
> be labeled with a %.
> 
> Here is what happens:
> 
> A  Task takes 3 days to finish.  There is one resource allocated to it 
> at 50% time and 45 cost.  Planner properly calculates the task to take 
> six days (because of 50% resource), but the cost is calculated at 540.   
> I would think, it should be 3*8*45= 1080  (three days * 8 hours * 45 
> $/hour).  Or, perhaps, 6*4*45=1080 (six days * 4 hours * 45 $/h).
> 
> Same thing with another task.  It takes 5 days to finish, the allocated 
> resource works 5% of time at cost of 30.  Planner properly calculates 
> the task to take 100 days to finish, but the cost is calculated at 60.  
> I would think, it should be 5*8*30=1200.  Or,  100*(8/20)*30=1200.
> 
> I am using version 0.11.
> 
> 
> _______________________________________________
> Planner mailing list
> Planner lists imendio com
> http://lists.imendio.com/mailman/listinfo/planner
> 
Index: libplanner/mrp-task.c
===================================================================
RCS file: /cvs/gnome/planner/libplanner/mrp-task.c,v
retrieving revision 1.2
diff -u -b -B -p -r1.2 mrp-task.c
--- libplanner/mrp-task.c	17 Feb 2004 20:00:17 -0000	1.2
+++ libplanner/mrp-task.c	6 Apr 2004 07:38:24 -0000
@@ -1569,7 +1569,7 @@ mrp_task_get_cost (MrpTask *task)
 		resource = mrp_assignment_get_resource (l->data);
 
 		mrp_object_get (resource, "cost", &cost, NULL);
-		total += mrp_assignment_get_units (l->data) * priv->work * cost / (3600.0 * 100);
+		total += priv->work * cost / 3600.0;
 	}
 
 	return total;

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]