Sales order line, check if price from Debtor Specific Prices

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

Sales order line, check if price from Debtor Specific Prices

Postby DannyC » Mon Apr 20, 2026 11:26 pm

I want to know the source price on each line of a sales order, e.g. debtor classification price, debtor specific price, default inventory price, group matrix price etc.

This line works when a new line is added to a sales order
Code: Select all
JiwaFinancials.Jiwa.JiwaPriceSchemes.ReturnedPrice returnedPrice = (JiwaFinancials.Jiwa.JiwaPriceSchemes.ReturnedPrice)soLine.PriceSelected;

but if I want to iterate through the line collection after a sales order is saved such as on the ReadEnd event, then it looks like
Code: Select all
soLine.PriceSelected
is null.

How can I determine if a sales order line price has been sourced from Debtor Specific Prices or any other price scheme element?
User avatar
DannyC
Senpai
Senpai
 
Posts: 720
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32

Re: Sales order line, check if price from Debtor Specific Pr

Postby SBarnes » Tue Apr 21, 2026 6:47 am

Whilst Scott or Mike may be able to suggest a better way to do this you could try calling RecalculatePrice on each line as that seems to set PriceSelected.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1697
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Sales order line, check if price from Debtor Specific Pr

Postby Mike.Sheen » Thu Apr 23, 2026 6:20 pm

DannyC wrote:but if I want to iterate through the line collection after a sales order is saved such as on the ReadEnd event, then it looks like
Code: Select all
soLine.PriceSelected
is null.

How can I determine if a sales order line price has been sourced from Debtor Specific Prices or any other price scheme element?


We don't persist to the database where the price came from - so create a custom field for the line to store the source of the price, and on the added event for the line, populate the custom field from the soLine.PriceSelected.

It won't help for existing orders already saved, but moving forward it will allow you to see the origin of the price.
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: 2584
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 812

Re: Sales order line, check if price from Debtor Specific Pr

Postby DannyC » Fri Apr 24, 2026 3:28 pm

create a custom field for the line to store the source of the price


Stuart & I were just discussing the exact same.

Good to get some validation.

Thanks
User avatar
DannyC
Senpai
Senpai
 
Posts: 720
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests