Add/edit rows in existing Movement(PO)

Hi,

An interface was built between ERP software and Quantify. In one part of the interface a purchase order made in the ERP package is transferred to Quantify adding a new Movement.

Part of the code that is used:

Movement = Movement.NewMovement(MovementType.Ordered, False)

                    With Movement
                        '.OrderLoadType = MovementOrderLoadType.New
                        .MovementNumber = row.Item("OrderNumber").ToString.Trim
                        .BusinessPartnerID = Guid.Parse(My.Settings.BusinessPartnerId.ToString)
                        .DestinationID = Guid.Parse(My.Settings.DestinationID.ToString)
                        .BackOrderNumber = "BO-" & row.Item("OrderNumber").ToString.Trim
                    End With

However it does happen that the initial purchase order changes in the ERP software, either quantities of an existing row change or a new row is added to the order.

Since the Movementnumber in Quantify has to be unique as well, I was wondering whether there is a way to retrieve an existing Movement based on the MovementNumber instead of the MovementID (since we do not store the MovementID, unique identifier,in the ERP software)?

Bernice

Hello Bernice. Sorry for the delay in getting back to you. First, you’ll want to include the master list in the movement when creating a new one. This loads all of the parts (flagged below with ** for emphasis). Plus, you’ll want to use the variable in your With, not the object definition.

Dim mov as Movement = Movement.NewMovement(MovementType.Ordered, **True**)
With mov

If you’re going to be changing the movement instead of placing back-orders against it, you may consider editing the movement instead. You can later add parts to the order instead.

Also, I have added an overload to the Movement.GetMovement method that will allow you to fetch a Movement by number instead of ID. For now, you can store the ID somewhere. This will be available in the next release of Quantify.

’ Get ID
Dim moveID As Guid = mov.MovementID

Ultimately you will find it easiest to manage your equipment solely in Quantify (not your ERP software) and sync the asset value back to your accounting software as a single asset line item in the GL (scaffolding, different types, etc). Almost all of our customers do this. Asset value in Quantify is tracked by average, last, or custom cost and is also exposed int he API from the product catalogue, this also works per branch to calculate when there are multiple branches.

We have had customers try and sync their purchases with their accounting software and it has always proved to be very complex and difficult. Not anything to do with the API on either end but due to the complexity of what’s allowed (and not) in each software package. This is common with new equipment (as apposed to used, or ‘available’)