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