Line items force backordered via plugin  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Line items force backordered via plugin

Postby Riyaz » Tue Mar 15, 2022 10:10 pm

Hi There

Is there a way to force the line items to go into back orders by making the quantity this delivery for that line item to be 0.

We are trying to do this via SalesOrderLine attribute as below but it wont reflect.

Line.QuantityBackOrdered = Line.QuantityOrdered;
Line.QuantityThisDelivery = 0;

Kindly advise
Riyaz
Kohai
Kohai
 
Posts: 254
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Line items force backordered via plugin

Postby SBarnes » Wed Mar 16, 2022 9:36 am

That should work but without seeing the plugin in its entirety its hard to see why it's not working, the product also needs to be to back orderable obviously.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Line items force backordered via plugin

Postby Riyaz » Wed Mar 16, 2022 12:58 pm

Hi Stuart

Pls find the plugin attached,
Attachments
Plugin Test - New Plugin Sales Orders.xml
(35.87 KiB) Downloaded 451 times
Riyaz
Kohai
Kohai
 
Posts: 254
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Line items force backordered via plugin  Topic is solved

Postby SBarnes » Wed Mar 16, 2022 1:46 pm

The attached works in a Jiwa Demo database all I did was change your save end to a save start and removed the call to sales order save, which is probably a better way to do it as with what you had the order is being saved twice because save end is called after Jiwa has saved the order and then you are doing it again.

You could also put the code in the sales order line added and sales or changed events so the user sees that is going to back order before they save which might be a bit more user friendly but if you do you will probably need to detach and then reattach the events after the code fires so you don't have the event handler firing the same event on itself.
Attachments
Plugin Test - New Plugin Sales Orders.xml
(35.88 KiB) Downloaded 342 times
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 1 guest