This commit is contained in:
@@ -2791,32 +2791,27 @@ namespace AyaNova.PlugIn.V8
|
|||||||
await util.PostAsync("workorder/items/parts", dwip.ToString());
|
await util.PostAsync("workorder/items/parts", dwip.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
//##### WORKORDER ITEM PART
|
//##### WORKORDER ITEM PARTREQUEST
|
||||||
foreach (WorkorderItemPart wip in wi.Parts)
|
foreach (WorkorderItemPartRequest wipr in wi.Parts)
|
||||||
{
|
{
|
||||||
progress.SubOp("WorkorderItemPart " + wip.ID.ToString());
|
progress.SubOp("WorkorderItemPartRequest " + wipr.ID.ToString());
|
||||||
dynamic dwip = new JObject();
|
if (wipr.Quantity == 0) continue;
|
||||||
dwip.workOrderId = RavenId;
|
|
||||||
dwip.workorderItemId = ravenwoitemid;
|
dynamic dwipr = new JObject();
|
||||||
dwip.quantity = wip.Quantity;
|
dwipr.workOrderId = RavenId;
|
||||||
var tryPartId = Getv7v8IdMapNullOk(wip.PartID);
|
dwipr.workorderItemId = ravenwoitemid;
|
||||||
|
dwipr.quantity = wipr.Quantity;
|
||||||
|
var tryPartId = Getv7v8IdMapNullOk(wipr.PartID);
|
||||||
if (tryPartId == null)
|
if (tryPartId == null)
|
||||||
{
|
{
|
||||||
dwip.partId = UnknownV7PartId;
|
dwipr.partId = UnknownV7PartId;
|
||||||
if (wip.Quantity == 0 && string.IsNullOrWhiteSpace(wip.Description))
|
|
||||||
continue; //no part record, no quantity, no text at all, just skip it
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dwip.partId = tryPartId;
|
dwipr.partId = tryPartId;
|
||||||
dwip.partWarehouseId = Getv7v8IdMap(wip.PartWarehouseID, "warehouse");
|
dwipr.partWarehouseId = Getv7v8IdMap(wipr.PartWarehouseID, "warehouse");
|
||||||
dwip.taxPartSaleId = Getv7v8IdMapNullOk(wip.TaxPartSaleID);
|
//TODO: if migrate purchase orders this is reqd
|
||||||
dwip.priceOverride = wip.Price;
|
// dwipr.purchaseOrderItemId = Getv7v8IdMapNullOk(wipr.PurchaseOrderItemID);
|
||||||
dwip.price = wip.Price;
|
await util.PostAsync("workorder/items/part-requests", dwipr.ToString());
|
||||||
dwip.cost = wip.Cost;
|
|
||||||
dwip.description = wip.Description;
|
|
||||||
if (wip.PartSerialID != Guid.Empty)
|
|
||||||
dwip.serials = PartSerial.GetSerialNumberFromPartSerialID(wip.PartSerialID);
|
|
||||||
await util.PostAsync("workorder/items/parts", dwip.ToString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
public static GZTW.AyaNova.BLL.LocalizedTextTable LocaleText = null;
|
public static GZTW.AyaNova.BLL.LocalizedTextTable LocaleText = null;
|
||||||
const string TEST_ROUTE = "notify/hello";
|
const string TEST_ROUTE = "notify/hello";
|
||||||
const string API_BASE_ROUTE = "api/v8/";
|
const string API_BASE_ROUTE = "api/v8/";
|
||||||
public static HttpClient client = null;
|
public static HttpClient client = new HttpClient();
|
||||||
//url once known to be good
|
//url once known to be good
|
||||||
internal static string ApiBaseUrl { get; set; }
|
internal static string ApiBaseUrl { get; set; }
|
||||||
internal static string JWT { get; set; }
|
internal static string JWT { get; set; }
|
||||||
@@ -40,11 +40,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
private static void InitClient()
|
private static void InitClient()
|
||||||
{
|
{
|
||||||
if (Initialized) return;
|
if (Initialized) return;
|
||||||
if (client != null)
|
//if (client != null)
|
||||||
client.Dispose();
|
// client.Dispose();
|
||||||
client = null;
|
//client = null;
|
||||||
client = new HttpClient();
|
//client = new HttpClient();
|
||||||
client.Timeout = new TimeSpan(0, 0, 30);
|
client.Timeout = new TimeSpan(0, 1, 0);
|
||||||
client.BaseAddress = new Uri(ApiBaseUrl);
|
client.BaseAddress = new Uri(ApiBaseUrl);
|
||||||
client.DefaultRequestHeaders.Accept.Clear();
|
client.DefaultRequestHeaders.Accept.Clear();
|
||||||
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
||||||
|
|||||||
Reference in New Issue
Block a user