This commit is contained in:
@@ -306,7 +306,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
route = "work-order-status";
|
route = "work-order-status";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RootObjectTypes.LoanItem:
|
case RootObjectTypes.LoanItem:
|
||||||
{
|
{
|
||||||
route = "loan-unit";
|
route = "loan-unit";
|
||||||
@@ -327,14 +327,14 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
|
|
||||||
//post route and dynamic object, insert into map and return
|
//post route and dynamic object, insert into map and return
|
||||||
var rMainObject = await util.PostAsync("customer", d);
|
var rMainObject = await util.PostAsync(route, d);
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Addv7v8IdMap(id, RavenId);
|
Addv7v8IdMap(id, RavenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private long XXSafeGetUserMap(Guid id)
|
private long XXXSafeGetUserMap(Guid id)
|
||||||
{
|
{
|
||||||
if (!V7ToV8IdMap.ContainsKey(id)) return 1;//1=raven administrator account
|
if (!V7ToV8IdMap.ContainsKey(id)) return 1;//1=raven administrator account
|
||||||
return V7ToV8IdMap[id];
|
return V7ToV8IdMap[id];
|
||||||
@@ -836,8 +836,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
// if (!progress.KeepGoing) return;
|
// if (!progress.KeepGoing) return;
|
||||||
// User c = User.GetItem(i.ID);
|
// User c = User.GetItem(i.ID);
|
||||||
// var newId = GetMapMap[c.ID];
|
// var newId = GetMapMap[c.ID];
|
||||||
// var creator = SafeGetUserMap(c.Creator);
|
// var creator = await Getv7v8IdMap(c.Creator,RootObjectTypes.User);
|
||||||
// var modifier = SafeGetUserMap(c.Modifier);
|
// var modifier = await Getv7v8IdMap(c.Modifier,RootObjectTypes.User);
|
||||||
|
|
||||||
// await util.EventLog(util.AyaType.User, newId, creator, modifier, c.Created, c.Modified);
|
// await util.EventLog(util.AyaType.User, newId, creator, modifier, c.Created, c.Modified);
|
||||||
//}
|
//}
|
||||||
@@ -1012,8 +1012,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
User c = User.GetItem(i.ID);
|
User c = User.GetItem(i.ID);
|
||||||
var newId = await Getv7v8IdMap(c.ID, RootObjectTypes.User);
|
var newId = await Getv7v8IdMap(c.ID, RootObjectTypes.User);
|
||||||
var creator = await Getv7v8IdMap(c.ID, RootObjectTypes.User);//SafeGetUserMap(c.Creator);
|
var creator = await Getv7v8IdMap(c.ID, RootObjectTypes.User);//await Getv7v8IdMap(c.Creator,RootObjectTypes.User);
|
||||||
var modifier = await Getv7v8IdMap(c.ID, RootObjectTypes.User);//SafeGetUserMap(c.Modifier);
|
var modifier = await Getv7v8IdMap(c.ID, RootObjectTypes.User);//await Getv7v8IdMap(c.Modifier,RootObjectTypes.User);
|
||||||
|
|
||||||
await util.EventLog(util.AyaType.User, newId, creator, modifier, c.Created, c.Modified);
|
await util.EventLog(util.AyaType.User, newId, creator, modifier, c.Created, c.Modified);
|
||||||
}
|
}
|
||||||
@@ -1189,7 +1189,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.Customer, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Customer, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
//RAVEN Contact type user from Client contact
|
//RAVEN Contact type user from Client contact
|
||||||
//note: this is not a login account, it could be in raven but here it's the way to get the
|
//note: this is not a login account, it could be in raven but here it's the way to get the
|
||||||
@@ -1230,7 +1230,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
|
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
|
||||||
//Event log fixup (using customer data since the contact is created from the customer)
|
//Event log fixup (using customer data since the contact is created from the customer)
|
||||||
await util.EventLog(util.AyaType.User, RavenContactId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.User, RavenContactId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1263,14 +1263,14 @@ namespace AyaNova.PlugIn.V8
|
|||||||
tags.Clear();
|
tags.Clear();
|
||||||
d = new JObject();
|
d = new JObject();
|
||||||
d.customerId = RavenId;
|
d.customerId = RavenId;
|
||||||
d.userId = SafeGetUserMap(cn.Creator);
|
d.userId = await Getv7v8IdMap(cn.Creator, RootObjectTypes.User);//SafeGetUserMap(cn.Creator);
|
||||||
d.noteDate = util.DateToV8(cn.Created, true);
|
d.noteDate = util.DateToV8(cn.Created, true);
|
||||||
d.notes = cn.Notes;
|
d.notes = cn.Notes;
|
||||||
TagFromv7Guid(cn.ClientNoteTypeID, tags);
|
TagFromv7Guid(cn.ClientNoteTypeID, tags);
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
var newId = util.IdFromResponse(await util.PostAsync("customer-note", d.ToString()));
|
var newId = util.IdFromResponse(await util.PostAsync("customer-note", d.ToString()));
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.CustomerNote, newId, SafeGetUserMap(cn.Creator), SafeGetUserMap(cn.Modifier), cn.Created, cn.Modified);
|
await util.EventLog(util.AyaType.CustomerNote, newId, await Getv7v8IdMap(cn.Creator, RootObjectTypes.User), await Getv7v8IdMap(cn.Modifier, RootObjectTypes.User), cn.Created, cn.Modified);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1403,7 +1403,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.HeadOffice, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.HeadOffice, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1447,7 +1447,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
|
await util.PutAsync("user-option/" + RavenContactId.ToString(), d.ToString());
|
||||||
|
|
||||||
//Event log fixup (using customer data since the contact is created from the customer)
|
//Event log fixup (using customer data since the contact is created from the customer)
|
||||||
await util.EventLog(util.AyaType.User, RavenContactId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.User, RavenContactId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1560,7 +1560,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.Contract, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Contract, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1649,7 +1649,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//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, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1767,7 +1767,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.Part, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Part, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
//INVENTORY?
|
//INVENTORY?
|
||||||
if (V7UseInventory)
|
if (V7UseInventory)
|
||||||
@@ -1790,8 +1790,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//create a part just to hold untracked parts from v7 which are partid guid.empty on workorderitempart records which was allowed in v7 but not in v8
|
//create a part just to hold untracked parts from v7 which are partid guid.empty on workorderitempart records which was allowed in v7 but not in v8
|
||||||
dynamic dx = new JObject();
|
dynamic dx = new JObject();
|
||||||
|
|
||||||
dx.name = MissingDataNamePrefix ;
|
dx.name = MissingDataNamePrefix;
|
||||||
dx.partNumber = GetUniqueName(MissingDataNamePrefix );
|
dx.partNumber = GetUniqueName(MissingDataNamePrefix);
|
||||||
progress.Op(ObjectTypeName + " " + dx.partNumber + " " + dx.name);
|
progress.Op(ObjectTypeName + " " + dx.partNumber + " " + dx.name);
|
||||||
dx.cost = 0;
|
dx.cost = 0;
|
||||||
dx.retail = 0;
|
dx.retail = 0;
|
||||||
@@ -1863,7 +1863,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var rMainObject = await util.PostAsync("part-assembly", d.ToString());
|
var rMainObject = await util.PostAsync("part-assembly", d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.Project, RavenId, SafeGetUserMap(p.Creator), SafeGetUserMap(p.Modifier), p.Created, p.Modified);
|
//await util.EventLog(util.AyaType.Project, RavenId, SafeGetUserMap(p.Creator), SafeGetUserMap(p.Modifier), p.Created, p.Modified);
|
||||||
|
long lCreator = await Getv7v8IdMap(p.Creator, RootObjectTypes.User);
|
||||||
|
long lModifier = await Getv7v8IdMap(p.Modifier, RootObjectTypes.User);
|
||||||
|
await util.EventLog(util.AyaType.Project, RavenId, lCreator, lModifier, p.Created, p.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion part assemblies
|
#endregion part assemblies
|
||||||
@@ -1977,7 +1981,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.Project, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Project, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2147,7 +2151,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.PurchaseOrder, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.PurchaseOrder, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}//end of PO loop
|
}//end of PO loop
|
||||||
|
|
||||||
@@ -2202,7 +2206,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var rMainObject = await util.PostAsync("task-group", d.ToString());
|
var rMainObject = await util.PostAsync("task-group", d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Addv7v8IdMap(c.ID, RavenId);
|
Addv7v8IdMap(c.ID, RavenId);
|
||||||
await util.EventLog(util.AyaType.Project, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Project, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion Task groups
|
#endregion Task groups
|
||||||
@@ -2324,7 +2328,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//DONT DO THIS for second steppers UNTIL THE SECOND STEP BELOW OR IT WILL BE WRONG for them
|
//DONT DO THIS for second steppers UNTIL THE SECOND STEP BELOW OR IT WILL BE WRONG for them
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
if (c.ParentID == Guid.Empty && c.ReplacedByUnitID == Guid.Empty)
|
if (c.ParentID == Guid.Empty && c.ReplacedByUnitID == Guid.Empty)
|
||||||
await util.EventLog(util.AyaType.Unit, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Unit, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2348,7 +2352,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
await util.PutAsync("unit", d.ToString());
|
await util.PutAsync("unit", d.ToString());
|
||||||
//-----
|
//-----
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.Unit, ThisUnitRavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Unit, ThisUnitRavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion Units
|
#endregion Units
|
||||||
@@ -2448,7 +2452,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.UnitModel, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.UnitModel, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2564,7 +2568,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.Vendor, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Vendor, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3092,7 +3096,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.WorkOrder, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.WorkOrder, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
//######### STATE #######
|
//######### STATE #######
|
||||||
//if closed then set that state as well but always first set the current state
|
//if closed then set that state as well but always first set the current state
|
||||||
@@ -3167,7 +3171,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
||||||
if (ravUnitId != null)
|
if (ravUnitId != null)
|
||||||
{
|
{
|
||||||
//we have a legit unit record, make it for v8
|
//we have a legit unit record, make it for v8
|
||||||
@@ -3295,7 +3299,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwil.workOrderId = RavenId;
|
dwil.workOrderId = RavenId;
|
||||||
dwil.workOrderItemId = ravenwoitemid;
|
dwil.workOrderItemId = ravenwoitemid;
|
||||||
|
|
||||||
dwil.loanUnitId = await Getv7v8IdMap(wil.LoanItemID, RootObjectTypes.LoanUnit);
|
dwil.loanUnitId = await Getv7v8IdMap(wil.LoanItemID, RootObjectTypes.LoanItem);
|
||||||
dwil.outDate = util.DateToV8(wil.OutDate);
|
dwil.outDate = util.DateToV8(wil.OutDate);
|
||||||
dwil.dueDate = util.DateToV8(wil.DueDate);
|
dwil.dueDate = util.DateToV8(wil.DueDate);
|
||||||
dwil.returnDate = util.DateToV8(wil.ReturnDate);
|
dwil.returnDate = util.DateToV8(wil.ReturnDate);
|
||||||
@@ -3410,7 +3414,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
||||||
if (ravUnitId != null)
|
if (ravUnitId != null)
|
||||||
{
|
{
|
||||||
//we have a legit unit record, make it for v8
|
//we have a legit unit record, make it for v8
|
||||||
@@ -3634,7 +3638,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.WorkOrder, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.WorkOrder, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
//######### STATE #######
|
//######### STATE #######
|
||||||
//if closed then set that state as well but always first set the current state
|
//if closed then set that state as well but always first set the current state
|
||||||
@@ -3691,7 +3695,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
||||||
if (ravUnitId != null)
|
if (ravUnitId != null)
|
||||||
{
|
{
|
||||||
//we have a legit unit record, make it for v8
|
//we have a legit unit record, make it for v8
|
||||||
@@ -4003,7 +4007,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.WorkOrder, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.WorkOrder, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
|
|
||||||
//##### ITEMS
|
//##### ITEMS
|
||||||
@@ -4043,7 +4047,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true, false, await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
||||||
if (ravUnitId != null)
|
if (ravUnitId != null)
|
||||||
{
|
{
|
||||||
//we have a legit unit record, make it for v8
|
//we have a legit unit record, make it for v8
|
||||||
@@ -4254,7 +4258,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.name = c.Name;
|
d.name = c.Name;
|
||||||
d.notes = c.Notes;
|
d.notes = c.Notes;
|
||||||
d.userId = V7ToV8IdMap[c.SourceID];
|
d.userId = V7ToV8IdMap[c.SourceID];
|
||||||
d.assignedByUserId = SafeGetUserMap(c.Creator);
|
d.assignedByUserId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
||||||
d.objectId = V7ToV8IdMap[c.FollowID];
|
d.objectId = V7ToV8IdMap[c.FollowID];
|
||||||
d.objectType = util.RootObjectToAyaType(c.FollowType);
|
d.objectType = util.RootObjectToAyaType(c.FollowType);
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
@@ -4262,7 +4266,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var rMainObject = await util.PostAsync("review", d.ToString());
|
var rMainObject = await util.PostAsync("review", d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Addv7v8IdMap(c.ID, RavenId);
|
Addv7v8IdMap(c.ID, RavenId);
|
||||||
await util.EventLog(util.AyaType.Review, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Review, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -4304,7 +4308,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
if (!V7ToV8IdMap.ContainsKey(c.ID))
|
if (!V7ToV8IdMap.ContainsKey(c.ID))
|
||||||
Addv7v8IdMap(c.ID, RavenId);
|
Addv7v8IdMap(c.ID, RavenId);
|
||||||
await util.EventLog(util.AyaType.Reminder, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.Reminder, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4426,10 +4430,10 @@ namespace AyaNova.PlugIn.V8
|
|||||||
else
|
else
|
||||||
d.notes = c.Details;
|
d.notes = c.Details;
|
||||||
d.dateRequested = util.DateToV8(c.Created, true);
|
d.dateRequested = util.DateToV8(c.Created, true);
|
||||||
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Customer);
|
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
||||||
d.unitId = await Getv7v8IdMapNullOk(c.UnitID, RootObjectTypes.Unit, true, false, Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
d.unitId = await Getv7v8IdMapNullOk(c.UnitID, RootObjectTypes.Unit, true, false, await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
||||||
d.workOrderItemId = await Getv7v8IdMapNullOk(c.WorkorderItemID, RootObjectTypes.WorkOrderItem, false, false);
|
d.workOrderItemId = await Getv7v8IdMapNullOk(c.WorkorderItemID, RootObjectTypes.WorkorderItem, false, false);
|
||||||
d.requestedByUserId = SafeGetUserMap(c.Creator);//creator should always be a 'outside' user account
|
d.requestedByUserId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User);//creator should always be a 'outside' user account
|
||||||
d.customerReferenceNumber = c.ClientRef;
|
d.customerReferenceNumber = c.ClientRef;
|
||||||
d.priority = (int)c.Priority;//same int value
|
d.priority = (int)c.Priority;//same int value
|
||||||
if (c.Status == ClientServiceRequestStatus.Closed)
|
if (c.Status == ClientServiceRequestStatus.Closed)
|
||||||
@@ -4458,7 +4462,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
await util.EventLog(util.AyaType.CustomerServiceRequest, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);
|
await util.EventLog(util.AyaType.CustomerServiceRequest, RavenId, await Getv7v8IdMap(c.Creator, RootObjectTypes.User), await Getv7v8IdMap(c.Modifier, RootObjectTypes.User), c.Created, c.Modified);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user