Page 1 of 2

Automating backorder processing in 7

PostPosted: Wed Jun 07, 2017 10:04 pm
by pricerc
back in 2010, Mike provided some sample code for scheduled backorder processing https://forums.jiwa.com.au/viewtopic.php?f=14&t=111&p=308&hilit=JiwaBOProcess#p308.

Our client is on 7.0.157, and I see that the underlying business objects still look very Jiwa 6 (BOProcess.StdFunctions).

Has the process changed significantly, or should I be able to just port that old breakout code to .NET ?

Re: Automating backorder processing in 7

PostPosted: Wed Jun 07, 2017 10:41 pm
by Mike.Sheen
pricerc wrote:back in 2010, Mike provided some sample code for scheduled backorder processing https://forums.jiwa.com.au/viewtopic.php?f=14&t=111&p=308&hilit=JiwaBOProcess#p308.

Our client is on 7.0.157, and I see that the underlying business objects still look very Jiwa 6 (BOProcess.StdFunctions).

Has the process changed significantly, or should I be able to just port that old breakout code to .NET ?


Oh, please don't port that old code!

Give me a few days and I'll provide a much cleaner solution for 7.00.157.00. I'll post back here the solution.

Re: Automating backorder processing in 7

PostPosted: Thu Jun 08, 2017 7:47 am
by pricerc
LOL

Re: Automating backorder processing in 7

PostPosted: Thu Jun 08, 2017 7:55 am
by pricerc
before you go doing an exact replacement for that old one, I better add some more background information.

I'm actually looking to automate the backorder release process from a shipment bookin activation.

I'm happy with getting a list of inventory items to be used in the BO process (the items on the bookin). I also see that we still have [usp_Jiwa_GetBackOrderProcessList] for getting invoice candidates, and I'm happy getting results back from a stored procedure.

So I'm mostly just looking for the correct way to handle the "BOProcessObject.ProcessBackOrdersForSingleSalesOrderUnattended" bit; I don't need *everything* from that old breakout.

Re: Automating backorder processing in 7

PostPosted: Wed Jun 14, 2017 6:02 pm
by pricerc
Mike.Sheen wrote:
pricerc wrote:back in 2010, Mike provided some sample code for scheduled backorder processing https://forums.jiwa.com.au/viewtopic.php?f=14&t=111&p=308&hilit=JiwaBOProcess#p308.

Our client is on 7.0.157, and I see that the underlying business objects still look very Jiwa 6 (BOProcess.StdFunctions).

Has the process changed significantly, or should I be able to just port that old breakout code to .NET ?


Oh, please don't port that old code!

Give me a few days and I'll provide a much cleaner solution for 7.00.157.00. I'll post back here the solution.


Hi; I don't mean to sound impatient (although our customer is), but any ETA on that code?

thanks
/Ryan

Re: Automating backorder processing in 7

PostPosted: Wed Jun 14, 2017 7:02 pm
by Mike.Sheen
Attached is a plugin which processes backorders when a shipment bookin is activated.

Unfortunately we don't have the mechanism in place to limit which backorders are processed - this has been added as DEV-6011.

Mike

Re: Automating backorder processing in 7

PostPosted: Wed Jun 14, 2017 7:18 pm
by pricerc
Thanks Mike, I'll check it out.

Re: Automating backorder processing in 7

PostPosted: Wed Jun 14, 2017 7:51 pm
by pricerc
Mike.Sheen wrote:Unfortunately we don't have the mechanism in place to limit which backorders are processed



what about selective inventory? I see a SelectiveInventory flag and a InvSelections collection?

Re: Automating backorder processing in 7  Topic is solved

PostPosted: Wed Jun 14, 2017 8:16 pm
by Mike.Sheen
pricerc wrote:what about selective inventory? I see a SelectiveInventory flag and a InvSelections collection?


Yes - that's possible - this will get passed to the stored procedure used to get the items to process.

I've updated the plugin (attached) to do this. I've also shown how you can override the stored procedure invoked (but commented that line out).

The relevant bit changed is as follows:

Code: Select all
// Process backorders
JiwaFinancials.Jiwa.JiwaBOProcess.StdFunctions boProcess = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaBOProcess.StdFunctions>(null);
boProcess.SetupProcessBackOrdersUnattended();
boProcess.SelectiveInventory = true;
//boProcess.StoredProcName = "your_sp_name"; // Make sure this accepts the same parameters as usp_Jiwa_GetBackOrderProcessList, and also returns an identical set of columns

// Filter only the inventory items on the BookIn
foreach(JiwaFinancials.Jiwa.JiwaLandedCost.BookIn.Line bookInLine in bookIn.Lines)
{
   JiwaFinancials.Jiwa.JiwaBOProcess.clsInventorySelection inventoryItem = new JiwaFinancials.Jiwa.JiwaBOProcess.clsInventorySelection() { InventoryID = bookInLine.Inventory.InventoryID, PartNo = bookInLine.Inventory.PartNo, Description = bookInLine.Inventory.Description };
   boProcess.InvSelections.AddItem(ref inventoryItem);
}
boProcess.Process();

Re: Automating backorder processing in 7

PostPosted: Wed Jun 14, 2017 8:26 pm
by pricerc
Cool.

and now for the next tricky bit. Not sure why I didn't think to ask this question earlier as well:

Can I get a list of orders that were released by the process so that I can send them to printers and/or EDI?

Or can I build/process the list myself using the ProcessSnapshotCreated event?