This commit is contained in:
@@ -3287,10 +3287,6 @@ namespace AyaNova.PlugIn.V8
|
||||
progress.Op("Start Quotes export");
|
||||
progress.SubOp("");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//################## v8 quote status to mirror v7 quote status ##########################
|
||||
{
|
||||
|
||||
@@ -3389,7 +3385,7 @@ namespace AyaNova.PlugIn.V8
|
||||
AddImportTag(tags);
|
||||
|
||||
|
||||
Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value);
|
||||
Workorder c = Workorder.GetItem(i.LT_O_WorkorderQuote.Value);
|
||||
if (IsDuplicatev7v8IdMapItem(c.ID, c.WorkorderQuote.QuoteNumber.ToString(), progress)) continue;
|
||||
var ObjectTID = new TypeAndID(RootObjectTypes.WorkorderQuote, c.ID);
|
||||
dynamic d = new JObject();
|
||||
@@ -3405,13 +3401,13 @@ namespace AyaNova.PlugIn.V8
|
||||
d.customerReferenceNumber = c.CustomerReferenceNumber;
|
||||
d.customerContactName = c.CustomerContactName;
|
||||
d.createdDate = util.DateToV8(c.Created, true);
|
||||
private Guid mPreparedByID;
|
||||
//private string mIntroduction="";
|
||||
//private SmartDate mQuoteRequestDate;
|
||||
//private SmartDate mValidUntilDate;
|
||||
//private SmartDate mDateSubmitted;
|
||||
//private SmartDate mDateApproved;
|
||||
d.onsite = c.Onsite;
|
||||
d.preparedById= Getv7v8IdMap(c.WorkorderQuote.PreparedByID,"quote prepared by id");
|
||||
d.introduction = c.WorkorderQuote.Introduction;
|
||||
d.requested=util.DateToV8(c.WorkorderQuote.QuoteRequestDate);
|
||||
d.validUntil=util.DateToV8(c.WorkorderQuote.ValidUntilDate);
|
||||
d.submitted=util.DateToV8(c.WorkorderQuote.DateSubmitted);
|
||||
d.approved=util.DateToV8(c.WorkorderQuote.DateApproved);
|
||||
|
||||
d.contractId = Getv7v8IdMapNullOk(c.ContractIDResolved());
|
||||
d.lastStatusId = (int)c.WorkorderQuote.QuoteStatus;
|
||||
|
||||
@@ -3448,27 +3444,16 @@ namespace AyaNova.PlugIn.V8
|
||||
//-----
|
||||
|
||||
// wiki
|
||||
if (WikiPage.HasWiki(c.ID))
|
||||
{
|
||||
// await ExportAttachments(ObjectTID, progress);
|
||||
d.wiki = GetWikiContent(ObjectTID);
|
||||
|
||||
}
|
||||
if (WikiPage.HasWiki(c.ID))
|
||||
d.wiki = GetWikiContent(ObjectTID);
|
||||
|
||||
//docs
|
||||
string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress, util.AyaType.WorkOrder);
|
||||
if (!string.IsNullOrEmpty(NonFileUrls))
|
||||
{
|
||||
////need to repost the user with the notes modified
|
||||
|
||||
//d.login = null;
|
||||
//d.password = null;
|
||||
d.notes = NonFileUrls + "\n-----------------\n" + d.notes;
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(NonFileUrls))
|
||||
d.notes = NonFileUrls + "\n-----------------\n" + d.notes;
|
||||
|
||||
//put the header object
|
||||
await util.PutAsync("workorder", d.ToString());
|
||||
await util.PutAsync("quote", d.ToString());
|
||||
//-----
|
||||
|
||||
//Event log fixup
|
||||
@@ -3481,30 +3466,14 @@ namespace AyaNova.PlugIn.V8
|
||||
if (c.WorkorderService.WorkorderStatusID != Guid.Empty)
|
||||
{
|
||||
dynamic state = new JObject();
|
||||
state.workOrderId = RavenId;
|
||||
state.workOrderStatusId = Getv7v8IdMap(c.WorkorderService.WorkorderStatusID, "Workorder status");
|
||||
state.quoteId = RavenId;
|
||||
state.quoteStatusId = (int)c.WorkorderQuote.QuoteStatus;
|
||||
state.created = util.DateToV8(c.Created, true);
|
||||
state.userId = Getv7v8IdMap(c.Creator, "Workorder creator for status");
|
||||
await util.PostAsync("workorder/states", state.ToString());
|
||||
}
|
||||
if (c.ServiceCompleted)
|
||||
{
|
||||
dynamic state = new JObject();
|
||||
state.workOrderId = RavenId;
|
||||
state.workOrderStatusId = ServiceCompletedWorkOrderStatus;
|
||||
state.created = util.DateToV8(c.Created, true);
|
||||
state.userId = Getv7v8IdMap(c.Creator, "Workorder creator for status");
|
||||
await util.PostAsync("workorder/states", state.ToString());
|
||||
}
|
||||
if (c.Closed)
|
||||
{
|
||||
dynamic state = new JObject();
|
||||
state.workOrderId = RavenId;
|
||||
state.workOrderStatusId = ClosedWorkOrderStatus;
|
||||
state.created = util.DateToV8(c.Created, true);
|
||||
state.userId = Getv7v8IdMap(c.Creator, "Workorder creator for status");
|
||||
await util.PostAsync("workorder/states", state.ToString());
|
||||
state.userId = Getv7v8IdMap(c.Creator, "Quote creator for status");
|
||||
await util.PostAsync("quote/states", state.ToString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user