This commit is contained in:
2021-08-17 18:53:45 +00:00
parent 6555234522
commit 5b46970edc

View File

@@ -368,7 +368,7 @@ namespace AyaNova.PlugIn.V8
await ExportWorkorderStatus(progress);//item and workorder both as split in v8 await ExportWorkorderStatus(progress);//item and workorder both as split in v8
await ExportWorkOrderItemPriorities(progress); await ExportWorkOrderItemPriorities(progress);
await ExportServiceWorkorders(progress); await ExportServiceWorkorders(progress);
await ExportQuotes(progress); await ExportQuotes(progress);
// await ExportPMs(progress); // await ExportPMs(progress);
//Must be after all root objects due to followups //Must be after all root objects due to followups
@@ -1469,89 +1469,89 @@ namespace AyaNova.PlugIn.V8
} }
//todo: maybe, seems as though only v8 has a field in the loanitem for woid and v7 doesn't so...?? //todo: maybe, seems as though only v8 has a field in the loanitem for woid and v7 doesn't so...??
//perhaps v8 is automatically flagging it when the woitemloan record is created? //perhaps v8 is automatically flagging it when the woitemloan record is created?
// private async System.Threading.Tasks.Task FlagWoForLoanItems(ProgressForm progress) // private async System.Threading.Tasks.Task FlagWoForLoanItems(ProgressForm progress)
// { // {
// if (!progress.KeepGoing) return;
// progress.Op("Start update loan items with current work order id");
// progress.SubOp("");
// PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem");
// foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl) // if (!progress.KeepGoing) return;
// { // progress.Op("Start update loan items with current work order id");
// if (!progress.KeepGoing) return; // progress.SubOp("");
// LoanItem c = LoanItem.GetItem(i.ID);
// dynamic d = new JObject();
// if(c.l!=guid.empty){
// d= (await util.GetAsync("loan-unit/"+ Getv7v8IdMap(i.ID,"loan item for updat of workorder"))).objectResponse; // PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem");
//d.workorderItemLoanId=
// }
// d.name = GetUniqueName(c.Name);
// if (IsDuplicatev7v8IdMapItem(c.ID, c.Name, progress)) continue;
// progress.Op(ObjectTypeName + " " + d.name);
// d.active = c.Active;
// d.notes = c.Notes;
// d.serial = c.Serial;
// //MIGRATE_OUTSTANDING
// //fixup after workorders
// //
// d.rateHour = c.RateHour;
// d.rateHalfDay = c.RateHalfDay;
// d.rateDay = c.RateDay;
// d.rateWeek = c.RateWeek;
// d.rateMonth = c.RateMonth;
// d.rateYear = c.RateYear;
// d.defaultRate = 1;
// TagFromv7Guid(c.RegionID, tags); // foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl)
// SetTags(d, tags); // {
// if (!progress.KeepGoing) return;
// //Custom fields? // LoanItem c = LoanItem.GetItem(i.ID);
// if (ShouldExportCustom) // dynamic d = new JObject();
// d.customFields = CustomFieldData(c, DateCustomFields); // if(c.l!=guid.empty){
// var rMainObject = await util.PostAsync("loan-unit", d.ToString()); // d= (await util.GetAsync("loan-unit/"+ Getv7v8IdMap(i.ID,"loan item for updat of workorder"))).objectResponse;
// long RavenId = util.IdFromResponse(rMainObject);
// Addv7v8IdMap(c.ID, RavenId);
// //Attachments / FILES //d.workorderItemLoanId=
// await ExportAttachments(ObjectTID, progress); // }
// //-----
// bool repost = false;
// d = rMainObject.ObjectResponse["data"];
// // wiki
// if (WikiPage.HasWiki(c.ID))
// {
// // await ExportAttachments(ObjectTID, progress);
// d.wiki = GetWikiContent(ObjectTID);
// repost = true;
// }
// //docs // d.name = GetUniqueName(c.Name);
// string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); // if (IsDuplicatev7v8IdMapItem(c.ID, c.Name, progress)) continue;
// if (!string.IsNullOrEmpty(NonFileUrls)) // progress.Op(ObjectTypeName + " " + d.name);
// { // d.active = c.Active;
// d.notes = NonFileUrls + "\n-----------------\n" + d.notes; // d.notes = c.Notes;
// repost = true; // d.serial = c.Serial;
// } // //MIGRATE_OUTSTANDING
// if (repost) // //fixup after workorders
// await util.PutAsync("loan-unit", d.ToString()); // //
// //----- // d.rateHour = c.RateHour;
// d.rateHalfDay = c.RateHalfDay;
// d.rateDay = c.RateDay;
// d.rateWeek = c.RateWeek;
// d.rateMonth = c.RateMonth;
// d.rateYear = c.RateYear;
// d.defaultRate = 1;
// //Event log fixup
// await util.EventLog(util.AyaType.LoanUnit, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
// } // TagFromv7Guid(c.RegionID, tags);
// } // SetTags(d, tags);
// //Custom fields?
// if (ShouldExportCustom)
// d.customFields = CustomFieldData(c, DateCustomFields);
// var rMainObject = await util.PostAsync("loan-unit", d.ToString());
// long RavenId = util.IdFromResponse(rMainObject);
// Addv7v8IdMap(c.ID, RavenId);
// //Attachments / FILES
// await ExportAttachments(ObjectTID, progress);
// //-----
// bool repost = false;
// d = rMainObject.ObjectResponse["data"];
// // wiki
// if (WikiPage.HasWiki(c.ID))
// {
// // await ExportAttachments(ObjectTID, progress);
// d.wiki = GetWikiContent(ObjectTID);
// repost = true;
// }
// //docs
// string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress);
// if (!string.IsNullOrEmpty(NonFileUrls))
// {
// d.notes = NonFileUrls + "\n-----------------\n" + d.notes;
// repost = true;
// }
// if (repost)
// await util.PutAsync("loan-unit", d.ToString());
// //-----
// //Event log fixup
// await util.EventLog(util.AyaType.LoanUnit, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
// }
// }
#endregion LoanItems #endregion LoanItems
@@ -1738,7 +1738,7 @@ namespace AyaNova.PlugIn.V8
+ "<WHEREITEMGROUP GROUPLOGICALOPERATOR=\"And\" UI=\"LT_O_PartAssembly\">" + "<WHEREITEMGROUP GROUPLOGICALOPERATOR=\"And\" UI=\"LT_O_PartAssembly\">"
+ "<WHEREITEM COMPAREOPERATOR=\"Equals\" CM=\"aPartAssembly.aID\" UICOMPAREVALUE=\"\" TYPE=\"System.Guid\" COMPAREVALUE=\"{" + p.ID.ToString().ToUpperInvariant() + "}\" /> " + "<WHEREITEM COMPAREOPERATOR=\"Equals\" CM=\"aPartAssembly.aID\" UICOMPAREVALUE=\"\" TYPE=\"System.Guid\" COMPAREVALUE=\"{" + p.ID.ToString().ToUpperInvariant() + "}\" /> "
+ "</WHEREITEMGROUP></GRIDCRITERIA>"; + "</WHEREITEMGROUP></GRIDCRITERIA>";
PartList pl = PartList.GetList(crit); PartList pl = PartList.GetList(crit);
dynamic d = new JObject(); dynamic d = new JObject();
d.name = GetUniqueName(p.Name); d.name = GetUniqueName(p.Name);
progress.Op(ObjectTypeName + " " + d.name); progress.Op(ObjectTypeName + " " + d.name);
@@ -1748,7 +1748,7 @@ namespace AyaNova.PlugIn.V8
foreach (PartList.PartListInfo i in pl) foreach (PartList.PartListInfo i in pl)
{ {
dynamic ditem = new JObject(); dynamic ditem = new JObject();
ditem.partId = Getv7v8IdMap(i.LT_O_Part.Value, "part id for assembly"); ditem.partId = Getv7v8IdMap(i.LT_O_Part.Value, "part id for assembly");
ditem.partAssemblyId = 0; ditem.partAssemblyId = 0;
ditem.quantity = 1; ditem.quantity = 1;
dItems.Add(ditem); dItems.Add(ditem);
@@ -3291,31 +3291,78 @@ namespace AyaNova.PlugIn.V8
//################## v8 quote status to mirror v7 quote status ########################## //################## v8 quote status to mirror v7 quote status ##########################
{ {
/*
Submitted
*/
if (!progress.KeepGoing) return; if (!progress.KeepGoing) return;
dynamic d = new JObject();
d.name = ; //InProgress 1:
progress.Op("Replicating Quote status " + d.name); await util.PostAsync("work-order-status", @"{""name"": ""In progress"",
d.active = s.Active; ""active"": true,
d.locked = false; ""notes"": ""In process of completing this quote"",
d.completed = false; ""color"": ""#00ff00"",
d.selectRoles = 1290;//biz-admin, service full, service tech, subcontractor ""selectRoles"": 32834,
d.removeRoles = 1290; ""removeRoles"": 32834,
d.color = System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color.FromArgb(s.ARGB)); ""completed"": false,
SetTags(d, tags); ""locked"": false}");
var rMainObject = await util.PostAsync("work-order-status", d.ToString());
long RavenId = util.IdFromResponse(rMainObject);
Addv7v8IdMap(s.ID, RavenId);
//Event log fixup //Submitted 2:
await util.EventLog(util.AyaType.WorkOrderStatus, RavenId, SafeGetUserMap(s.Creator), SafeGetUserMap(s.Modifier), s.Created, s.Modified); await util.PostAsync("work-order-status", @"{""name"": ""Submitted"",
""active"": true,
""notes"": ""Use to lock quote after given to customer and wait for approval"",
""color"": ""#c00000"",
""selectRoles"": 32834,
""removeRoles"": 32834,
""completed"": true,
""locked"": true}");
//Awarded 3:
await util.PostAsync("work-order-status", @"{""name"": ""Awarded"",
""active"": true,
""notes"": ""Waiting for work order to be generated"",
""color"": ""#80ffff"",
""selectRoles"": 32834,
""removeRoles"": 32842,
""completed"": true,
""locked"": true}");
//NotAwarded 4:
await util.PostAsync("work-order-status", @"{""name"": ""Not awarded"",
""active"": true,
""notes"": ""Not successful"",
""color"": ""#f2f2f2"",
""selectRoles"": 32834,
""removeRoles"": 32834,
""completed"": true,
""locked"": true}");
//New 5:
await util.PostAsync("work-order-status", @"{""name"": ""New"",
""active"": true,
""notes"": ""New quote required; Sales to complete this Quote for submission"",
""color"": ""#8080ff"",
""selectRoles"": 32834,
""removeRoles"": 32834,
""completed"": false,
""locked"": false}");
//NotAwarded2 6:
await util.PostAsync("work-order-status", @"{""name"": ""Beyond economical repair"",
""active"": true,
""notes"": ""Not worth repairing"",
""color"": ""#ff0000"",
""selectRoles"": 32834,
""removeRoles"": 32834,
""completed"": true,
""locked"": true}");
} }
//####################################################################################### //#######################################################################################