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 ExportWorkOrderItemPriorities(progress);
await ExportServiceWorkorders(progress);
await ExportQuotes(progress);
await ExportQuotes(progress);
// await ExportPMs(progress);
//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...??
//perhaps v8 is automatically flagging it when the woitemloan record is created?
// 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");
// private async System.Threading.Tasks.Task FlagWoForLoanItems(ProgressForm progress)
// {
// foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl)
// {
// if (!progress.KeepGoing) return;
// LoanItem c = LoanItem.GetItem(i.ID);
// dynamic d = new JObject();
// if(c.l!=guid.empty){
// if (!progress.KeepGoing) return;
// progress.Op("Start update loan items with current work order id");
// progress.SubOp("");
// d= (await util.GetAsync("loan-unit/"+ Getv7v8IdMap(i.ID,"loan item for updat of workorder"))).objectResponse;
//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;
// PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem");
// TagFromv7Guid(c.RegionID, tags);
// SetTags(d, tags);
// foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl)
// {
// if (!progress.KeepGoing) return;
// //Custom fields?
// if (ShouldExportCustom)
// d.customFields = CustomFieldData(c, DateCustomFields);
// LoanItem c = LoanItem.GetItem(i.ID);
// dynamic d = new JObject();
// if(c.l!=guid.empty){
// var rMainObject = await util.PostAsync("loan-unit", d.ToString());
// long RavenId = util.IdFromResponse(rMainObject);
// Addv7v8IdMap(c.ID, RavenId);
// d= (await util.GetAsync("loan-unit/"+ Getv7v8IdMap(i.ID,"loan item for updat of workorder"))).objectResponse;
// //Attachments / FILES
// await ExportAttachments(ObjectTID, progress);
//d.workorderItemLoanId=
// }
// //-----
// 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());
// //-----
// 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;
// //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
@@ -1738,7 +1738,7 @@ namespace AyaNova.PlugIn.V8
+ "<WHEREITEMGROUP GROUPLOGICALOPERATOR=\"And\" UI=\"LT_O_PartAssembly\">"
+ "<WHEREITEM COMPAREOPERATOR=\"Equals\" CM=\"aPartAssembly.aID\" UICOMPAREVALUE=\"\" TYPE=\"System.Guid\" COMPAREVALUE=\"{" + p.ID.ToString().ToUpperInvariant() + "}\" /> "
+ "</WHEREITEMGROUP></GRIDCRITERIA>";
PartList pl = PartList.GetList(crit);
PartList pl = PartList.GetList(crit);
dynamic d = new JObject();
d.name = GetUniqueName(p.Name);
progress.Op(ObjectTypeName + " " + d.name);
@@ -1748,7 +1748,7 @@ namespace AyaNova.PlugIn.V8
foreach (PartList.PartListInfo i in pl)
{
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.quantity = 1;
dItems.Add(ditem);
@@ -3291,31 +3291,78 @@ namespace AyaNova.PlugIn.V8
//################## v8 quote status to mirror v7 quote status ##########################
{
/*
Submitted
*/
//################## v8 quote status to mirror v7 quote status ##########################
{
if (!progress.KeepGoing) return;
dynamic d = new JObject();
d.name = ;
progress.Op("Replicating Quote status " + d.name);
d.active = s.Active;
d.locked = false;
d.completed = false;
d.selectRoles = 1290;//biz-admin, service full, service tech, subcontractor
d.removeRoles = 1290;
d.color = System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color.FromArgb(s.ARGB));
SetTags(d, tags);
var rMainObject = await util.PostAsync("work-order-status", d.ToString());
long RavenId = util.IdFromResponse(rMainObject);
Addv7v8IdMap(s.ID, RavenId);
//Event log fixup
await util.EventLog(util.AyaType.WorkOrderStatus, RavenId, SafeGetUserMap(s.Creator), SafeGetUserMap(s.Modifier), s.Created, s.Modified);
//InProgress 1:
await util.PostAsync("work-order-status", @"{""name"": ""In progress"",
""active"": true,
""notes"": ""In process of completing this quote"",
""color"": ""#00ff00"",
""selectRoles"": 32834,
""removeRoles"": 32834,
""completed"": false,
""locked"": false}");
//Submitted 2:
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}");
}
//#######################################################################################
//#######################################################################################