Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Material Price Code

Status
Not open for further replies.

sbudzynski

Technical User
Jul 7, 2005
462
US
I know project calculates total costs derived from both material and work resources. Is there any way to have separate columns for the same task, one column for material resource cost and one for work resource cost?

I tried to write a custom field but my computer and I do not speak the same language if you know what I mean! (haha)

Thanks all,


Steve

Be :)
 
Untested

dim tsk as Task
dim asgn as Assignment
dim res as Resource
dim lTotalMaterialCost as long

for each tsk in activeproject.tasks
lTotalMaterialCost = 0
for each asgn in tsk.assignments
if asgn.resourcetype = 1 then 'material resource
tempRes = asgn.resourceid
tempCost = activeproject.resources(tempRes).standardrate
tempUnits = asgn.Units
tempExt = tempCost * tempUnits
lTotalMaterialCost = lTotalMaterialCost + tempExt
end if
next
tsk.Cost1 = lTotalMaterialCost
tsk.cost2 = tsk.cost - tsk.cost1 'Labour only costs
next

Remember to include code to ignore blank tasks and summary tasks.
 
thank you,

I'll be sure to let you know how it works out for me!


Steve

Be :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top