Assignment Overtime and Remaining Costs
Contents
[
Hide
Show
]Handling Overtime, Remaining Costs and Work
The Asn class exposes a number of properties for handling an assignment’s overtime, remaining costs and work:
- OvertimeCost represents the sum of the actual and remaining overtime costs of an assignment (decimal).
- OvertimeWork represents the scheduled overtime work for an assignment (TimeSpan).
- RemainingCost represents the remaining projected cost for completing an assignment (decimal).
- RemainingOvertimeCost represents the remaining projected overtime cost for completing an assignment (decimal).
- RemainingWork represents the scheduled remaining work for an assignment (TimeSpan).
- RemainingOvertimeWork represents the scheduled remaining overtime work for an assignment (TimeSpan).
To see assignment overtime, remaining cost and work in Microsoft Project:
- On the Task Usage screen, select the Insert menu, then Column.
- Add the desired columns.
Getting Assignment Overtimes in Aspose.Tasks
The following code example demonstrates how to get assignment overtimes, remaining costs and work using Aspose.Tasks.
1// Create project instance
2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceAssignmentOvertimes.mpp");
3
4// Print assignment overtimes
5
6{
7 auto ra_enumerator = (project1->get_ResourceAssignments())->GetEnumerator();
8 decltype(ra_enumerator->get_Current()) ra;
9 while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
10 {
11 System::Console::WriteLine(ra->Get<System::Decimal>(Asn::OvertimeCost()));
12 System::Console::WriteLine(System::ObjectExt::ToString(ra->Get<Duration>(Asn::OvertimeWork())));
13 System::Console::WriteLine(ra->Get<System::Decimal>(Asn::RemainingCost()));
14 System::Console::WriteLine(ra->Get<System::Decimal>(Asn::RemainingOvertimeCost()));
15 System::Console::WriteLine(System::ObjectExt::ToString(ra->Get<Duration>(Asn::RemainingOvertimeWork())));
16 System::Console::WriteLine(System::ObjectExt::ToString(ra->Get<Duration>(Asn::RemainingOvertimeWork())));
17 }
18}
Work Completion Percentage
The PercentWorkComplete property exposed by the Asn class is used to manage the percentage of work completed on an assignment.
- PercentWorkComplete represents the percentage of the completed work on an assignment (integer).
The following example shows how to get the percentage of work completed on an assignment using Aspose.Tasks.
1// Create project instance
2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceAssignmentPercentWorkComplete.mpp");
3
4// Print assignment percent completion
5
6{
7 auto ra_enumerator = (project1->get_ResourceAssignments())->GetEnumerator();
8 decltype(ra_enumerator->get_Current()) ra;
9 while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
10 {
11 System::Console::WriteLine(System::Convert::ToString(ra->Get<int32_t>(Asn::PercentWorkComplete())));
12 }
13}