Sales order lines loop - Back ordered items

Discussions relating to plugin development, and the Jiwa API.

Sales order lines loop - Back ordered items

Postby Riyaz » Tue Jun 02, 2020 3:46 pm

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
Attachments
SO85494.png
SO85494
SO85493.png
SO85493
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales order lines loop - Back ordered items

Postby Scott.Pearce » Wed Jun 03, 2020 11:57 am

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.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Sales order lines loop - Back ordered items

Postby Riyaz » Wed Jun 03, 2020 12:11 pm

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 ?
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales order lines loop - Back ordered items

Postby Mike.Sheen » Wed Jun 03, 2020 12:14 pm

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.
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
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Sales order lines loop - Back ordered items

Postby Riyaz » Wed Jun 03, 2020 12:19 pm

Hi Mike

Yes, and also need some customization made too, hence trying with a clone.
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales order lines loop - Back ordered items

Postby Scott.Pearce » Wed Jun 03, 2020 12:21 pm

we are having some issues with the items that are backordered,

What's the issue with the standard plugin exactly?
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Sales order lines loop - Back ordered items

Postby Riyaz » Wed Jun 03, 2020 12:28 pm

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
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales order lines loop - Back ordered items

Postby Riyaz » Mon Jun 08, 2020 12:55 pm

Hi There

Any advise for me pls so we can continue on this.
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales order lines loop - Back ordered items

Postby Mike.Sheen » Mon Jun 08, 2020 2:00 pm

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.
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
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests