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 //Must be after all root objects due to followups
await ExportScheduleMarkers(progress); 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 //NOTE: when get to PRIORITY, or WORKORDER STATUS be sure to add color code as per already done in USER export
if (progress.KeepGoing) if (progress.KeepGoing)
@@ -1823,6 +1825,61 @@ namespace AyaNova.PlugIn.V8
} }
#endregion Vendors #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 #region Memos
private async System.Threading.Tasks.Task ExportMemos(ProgressForm progress) private async System.Threading.Tasks.Task ExportMemos(ProgressForm progress)
{ {

View File

@@ -456,138 +456,140 @@ namespace AyaNova.PlugIn.V8
} }
} }
public enum AyaType : int public enum AyaType : int
{ {
//COREBIZOBJECT attribute must be set on objects that are: //COREBIZOBJECT attribute must be set on objects that are:
//Attachable objects can have attachments, //Attachable objects can have attachments,
//wikiable objects can have a wiki //wikiable objects can have a wiki
//reviewable objects can have a review which is basically the same as a Reminder but with an object attached (was follow up schedmarker in v7) //reviewable objects can have a review which is basically the same as a Reminder but with an object attached (was follow up schedmarker in v7)
//PIckList-able (has picklist template) //PIckList-able (has picklist template)
//Pretty much everything that represents some kind of real world object is wikiable or attachable as long as it has an ID and a type //Pretty much everything that represents some kind of real world object is wikiable or attachable as long as it has an ID and a type
//exceptions would be utility type objects like datalistview, formcustom etc that are not //exceptions would be utility type objects like datalistview, formcustom etc that are not
//NOTE: NEW CORE OBJECTS - All areas of server AND CLIENT code that require adding any new core objects have been tagged with the following comment: //NOTE: NEW CORE OBJECTS - All areas of server AND CLIENT code that require adding any new core objects have been tagged with the following comment:
//CoreBizObject add here //CoreBizObject add here
//Search for that IN SERVER AND CLIENT CODE and you will see all areas that need coding for the new object //Search for that IN SERVER AND CLIENT CODE and you will see all areas that need coding for the new object
//***IMPORTANT: Also need to add translations for any new biz objects added that don't match exactly the name here in the key //***IMPORTANT: Also need to add translations for any new biz objects added that don't match exactly the name here in the key
//because enumlist gets it that way, i.e. "Global" would be the expected key //because enumlist gets it that way, i.e. "Global" would be the expected key
NoType = 0, NoType = 0,
Global = 1, Global = 1,
//corebizobject //corebizobject
Widget = 2, Widget = 2,
//corebizobject //corebizobject
User = 3, User = 3,
ServerState = 4, ServerState = 4,
License = 5, License = 5,
LogFile = 6, LogFile = 6,
PickListTemplate = 7, PickListTemplate = 7,
//corebizobject //corebizobject
Customer = 8, Customer = 8,
ServerJob = 9, ServerJob = 9,
//corebizobject //corebizobject
Contract = 10, Contract = 10,
TrialSeeder = 11, TrialSeeder = 11,
ServerMetrics = 12, ServerMetrics = 12,
Translation = 13, Translation = 13,
UserOptions = 14, UserOptions = 14,
//corebizobject //corebizobject
HeadOffice = 15, HeadOffice = 15,
//corebizobject //corebizobject
LoanUnit = 16, LoanUnit = 16,
FileAttachment = 17, FileAttachment = 17,
DataListView = 18, DataListView = 18,
FormCustom = 19, FormCustom = 19,
//corebizobject //corebizobject
Part = 20, Part = 20,
//corebizobject //corebizobject
PM = 21, PM = 21,
//corebizobject //corebizobject
PMItem = 22, PMItem = 22,
//corebizobject //corebizobject
PMTemplate = 23, PMTemplate = 23,
//corebizobject //corebizobject
PMTemplateItem = 24, PMTemplateItem = 24,
//corebizobject //corebizobject
Project = 25, Project = 25,
//corebizobject //corebizobject
PurchaseOrder = 26, PurchaseOrder = 26,
//corebizobject //corebizobject
Quote = 27, Quote = 27,
//corebizobject //corebizobject
QuoteItem = 28, QuoteItem = 28,
//corebizobject //corebizobject
QuoteTemplate = 29, QuoteTemplate = 29,
//corebizobject //corebizobject
QuoteTemplateItem = 30, QuoteTemplateItem = 30,
//corebizobject //corebizobject
Unit = 31, Unit = 31,
//corebizobject //corebizobject
UnitModel = 32, UnitModel = 32,
//corebizobject //corebizobject
Vendor = 33, Vendor = 33,
//--- WorkOrder //--- WorkOrder
//corebizobject //corebizobject
WorkOrder = 34, WorkOrder = 34,
//corebizobject //corebizobject
WorkOrderItem = 35, WorkOrderItem = 35,
//corebizobject //corebizobject
WorkOrderItemExpense = 36, WorkOrderItemExpense = 36,
//corebizobject //corebizobject
WorkOrderItemLabor = 37, WorkOrderItemLabor = 37,
//corebizobject //corebizobject
WorkOrderItemLoan = 38, WorkOrderItemLoan = 38,
//corebizobject //corebizobject
WorkOrderItemPart = 39, WorkOrderItemPart = 39,
//corebizobject //corebizobject
WorkOrderItemPartRequest = 40, WorkOrderItemPartRequest = 40,
//corebizobject //corebizobject
WorkOrderItemScheduledUser = 41, WorkOrderItemScheduledUser = 41,
//corebizobject //corebizobject
WorkOrderItemTask = 42, WorkOrderItemTask = 42,
//corebizobject //corebizobject
WorkOrderItemTravel = 43, WorkOrderItemTravel = 43,
//corebizobject //corebizobject
WorkOrderItemUnit = 44, WorkOrderItemUnit = 44,
//--- //---
//corebizobject //corebizobject
WorkOrderTemplate = 45, WorkOrderTemplate = 45,
//corebizobject //corebizobject
WorkOrderTemplateItem = 46, WorkOrderTemplateItem = 46,
GlobalOps = 47,//really only used for rights, not an object type of any kind GlobalOps = 47,//really only used for rights, not an object type of any kind
BizMetrics = 48,//deprecate? Not used for anything as of nov 2020 BizMetrics = 48,//deprecate? Not used for anything as of nov 2020
Backup = 49, Backup = 49,
Notification = 50, Notification = 50,
NotifySubscription = 51, NotifySubscription = 51,
//corebizobject //corebizobject
Reminder = 52, Reminder = 52,
UnitMeterReading = 53, UnitMeterReading = 53,
CustomerServiceRequest = 54, CustomerServiceRequest = 54,
ServiceBank = 55, ServiceBank = 55,
OpsNotificationSettings = 56, OpsNotificationSettings = 56,
Report = 57, Report = 57,
DashboardView = 58, DashboardView = 58,
//corebizobject //corebizobject
CustomerNote = 59, CustomerNote = 59,
//corebizobject //corebizobject
Memo = 60, Memo = 60,
//corebizobject //corebizobject
Review = 61 Review = 61,
ServiceRate = 62,
TravelRate = 63
//NOTE: New objects added here need to also be added to the following classes: //NOTE: New objects added here need to also be added to the following classes:
//AyaNova.Biz.BizObjectExistsInDatabase //AyaNova.Biz.BizObjectExistsInDatabase
//AyaNova.Biz.BizObjectFactory //AyaNova.Biz.BizObjectFactory
//AyaNova.Biz.BizRoles //AyaNova.Biz.BizRoles
//AyaNova.Biz.BizObjectNameFetcherDIRECT //AyaNova.Biz.BizObjectNameFetcherDIRECT
//and in the CLIENT in ayatype.js //and in the CLIENT in ayatype.js
//and their model needs to have the ICoreBizObjectModel interface //and their model needs to have the ICoreBizObjectModel interface
//and need TRANSLATION KEYS because any type could show in the event log at the client end //and need TRANSLATION KEYS because any type could show in the event log at the client end
} }