Page 1 of 1

Order Units on Pack Sizes

PostPosted: Mon May 11, 2015 3:36 pm
by Sunny
Hi,
We are upgrading one of our customers from 6.5.13 to Version 7. One of the features required to be ported across is their ability to overwrite the pack order size populated by JIWA in the Qty field, if a product has Order Units in the Supply tab. Eg, If you have 576 order units on a part, when raising a new order, 576 is shown on the purchase order, you then enter eg. 590, then it will update the Qty to 1,152, which is correct. We require this field to be overwritten, if it is required to order an odd lot. This was achieved by a breakout written in the PurchaseOrderOrderLineChangedEvent as below:

PurchaseOrderObject.OrderLines(LineKey).OrderUnits = 1
End Sub

Screen Shot attached.
Have you created a Plugin for this behaviour as yet and if not can we have one please?

Thanks and Regards.
Sunny

Re: Order Units on Pack Sizes  Topic is solved

PostPosted: Mon May 11, 2015 4:32 pm
by Mike.Sheen
Sunny wrote:Have you created a Plugin for this behaviour as yet and if not can we have one please?y


Hi Sunny,

As this is not a standard Jiwa feature in version 6 - but rather a customisation, we have not done a version 7 plugin for it.

It should be pretty simple, though - create a new plugin, add the purchase order Form to the forms tab, and in the Setup method of the FormPlugin class, add a handler for the Changed event of the Purchase Order Lines collection, and in that handler set the Order Units. Make sure you don't cause a stack overflow by setting the OrderUnits without first examining the PropertyName of the PropertyChangedEventArgs parameter (because setting the OrderUnits property inside a handler for the PO Lines changed event will cause in turn a Property changed event - it'll go around and around until your stack runs out of space).

Unfortunately, there is one small problem with this... the OrderUnits property of the Purchase Order Line class is read-only in version 7. I have logged this as bug 11707.

Mike

Re: Order Units on Pack Sizes

PostPosted: Thu May 14, 2015 4:51 pm
by Sunny
Thanks Mike. Will give it a try.
Sunny