This commit is contained in:
@@ -1843,6 +1843,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (PurchaseOrderReceipt r in receipts)
|
foreach (PurchaseOrderReceipt r in receipts)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(r.Text1))
|
if (!string.IsNullOrWhiteSpace(r.Text1))
|
||||||
@@ -1856,7 +1857,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
//Note: in v7 must receive to same warehouse as ordered, no option otherwise so no need
|
//Note: in v7 must receive to same warehouse as ordered, no option otherwise so no need
|
||||||
//to worry about that here
|
//to worry about that here
|
||||||
//No, use the poitem value above, this one can be wonky dItem.quantityReceived += ri.QuantityReceived;
|
//No, use the poitem value above, this one can be wonky dItem.quantityReceived += ri.QuantityReceived;
|
||||||
dItem.receivedCost = ri.ReceiptCost;//yes, last receipt wins for cost
|
dItem.receivedCost = ri.ReceiptCost;//yes, last receipt wins for cost
|
||||||
foreach (PartSerial sn in ri.SerialNumbers)
|
foreach (PartSerial sn in ri.SerialNumbers)
|
||||||
sbSerials.Append(sn.SerialNumber + ", ");
|
sbSerials.Append(sn.SerialNumber + ", ");
|
||||||
@@ -2907,6 +2908,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
progress.SubOp("WorkorderItemPartRequest " + wipr.ID.ToString());
|
progress.SubOp("WorkorderItemPartRequest " + wipr.ID.ToString());
|
||||||
if (wipr.Quantity == 0) continue;
|
if (wipr.Quantity == 0) continue;
|
||||||
|
|
||||||
|
JObject dPO = null;
|
||||||
|
JObject v8poitemtoupdate = null;
|
||||||
dynamic dwipr = new JObject();
|
dynamic dwipr = new JObject();
|
||||||
dwipr.workOrderId = RavenId;
|
dwipr.workOrderId = RavenId;
|
||||||
dwipr.workorderItemId = ravenwoitemid;
|
dwipr.workorderItemId = ravenwoitemid;
|
||||||
@@ -2919,15 +2922,47 @@ namespace AyaNova.PlugIn.V8
|
|||||||
else
|
else
|
||||||
dwipr.partId = tryPartId;
|
dwipr.partId = tryPartId;
|
||||||
dwipr.partWarehouseId = Getv7v8IdMap(wipr.PartWarehouseID, "warehouse");
|
dwipr.partWarehouseId = Getv7v8IdMap(wipr.PartWarehouseID, "warehouse");
|
||||||
|
|
||||||
|
poitemtowoitempartrequest pto = PoItemPartRequestMap.FirstOrDefault(z => z.v7woitempartrequestid == wipr.ID);
|
||||||
|
if (pto != null)
|
||||||
|
{
|
||||||
|
//tag this part request with the v8 poitem id that matches
|
||||||
|
//get v8 po id
|
||||||
|
//fetch po
|
||||||
|
//iterate po and look for item with the vendorpartnumber set to this woitempartid by guid string
|
||||||
|
//update the po item with the raven partrequestid
|
||||||
|
//save po
|
||||||
|
long? v8poid = Getv7v8IdMapNullOk(pto.v7poid);
|
||||||
|
if (v8poid != null)
|
||||||
|
{
|
||||||
|
var a = await util.GetAsync("purchase-order/" + v8poid.ToString());
|
||||||
|
dPO = (JObject)a.ObjectResponse["data"];
|
||||||
|
if (dPO != null)
|
||||||
|
{
|
||||||
|
v8poitemtoupdate = (JObject)dPO["items"].FirstOrDefault(z => (string)z["vendorPartNumber"] == wipr.ID.ToString());
|
||||||
|
if (v8poitemtoupdate != null)
|
||||||
|
{
|
||||||
|
//update the woitempart request purchase order item id
|
||||||
|
dwipr.purchaseOrderItemId = (long)v8poitemtoupdate["id"];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: if migrate purchase orders this is reqd
|
//TODO: if migrate purchase orders this is reqd
|
||||||
// dwipr.purchaseOrderItemId = Getv7v8IdMapNullOk(wipr.PurchaseOrderItemID);
|
// dwipr.purchaseOrderItemId = Getv7v8IdMapNullOk(wipr.PurchaseOrderItemID);
|
||||||
await util.PostAsync("workorder/items/part-requests", dwipr.ToString());
|
long v8partrequestid = util.IdFromResponse(await util.PostAsync("workorder/items/part-requests", dwipr.ToString()));
|
||||||
//todo: consult map to see if this workorderitempart requet has any poitems to tag and
|
|
||||||
//if so fetch the po from v8, look in the vnedorpartnumber of items for the mtching guid of this v7woitempart request
|
//SAVE PO if fetched and updated here
|
||||||
//clear that vendpartnumber but set the long?woitempartrequestid and save the po
|
if (dPO != null && v8poitemtoupdate != null)
|
||||||
//also it apears needs reverse here as well to back link so need to update this part request with the poitem id I think
|
{
|
||||||
|
//save the PO
|
||||||
|
v8poitemtoupdate["workorderItemPartRequestId"] = v8partrequestid;
|
||||||
|
v8poitemtoupdate["vendorPartNumber"] = null;
|
||||||
|
await util.PutAsync("purchase-order", dPO.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
//todo: this PoItemPartRequestMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//##### WORKORDER ITEM LOANERS
|
//##### WORKORDER ITEM LOANERS
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
||||||
<!-- Development test MSSQL DB -->
|
<!-- Development test MSSQL DB
|
||||||
<ConnectionType>DataBase</ConnectionType>
|
<ConnectionType>DataBase</ConnectionType>
|
||||||
<DataBaseType>MSSQL</DataBaseType>
|
<DataBaseType>MSSQL</DataBaseType>
|
||||||
<DataBaseConnectionString>Server=DEV-V7-LAPTOP\SQLEXPRESS;initial catalog=AyaNova;User Id=sa; Password = abraxis;</DataBaseConnectionString>
|
<DataBaseConnectionString>Server=DEV-V7-LAPTOP\SQLEXPRESS;initial catalog=AyaNova;User Id=sa; Password = abraxis;</DataBaseConnectionString>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- DEVELOPMENT embedded Firebird database -->
|
||||||
<!-- DEVELOPMENT embedded Firebird database
|
|
||||||
|
|
||||||
<ConnectionType>DataBase</ConnectionType>
|
<ConnectionType>DataBase</ConnectionType>
|
||||||
<DataBaseType>FireBird</DataBaseType>
|
<DataBaseType>FireBird</DataBaseType>
|
||||||
<DataBaseConnectionString>ServerType=1;DataBase=C:\data\AyaNova\database\AYANOVA.fdb;Dialect=3;</DataBaseConnectionString>
|
<DataBaseConnectionString>ServerType=1;DataBase=C:\data\AyaNova\database\AYANOVA.fdb;Dialect=3;</DataBaseConnectionString>
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- DataPortal
|
<!-- DataPortal
|
||||||
|
|||||||
Reference in New Issue
Block a user