Page 1 of 1

Purchase Orders setting QTYs to zero on close

PostPosted: Fri Dec 04, 2015 4:58 pm
by aegean66
We have began using a separate warehouse, and since then we have had an issue where if we set a purchase order to closed, it sets all the quantities on the order to zero.

This doesn't happen usually, and it still doesn't happen in our original warehouse. Sometimes we will restate a purchase order from closed to sent, and need the original quantities.

Any ideas why this is behaving differently from the original warehouse?

thanks
Damon.

Re: Purchase Orders setting QTYs to zero on close

PostPosted: Mon Dec 07, 2015 8:16 am
by Scott.Pearce
Upon closing a purchase order, the quantities will be set to that which was delivered (as per GRNs that reference the purchase order). The code that does this:

Code: Select all
    Public Sub CloseOrder()
        OnClosing()

        For Each Line As Line In Lines
            If Line.Delivered < Line.Quantity Then
                Line.Quantity = Line.Delivered
            End If
        Next Line

        _OrderStatus = JiwaApplication.Entities.PurchaseOrder.Workflow.Status.Closed

        Save()

        OnClosed()
    End Sub


As you can see, it is quite explicit and the behaviour does not alter based on warehouse.