This commit is contained in:
2020-12-29 00:05:34 +00:00
parent 079d832db0
commit 0eb6c4206d
2 changed files with 185 additions and 126 deletions

View File

@@ -328,6 +328,8 @@ namespace AyaNova.PlugIn.V8
//Must be after all root objects due to followups
await ExportScheduleMarkers(progress);
await ExportRates(progress);
//NOTE: when get to PRIORITY, or WORKORDER STATUS be sure to add color code as per already done in USER export
if (progress.KeepGoing)
@@ -1823,6 +1825,61 @@ namespace AyaNova.PlugIn.V8
}
#endregion Vendors
#region Rates
private async System.Threading.Tasks.Task ExportRates(ProgressForm progress)
{
ResetUniqueNames();
if (!progress.KeepGoing) return;
progress.Op("Start Rates export");
progress.SubOp("");
var ObjectTypeName = "Rate";
//Step 2: export the objects
Rates pl = Rates.GetItems(false);
progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s");
foreach (Rate i in pl)
{
if (!progress.KeepGoing) return;
List<string> tags = new List<string>();
tags.Add(ImportTag);
dynamic d = new JObject();
d.name = GetUniqueName(i.Name);
if (IsDuplicateMapItem(i.ID, i.Name, progress)) continue;
progress.Op(ObjectTypeName + " " + d.name);
d.active = i.Active;
d.notes = i.Description;
d.accountNumber = i.AccountNumber;
Tagit(i.RegionID, tags);
Tagit(i.ClientGroupID, tags);
SetTags(d, tags);
string route = "service-rate";
util.AyaType ravenType = util.AyaType.ServiceRate;
if (i.RateType == RateTypes.Travel)
{
route = "travel-rate";
ravenType = util.AyaType.TravelRate;
}
var rMainObject = await util.PostAsync(route, d.ToString());
long RavenId = util.IdFromResponse(rMainObject);
AddMap(i.ID, RavenId);
//-----
//Event log fixup
await util.EventLog(ravenType, RavenId, SafeGetUserMap(i.Creator), SafeGetUserMap(i.Modifier), i.Created, i.Modified);
}
}
#endregion Rates
#region Memos
private async System.Threading.Tasks.Task ExportMemos(ProgressForm progress)
{

View File

@@ -573,7 +573,9 @@ namespace AyaNova.PlugIn.V8
//corebizobject
Memo = 60,
//corebizobject
Review = 61
Review = 61,
ServiceRate = 62,
TravelRate = 63