This commit is contained in:
2021-08-24 22:03:11 +00:00
parent 17a42b1571
commit bddfb42508

View File

@@ -483,6 +483,8 @@ namespace AyaNova.PlugIn.V8
await ExportPMs(progress);
await ExportServiceWorkorders(progress);
//todo: fixup pm,quote links on service wo, should I export them first??
await ExportUnitMeterReadings(progress);
//Must be after all root objects due to followups
await ExportScheduleMarkers(progress);
@@ -2387,7 +2389,7 @@ namespace AyaNova.PlugIn.V8
//METER READINGS
if (c.Metered)
{
var RavenId = Getv7v8IdMap(c.ID, RootObjectTypes.Unit, false, false);
var RavenId = await Getv7v8IdMap(c.ID, RootObjectTypes.Unit, false, false);
UnitMeterReadingList uml = UnitMeterReadingList.GetList(c.ID, null);
if (uml.Count > 0)
{
@@ -2403,7 +2405,7 @@ namespace AyaNova.PlugIn.V8
{
//workorder items in v7 are only mapped for this one op and only return the workorderitemUnit id which is
//what v8 uses here if it fails, then if fails and null is ok here
dm.workOrderItemUnitId = Getv7v8IdMapNullOk(ui.LT_UnitMeterReading_Label_WorkorderItemID.Value, RootObjectTypes.WorkorderItem, false);
dm.workOrderItemUnitId = await Getv7v8IdMapNullOk(ui.LT_UnitMeterReading_Label_WorkorderItemID.Value, RootObjectTypes.WorkorderItem, false);
}
await util.PostAsync("unit/meter-reading", dm);
}
@@ -3239,7 +3241,13 @@ namespace AyaNova.PlugIn.V8
List<string> wiutags = new List<string>();
TagFromv7Guid(wi.WorkorderItemUnitServiceTypeID, wiutags);
SetTags(dwiu, wiutags);
await util.PostAsync("workorder/items/units", dwiu.ToString());
long v8woitemunitid= util.IdFromResponse(await util.PostAsync("workorder/items/units", dwiu.ToString()));
//Map used for unit meter reading later, this is the ONLY use for this
//The map required is v7woitemid to v7woitemunitid for meter reading so that's what this saves
//any other use would be broken like if it needed the v8woitemid for something in future
Addv7v8IdMap(wi.ID, v8woitemunitid);
}
}