GRN Activation Does Not Update SOH  Topic is solved

Discussions relating to the REST API of Jiwa 7.

GRN Activation Does Not Update SOH

Postby nsbandara » Thu Apr 19, 2018 12:46 am

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 ?
Attachments
jason-reponse-files.zip
JSON response filess
(6.08 KiB) Downloaded 86 times
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

Re: GRN Activation Does Not Update SOH

Postby Mike.Sheen » Tue Apr 24, 2018 3:13 pm

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
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
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: GRN Activation Does Not Update SOH  Topic is solved

Postby 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
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757


Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest