Not changing Quantities Back Ordered on Sales order Line  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Not changing Quantities Back Ordered on Sales order Line

Postby SBarnes » Sun Sep 25, 2022 12:37 pm

If on a sales order you call MakeNewSnapshot with no parameters and the try to change Quantity Back Ordered on any line in the sales order, the property is not changed and no error is produced I know why in the logic it is not changing the value because NewManualSnapForDeliveries is then passed in as true but wouldn't this be a bug as the assumption is the code did change the back order quantity?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Not changing Quantities Back Ordered on Sales order Line

Postby Mike.Sheen » Tue Sep 27, 2022 3:36 pm

SBarnes wrote:wouldn't this be a bug as the assumption is the code did change the back order quantity?


What code changed the backorder quantity?

When invoking MakeNewSnapshot, if the optional parameter NewManualSnapForDeliveries is not supplied, or is true, then we allow the increase of the delivery quantity.

If MakeNewSnapshot was invoked with the parameter set to false, then we allow the decrease of back orders to effectively cancel the back orders.
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: Not changing Quantities Back Ordered on Sales order Line

Postby SBarnes » Tue Sep 27, 2022 3:38 pm

The code was changing the back order quantity to zero, my point is it looks like its made the change when it hadn't
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Not changing Quantities Back Ordered on Sales order Line

Postby Mike.Sheen » Tue Sep 27, 2022 3:40 pm

SBarnes wrote:The code was changing the back order quantity to zero


We don't let you set the back order quantity if MakeNewSnapshot was invoked with NewManualSnapForDeliveries set to true.

Invoking NewManualSnapForDeliveries with NewManualSnapForDeliveries will allow the cancelling of backorders.
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: Not changing Quantities Back Ordered on Sales order Line

Postby SBarnes » Tue Sep 27, 2022 3:42 pm

Yes I know but should the code throw an exception for the not allowed change, otherwise from the outside it looks like it has done it?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Not changing Quantities Back Ordered on Sales order Line  Topic is solved

Postby Mike.Sheen » Tue Sep 27, 2022 3:50 pm

SBarnes wrote:Yes I know but should the code throw an exception for the not allowed change, otherwise from the outside it looks like it has done it?


We behave that way to suit the users of the user interface.

Forms and API both use the underlying business logic, and we sometimes do silently change / modify things when the user keys it in instead of throwing an error, as the users don't like error messages - and we do this change / modifying inside the business logic.

We could add logic into the UI to anticipate when this would cause an exception (such as setting min or max values for the grid cells), and then also modify the business logic to throw an exception instead of ignoring / adjusting, or we could catch specific exceptions in the UI and swallow them - but logic or complexity in general in the UI isn't something I'm terribly fond of - I'd much rather it just be a really dumb presentation layer.

I'd also rather not have the silly rule that the user needs to know when creating a new snapshot if it is to cancel backorders or fulfill the backorders - just let them do either!
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 38 guests