This commit is contained in:
@@ -2568,6 +2568,9 @@ namespace AyaNova.PlugIn.V8
|
||||
WorkorderServiceList pl = WorkorderServiceList.GetList(crit);
|
||||
progress.Append("Exporting " + pl.Count.ToString() + " Service " + ObjectTypeName + "s");
|
||||
|
||||
//task picklist used over and over
|
||||
var AllTasks = TaskPickList.GetList();
|
||||
|
||||
foreach (WorkorderServiceList.WorkorderServiceListInfo i in pl)
|
||||
{
|
||||
if (!progress.KeepGoing) return;
|
||||
@@ -2867,7 +2870,6 @@ namespace AyaNova.PlugIn.V8
|
||||
dynamic dwl = new JObject();
|
||||
dwl.workOrderId = RavenId;
|
||||
dwl.workorderItemId = ravenwoitemid;
|
||||
|
||||
//null is ok here for user
|
||||
dwl.userId = Getv7v8IdMapNullOk(wl.UserID);
|
||||
dwl.serviceStartDate = util.DateToV8(wl.ServiceStartDate);
|
||||
@@ -2888,7 +2890,6 @@ namespace AyaNova.PlugIn.V8
|
||||
dynamic dwt = new JObject();
|
||||
dwt.workOrderId = RavenId;
|
||||
dwt.workorderItemId = ravenwoitemid;
|
||||
|
||||
//null is ok here for user
|
||||
dwt.userId = Getv7v8IdMapNullOk(wt.UserID);
|
||||
dwt.travelStartDate = util.DateToV8(wt.TravelStartDate);
|
||||
@@ -2899,11 +2900,30 @@ namespace AyaNova.PlugIn.V8
|
||||
dwt.travelRateId = Getv7v8IdMapNullOk(wt.TravelRateID);
|
||||
dwt.travelDetails = wt.TravelDetails;
|
||||
dwt.distance = wt.Distance;
|
||||
|
||||
|
||||
await util.PostAsync("workorder/items/travels", dwt.ToString());
|
||||
}
|
||||
|
||||
int nTaskSequence = 0;
|
||||
foreach (WorkorderItemTask wt in wi.Tasks)
|
||||
{
|
||||
progress.SubOp("WorkorderItemTask " + wt.ID.ToString());
|
||||
var tg = TaskGroup.GetItem(wt.TaskGroupID);
|
||||
dynamic dwt = new JObject();
|
||||
dwt.workOrderId = RavenId;
|
||||
dwt.workorderItemId = ravenwoitemid;
|
||||
dwt.sequence = ++nTaskSequence;
|
||||
var task = AllTasks[wt.TaskID];
|
||||
dwt.task = task.Name;
|
||||
dwt.status = (int)wt.WorkorderItemTaskCompletionType;//same enum values in v8
|
||||
//these two fields don't really exist in v7 so leaving out for now
|
||||
//but could wing it if necessary for some reason
|
||||
//dwt.completedByUserId = Getv7v8IdMapNullOk(wt.Modifier);
|
||||
//dwt.completedDate=
|
||||
|
||||
|
||||
await util.PostAsync("workorder/items/tasks", dwt.ToString());
|
||||
}
|
||||
|
||||
|
||||
}//items loop
|
||||
}//wo loop
|
||||
|
||||
Reference in New Issue
Block a user