Hi,
I have the following scenario.
The client has Line Discount Trade Agreements configured for customers.
For a single customer there could be multiple Line Discount TA's configured for the same item and well as inventory dimensions, the only difference being the applicable date and the discount %.
Some customers also have a combination of All, Group and Table codes with various discount % and they could all be "active" at the same time
For the most part the discounts are created with "Find Next" = false.
Standard FO will use the All > Group > Table hierarchy to find an applicable discount and will mostly settle on the lowest discount value depending on this hierarchy and whether or not "Find Next" is true or false as well as the price attribute combination rank.
My requirement is to override this logic at sales line creation and find the single highest applicable discount % regardless if this value falls under All, Group or Table.
I have had a look at the logic in SalesLine.SetPriceDisc and the subsequent call stack but I am unsure where exactly to add logic to override this safely...
If anyone has had this requirement or could offer some guidance it would be greatly appreciated.
Thank you in advance.