Unit Of Measure  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Unit Of Measure

Postby Ernst » Wed Jul 31, 2019 1:54 pm

Am trying to default the Unit of Measure to a different value in the sales order line add plugin in JIWA 7.02.
Had coded below, But does not seem I can assign the recid so easily. Do I need to do something with the collection to get this to work..

Thanks for help.


' Check For Default Unit Of Measure.....

With Item.Manager.Database
Dim SQL As String = "select top 1 Ltrim(recid) as UOMRecid from IN_UnitOfMeasure where IN_Main_InventoryID = '" & Item.InventoryID & "' and PartNo = 'DEFAULT' "
Dim SQLReader As SqlDataReader = Nothing
' Dim SQLParam As SqlParameter
'
Using SQLCmd = New SqlCommand(SQL, .SQLConnection, .SQLTransaction)
'
Try

SQLReader = SQLCmd.ExecuteReader()
'
If SQLReader.Read = True Then
msgbox( .Sanitise(SQLReader, "UOMRecid"))
Item.UnitOfMeasure.Recid = .Sanitise(SQLReader, "UOMRecid")

Else
End If
'
Finally
If Not SQLReader Is Nothing Then
SQLReader.Close()
SQLReader = Nothing
End If
End Try
End Using
'
End With
User avatar
Ernst
Regular Contributor
Regular Contributor
 
Posts: 99
Joined: Tue Feb 19, 2008 2:43 pm
Topics Solved: 5

Re: Unit Of Measure  Topic is solved

Postby Mike.Sheen » Wed Jul 31, 2019 1:59 pm

Just set the UnitOfMeasure of the sales order line to be an item in the UnitOfMeasureCollection of the line.

eg - to try and give you something which should work with your code sample (I'm assuming item is a sales order line instance - you like making us guess, don't you?):

Code: Select all
item.UnitOfMeasure = item.UnitOfMeasureCollection(.Sanitise(SQLReader, "UOMRecid"))
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
Jiwa Shihan
Jiwa Shihan
 
Posts: 1448
Joined: Tue Feb 12, 2008 10:12 am
Location: North Sydney
Topics Solved: 486

Re: Unit Of Measure

Postby Ernst » Wed Jul 31, 2019 2:04 pm

Now why didnt I think of that...;)

Thanks works a treat.
User avatar
Ernst
Regular Contributor
Regular Contributor
 
Posts: 99
Joined: Tue Feb 19, 2008 2:43 pm
Topics Solved: 5

Re: Unit Of Measure

Postby Ernst » Wed Jul 31, 2019 2:14 pm

This is a great feature, if you want to sell your items in Packs, but keep them in units. It changes the default UOM to the packs, and the qty will auto change to the multiple of the pack, a bit like the PO system does order units.

Is going to be very useful for customers.

A default tick on the UOM line in a future upgrade, would be great also.

Thanks
User avatar
Ernst
Regular Contributor
Regular Contributor
 
Posts: 99
Joined: Tue Feb 19, 2008 2:43 pm
Topics Solved: 5

Re: Unit Of Measure

Postby Mike.Sheen » Wed Jul 31, 2019 2:23 pm

Ernst wrote:A default tick on the UOM line in a future upgrade, would be great also.


As UOM's can be configured to be sell, purchase or both - it would probably would be better to have a way of indicating the default sell UOM and default Purchasing UOM - and it's not really going to cut it to put that per UOM in the inventory maintenance as you might also want the default to be the Stock Keeping Unit.

So, I'd suggest two drop-down combo boxes on the Unit Of Measure Tab, next to the Stock Keeping Unit textbox which lists the SKU text and each UOM - one combo for default sell UOM and one for default purchase UOM.

Ernst wrote:This is a great feature, if you want to sell your items in Packs, but keep them in units. It changes the default UOM to the packs, and the qty will auto change to the multiple of the pack, a bit like the PO system does order units.

2016 called, they want their news back.. Unit Of Measure has been in the software for literal years - have you just noticed it?
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
Jiwa Shihan
Jiwa Shihan
 
Posts: 1448
Joined: Tue Feb 12, 2008 10:12 am
Location: North Sydney
Topics Solved: 486

Re: Unit Of Measure

Postby Ernst » Wed Jul 31, 2019 2:33 pm

Mike.Sheen wrote:- and it's not really going to cut it to put that per UOM in the inventory maintenance as you might also want the default to be the Stock Keeping Unit.


You could ignore the UOM tab, in which case UOM is Stock Keeping Unit, Or if you wanted to use the UOM tab, Specify the Stock keeping Unit with a Quantity Inner of 1, and Tick that as default sales.
Certainly 2 default would be required.

Mike.Sheen wrote: 2016 called, they want their news back..Unit Of Measure has been in the software for literal years - have you just noticed it?


We only notice things when the customer ask us to do something with it.. ;) I think they have been waiting to see if its going to be a permanent feature, or a fly by night..
User avatar
Ernst
Regular Contributor
Regular Contributor
 
Posts: 99
Joined: Tue Feb 19, 2008 2:43 pm
Topics Solved: 5


Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron