by Mike.Sheen » Tue Apr 24, 2018 3:40 pm
Ok, so I've logged this as
DEV-6589.
The good news is there is a workaround - provide the linedetails in the PATCH for the GRN line - and then the subsequent activate of the GRN will add the stock to the system.
Below is my test code which creates the PO, sends (Activates) the PO, creates the GRN, patches the line and activates the GRN - and because I supply the line details it will create the stock records.
- Code: Select all
var client = new ServiceStack.JsonServiceClient("http://localhost");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var PO = new PurchaseOrderPOSTRequest() { CreditorAccountNo = "5001", OrderDate = DateTime.Now };
PO.Lines.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.PurchaseOrders.PurchaseOrderLine() { PartNo = "1170", Quantity = 5, Cost = 12.34M });
var poPostResponse = client.Post(PO);
var poActivateResponse = client.Post(new PurchaseOrderACTIVATERequest() { PurchaseOrderID = poPostResponse.PurchaseOrderID } );
var grnPostResponse = client.Post(new GoodsReceivedNoteCREATEFromPORequest() { OrderNos = new[] { poPostResponse.OrderNo } });
// This is the DTO which needs to be modified to include the line details
var grnLinePatchResponse = client.Patch(new GoodsReceivedNoteLinePATCHRequest() { GRNID = grnPostResponse.GRNID, LineID = grnPostResponse.Lines[0].LineID, Quantity = 5, LineDetails = new List<JiwaFinancials.Jiwa.JiwaServiceModel.GoodsReceivedNotes.GoodsReceivedNoteLineDetail>() { new JiwaFinancials.Jiwa.JiwaServiceModel.GoodsReceivedNotes.GoodsReceivedNoteLineDetail() { Quantity = 5 } } });
var grnActivateResponse = client.Post(new GoodsReceivedNoteACTIVATERequest() { GRNID = grnPostResponse.GRNID });
Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials
If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution