Skip to content

Instantly share code, notes, and snippets.

@xavierzwirtz
Created January 15, 2020 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavierzwirtz/a51ae572e3b2514e289d27811db120e9 to your computer and use it in GitHub Desktop.
Save xavierzwirtz/a51ae572e3b2514e289d27811db120e9 to your computer and use it in GitHub Desktop.
Imports BirdDogSoftware.Interfaces
Namespace Events
Public Class MagentoEvents
Public Shared Function GetItemQtyOnHand(
Connection As MagentoConnector.Connection,
Connector As IConnectorAccount,
Item As IItem
) as Maybe(Of Double)
dim qty As Double = 0
For Each loc As IItemLocation in Item.Locations
If {"368", "888"}.Contains(loc.Loc) Then
qty += loc.Qty_On_Hand
End If
Next
Return Maybe.Some(qty)
End Sub
End Class
End Namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment