This commit is contained in:
@@ -208,7 +208,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private async System.Threading.Tasks.Task<long> Getv7v8IdMap(Guid id, RootObjectTypes desiredType, bool allowPatch = true, bool doNotFail = true, long? extraV8Id=null)
|
private async System.Threading.Tasks.Task<long> Getv7v8IdMap(Guid id, RootObjectTypes desiredType, bool allowPatch = true, bool doNotFail = true, long? extraV8Id = null)
|
||||||
{
|
{
|
||||||
if (!V7ToV8IdMap.ContainsKey(id))
|
if (!V7ToV8IdMap.ContainsKey(id))
|
||||||
{
|
{
|
||||||
@@ -223,7 +223,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
return V7ToV8IdMap[id];
|
return V7ToV8IdMap[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
private async System.Threading.Tasks.Task<long?> Getv7v8IdMapNullOk(Guid id, RootObjectTypes desiredType, bool allowPatch = true, bool doNotFail = false, long? extraV8Id=null)
|
private async System.Threading.Tasks.Task<long?> Getv7v8IdMapNullOk(Guid id, RootObjectTypes desiredType, bool allowPatch = true, bool doNotFail = false, long? extraV8Id = null)
|
||||||
{
|
{
|
||||||
if (id == Guid.Empty) return null;
|
if (id == Guid.Empty) return null;
|
||||||
long l = await Getv7v8IdMap(id, desiredType, allowPatch, doNotFail, extraV8Id);
|
long l = await Getv7v8IdMap(id, desiredType, allowPatch, doNotFail, extraV8Id);
|
||||||
@@ -237,14 +237,14 @@ namespace AyaNova.PlugIn.V8
|
|||||||
private string MissingDataNamePrefix = "zV8migrate_substitute";//append guid to ensure uniqueness
|
private string MissingDataNamePrefix = "zV8migrate_substitute";//append guid to ensure uniqueness
|
||||||
|
|
||||||
|
|
||||||
private async System.Threading.Tasks.Task CreateSubstitute(Guid id, RootObjectTypes desiredType, long? extraV8Id=null)
|
private async System.Threading.Tasks.Task CreateSubstitute(Guid id, RootObjectTypes desiredType, long? extraV8Id = null)
|
||||||
{
|
{
|
||||||
//create the simplest possible version of this object desired
|
//create the simplest possible version of this object desired
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
string sName = MissingDataNamePrefix + " " + id.ToString();
|
string sName = MissingDataNamePrefix + " " + id.ToString();
|
||||||
d.name = sName;//usually this will suffice, for the rare cases it doesn't add to the correct property below, the name property will be ignored if it's not applicable
|
d.name = sName;//usually this will suffice, for the rare cases it doesn't add to the correct property below, the name property will be ignored if it's not applicable
|
||||||
d.active=false;
|
d.active = false;
|
||||||
d.notes="This object created during v8 migrate as a substitute for a missing linked record in v7";
|
d.notes = "This object created during v8 migrate as a substitute for a missing linked record in v7";
|
||||||
string route = "";
|
string route = "";
|
||||||
switch (desiredType)
|
switch (desiredType)
|
||||||
{
|
{
|
||||||
@@ -297,8 +297,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
case RootObjectTypes.Unit:
|
case RootObjectTypes.Unit:
|
||||||
{
|
{
|
||||||
route = "unit";
|
route = "unit";
|
||||||
d.serial=sName;
|
d.serial = sName;
|
||||||
d.customerId=extraV8Id;
|
d.customerId = extraV8Id;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RootObjectTypes.WorkOrderStatus:
|
case RootObjectTypes.WorkOrderStatus:
|
||||||
@@ -311,13 +311,23 @@ namespace AyaNova.PlugIn.V8
|
|||||||
route = "work-order-item-priority";
|
route = "work-order-item-priority";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RootObjectTypes.LoanUnit:
|
case RootObjectTypes.LoanUnit:
|
||||||
{
|
{
|
||||||
route = "loan-unit";
|
route = "loan-unit";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case RootObjectTypes.ServiceRate:
|
||||||
|
{
|
||||||
|
route = "service-rate";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RootObjectTypes.TravelRate:
|
||||||
|
{
|
||||||
|
route = "travel-rate";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Exception("Error: CreateSubstitute (source id: " + id.ToString() + " for type: " + desiredType.ToString() + ") THIS TYPE NOT CODED YET");
|
throw new Exception("Error: CreateSubstitute (source id: " + id.ToString() + " for type: " + desiredType.ToString() + ") THIS TYPE NOT CODED YET");
|
||||||
}
|
}
|
||||||
@@ -915,17 +925,17 @@ namespace AyaNova.PlugIn.V8
|
|||||||
if (c.VendorID != Guid.Empty)
|
if (c.VendorID != Guid.Empty)
|
||||||
{
|
{
|
||||||
d.userType = RavenUserType.ServiceContractor;
|
d.userType = RavenUserType.ServiceContractor;
|
||||||
d.vendorId = Getv7v8IdMap(c.VendorID, RootObjectTypes.Vendor);
|
d.vendorId = await Getv7v8IdMap(c.VendorID, RootObjectTypes.Vendor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.ClientID != Guid.Empty)
|
if (c.ClientID != Guid.Empty)
|
||||||
{
|
{
|
||||||
d.customerId = Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.HeadOfficeID != Guid.Empty)
|
if (c.HeadOfficeID != Guid.Empty)
|
||||||
{
|
{
|
||||||
d.headOfficeId = Getv7v8IdMap(c.HeadOfficeID, RootObjectTypes.HeadOffice);
|
d.headOfficeId = await Getv7v8IdMap(c.HeadOfficeID, RootObjectTypes.HeadOffice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1007,9 +1017,9 @@ 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 = Getv7v8IdMap(c.ID, RootObjectTypes.User);
|
var newId = await Getv7v8IdMap(c.ID, RootObjectTypes.User);
|
||||||
var creator = Getv7v8IdMap(c.ID, RootObjectTypes.User);//SafeGetUserMap(c.Creator);
|
var creator = await Getv7v8IdMap(c.ID, RootObjectTypes.User);//SafeGetUserMap(c.Creator);
|
||||||
var modifier = Getv7v8IdMap(c.ID, RootObjectTypes.User);//SafeGetUserMap(c.Modifier);
|
var modifier = await Getv7v8IdMap(c.ID, RootObjectTypes.User);//SafeGetUserMap(c.Modifier);
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -1108,7 +1118,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
if (c.HeadOfficeID != Guid.Empty)
|
if (c.HeadOfficeID != Guid.Empty)
|
||||||
{
|
{
|
||||||
d.headOfficeId = Getv7v8IdMap(c.HeadOfficeID, RootObjectTypes.HeadOffice);
|
d.headOfficeId = await Getv7v8IdMap(c.HeadOfficeID, RootObjectTypes.HeadOffice);
|
||||||
}
|
}
|
||||||
d.techNotes = c.TechNotes;
|
d.techNotes = c.TechNotes;
|
||||||
d.accountNumber = c.AccountNumber;
|
d.accountNumber = c.AccountNumber;
|
||||||
@@ -1118,7 +1128,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
if (c.ContractID != Guid.Empty)
|
if (c.ContractID != Guid.Empty)
|
||||||
{
|
{
|
||||||
long? ctId = Getv7v8IdMapNullOk(c.ContractID, RootObjectTypes.Contract, false, true);
|
long? ctId = await Getv7v8IdMapNullOK(c.ContractID, RootObjectTypes.Contract, false, true);
|
||||||
if (ctId != 0 && ctId != null)
|
if (ctId != 0 && ctId != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1328,7 +1338,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
if (c.ContractID != Guid.Empty)
|
if (c.ContractID != Guid.Empty)
|
||||||
{
|
{
|
||||||
long? ctId = Getv7v8IdMapNullOk(c.ContractID, RootObjectTypes.Contract, false, true);
|
long? ctId = await Getv7v8IdMapNullOK(c.ContractID, RootObjectTypes.Contract, false, true);
|
||||||
if (ctId != 0 && ctId != null)
|
if (ctId != 0 && ctId != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1712,11 +1722,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.partNumber = GetUniqueName(c.PartNumber);
|
d.partNumber = GetUniqueName(c.PartNumber);
|
||||||
progress.SubOp("");
|
progress.SubOp("");
|
||||||
progress.Op(ObjectTypeName + " " + d.partNumber + " " + d.name);
|
progress.Op(ObjectTypeName + " " + d.partNumber + " " + d.name);
|
||||||
d.manufacturerId = Getv7v8IdMapNullOk(c.ManufacturerID, RootObjectTypes.Vendor);
|
d.manufacturerId = await Getv7v8IdMapNullOK(c.ManufacturerID, RootObjectTypes.Vendor);
|
||||||
d.manufacturerNumber = c.ManufacturerNumber;
|
d.manufacturerNumber = c.ManufacturerNumber;
|
||||||
d.wholeSalerId = Getv7v8IdMapNullOk(c.WholesalerID, RootObjectTypes.Vendor);
|
d.wholeSalerId = await Getv7v8IdMapNullOK(c.WholesalerID, RootObjectTypes.Vendor);
|
||||||
d.wholeSalerNumber = c.WholesalerNumber;
|
d.wholeSalerNumber = c.WholesalerNumber;
|
||||||
d.alternativeWholeSalerId = Getv7v8IdMapNullOk(c.AlternativeWholesalerID, RootObjectTypes.Vendor);
|
d.alternativeWholeSalerId = await Getv7v8IdMapNullOK(c.AlternativeWholesalerID, RootObjectTypes.Vendor);
|
||||||
d.alternativeWholeSalerNumber = c.AlternativeWholesalerNumber;
|
d.alternativeWholeSalerNumber = c.AlternativeWholesalerNumber;
|
||||||
d.cost = c.Cost;
|
d.cost = c.Cost;
|
||||||
d.retail = c.Retail;
|
d.retail = c.Retail;
|
||||||
@@ -1846,7 +1856,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, RootObjectTypes.Part);
|
ditem.partId = await Getv7v8IdMap(i.LT_O_Part.Value, RootObjectTypes.Part);
|
||||||
ditem.partAssemblyId = 0;
|
ditem.partAssemblyId = 0;
|
||||||
ditem.quantity = 1;
|
ditem.quantity = 1;
|
||||||
dItems.Add(ditem);
|
dItems.Add(ditem);
|
||||||
@@ -2023,13 +2033,13 @@ namespace AyaNova.PlugIn.V8
|
|||||||
_highestPurchaseOrderNumberExported = c.PONumber;
|
_highestPurchaseOrderNumberExported = c.PONumber;
|
||||||
d.notes = c.Notes;
|
d.notes = c.Notes;
|
||||||
d.vendorMemo = c.VendorMemo;
|
d.vendorMemo = c.VendorMemo;
|
||||||
d.dropShipToCustomerId = Getv7v8IdMapNullOk(c.DropShipToClientID, RootObjectTypes.Client);
|
d.dropShipToCustomerId = await Getv7v8IdMapNullOK(c.DropShipToClientID, RootObjectTypes.Client);
|
||||||
d.referenceNumber = c.ReferenceNumber;
|
d.referenceNumber = c.ReferenceNumber;
|
||||||
d.vendorId = Getv7v8IdMap(c.VendorID, RootObjectTypes.Vendor);
|
d.vendorId = await Getv7v8IdMap(c.VendorID, RootObjectTypes.Vendor);
|
||||||
d.orderedDate = util.DateToV8(c.OrderedDate);
|
d.orderedDate = util.DateToV8(c.OrderedDate);
|
||||||
d.expectedReceiveDate = util.DateToV8(c.ExpectedReceiveDate);
|
d.expectedReceiveDate = util.DateToV8(c.ExpectedReceiveDate);
|
||||||
d.status = (int)c.Status;//same enum id's so this is kosher
|
d.status = (int)c.Status;//same enum id's so this is kosher
|
||||||
d.projectId = Getv7v8IdMapNullOk(c.ProjectID, RootObjectTypes.Project);
|
d.projectId = await Getv7v8IdMapNullOK(c.ProjectID, RootObjectTypes.Project);
|
||||||
|
|
||||||
StringBuilder sbText1 = new StringBuilder();
|
StringBuilder sbText1 = new StringBuilder();
|
||||||
StringBuilder sbText2 = new StringBuilder();
|
StringBuilder sbText2 = new StringBuilder();
|
||||||
@@ -2061,15 +2071,15 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
dynamic dItem = new JObject();
|
dynamic dItem = new JObject();
|
||||||
dItem.purchaseOrderId = 0;
|
dItem.purchaseOrderId = 0;
|
||||||
dItem.partId = Getv7v8IdMap(pi.PartID, RootObjectTypes.Part);
|
dItem.partId = await Getv7v8IdMap(pi.PartID, RootObjectTypes.Part);
|
||||||
dItem.partWarehouseId = Getv7v8IdMap(pi.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
dItem.partWarehouseId = await Getv7v8IdMap(pi.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
||||||
dItem.quantityOrdered = pi.QuantityOrdered;
|
dItem.quantityOrdered = pi.QuantityOrdered;
|
||||||
dItem.quantityReceived = pi.QuantityReceived;
|
dItem.quantityReceived = pi.QuantityReceived;
|
||||||
//dItem.serials = string.Empty;
|
//dItem.serials = string.Empty;
|
||||||
StringBuilder sbSerials = new StringBuilder();
|
StringBuilder sbSerials = new StringBuilder();
|
||||||
dItem.purchaseOrderCost = pi.PurchaseOrderCost;
|
dItem.purchaseOrderCost = pi.PurchaseOrderCost;
|
||||||
dItem.partRequestedById = Getv7v8IdMapNullOk(pi.PartRequestedByID, RootObjectTypes.User);
|
dItem.partRequestedById = await Getv7v8IdMapNullOK(pi.PartRequestedByID, RootObjectTypes.User);
|
||||||
dItem.purchaseTaxCodeId = Getv7v8IdMapNullOk(pi.PurchaseTaxCodeID, RootObjectTypes.TaxCode);
|
dItem.purchaseTaxCodeId = await Getv7v8IdMapNullOK(pi.PurchaseTaxCodeID, RootObjectTypes.TaxCode);
|
||||||
if (pi.WorkorderItemPartRequestID != Guid.Empty)
|
if (pi.WorkorderItemPartRequestID != Guid.Empty)
|
||||||
{
|
{
|
||||||
dItem.vendorPartNumber = pi.WorkorderItemPartRequestID.ToString();//temp holder for guid, not used in v7 so available
|
dItem.vendorPartNumber = pi.WorkorderItemPartRequestID.ToString();//temp holder for guid, not used in v7 so available
|
||||||
@@ -2247,11 +2257,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
progress.Op(ObjectTypeName + " " + d.serial);
|
progress.Op(ObjectTypeName + " " + d.serial);
|
||||||
d.active = c.Active;
|
d.active = c.Active;
|
||||||
d.notes = c.Notes;
|
d.notes = c.Notes;
|
||||||
d.customerId = Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
||||||
d.unitModelId = Getv7v8IdMapNullOk(c.UnitModelID, RootObjectTypes.UnitModel);
|
d.unitModelId = await Getv7v8IdMapNullOK(c.UnitModelID, RootObjectTypes.UnitModel);
|
||||||
d.unitHasOwnAddress = c.UnitHasOwnAddress;
|
d.unitHasOwnAddress = c.UnitHasOwnAddress;
|
||||||
d.boughtHere = c.BoughtHere;
|
d.boughtHere = c.BoughtHere;
|
||||||
d.purchasedFromVendorId = Getv7v8IdMapNullOk(c.PurchasedFromID, RootObjectTypes.Vendor);
|
d.purchasedFromVendorId = await Getv7v8IdMapNullOK(c.PurchasedFromID, RootObjectTypes.Vendor);
|
||||||
d.receipt = c.Receipt;
|
d.receipt = c.Receipt;
|
||||||
d.purchasedDate = util.DateToV8(c.PurchasedDate);
|
d.purchasedDate = util.DateToV8(c.PurchasedDate);
|
||||||
d.description = c.Description;
|
d.description = c.Description;
|
||||||
@@ -2333,13 +2343,13 @@ namespace AyaNova.PlugIn.V8
|
|||||||
Unit c = Unit.GetItem(i.ID);
|
Unit c = Unit.GetItem(i.ID);
|
||||||
if (c.ParentID == Guid.Empty && c.ReplacedByUnitID == Guid.Empty) continue;
|
if (c.ParentID == Guid.Empty && c.ReplacedByUnitID == Guid.Empty) continue;
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Unit, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Unit, c.ID);
|
||||||
long ThisUnitRavenId = Getv7v8IdMap(c.ID, RootObjectTypes.Unit);
|
long ThisUnitRavenId = await Getv7v8IdMap(c.ID, RootObjectTypes.Unit);
|
||||||
var a = await util.GetAsync("unit/" + ThisUnitRavenId.ToString());
|
var a = await util.GetAsync("unit/" + ThisUnitRavenId.ToString());
|
||||||
dynamic d = a.ObjectResponse["data"];
|
dynamic d = a.ObjectResponse["data"];
|
||||||
|
|
||||||
progress.Op(ObjectTypeName + " " + d.serial);
|
progress.Op(ObjectTypeName + " " + d.serial);
|
||||||
d.replacedByUnitId = Getv7v8IdMapNullOk(c.ReplacedByUnitID, RootObjectTypes.Unit);
|
d.replacedByUnitId = await Getv7v8IdMapNullOK(c.ReplacedByUnitID, RootObjectTypes.Unit);
|
||||||
d.parentUnitId = Getv7v8IdMapNullOk(c.ParentID, RootObjectTypes.Unit);
|
d.parentUnitId = await Getv7v8IdMapNullOK(c.ParentID, RootObjectTypes.Unit);
|
||||||
if (d.parentUnitId != null || d.replacedByUnitId != null)
|
if (d.parentUnitId != null || d.replacedByUnitId != null)
|
||||||
await util.PutAsync("unit", d.ToString());
|
await util.PutAsync("unit", d.ToString());
|
||||||
//-----
|
//-----
|
||||||
@@ -2397,7 +2407,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.active = c.Active;
|
d.active = c.Active;
|
||||||
d.notes = c.Notes;
|
d.notes = c.Notes;
|
||||||
if (c.VendorID != Guid.Empty)
|
if (c.VendorID != Guid.Empty)
|
||||||
d.vendorId = Getv7v8IdMap(c.VendorID, RootObjectTypes.Vendor);
|
d.vendorId = await Getv7v8IdMap(c.VendorID, RootObjectTypes.Vendor);
|
||||||
d.upc = c.UPC;
|
d.upc = c.UPC;
|
||||||
d.lifeTimeWarranty = c.LifeTimeWarranty;
|
d.lifeTimeWarranty = c.LifeTimeWarranty;
|
||||||
d.introduceDate = util.DateToV8(c.IntroducedDate);
|
d.introduceDate = util.DateToV8(c.IntroducedDate);
|
||||||
@@ -2677,8 +2687,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
//nope, it's non-existant anywhere
|
//nope, it's non-existant anywhere
|
||||||
if (mustExist)
|
if (mustExist)
|
||||||
todo: Used reg getv7 here
|
return Getv7v8IdMap(rateId, RootObjectTypes.ServiceRate);
|
||||||
throw new Exception("Mandatory Rate missing, cannot proceed, last logged item needs to be fixed");
|
//throw new Exception("Mandatory Rate missing, cannot proceed, last logged item needs to be fixed");
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -2703,8 +2713,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
return ravenId;
|
return ravenId;
|
||||||
}
|
}
|
||||||
//nope, it's non-existant anywhere
|
//nope, it's non-existant anywhere
|
||||||
if (mustExist) todo: Used reg getv7 here
|
if (mustExist)
|
||||||
throw new Exception("Mandatory Rate missing, cannot proceed, last logged item needs to be fixed");
|
return Getv7v8IdMap(rateId, RootObjectTypes.Travel);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -3010,9 +3020,9 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.serial = c.WorkorderService.ServiceNumber;
|
d.serial = c.WorkorderService.ServiceNumber;
|
||||||
if (c.WorkorderService.ServiceNumber > _highestWorkOrderNumberExported)
|
if (c.WorkorderService.ServiceNumber > _highestWorkOrderNumberExported)
|
||||||
_highestWorkOrderNumberExported = c.WorkorderService.ServiceNumber;
|
_highestWorkOrderNumberExported = c.WorkorderService.ServiceNumber;
|
||||||
d.customerId = Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
||||||
d.notes = c.Summary;
|
d.notes = c.Summary;
|
||||||
d.projectId = Getv7v8IdMapNullOk(c.ProjectID, RootObjectTypes.Project);
|
d.projectId = await Getv7v8IdMapNullOK(c.ProjectID, RootObjectTypes.Project);
|
||||||
d.internalReferenceNumber = c.InternalReferenceNumber;
|
d.internalReferenceNumber = c.InternalReferenceNumber;
|
||||||
d.customerReferenceNumber = c.CustomerReferenceNumber;
|
d.customerReferenceNumber = c.CustomerReferenceNumber;
|
||||||
d.customerContactName = c.CustomerContactName;
|
d.customerContactName = c.CustomerContactName;
|
||||||
@@ -3021,10 +3031,10 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.completeByDate = util.DateToV8(c.WorkorderService.CloseByDate);
|
d.completeByDate = util.DateToV8(c.WorkorderService.CloseByDate);
|
||||||
d.invoiceNumber = c.WorkorderService.InvoiceNumber;
|
d.invoiceNumber = c.WorkorderService.InvoiceNumber;
|
||||||
d.onsite = c.Onsite;
|
d.onsite = c.Onsite;
|
||||||
long? ctId = Getv7v8IdMapNullOk(c.ContractIDResolved(), RootObjectTypes.Contract, false, true);
|
long? ctId = await Getv7v8IdMapNullOK(c.ContractIDResolved(), RootObjectTypes.Contract, false, true);
|
||||||
if (ctId == 0) ctId = null;
|
if (ctId == 0) ctId = null;
|
||||||
d.contractId = ctId;
|
d.contractId = ctId;
|
||||||
d.lastStatusId = Getv7v8IdMapNullOk(c.WorkorderService.WorkorderStatusID, RootObjectTypes.WorkOrderStatus);//workorder status is in regular map, only item status is special
|
d.lastStatusId = await Getv7v8IdMapNullOK(c.WorkorderService.WorkorderStatusID, RootObjectTypes.WorkOrderStatus);//workorder status is in regular map, only item status is special
|
||||||
|
|
||||||
var client = c.uiClient;
|
var client = c.uiClient;
|
||||||
if (client != null)
|
if (client != null)
|
||||||
@@ -3098,9 +3108,9 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
dynamic state = new JObject();
|
dynamic state = new JObject();
|
||||||
state.workOrderId = RavenId;
|
state.workOrderId = RavenId;
|
||||||
state.workOrderStatusId = Getv7v8IdMap(c.WorkorderService.WorkorderStatusID, RootObjectTypes.WorkOrderStatus);
|
state.workOrderStatusId = await Getv7v8IdMap(c.WorkorderService.WorkorderStatusID, RootObjectTypes.WorkOrderStatus);
|
||||||
state.created = util.DateToV8(c.Created, true);
|
state.created = util.DateToV8(c.Created, true);
|
||||||
state.userId = Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
state.userId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
||||||
await util.PostAsync("workorder/states", state.ToString());
|
await util.PostAsync("workorder/states", state.ToString());
|
||||||
}
|
}
|
||||||
if (c.ServiceCompleted)
|
if (c.ServiceCompleted)
|
||||||
@@ -3109,7 +3119,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
state.workOrderId = RavenId;
|
state.workOrderId = RavenId;
|
||||||
state.workOrderStatusId = ServiceCompletedWorkOrderStatus;
|
state.workOrderStatusId = ServiceCompletedWorkOrderStatus;
|
||||||
state.created = util.DateToV8(c.Created, true);
|
state.created = util.DateToV8(c.Created, true);
|
||||||
state.userId = Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
state.userId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
||||||
await util.PostAsync("workorder/states", state.ToString());
|
await util.PostAsync("workorder/states", state.ToString());
|
||||||
}
|
}
|
||||||
if (c.Closed)
|
if (c.Closed)
|
||||||
@@ -3118,7 +3128,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
state.workOrderId = RavenId;
|
state.workOrderId = RavenId;
|
||||||
state.workOrderStatusId = ClosedWorkOrderStatus;
|
state.workOrderStatusId = ClosedWorkOrderStatus;
|
||||||
state.created = util.DateToV8(c.Created, true);
|
state.created = util.DateToV8(c.Created, true);
|
||||||
state.userId = Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
state.userId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
||||||
await util.PostAsync("workorder/states", state.ToString());
|
await util.PostAsync("workorder/states", state.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3140,7 +3150,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwi.techNotes = wi.TechNotes;
|
dwi.techNotes = wi.TechNotes;
|
||||||
dwi.requestDate = util.DateToV8(wi.RequestDate);//allow empty dates if empty source
|
dwi.requestDate = util.DateToV8(wi.RequestDate);//allow empty dates if empty source
|
||||||
dwi.workOrderItemStatusId = Getv7v8WorkOrderItemStatusIdNullOk(wi.WorkorderStatusID);
|
dwi.workOrderItemStatusId = Getv7v8WorkOrderItemStatusIdNullOk(wi.WorkorderStatusID);
|
||||||
dwi.workOrderItemPriorityId = Getv7v8IdMapNullOk(wi.PriorityID, RootObjectTypes.WorkOrderItemPriority);
|
dwi.workOrderItemPriorityId = await Getv7v8IdMapNullOK(wi.PriorityID, RootObjectTypes.WorkOrderItemPriority);
|
||||||
dwi.warrantyService = wi.WarrantyService;
|
dwi.warrantyService = wi.WarrantyService;
|
||||||
|
|
||||||
|
|
||||||
@@ -3160,7 +3170,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit, true,false,Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOK(wi.UnitID, RootObjectTypes.Unit, true, false, 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
|
||||||
@@ -3185,7 +3195,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwisu.workOrderId = RavenId;
|
dwisu.workOrderId = RavenId;
|
||||||
dwisu.workOrderItemId = ravenwoitemid;
|
dwisu.workOrderItemId = ravenwoitemid;
|
||||||
//null is ok here for a sched user
|
//null is ok here for a sched user
|
||||||
dwisu.userId = Getv7v8IdMapNullOk(wisu.UserID, RootObjectTypes.User);
|
dwisu.userId = await Getv7v8IdMapNullOK(wisu.UserID, RootObjectTypes.User);
|
||||||
dwisu.startDate = util.DateToV8(wisu.StartDate);
|
dwisu.startDate = util.DateToV8(wisu.StartDate);
|
||||||
dwisu.stopDate = util.DateToV8(wisu.StopDate);
|
dwisu.stopDate = util.DateToV8(wisu.StopDate);
|
||||||
dwisu.estimatedQuantity = wisu.EstimatedQuantity;
|
dwisu.estimatedQuantity = wisu.EstimatedQuantity;
|
||||||
@@ -3201,7 +3211,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwip.workOrderId = RavenId;
|
dwip.workOrderId = RavenId;
|
||||||
dwip.workOrderItemId = ravenwoitemid;
|
dwip.workOrderItemId = ravenwoitemid;
|
||||||
dwip.quantity = wip.Quantity;
|
dwip.quantity = wip.Quantity;
|
||||||
var tryPartId = Getv7v8IdMapNullOk(wip.PartID, RootObjectTypes.Part);
|
var tryPartId = await Getv7v8IdMapNullOK(wip.PartID, RootObjectTypes.Part);
|
||||||
if (tryPartId == null)
|
if (tryPartId == null)
|
||||||
{
|
{
|
||||||
dwip.partId = UnknownV7PartId;
|
dwip.partId = UnknownV7PartId;
|
||||||
@@ -3210,8 +3220,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
dwip.partId = tryPartId;
|
dwip.partId = tryPartId;
|
||||||
dwip.partWarehouseId = Getv7v8IdMap(wip.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
dwip.partWarehouseId = await Getv7v8IdMap(wip.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
||||||
dwip.taxPartSaleId = Getv7v8IdMapNullOk(wip.TaxPartSaleID, RootObjectTypes.TaxCode);
|
dwip.taxPartSaleId = await Getv7v8IdMapNullOK(wip.TaxPartSaleID, RootObjectTypes.TaxCode);
|
||||||
if (wip.Discount != 0)
|
if (wip.Discount != 0)
|
||||||
dwip.priceOverride = wip.Price - (wip.Price * wip.Discount);
|
dwip.priceOverride = wip.Price - (wip.Price * wip.Discount);
|
||||||
else
|
else
|
||||||
@@ -3249,7 +3259,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//iterate po and look for item with the vendorpartnumber set to this woitempartid by guid string
|
//iterate po and look for item with the vendorpartnumber set to this woitempartid by guid string
|
||||||
//update the po item with the raven partrequestid
|
//update the po item with the raven partrequestid
|
||||||
//save po
|
//save po
|
||||||
long? v8poid = Getv7v8IdMapNullOk(pto.v7poid, RootObjectTypes.PurchaseOrder);
|
long? v8poid = await Getv7v8IdMapNullOK(pto.v7poid, RootObjectTypes.PurchaseOrder);
|
||||||
if (v8poid != null)
|
if (v8poid != null)
|
||||||
{
|
{
|
||||||
var a = await util.GetAsync("purchase-order/" + v8poid.ToString());
|
var a = await util.GetAsync("purchase-order/" + v8poid.ToString());
|
||||||
@@ -3288,11 +3298,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwil.workOrderId = RavenId;
|
dwil.workOrderId = RavenId;
|
||||||
dwil.workOrderItemId = ravenwoitemid;
|
dwil.workOrderItemId = ravenwoitemid;
|
||||||
|
|
||||||
dwil.loanUnitId = Getv7v8IdMap(wil.LoanItemID, RootObjectTypes.LoanUnit);
|
dwil.loanUnitId = await Getv7v8IdMap(wil.LoanItemID, RootObjectTypes.LoanUnit);
|
||||||
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);
|
||||||
dwil.taxCodeId = Getv7v8IdMapNullOk(wil.TaxCodeID, RootObjectTypes.TaxCode);
|
dwil.taxCodeId = await Getv7v8IdMapNullOK(wil.TaxCodeID, RootObjectTypes.TaxCode);
|
||||||
dwil.quantity = wil.Quantity;
|
dwil.quantity = wil.Quantity;
|
||||||
switch (wil.Rate)
|
switch (wil.Rate)
|
||||||
{
|
{
|
||||||
@@ -3331,12 +3341,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwl.workOrderId = RavenId;
|
dwl.workOrderId = RavenId;
|
||||||
dwl.workOrderItemId = ravenwoitemid;
|
dwl.workOrderItemId = ravenwoitemid;
|
||||||
//null is ok here for user
|
//null is ok here for user
|
||||||
dwl.userId = Getv7v8IdMapNullOk(wl.UserID, RootObjectTypes.User);
|
dwl.userId = await Getv7v8IdMapNullOK(wl.UserID, RootObjectTypes.User);
|
||||||
dwl.serviceStartDate = util.DateToV8(wl.ServiceStartDate);
|
dwl.serviceStartDate = util.DateToV8(wl.ServiceStartDate);
|
||||||
dwl.serviceStopDate = util.DateToV8(wl.ServiceStopDate);
|
dwl.serviceStopDate = util.DateToV8(wl.ServiceStopDate);
|
||||||
dwl.serviceRateQuantity = wl.ServiceRateQuantity;
|
dwl.serviceRateQuantity = wl.ServiceRateQuantity;
|
||||||
dwl.noChargeQuantity = wl.NoChargeQuantity;
|
dwl.noChargeQuantity = wl.NoChargeQuantity;
|
||||||
dwl.taxCodeSaleId = Getv7v8IdMapNullOk(wl.TaxRateSaleID, RootObjectTypes.TaxCode);
|
dwl.taxCodeSaleId = await Getv7v8IdMapNullOK(wl.TaxRateSaleID, RootObjectTypes.TaxCode);
|
||||||
dwl.serviceRateId = await GetRate(false, wl.ServiceRateID);
|
dwl.serviceRateId = await GetRate(false, wl.ServiceRateID);
|
||||||
dwl.serviceDetails = wl.ServiceDetails;
|
dwl.serviceDetails = wl.ServiceDetails;
|
||||||
|
|
||||||
@@ -3351,12 +3361,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwt.workOrderId = RavenId;
|
dwt.workOrderId = RavenId;
|
||||||
dwt.workOrderItemId = ravenwoitemid;
|
dwt.workOrderItemId = ravenwoitemid;
|
||||||
//null is ok here for user
|
//null is ok here for user
|
||||||
dwt.userId = Getv7v8IdMapNullOk(wt.UserID, RootObjectTypes.User);
|
dwt.userId = await Getv7v8IdMapNullOK(wt.UserID, RootObjectTypes.User);
|
||||||
dwt.travelStartDate = util.DateToV8(wt.TravelStartDate);
|
dwt.travelStartDate = util.DateToV8(wt.TravelStartDate);
|
||||||
dwt.travelStopDate = util.DateToV8(wt.TravelStopDate);
|
dwt.travelStopDate = util.DateToV8(wt.TravelStopDate);
|
||||||
dwt.travelRateQuantity = wt.TravelRateQuantity;
|
dwt.travelRateQuantity = wt.TravelRateQuantity;
|
||||||
dwt.noChargeQuantity = wt.NoChargeQuantity;
|
dwt.noChargeQuantity = wt.NoChargeQuantity;
|
||||||
dwt.taxCodeSaleId = Getv7v8IdMapNullOk(wt.TaxRateSaleID, RootObjectTypes.TaxCode);
|
dwt.taxCodeSaleId = await Getv7v8IdMapNullOK(wt.TaxRateSaleID, RootObjectTypes.TaxCode);
|
||||||
dwt.travelRateId = await GetRate(true, wt.TravelRateID);
|
dwt.travelRateId = await GetRate(true, wt.TravelRateID);
|
||||||
dwt.travelDetails = wt.TravelDetails;
|
dwt.travelDetails = wt.TravelDetails;
|
||||||
dwt.distance = wt.Distance;
|
dwt.distance = wt.Distance;
|
||||||
@@ -3391,9 +3401,9 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwe.totalCost = we.TotalCost;
|
dwe.totalCost = we.TotalCost;
|
||||||
dwe.chargeAmount = we.ChargeAmount;
|
dwe.chargeAmount = we.ChargeAmount;
|
||||||
dwe.taxPaid = we.TaxPaid;
|
dwe.taxPaid = we.TaxPaid;
|
||||||
dwe.chargeTaxCodeId = Getv7v8IdMapNullOk(we.ChargeTaxCodeID, RootObjectTypes.TaxCode);
|
dwe.chargeTaxCodeId = await Getv7v8IdMapNullOK(we.ChargeTaxCodeID, RootObjectTypes.TaxCode);
|
||||||
dwe.reimburseUser = we.ReimburseUser;
|
dwe.reimburseUser = we.ReimburseUser;
|
||||||
dwe.userId = Getv7v8IdMapNullOk(we.UserID, RootObjectTypes.User);
|
dwe.userId = await Getv7v8IdMapNullOK(we.UserID, RootObjectTypes.User);
|
||||||
dwe.chargeToCustomer = we.ChargeToClient;
|
dwe.chargeToCustomer = we.ChargeToClient;
|
||||||
await util.PostAsync("workorder/items/expenses", dwe.ToString());
|
await util.PostAsync("workorder/items/expenses", dwe.ToString());
|
||||||
}
|
}
|
||||||
@@ -3403,7 +3413,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit,true,false,Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOK(wi.UnitID, RootObjectTypes.Unit, true, false, 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
|
||||||
@@ -3413,8 +3423,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwio.workOrderItemId = ravenwoitemid;
|
dwio.workOrderItemId = ravenwoitemid;
|
||||||
dwio.unitId = ravUnitId;
|
dwio.unitId = ravUnitId;
|
||||||
dwio.notes = wi.OutsideService.Notes;
|
dwio.notes = wi.OutsideService.Notes;
|
||||||
dwio.vendorSentToId = Getv7v8IdMapNullOk(wi.OutsideService.VendorSentToID, RootObjectTypes.Vendor);
|
dwio.vendorSentToId = await Getv7v8IdMapNullOK(wi.OutsideService.VendorSentToID, RootObjectTypes.Vendor);
|
||||||
dwio.vendorSentViaId = Getv7v8IdMapNullOk(wi.OutsideService.VendorSentViaID, RootObjectTypes.Vendor);
|
dwio.vendorSentViaId = await Getv7v8IdMapNullOK(wi.OutsideService.VendorSentViaID, RootObjectTypes.Vendor);
|
||||||
dwio.rMANumber = wi.OutsideService.RMANumber;
|
dwio.rMANumber = wi.OutsideService.RMANumber;
|
||||||
dwio.trackingNumber = wi.OutsideService.TrackingNumber;
|
dwio.trackingNumber = wi.OutsideService.TrackingNumber;
|
||||||
dwio.repairCost = wi.OutsideService.RepairCost;
|
dwio.repairCost = wi.OutsideService.RepairCost;
|
||||||
@@ -3563,20 +3573,20 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.serial = c.WorkorderQuote.QuoteNumber;
|
d.serial = c.WorkorderQuote.QuoteNumber;
|
||||||
if (c.WorkorderQuote.QuoteNumber > _highestQuoteNumberExported)
|
if (c.WorkorderQuote.QuoteNumber > _highestQuoteNumberExported)
|
||||||
_highestQuoteNumberExported = c.WorkorderQuote.QuoteNumber;
|
_highestQuoteNumberExported = c.WorkorderQuote.QuoteNumber;
|
||||||
d.customerId = Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
||||||
d.notes = c.Summary;
|
d.notes = c.Summary;
|
||||||
d.projectId = Getv7v8IdMapNullOk(c.ProjectID, RootObjectTypes.Project);
|
d.projectId = await Getv7v8IdMapNullOK(c.ProjectID, RootObjectTypes.Project);
|
||||||
d.internalReferenceNumber = c.InternalReferenceNumber;
|
d.internalReferenceNumber = c.InternalReferenceNumber;
|
||||||
d.customerReferenceNumber = c.CustomerReferenceNumber;
|
d.customerReferenceNumber = c.CustomerReferenceNumber;
|
||||||
d.customerContactName = c.CustomerContactName;
|
d.customerContactName = c.CustomerContactName;
|
||||||
d.createdDate = util.DateToV8(c.Created, true);
|
d.createdDate = util.DateToV8(c.Created, true);
|
||||||
d.preparedById = Getv7v8IdMap(c.WorkorderQuote.PreparedByID, RootObjectTypes.User);
|
d.preparedById = await Getv7v8IdMap(c.WorkorderQuote.PreparedByID, RootObjectTypes.User);
|
||||||
d.introduction = c.WorkorderQuote.Introduction;
|
d.introduction = c.WorkorderQuote.Introduction;
|
||||||
d.requested = util.DateToV8(c.WorkorderQuote.QuoteRequestDate);
|
d.requested = util.DateToV8(c.WorkorderQuote.QuoteRequestDate);
|
||||||
d.validUntil = util.DateToV8(c.WorkorderQuote.ValidUntilDate);
|
d.validUntil = util.DateToV8(c.WorkorderQuote.ValidUntilDate);
|
||||||
d.submitted = util.DateToV8(c.WorkorderQuote.DateSubmitted);
|
d.submitted = util.DateToV8(c.WorkorderQuote.DateSubmitted);
|
||||||
d.approved = util.DateToV8(c.WorkorderQuote.DateApproved);
|
d.approved = util.DateToV8(c.WorkorderQuote.DateApproved);
|
||||||
long? ctId = Getv7v8IdMapNullOk(c.ContractIDResolved(), RootObjectTypes.Contract, false, true);
|
long? ctId = await Getv7v8IdMapNullOK(c.ContractIDResolved(), RootObjectTypes.Contract, false, true);
|
||||||
if (ctId == 0) ctId = null;
|
if (ctId == 0) ctId = null;
|
||||||
d.contractId = ctId;
|
d.contractId = ctId;
|
||||||
d.lastStatusId = (int)c.WorkorderQuote.QuoteStatus;
|
d.lastStatusId = (int)c.WorkorderQuote.QuoteStatus;
|
||||||
@@ -3639,7 +3649,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
state.quoteId = RavenId;
|
state.quoteId = RavenId;
|
||||||
state.quoteStatusId = (int)c.WorkorderQuote.QuoteStatus;
|
state.quoteStatusId = (int)c.WorkorderQuote.QuoteStatus;
|
||||||
state.created = util.DateToV8(c.Created, true);
|
state.created = util.DateToV8(c.Created, true);
|
||||||
state.userId = Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
state.userId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User);
|
||||||
await util.PostAsync("quote/states", state.ToString());
|
await util.PostAsync("quote/states", state.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3663,7 +3673,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwi.techNotes = wi.TechNotes;
|
dwi.techNotes = wi.TechNotes;
|
||||||
dwi.requestDate = util.DateToV8(wi.RequestDate);//allow empty dates if empty source
|
dwi.requestDate = util.DateToV8(wi.RequestDate);//allow empty dates if empty source
|
||||||
dwi.workOrderItemStatusId = Getv7v8WorkOrderItemStatusIdNullOk(wi.WorkorderStatusID);
|
dwi.workOrderItemStatusId = Getv7v8WorkOrderItemStatusIdNullOk(wi.WorkorderStatusID);
|
||||||
dwi.workOrderItemPriorityId = Getv7v8IdMapNullOk(wi.PriorityID, RootObjectTypes.WorkOrderItemPriority);
|
dwi.workOrderItemPriorityId = await Getv7v8IdMapNullOK(wi.PriorityID, RootObjectTypes.WorkOrderItemPriority);
|
||||||
dwi.warrantyService = wi.WarrantyService;
|
dwi.warrantyService = wi.WarrantyService;
|
||||||
|
|
||||||
|
|
||||||
@@ -3683,7 +3693,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit,true,false,Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOK(wi.UnitID, RootObjectTypes.Unit, true, false, 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
|
||||||
@@ -3708,7 +3718,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwisu.quoteId = RavenId;
|
dwisu.quoteId = RavenId;
|
||||||
dwisu.quoteItemId = ravenwoitemid;
|
dwisu.quoteItemId = ravenwoitemid;
|
||||||
//null is ok here for a sched user
|
//null is ok here for a sched user
|
||||||
dwisu.userId = Getv7v8IdMapNullOk(wisu.UserID, RootObjectTypes.User);
|
dwisu.userId = await Getv7v8IdMapNullOK(wisu.UserID, RootObjectTypes.User);
|
||||||
dwisu.startDate = util.DateToV8(wisu.StartDate);
|
dwisu.startDate = util.DateToV8(wisu.StartDate);
|
||||||
dwisu.stopDate = util.DateToV8(wisu.StopDate);
|
dwisu.stopDate = util.DateToV8(wisu.StopDate);
|
||||||
dwisu.estimatedQuantity = wisu.EstimatedQuantity;
|
dwisu.estimatedQuantity = wisu.EstimatedQuantity;
|
||||||
@@ -3724,7 +3734,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwip.quoteId = RavenId;
|
dwip.quoteId = RavenId;
|
||||||
dwip.quoteItemId = ravenwoitemid;
|
dwip.quoteItemId = ravenwoitemid;
|
||||||
dwip.quantity = wip.Quantity;
|
dwip.quantity = wip.Quantity;
|
||||||
var tryPartId = Getv7v8IdMapNullOk(wip.PartID, RootObjectTypes.Part);
|
var tryPartId = await Getv7v8IdMapNullOK(wip.PartID, RootObjectTypes.Part);
|
||||||
if (tryPartId == null)
|
if (tryPartId == null)
|
||||||
{
|
{
|
||||||
dwip.partId = UnknownV7PartId;
|
dwip.partId = UnknownV7PartId;
|
||||||
@@ -3733,8 +3743,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
dwip.partId = tryPartId;
|
dwip.partId = tryPartId;
|
||||||
dwip.partWarehouseId = Getv7v8IdMap(wip.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
dwip.partWarehouseId = await Getv7v8IdMap(wip.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
||||||
dwip.taxPartSaleId = Getv7v8IdMapNullOk(wip.TaxPartSaleID, RootObjectTypes.TaxCode);
|
dwip.taxPartSaleId = await Getv7v8IdMapNullOK(wip.TaxPartSaleID, RootObjectTypes.TaxCode);
|
||||||
if (wip.Discount != 0)
|
if (wip.Discount != 0)
|
||||||
dwip.priceOverride = wip.Price - (wip.Price * wip.Discount);
|
dwip.priceOverride = wip.Price - (wip.Price * wip.Discount);
|
||||||
else
|
else
|
||||||
@@ -3757,12 +3767,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwl.quoteId = RavenId;
|
dwl.quoteId = RavenId;
|
||||||
dwl.quoteItemId = ravenwoitemid;
|
dwl.quoteItemId = ravenwoitemid;
|
||||||
//null is ok here for user
|
//null is ok here for user
|
||||||
dwl.userId = Getv7v8IdMapNullOk(wl.UserID, RootObjectTypes.User);
|
dwl.userId = await Getv7v8IdMapNullOK(wl.UserID, RootObjectTypes.User);
|
||||||
dwl.serviceStartDate = util.DateToV8(wl.ServiceStartDate);
|
dwl.serviceStartDate = util.DateToV8(wl.ServiceStartDate);
|
||||||
dwl.serviceStopDate = util.DateToV8(wl.ServiceStopDate);
|
dwl.serviceStopDate = util.DateToV8(wl.ServiceStopDate);
|
||||||
dwl.serviceRateQuantity = wl.ServiceRateQuantity;
|
dwl.serviceRateQuantity = wl.ServiceRateQuantity;
|
||||||
dwl.noChargeQuantity = wl.NoChargeQuantity;
|
dwl.noChargeQuantity = wl.NoChargeQuantity;
|
||||||
dwl.taxCodeSaleId = Getv7v8IdMapNullOk(wl.TaxRateSaleID, RootObjectTypes.TaxCode);
|
dwl.taxCodeSaleId = await Getv7v8IdMapNullOK(wl.TaxRateSaleID, RootObjectTypes.TaxCode);
|
||||||
dwl.serviceRateId = await GetRate(false, wl.ServiceRateID);
|
dwl.serviceRateId = await GetRate(false, wl.ServiceRateID);
|
||||||
dwl.serviceDetails = wl.ServiceDetails;
|
dwl.serviceDetails = wl.ServiceDetails;
|
||||||
|
|
||||||
@@ -3777,12 +3787,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwt.quoteId = RavenId;
|
dwt.quoteId = RavenId;
|
||||||
dwt.quoteItemId = ravenwoitemid;
|
dwt.quoteItemId = ravenwoitemid;
|
||||||
//null is ok here for user
|
//null is ok here for user
|
||||||
dwt.userId = Getv7v8IdMapNullOk(wt.UserID, RootObjectTypes.User);
|
dwt.userId = await Getv7v8IdMapNullOK(wt.UserID, RootObjectTypes.User);
|
||||||
dwt.travelStartDate = util.DateToV8(wt.TravelStartDate);
|
dwt.travelStartDate = util.DateToV8(wt.TravelStartDate);
|
||||||
dwt.travelStopDate = util.DateToV8(wt.TravelStopDate);
|
dwt.travelStopDate = util.DateToV8(wt.TravelStopDate);
|
||||||
dwt.travelRateQuantity = wt.TravelRateQuantity;
|
dwt.travelRateQuantity = wt.TravelRateQuantity;
|
||||||
dwt.noChargeQuantity = wt.NoChargeQuantity;
|
dwt.noChargeQuantity = wt.NoChargeQuantity;
|
||||||
dwt.taxCodeSaleId = Getv7v8IdMapNullOk(wt.TaxRateSaleID, RootObjectTypes.TaxCode);
|
dwt.taxCodeSaleId = await Getv7v8IdMapNullOK(wt.TaxRateSaleID, RootObjectTypes.TaxCode);
|
||||||
dwt.travelRateId = await GetRate(true, wt.TravelRateID);
|
dwt.travelRateId = await GetRate(true, wt.TravelRateID);
|
||||||
dwt.travelDetails = wt.TravelDetails;
|
dwt.travelDetails = wt.TravelDetails;
|
||||||
dwt.distance = wt.Distance;
|
dwt.distance = wt.Distance;
|
||||||
@@ -3870,14 +3880,14 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.serial = c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber;
|
d.serial = c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber;
|
||||||
if (c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber > _highestPMNumberExported)
|
if (c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber > _highestPMNumberExported)
|
||||||
_highestPMNumberExported = c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber;
|
_highestPMNumberExported = c.WorkorderPreventiveMaintenance.PreventiveMaintenanceNumber;
|
||||||
d.customerId = Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Client);
|
||||||
d.notes = c.Summary;
|
d.notes = c.Summary;
|
||||||
d.projectId = Getv7v8IdMapNullOk(c.ProjectID, RootObjectTypes.Project);
|
d.projectId = await Getv7v8IdMapNullOK(c.ProjectID, RootObjectTypes.Project);
|
||||||
d.internalReferenceNumber = c.InternalReferenceNumber;
|
d.internalReferenceNumber = c.InternalReferenceNumber;
|
||||||
d.customerReferenceNumber = c.CustomerReferenceNumber;
|
d.customerReferenceNumber = c.CustomerReferenceNumber;
|
||||||
d.customerContactName = c.CustomerContactName;
|
d.customerContactName = c.CustomerContactName;
|
||||||
d.createdDate = util.DateToV8(c.Created, true);
|
d.createdDate = util.DateToV8(c.Created, true);
|
||||||
long? ctId = Getv7v8IdMapNullOk(c.ContractIDResolved(), RootObjectTypes.Contract, false, true);
|
long? ctId = await Getv7v8IdMapNullOK(c.ContractIDResolved(), RootObjectTypes.Contract, false, true);
|
||||||
if (ctId == 0) ctId = null;
|
if (ctId == 0) ctId = null;
|
||||||
d.contractId = ctId;
|
d.contractId = ctId;
|
||||||
|
|
||||||
@@ -4014,7 +4024,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwi.techNotes = wi.TechNotes;
|
dwi.techNotes = wi.TechNotes;
|
||||||
dwi.requestDate = util.DateToV8(wi.RequestDate);//allow empty dates if empty source
|
dwi.requestDate = util.DateToV8(wi.RequestDate);//allow empty dates if empty source
|
||||||
dwi.workOrderItemStatusId = Getv7v8WorkOrderItemStatusIdNullOk(wi.WorkorderStatusID);
|
dwi.workOrderItemStatusId = Getv7v8WorkOrderItemStatusIdNullOk(wi.WorkorderStatusID);
|
||||||
dwi.workOrderItemPriorityId = Getv7v8IdMapNullOk(wi.PriorityID, RootObjectTypes.WorkOrderItemPriority);
|
dwi.workOrderItemPriorityId = await Getv7v8IdMapNullOK(wi.PriorityID, RootObjectTypes.WorkOrderItemPriority);
|
||||||
dwi.warrantyService = wi.WarrantyService;
|
dwi.warrantyService = wi.WarrantyService;
|
||||||
|
|
||||||
|
|
||||||
@@ -4034,7 +4044,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
|
|
||||||
//make sure we have a matching unit already
|
//make sure we have a matching unit already
|
||||||
var ravUnitId = Getv7v8IdMapNullOk(wi.UnitID, RootObjectTypes.Unit,true,false,Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
var ravUnitId = await Getv7v8IdMapNullOK(wi.UnitID, RootObjectTypes.Unit, true, false, 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
|
||||||
@@ -4059,7 +4069,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwisu.pmId = RavenId;
|
dwisu.pmId = RavenId;
|
||||||
dwisu.pmItemId = ravenwoitemid;
|
dwisu.pmItemId = ravenwoitemid;
|
||||||
//null is ok here for a sched user
|
//null is ok here for a sched user
|
||||||
dwisu.userId = Getv7v8IdMapNullOk(wisu.UserID, RootObjectTypes.User);
|
dwisu.userId = await Getv7v8IdMapNullOK(wisu.UserID, RootObjectTypes.User);
|
||||||
dwisu.startDate = util.DateToV8(wisu.StartDate);
|
dwisu.startDate = util.DateToV8(wisu.StartDate);
|
||||||
dwisu.stopDate = util.DateToV8(wisu.StopDate);
|
dwisu.stopDate = util.DateToV8(wisu.StopDate);
|
||||||
dwisu.estimatedQuantity = wisu.EstimatedQuantity;
|
dwisu.estimatedQuantity = wisu.EstimatedQuantity;
|
||||||
@@ -4075,7 +4085,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwip.pmId = RavenId;
|
dwip.pmId = RavenId;
|
||||||
dwip.pmItemId = ravenwoitemid;
|
dwip.pmItemId = ravenwoitemid;
|
||||||
dwip.quantity = wip.Quantity;
|
dwip.quantity = wip.Quantity;
|
||||||
var tryPartId = Getv7v8IdMapNullOk(wip.PartID, RootObjectTypes.Part);
|
var tryPartId = await Getv7v8IdMapNullOK(wip.PartID, RootObjectTypes.Part);
|
||||||
if (tryPartId == null)
|
if (tryPartId == null)
|
||||||
{
|
{
|
||||||
dwip.partId = UnknownV7PartId;
|
dwip.partId = UnknownV7PartId;
|
||||||
@@ -4084,8 +4094,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
dwip.partId = tryPartId;
|
dwip.partId = tryPartId;
|
||||||
dwip.partWarehouseId = Getv7v8IdMap(wip.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
dwip.partWarehouseId = await Getv7v8IdMap(wip.PartWarehouseID, RootObjectTypes.PartWarehouse);
|
||||||
dwip.taxPartSaleId = Getv7v8IdMapNullOk(wip.TaxPartSaleID, RootObjectTypes.TaxCode);
|
dwip.taxPartSaleId = await Getv7v8IdMapNullOK(wip.TaxPartSaleID, RootObjectTypes.TaxCode);
|
||||||
if (wip.Discount != 0)
|
if (wip.Discount != 0)
|
||||||
dwip.priceOverride = wip.Price - (wip.Price * wip.Discount);
|
dwip.priceOverride = wip.Price - (wip.Price * wip.Discount);
|
||||||
else
|
else
|
||||||
@@ -4108,12 +4118,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwl.pmId = RavenId;
|
dwl.pmId = RavenId;
|
||||||
dwl.pmItemId = ravenwoitemid;
|
dwl.pmItemId = ravenwoitemid;
|
||||||
//null is ok here for user
|
//null is ok here for user
|
||||||
dwl.userId = Getv7v8IdMapNullOk(wl.UserID, RootObjectTypes.User);
|
dwl.userId = await Getv7v8IdMapNullOK(wl.UserID, RootObjectTypes.User);
|
||||||
dwl.serviceStartDate = util.DateToV8(wl.ServiceStartDate);
|
dwl.serviceStartDate = util.DateToV8(wl.ServiceStartDate);
|
||||||
dwl.serviceStopDate = util.DateToV8(wl.ServiceStopDate);
|
dwl.serviceStopDate = util.DateToV8(wl.ServiceStopDate);
|
||||||
dwl.serviceRateQuantity = wl.ServiceRateQuantity;
|
dwl.serviceRateQuantity = wl.ServiceRateQuantity;
|
||||||
dwl.noChargeQuantity = wl.NoChargeQuantity;
|
dwl.noChargeQuantity = wl.NoChargeQuantity;
|
||||||
dwl.taxCodeSaleId = Getv7v8IdMapNullOk(wl.TaxRateSaleID, RootObjectTypes.TaxCode);
|
dwl.taxCodeSaleId = await Getv7v8IdMapNullOK(wl.TaxRateSaleID, RootObjectTypes.TaxCode);
|
||||||
dwl.serviceRateId = await GetRate(false, wl.ServiceRateID);
|
dwl.serviceRateId = await GetRate(false, wl.ServiceRateID);
|
||||||
dwl.serviceDetails = wl.ServiceDetails;
|
dwl.serviceDetails = wl.ServiceDetails;
|
||||||
|
|
||||||
@@ -4128,12 +4138,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
dwt.pmId = RavenId;
|
dwt.pmId = RavenId;
|
||||||
dwt.pmItemId = ravenwoitemid;
|
dwt.pmItemId = ravenwoitemid;
|
||||||
//null is ok here for user
|
//null is ok here for user
|
||||||
dwt.userId = Getv7v8IdMapNullOk(wt.UserID, RootObjectTypes.User);
|
dwt.userId = await Getv7v8IdMapNullOK(wt.UserID, RootObjectTypes.User);
|
||||||
dwt.travelStartDate = util.DateToV8(wt.TravelStartDate);
|
dwt.travelStartDate = util.DateToV8(wt.TravelStartDate);
|
||||||
dwt.travelStopDate = util.DateToV8(wt.TravelStopDate);
|
dwt.travelStopDate = util.DateToV8(wt.TravelStopDate);
|
||||||
dwt.travelRateQuantity = wt.TravelRateQuantity;
|
dwt.travelRateQuantity = wt.TravelRateQuantity;
|
||||||
dwt.noChargeQuantity = wt.NoChargeQuantity;
|
dwt.noChargeQuantity = wt.NoChargeQuantity;
|
||||||
dwt.taxCodeSaleId = Getv7v8IdMapNullOk(wt.TaxRateSaleID, RootObjectTypes.TaxCode);
|
dwt.taxCodeSaleId = await Getv7v8IdMapNullOK(wt.TaxRateSaleID, RootObjectTypes.TaxCode);
|
||||||
dwt.travelRateId = await GetRate(true, wt.TravelRateID);
|
dwt.travelRateId = await GetRate(true, wt.TravelRateID);
|
||||||
dwt.travelDetails = wt.TravelDetails;
|
dwt.travelDetails = wt.TravelDetails;
|
||||||
dwt.distance = wt.Distance;
|
dwt.distance = wt.Distance;
|
||||||
@@ -4344,13 +4354,13 @@ namespace AyaNova.PlugIn.V8
|
|||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// d.sourceId = Getv7v8IdMap(i.LT_ServiceBank_Label_SourceRootObjectType.Value, "Service bank record's source object id");
|
// d.sourceId = await Getv7v8IdMap(i.LT_ServiceBank_Label_SourceRootObjectType.Value, "Service bank record's source object id");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// //
|
// //
|
||||||
// d.sourceType = util.RootObjectToAyaType(i.LT_ServiceBank_Label_SourceRootObjectType.RootObjectType);
|
// d.sourceType = util.RootObjectToAyaType(i.LT_ServiceBank_Label_SourceRootObjectType.RootObjectType);
|
||||||
|
|
||||||
// d.objectId = Getv7v8IdMap(bo.Key, "Service bank record's root object id");
|
// d.objectId = await Getv7v8IdMap(bo.Key, "Service bank record's root object id");
|
||||||
// d.objectType = util.RootObjectToAyaType(bo.Value);
|
// d.objectType = util.RootObjectToAyaType(bo.Value);
|
||||||
// d.incidents = i.LT_ServiceBank_Label_Incidents;
|
// d.incidents = i.LT_ServiceBank_Label_Incidents;
|
||||||
// d.incidentsBalance = i.LT_ServiceBank_Label_IncidentsBalance;
|
// d.incidentsBalance = i.LT_ServiceBank_Label_IncidentsBalance;
|
||||||
@@ -4417,9 +4427,9 @@ 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 = Getv7v8IdMap(c.ClientID, RootObjectTypes.Customer);
|
d.customerId = await Getv7v8IdMap(c.ClientID, RootObjectTypes.Customer);
|
||||||
d.unitId = Getv7v8IdMapNullOk(c.UnitID, RootObjectTypes.Unit,true,false,Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
d.unitId = await Getv7v8IdMapNullOK(c.UnitID, RootObjectTypes.Unit, true, false, Getv7v8IdMap(c.ClientID, RootObjectTypes.Client));
|
||||||
d.workOrderItemId = 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 = SafeGetUserMap(c.Creator);//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
|
||||||
@@ -4472,7 +4482,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
progress.SubOp("sync part " + i.Name);
|
progress.SubOp("sync part " + i.Name);
|
||||||
PartInventoryList v7inv = PartInventoryList.GetListForSingleItem(i.ID);
|
PartInventoryList v7inv = PartInventoryList.GetListForSingleItem(i.ID);
|
||||||
long v8PartId = Getv7v8IdMap(i.ID, RootObjectTypes.Part);
|
long v8PartId = await Getv7v8IdMap(i.ID, RootObjectTypes.Part);
|
||||||
JObject v8inv = (await util.GetAsync("part/latest-inventory/" + v8PartId)).ObjectResponse;
|
JObject v8inv = (await util.GetAsync("part/latest-inventory/" + v8PartId)).ObjectResponse;
|
||||||
//iterate v8 inventory
|
//iterate v8 inventory
|
||||||
foreach (JObject v8o in v8inv["data"])
|
foreach (JObject v8o in v8inv["data"])
|
||||||
@@ -4483,7 +4493,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
decimal v8OnHand = (decimal)v8o["balance"];
|
decimal v8OnHand = (decimal)v8o["balance"];
|
||||||
foreach (PartInventoryList.PartInventoryListInfo v7o in v7inv)
|
foreach (PartInventoryList.PartInventoryListInfo v7o in v7inv)
|
||||||
{
|
{
|
||||||
long whsv7tov8id = Getv7v8IdMap(v7o.LT_O_PartWarehouse.Value, RootObjectTypes.PartWarehouse);
|
long whsv7tov8id = await Getv7v8IdMap(v7o.LT_O_PartWarehouse.Value, RootObjectTypes.PartWarehouse);
|
||||||
if (whsv7tov8id == (long)v8o["partWarehouseId"])
|
if (whsv7tov8id == (long)v8o["partWarehouseId"])
|
||||||
{
|
{
|
||||||
//this is the match, do the fixup
|
//this is the match, do the fixup
|
||||||
@@ -5332,7 +5342,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//Form data like the bizobject type and id
|
//Form data like the bizobject type and id
|
||||||
string RavenTypeAsString = "";
|
string RavenTypeAsString = "";
|
||||||
int ravenType = 0;//notype is default for orphaned objects
|
int ravenType = 0;//notype is default for orphaned objects
|
||||||
long v8Id = Getv7v8IdMap(tid.ID, tid.RootObjectType, false, true);//default to 0 id if no match which is good for raven as it puts it into a list users can deal with in UI
|
long v8Id = await Getv7v8IdMap(tid.ID, tid.RootObjectType, false, true);//default to 0 id if no match which is good for raven as it puts it into a list users can deal with in UI
|
||||||
if (v8Id != 0)
|
if (v8Id != 0)
|
||||||
{
|
{
|
||||||
if (specificRavenType != util.AyaType.NoType)
|
if (specificRavenType != util.AyaType.NoType)
|
||||||
@@ -5437,7 +5447,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
string RavenTypeAsString = "";
|
string RavenTypeAsString = "";
|
||||||
int ravenType = 0;//notype is default for orphaned objects
|
int ravenType = 0;//notype is default for orphaned objects
|
||||||
long v8Id = Getv7v8IdMap(tid.ID, tid.RootObjectType, false, true);//default to 0 id if no match which is good for raven as it puts it into a list users can deal with in UI
|
long v8Id = await Getv7v8IdMap(tid.ID, tid.RootObjectType, false, true);//default to 0 id if no match which is good for raven as it puts it into a list users can deal with in UI
|
||||||
if (v8Id != 0)
|
if (v8Id != 0)
|
||||||
{
|
{
|
||||||
if (specificRavenType != util.AyaType.NoType)
|
if (specificRavenType != util.AyaType.NoType)
|
||||||
@@ -5495,13 +5505,17 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var content = w.GetContentAsString;
|
var content = w.GetContentAsString;
|
||||||
if (string.IsNullOrWhiteSpace(content)) return null;
|
if (string.IsNullOrWhiteSpace(content)) return null;
|
||||||
|
|
||||||
//TODO: fixup internal urls using MAP of file attachment uploads
|
|
||||||
|
|
||||||
MatchCollection mc = AyaBizUtils.rxAyaImageTags.Matches(content);
|
MatchCollection mc = AyaBizUtils.rxAyaImageTags.Matches(content);
|
||||||
foreach (Match m in mc)
|
foreach (Match m in mc)
|
||||||
{
|
{
|
||||||
var RavenId = Getv7v8IdMap(new Guid(m.Groups["guid"].Value), tid.Type); ??//Map[new Guid(m.Groups["guid"].Value)];
|
//this is image links to file attachments
|
||||||
content = content.Replace(m.Value, "<img src=\"" + "[ATTACH:" + RavenId.ToString() + "]" + "\">");
|
//if there is no match then chuck it, it's not critically important and already was missing in v7 anyway
|
||||||
|
var RavenId = await Getv7v8IdMapNullOK(new Guid(m.Groups["guid"].Value), tid.Type, false);//Map[new Guid(m.Groups["guid"].Value)];
|
||||||
|
if (RavenId != null)
|
||||||
|
content = content.Replace(m.Value, "<img src=\"" + "[ATTACH:" + RavenId.ToString() + "]" + "\">");
|
||||||
|
else
|
||||||
|
content = content.Replace(m.Value, "[v8migrate deleted / not found]");
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo: fixup font size, try to convert to heading tags instead
|
//todo: fixup font size, try to convert to heading tags instead
|
||||||
|
|||||||
Reference in New Issue
Block a user