Page 1 of 1

GRN Activation Does Not Update SOH

PostPosted: Thu Apr 19, 2018 12:46 am
by nsbandara
Hi,

I'm trying to bring in stock by activating a GRN created for a purchase order through REST API.

Here are the steps I followed.

    1. Create purchase order (PurchaseOrderPOSTRequest)
    2. Create GRN for created purchase order (GoodsReceivedNoteCREATEFromPORequest)
    3. Update GRN line received quantity (GoodsReceivedNoteLinePATCHRequest)
    4. Activate GRN (GoodsReceivedNoteACTIVATERequest)

When I check SOH for particular product in GRN after activation, inventory transactions were not updated. Is that known bug in API or I'm I missing any step here ?

Re: GRN Activation Does Not Update SOH

PostPosted: Tue Apr 24, 2018 3:13 pm
by Mike.Sheen
Hi Nishantha,

I've just tested this and I also find the SOH record is not created when the GRN is activated. I'm looking now at why and I'll report back what I find and if there is a work-around.

Mike

Re: GRN Activation Does Not Update SOH  Topic is solved

PostPosted: Tue Apr 24, 2018 3:40 pm
by Mike.Sheen
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