Recalcing Qty Available on SO lines  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Recalcing Qty Available on SO lines

Postby DannyC » Thu May 05, 2022 2:13 pm

See attached plugin.
I want to change the calculation for the Qty Available column to also include backorders on unprocessed orders.

I'm confident my calculation is sound, but after I've added a line, the Qty Avail still gets displayed as the Jiwa default value - which is only backorders from processed orders, i.e. data in the IN_OnBackorder table.

I suspect I'm not hooking the correct event. I've tried both
salesOrderForm.SalesOrder.SalesOrderLines.Added
and
salesOrderForm.SalesOrder.SalesOrderLineAdded.

Suggestions?
Attachments
Plugin Attkey - Recalc Qty Available to incude Unprocessed backorders.xml
(34.98 KiB) Downloaded 40 times
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Recalcing Qty Available on SO lines  Topic is solved

Postby Mike.Sheen » Thu May 05, 2022 2:53 pm

The QuantitySOHAvailable property will be set whenever the QuantityThisDelivery property changes also - and that gets changed after the salesOrderForm.SalesOrder.SalesOrderLines.Added and salesOrderForm.SalesOrder.SalesOrderLineAdded events.

Try the AddInventoryItemEnd event instead - but note that if the user changes any of the quantity fields, then it will get reset - so you'd be better off with the Lines PropertyChanged handler where the property name is "QuantityThisDelivery".

Depending on what you need, you might find handling the LineDisplayed event of the form and poking the desired value into the grid instead might work better. I'd normally try to steer away from that - but if it's just to display a value and not to change decisions over how much to backorder or anything, then it's a fairly safe route to take.
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: Recalcing Qty Available on SO lines

Postby DannyC » Thu May 05, 2022 3:18 pm

Cheers.
Thx for the info
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 10 guests