This commit is contained in:
2020-05-11 23:43:30 +00:00
parent ddce644e65
commit e0b635ad09

View File

@@ -123,7 +123,7 @@ namespace AyaNova.PlugIn.V8
public void CommandSelectedForSingleObject(string commandKey, RootObjectTypes objectType, object ayaNovaObject)
{
util.PRE_RELEASE_VERSION_STRING = "Pre-release test "+ this.PluginVersion;
util.PRE_RELEASE_VERSION_STRING = "Pre-release test " + this.PluginVersion;
if (!User.CurrentUserIsAnAdministrator)
{
@@ -295,8 +295,8 @@ namespace AyaNova.PlugIn.V8
await ExportServiceWorkorders(progress);
//todo: these are now invalid and awaiting RAVEN end implementation
//after which can copy mostly from service workorder block
// await ExportQuotes(progress);
// await ExportPMs(progress);
// await ExportQuotes(progress);
// await ExportPMs(progress);
//NOTE: when get to PRIORITY, or WORKORDER STATUS be sure to add color code as per already done in USER export
@@ -1357,7 +1357,27 @@ namespace AyaNova.PlugIn.V8
var DateCustomFields = await ExportCustomFieldSchema(ocf, "WorkorderItem", "WorkOrderItem");
//Step 2: export the objects
WorkorderServiceList pl = WorkorderServiceList.GetList("");
//sort by woid
// var crit = @"<?xml version=""1.0"" encoding=""utf-16"" standalone=""yes""?>
//<GRIDCRITERIA>
// <COLUMNITEM CM=""aWorkorderService.aServiceNumber"" UI=""LT_O_Workorder"" PIN=""0"" WIDTH=""92"" SORT=""ASC"" />
// <COLUMNITEM CM=""aWorkorderService.aServiceDate"" UI=""LT_WorkorderService_Label_ServiceDate"" PIN=""0"" WIDTH=""119"" />
// <COLUMNITEM CM=""aClient.aName"" UI=""LT_O_Client"" PIN=""0"" WIDTH=""148"" />
// <COLUMNITEM CM=""aWorkorderStatus.aName"" UI=""LT_O_WorkorderStatus"" PIN=""0"" WIDTH=""133"" />
// <COLUMNITEM CM=""aWorkorder.aSummary"" UI=""LT_Workorder_Label_Summary"" PIN=""0"" WIDTH=""154"" />
// <COLUMNITEM CM=""aWorkorderPreventiveMaintenance.aPreventiveMaintenanceNumber"" UI=""LT_Workorder_Label_FromPMID"" PIN=""0"" WIDTH=""106"" />
// <COLUMNITEM CM=""aWorkorderQuote.aQuoteNumber"" UI=""LT_Workorder_Label_FromQuoteID"" PIN=""0"" WIDTH=""99"" />
// <COLUMNITEM CM=""aWorkorder.aClosed"" UI=""LT_Workorder_Label_Closed"" PIN=""0"" WIDTH=""82"" />
// <COLUMNITEM CM=""aWorkorderService.aInvoiceNumber"" UI=""LT_WorkorderService_Label_InvoiceNumber"" PIN=""0"" WIDTH=""126"" />
// <COLUMNITEM CM=""aWorkorder.aServiceCompleted"" UI=""LT_Workorder_Label_ServiceCompleted"" PIN=""0"" WIDTH=""143"" />
//</GRIDCRITERIA>";
var crit = @"<?xml version=""1.0"" encoding=""utf-16"" standalone=""yes""?>
<GRIDCRITERIA>
<COLUMNITEM CM=""aWorkorderService.aServiceNumber"" UI=""LT_O_Workorder"" PIN=""0"" WIDTH=""92"" SORT=""ASC"" />
</GRIDCRITERIA>";
WorkorderServiceList pl = WorkorderServiceList.GetList(crit);
progress.Append("Exporting " + pl.Count.ToString() + " Service " + ObjectTypeName + "s");
foreach (WorkorderServiceList.WorkorderServiceListInfo i in pl)
@@ -1369,8 +1389,8 @@ namespace AyaNova.PlugIn.V8
Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value);
if (IsDuplicateMapItem(c.ID, c.WorkorderService.ServiceNumber.ToString(), progress)) continue;
var ObjectTID = new TypeAndID(RootObjectTypes.WorkorderService, c.ID);
dynamic d = new JObject();
//d.concurrencyToken = util.CTokenFromResponse(rMainObject);
progress.Op(ObjectTypeName + " " + c.WorkorderService.ServiceNumber);
@@ -1379,19 +1399,20 @@ namespace AyaNova.PlugIn.V8
Tagit(c.RegionID, tags);
SetTags(d, tags);
var rMainObject = await util.PostAsync(RavenRouteName, d.ToString());
long RavenId = util.IdFromResponse(rMainObject);
AddMap(c.ID, RavenId);
d = rMainObject.ObjectResponse["data"];
d.serial = c.WorkorderService.ServiceNumber;
d.notes = c.Summary;
//Attachments / FILES
await ExportAttachments(ObjectTID, progress, util.AyaType.WorkOrder);
//-----
// wiki
if (WikiPage.HasWiki(c.ID))
{