This commit is contained in:
@@ -358,8 +358,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
await ExportParts(progress);
|
await ExportParts(progress);
|
||||||
await ExportProjects(progress);
|
await ExportProjects(progress);
|
||||||
|
|
||||||
if(V7UseInventory)
|
if (V7UseInventory)
|
||||||
await ExportPurchaseOrders(progress);
|
await ExportPurchaseOrders(progress);
|
||||||
await ExportUnitModels(progress);
|
await ExportUnitModels(progress);
|
||||||
await ExportUnits(progress);
|
await ExportUnits(progress);
|
||||||
await ExportExternalUsers(progress);//needs vendors, clients and headoffices already exported so needs to be here late
|
await ExportExternalUsers(progress);//needs vendors, clients and headoffices already exported so needs to be here late
|
||||||
@@ -1748,6 +1748,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
#endregion Projects
|
#endregion Projects
|
||||||
|
|
||||||
#region PurchaseOrders
|
#region PurchaseOrders
|
||||||
|
|
||||||
private async System.Threading.Tasks.Task ExportPurchaseOrders(ProgressForm progress)
|
private async System.Threading.Tasks.Task ExportPurchaseOrders(ProgressForm progress)
|
||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
@@ -1771,21 +1772,51 @@ namespace AyaNova.PlugIn.V8
|
|||||||
List<string> tags = new List<string>();
|
List<string> tags = new List<string>();
|
||||||
AddImportTag(tags);
|
AddImportTag(tags);
|
||||||
PurchaseOrder c = PurchaseOrder.GetItem(i.LT_PurchaseOrder_Label_PONumber.Value);
|
PurchaseOrder c = PurchaseOrder.GetItem(i.LT_PurchaseOrder_Label_PONumber.Value);
|
||||||
|
|
||||||
//get receipts for this PO
|
|
||||||
PurchaseOrderReceiptListDetailed prl = PurchaseOrderReceiptListDetailed.GetList(
|
|
||||||
"<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?><GRIDCRITERIA><COLUMNITEM CM=\"aPurchaseOrderReceipt.aReceivedDate\" UI=\"LT_PurchaseOrderReceipt_Label_ReceivedDate\" PIN=\"0\" WIDTH=\"121\" SORT=\"ASC\" /><COLUMNITEM CM=\"aPurchaseOrder.aPONumber\" UI=\"LT_PurchaseOrder_Label_PONumber\" PIN=\"0\" WIDTH=\"105\" /><COLUMNITEM CM=\"grid\" UI=\"LT_O_PurchaseOrderReceipt\" PIN=\"0\" WIDTH=\"155\" /><WHEREITEMGROUP GROUPLOGICALOPERATOR=\"And\" UI=\"LT_PurchaseOrder_Label_PONumber\"><WHEREITEM COMPAREOPERATOR=\"Equals\" CM=\"aPurchaseOrder.aID\" UICOMPAREVALUE=\"\" TYPE=\"System.Guid\" COMPAREVALUE=\"{" +
|
|
||||||
c.ID.ToString().ToUpper()
|
|
||||||
+ "}\" /></WHEREITEMGROUP></GRIDCRITERIA>");
|
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.PurchaseOrder, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.PurchaseOrder, c.ID);
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
|
|
||||||
d.serial = c.PONumber;
|
d.serial = c.PONumber;
|
||||||
if (IsDuplicatev7v8IdMapItem(c.ID, i.LT_PurchaseOrder_Label_PONumber.Display, progress)) continue;
|
if (IsDuplicatev7v8IdMapItem(c.ID, i.LT_PurchaseOrder_Label_PONumber.Display, progress)) continue;
|
||||||
progress.Op(ObjectTypeName + " " + d.name);
|
progress.Op(ObjectTypeName + " " + d.name);
|
||||||
|
|
||||||
d.notes = c.Notes;
|
d.notes = c.Notes;
|
||||||
d.vendorMemo
|
d.vendorMemo = c.VendorMemo;
|
||||||
|
d.dropShipToCustomerId =Getv7v8IdMapNullOk(c.DropShipToClientID);
|
||||||
|
d.referenceNumber = c.ReferenceNumber;
|
||||||
|
d.vendorId = Getv7v8IdMap(c.VendorID, "Vendor for PO");
|
||||||
|
d.orderedDate = util.DateToV8(c.OrderedDate);
|
||||||
|
d.expectedReceiveDate = util.DateToV8(c.ExpectedReceiveDate);
|
||||||
|
d.status = (int)c.Status;//same enum id's so this is kosher
|
||||||
|
d.projectId = Getv7v8IdMapNullOk(c.ProjectID);
|
||||||
|
|
||||||
|
StringBuilder sbText1 = new StringBuilder();
|
||||||
|
StringBuilder sbText2 = new StringBuilder();
|
||||||
|
//get receipts for this PO
|
||||||
|
PurchaseOrderReceiptListDetailed prl = PurchaseOrderReceiptListDetailed.GetList(
|
||||||
|
"<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?><GRIDCRITERIA><COLUMNITEM CM=\"aPurchaseOrderReceipt.aReceivedDate\" UI=\"LT_PurchaseOrderReceipt_Label_ReceivedDate\" PIN=\"0\" WIDTH=\"121\" SORT=\"ASC\" /><COLUMNITEM CM=\"aPurchaseOrder.aPONumber\" UI=\"LT_PurchaseOrder_Label_PONumber\" PIN=\"0\" WIDTH=\"105\" /><COLUMNITEM CM=\"grid\" UI=\"LT_O_PurchaseOrderReceipt\" PIN=\"0\" WIDTH=\"155\" /><WHEREITEMGROUP GROUPLOGICALOPERATOR=\"And\" UI=\"LT_PurchaseOrder_Label_PONumber\"><WHEREITEM COMPAREOPERATOR=\"Equals\" CM=\"aPurchaseOrder.aID\" UICOMPAREVALUE=\"\" TYPE=\"System.Guid\" COMPAREVALUE=\"{" +
|
||||||
|
c.ID.ToString().ToUpper()
|
||||||
|
+ "}\" /></WHEREITEMGROUP></GRIDCRITERIA>");
|
||||||
|
|
||||||
|
//compile all actual receipts into collection for later recombination
|
||||||
|
//above list is missing crucial bit which is which exact poitemid they are received against so need actual full record
|
||||||
|
//even though list has almost everything else needed
|
||||||
|
List<PurchaseOrderReceipt> receipts = new List<PurchaseOrderReceipt>();
|
||||||
|
foreach (PurchaseOrderReceiptListDetailed.PurchaseOrderReceiptListDetailedInfo prli in prl)
|
||||||
|
{
|
||||||
|
receipts.Add(PurchaseOrderReceipt.GetItem(prli.LT_O_PurchaseOrderReceipt.Value));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
foreach (PurchaseOrderItem pi in c.OrderItems)
|
||||||
|
{
|
||||||
|
//here combine potiem and poreceipts into singular items for v8
|
||||||
|
//also compile all text1,text2 to put into header for v8 later
|
||||||
|
|
||||||
|
//iterate receipt list find id's fetch actual receipts which contain exactly which poitem they were received against
|
||||||
|
//also, keep track of required woitempartrequestid's for later so can fixup when the time comes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1842,7 +1873,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//Step 2: export the objects
|
//Step 2: export the objects
|
||||||
PickListAutoComplete pl = PickListAutoComplete.GetList("**", "taskgroup");
|
PickListAutoComplete pl = PickListAutoComplete.GetList("**", "taskgroup");
|
||||||
progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s");
|
progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s");
|
||||||
//task picklist used over and over
|
//task picklist used over and over
|
||||||
var AllTasks = TaskPickList.GetList();
|
var AllTasks = TaskPickList.GetList();
|
||||||
foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl)
|
foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user