Page 1 of 1

Sales order lines loop - Back ordered items

PostPosted: Tue Jun 02, 2020 3:46 pm
by Riyaz
Hi There

With the move order lines plugin, we are having some issues with the items that are backordered, as they wont reduce the quantity moved to the new order. Hence we using custom code for this, all works well except the QuantityAvailable gets increased by that amount all the time.

So the back ordered quantity successfully moves to new order and its also reduces on the existing one, but it increases the quantityavailable by the amount in new order,

Pls see screenshot, the first one SO 85493, the order quantity gets set to 0's correctly, but quantityavailable was -67 first before moving, and after moving to order SO 85494 it became -69

Below is the code we are using, the IF part works just fine, its just the ELSE part, we're having problem with. Kindly advise.

If existingSalesOrderLine.QuantityBackOrdered > 0 Then
If existingSalesOrderLine.QuantityBackOrdered > quantityTaken Then
existingSalesOrderLine.HiddenSetQuantityBackOrdered(existingSalesOrderLine.QuantityBackOrdered - quantityTaken)
Else existingSalesOrderLine.QuantityBackOrdered = quantityTaken
existingSalesOrderLine.HiddenSetQuantityOrdered(0)
existingSalesOrderLine.HiddenSetQuantityThisDelivery(0)
existingSalesOrderLine.HiddenSetQuantityBackOrdered(0)
End If
End If

Re: Sales order lines loop - Back ordered items

PostPosted: Wed Jun 03, 2020 11:57 am
by Scott.Pearce
I don't think you should be using the "Hidden" functions - they bypass the business logic. You may find that the source sales order actually has linedetails when it shouldn't have because of this bypass. Your stock will be out.

Re: Sales order lines loop - Back ordered items

PostPosted: Wed Jun 03, 2020 12:11 pm
by Riyaz
Hi Scott

Thanks for the reply, I was just following the jiwa standard plugin for move lines, can you pls advise how else to achieve this, would you want me to set like this, lineDetails.QuantityBackOrdered = 0 ?

Re: Sales order lines loop - Back ordered items

PostPosted: Wed Jun 03, 2020 12:14 pm
by Mike.Sheen
Riyaz wrote:Hi Scott

Thanks for the reply, I was just following the jiwa standard plugin for move lines, can you pls advise how else to achieve this, would you want me to set like this, lineDetails.QuantityBackOrdered = 0 ?


Hi Riyaz,

Are you saying our standard "Move Lines to New Order" plugin doesn't work properly when there are backorders on one or some of the lines? If so, we'll fix that.

Re: Sales order lines loop - Back ordered items

PostPosted: Wed Jun 03, 2020 12:19 pm
by Riyaz
Hi Mike

Yes, and also need some customization made too, hence trying with a clone.

Re: Sales order lines loop - Back ordered items

PostPosted: Wed Jun 03, 2020 12:21 pm
by Scott.Pearce
we are having some issues with the items that are backordered,

What's the issue with the standard plugin exactly?

Re: Sales order lines loop - Back ordered items

PostPosted: Wed Jun 03, 2020 12:28 pm
by Riyaz
Basically couple of things

1/ The original order wont get processed automatically, whose line items quantities became zero as a result of the move

2/ The backorder wont work, it moves the items to the new order, but also increases (duplicates) the Quantity Available

Other than this, we need some customizations made too, which are working just fine now, only stuck with this scenario, when the quantityavailable also gets increased after the move

Re: Sales order lines loop - Back ordered items

PostPosted: Mon Jun 08, 2020 12:55 pm
by Riyaz
Hi There

Any advise for me pls so we can continue on this.

Re: Sales order lines loop - Back ordered items

PostPosted: Mon Jun 08, 2020 2:00 pm
by Mike.Sheen
Riyaz wrote:1/ The original order wont get processed automatically, whose line items quantities became zero as a result of the move


We never intended for it to process the original sales order automatically, so we don't even try to process it - and changing that behaviour so it does process the order when lines are moved won't suit everyone, so that's not something we're willing to do. You can do that yourself in your own version of the plugin.

Riyaz wrote:2/ The backorder wont work, it moves the items to the new order, but also increases (duplicates) the Quantity Available


I'm not seeing that in my testing on Demo data. Where are you seeing the Quantity Available being duplicated?

In any event, the issues sound like more of a product support issue than a technical / programming guidance / help issue - you should lodge an issue on our helpdesk for that.