diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index fa7d89f..42bcc12 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -239,8 +239,9 @@ namespace AyaNova.PlugIn.V8 private string ImportTag = string.Empty; - private void AddImportTag(List tags){ - if(!string.IsNullOrWhiteSpace(ImportTag)) + private void AddImportTag(List tags) + { + if (!string.IsNullOrWhiteSpace(ImportTag)) tags.Add(ImportTag); } @@ -360,6 +361,9 @@ namespace AyaNova.PlugIn.V8 await ExportExternalUsers(progress);//needs vendors, clients and headoffices already exported so needs to be here late await ExportMemos(progress); + await ExportWorkorderStatus(progress);//item and workorder both as split in v8 + await ExportWorkOrderItemPriorities(progress); + await ExportServiceWorkorders(progress); //MIGRATE_OUTSTANDING - here can fixup loanitem workorder id's @@ -945,7 +949,7 @@ namespace AyaNova.PlugIn.V8 d.contractId = Getv7v8IdMap(c.ContractID, "Contract for Client " + d.name); d.contractExpires = c.ContractExpires; } - + //todo d.defaultServiceTemplateId = c.defaultservicetemplateid d.phone1 = c.Phone1; d.phone2 = c.Phone2; @@ -1152,7 +1156,7 @@ namespace AyaNova.PlugIn.V8 d.contractExpires = c.ContractExpires; } - + d.phone1 = c.Phone1; d.phone2 = c.Phone2; d.phone3 = c.Phone3; @@ -2247,6 +2251,54 @@ namespace AyaNova.PlugIn.V8 } #endregion Memos + + //await (progress);//item and workorder both as split in v8 + //await ExportWorkOrderItemPriorities(progress); + #region WorkorderStatus + private async System.Threading.Tasks.Task ExportWorkorderStatus(ProgressForm progress) + { + if (!progress.KeepGoing) return; + progress.Op("Start WorkOrder/Item Status export"); + progress.SubOp(""); + var ObjectTypeName = "WorkorderStatus"; + progress.Append("Exporting all " + " " + ObjectTypeName + "s"); + List tags = new List(); + AddImportTag(tags); + WorkorderStatusPickList pl = WorkorderStatusPickList.GetList(); + + foreach (WorkorderStatusPickList.WorkorderStatusPickListInfo pli in pl) + { + if (!progress.KeepGoing) return; + + + if (!progress.KeepGoing) return; + + dynamic d = new JObject(); + + + SetTags(d, tags); + + + progress.Op(ObjectTypeName + " " + pli.ID.ToString()); + + var rMainObject = await util.PostAsync("work-order-status", d.ToString()); + long RavenId = util.IdFromResponse(rMainObject); + //Event log fixup + await util.EventLog(util.AyaType, RavenId, RavenFromId, RavenFromId, mem.Created, mem.Modified); + + } + + + //------ + + + } + #endregion workorder status + + + + + /* ██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝ ██╔═══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗ @@ -2262,7 +2314,7 @@ namespace AyaNova.PlugIn.V8 progress.Op("Start Service workorders export"); progress.SubOp(""); var ObjectTypeName = "Workorder"; - + //Step 1: export the CustomFields to FormCustom if applicable so that when doing individual items we can export their custom data too var ocf = ObjectHasCustomFieldDataToExport("WorkorderItem"); bool ShouldExportCustom = ocf != null; @@ -2283,7 +2335,7 @@ namespace AyaNova.PlugIn.V8 if (!progress.KeepGoing) return; List tags = new List(); AddImportTag(tags); - + Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value); if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderService.ServiceNumber.ToString(), progress)) continue; @@ -2340,7 +2392,7 @@ namespace AyaNova.PlugIn.V8 // d.concurrency = util.CTokenFromResponse(rMainObject); progress.Op("WorkorderItem " + wi.ID.ToString()); - + TagFromv7Guid(wi.TypeID, tags); TagFromv7Guid(wi.WorkorderItemUnitServiceTypeID, tags); SetTags(dwi, tags); @@ -2450,7 +2502,7 @@ namespace AyaNova.PlugIn.V8 } #endregion Quotes - /* + /* ██████╗ ███╗ ███╗ ██╔══██╗████╗ ████║ ██████╔╝██╔████╔██║