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; // if (!progress.KeepGoing) return;
// progress.Op("Start update loan items with current work order id"); // progress.Op("Start update loan items with current work order id");
// progress.SubOp(""); // progress.SubOp("");
// PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem"); // PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem");
// foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl) // foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl)
// { // {
// if (!progress.KeepGoing) return; // if (!progress.KeepGoing) return;
// LoanItem c = LoanItem.GetItem(i.ID); // LoanItem c = LoanItem.GetItem(i.ID);
// dynamic d = new JObject(); // dynamic d = new JObject();
// if(c.l!=guid.empty){ // if(c.l!=guid.empty){
// d= (await util.GetAsync("loan-unit/"+ Getv7v8IdMap(i.ID,"loan item for updat of workorder"))).objectResponse; // d= (await util.GetAsync("loan-unit/"+ Getv7v8IdMap(i.ID,"loan item for updat of workorder"))).objectResponse;
//d.workorderItemLoanId= //d.workorderItemLoanId=
// } // }
// d.name = GetUniqueName(c.Name); // d.name = GetUniqueName(c.Name);
// if (IsDuplicatev7v8IdMapItem(c.ID, c.Name, progress)) continue; // if (IsDuplicatev7v8IdMapItem(c.ID, c.Name, progress)) continue;
// progress.Op(ObjectTypeName + " " + d.name); // progress.Op(ObjectTypeName + " " + d.name);
// d.active = c.Active; // d.active = c.Active;
// d.notes = c.Notes; // d.notes = c.Notes;
// d.serial = c.Serial; // d.serial = c.Serial;
// //MIGRATE_OUTSTANDING // //MIGRATE_OUTSTANDING
// //fixup after workorders // //fixup after workorders
// // // //
// d.rateHour = c.RateHour; // d.rateHour = c.RateHour;
// d.rateHalfDay = c.RateHalfDay; // d.rateHalfDay = c.RateHalfDay;
// d.rateDay = c.RateDay; // d.rateDay = c.RateDay;
// d.rateWeek = c.RateWeek; // d.rateWeek = c.RateWeek;
// d.rateMonth = c.RateMonth; // d.rateMonth = c.RateMonth;
// d.rateYear = c.RateYear; // d.rateYear = c.RateYear;
// d.defaultRate = 1; // d.defaultRate = 1;
// TagFromv7Guid(c.RegionID, tags); // TagFromv7Guid(c.RegionID, tags);
// SetTags(d, tags); // SetTags(d, tags);
// //Custom fields? // //Custom fields?
// if (ShouldExportCustom) // if (ShouldExportCustom)
// d.customFields = CustomFieldData(c, DateCustomFields); // d.customFields = CustomFieldData(c, DateCustomFields);
// var rMainObject = await util.PostAsync("loan-unit", d.ToString()); // var rMainObject = await util.PostAsync("loan-unit", d.ToString());
// long RavenId = util.IdFromResponse(rMainObject); // long RavenId = util.IdFromResponse(rMainObject);
// Addv7v8IdMap(c.ID, RavenId); // Addv7v8IdMap(c.ID, RavenId);
// //Attachments / FILES // //Attachments / FILES
// await ExportAttachments(ObjectTID, progress); // await ExportAttachments(ObjectTID, progress);
// //----- // //-----
// bool repost = false; // bool repost = false;
// d = rMainObject.ObjectResponse["data"]; // d = rMainObject.ObjectResponse["data"];
// // wiki // // wiki
// if (WikiPage.HasWiki(c.ID)) // if (WikiPage.HasWiki(c.ID))
// { // {
// // await ExportAttachments(ObjectTID, progress); // // await ExportAttachments(ObjectTID, progress);
// d.wiki = GetWikiContent(ObjectTID); // d.wiki = GetWikiContent(ObjectTID);
// repost = true; // repost = true;
// } // }
// //docs // //docs
// string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); // string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress);
// if (!string.IsNullOrEmpty(NonFileUrls)) // if (!string.IsNullOrEmpty(NonFileUrls))
// { // {
// d.notes = NonFileUrls + "\n-----------------\n" + d.notes; // d.notes = NonFileUrls + "\n-----------------\n" + d.notes;
// repost = true; // repost = true;
// } // }
// if (repost) // if (repost)
// await util.PutAsync("loan-unit", d.ToString()); // await util.PutAsync("loan-unit", d.ToString());
// //----- // //-----
// //Event log fixup // //Event log fixup
// await util.EventLog(util.AyaType.LoanUnit, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified); // await util.EventLog(util.AyaType.LoanUnit, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
// } // }
// } // }
#endregion LoanItems #endregion LoanItems
@@ -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}");
} }
//####################################################################################### //#######################################################################################