Developer forum

Forum » Integration » Line discount %/Discount groups in BC18

Line discount %/Discount groups in BC18

Chris Søgaard
Chris Søgaard
Reply

Hi

We have an issue on a client that uses D365 BC Cloud and recently updated to BC18 and also updated the codeunit to 1.2.0.13. Problem is that after the update, the live integration no longer shows the correct price on product pages, in cart and on checkout page, if that customer has a line discount % in BC. We can see in previous tests from screenshots, that it worked before the update, but it no longer shows the correct price. Testing the live integration from the test tool doesn't return the correct price either.

The funny thing is, that if the customer has a fixed net price, the price is shown correctly on the site. Also when completing the order and sending it to BC, the order XML returned, includes the correct line discount on the order.

I have disabling different settings in the live integration, but without an luck. Could there be a bug in the newest version of the code unit?

BR Chris


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
Hi Chris, Could be a bug. What is your setup in BC? Are using a new feature introduced in BC18 for calculating the prices? Can you make a screens of your customer discount settings and item prices? Also make a screen of the Live integration settings Kind regards, Dmitrij
 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitriy

Weve tried different settings in BC and with the live integration. Here's some screenshots from the customers BC. These screenshots show a setup with the new feature in BC18, but we've also tried the regular "old" one, that doesn't work either.

This is a picture of the customer card showing that the customer has the discount group "STAFFEL3":

Going into the "Price List Lines" on the item in BC shows this line, indicating a line discount of 6,9%:

This is a screenshot of the settings of the live integration on the solution:

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Chris,
does it work when you setup it for just one customer instead of a group?

Regards, Dmitrij

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitriy 

No it does not work regardless of whether the line discount is applied to a Group or to a specific customer number.

BR Chris

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Is this option(screen below) enabled or disabled?
When it is disabled(default) the everything should work as before with previous versions, when it is enabled a new price calculation logic should be applied.

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitriy

This feature is enabled in the customer BC.

Are you syaing that Code Unit v. 1.20.0.13 does not support calculating the prices with this feature enabled?

BR Chris

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Chris,
it supports it, but probably there is a bug for this case. It will be fixed in the next Codeunit version.
Could you try to set it with Customer Price Group instead:

Kind regards, Dmitrij

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitriy

Unfortunately the customer does not use this feature, and does not have the proper knowledge to set this up for a reliable test.

BR Chris

 
Jannich Ariyanayagam
Jannich Ariyanayagam
Reply

Hi Dmitriy,

When is the next codeunit version released we experience the exact same issue.

Best regards Jannich

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi guys,

the new version of the code unit for BC18 with this bug fixed is now available on the MS App source, it is 1.2.0.14 version.
So you can now try to update the extension and check it.
Kind regards, Dmitrij

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitrij

It fixed some of the issues, but the line discounts will in some cases be applied where they shouldn't, if we refer to how BC calculates prices from standard. I will try and explain the issue here. Furthermore I have some pictures that would elaborate the issue in case these are needed, but they are not for sharing with public.

Our client have a good example of what the issue is.

  • For a specific product there's a retail price of 263,48 DKK.
  • This product is also part of a "Sales price list" that applies to all customers and gives a price of 150 DKK.
  • This product is also part of a "Sales price list" that applies to customer "58622000" and gives a price of 170 DKK.
  • On both "Sales price list" the line for this product has the checkboxes "Allow line Disc." and "Allow invoice Disc." unchecked, which will mean that line discounts should not be applied to this price.
  • Customer "58622000" is also a part of a "Customer Discount Group" which applies to this product as well and gives 25,37% line discount.
  • As "Allow line Disc." and "Allow invoice Disc."  are unchecked on both "Sales price list", there's in theory 3 prices in play here:
    • The "Sales price list" for all customers gives a price of 150 DKK
    • The "Sales price list" for customer "58622000" gives a price of 170 DKK
    • The "Customer Discount Group" gives a price of 196,64 DKK (retail price 263,48 DKK minus 25,37% line discount)

According to the above explanation, the cheapest price for this customer is 150 DKK, and this is also the value being applied in BC, when they manually create an order in BC. But the code unit returns 126,87 DKK which correlates with the price from the customer specific "Sales price list" (170 DKK) minus the line discount of 25,37%. This is not expected as the checkboxes for line discount on both "Sales price list" is unchecked, and line discount should not be applied to this special price. Also it seems as if the price from the "Sales price list" for all customers is not taken into account here when calculating the prices.

BR Chris 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Chris,

thx for the feedback, indeed this is another bug. We are trying to solve it asap. As a workaround you can use this subscriber that should calculate the price correctly now.
This suscriber only solves the problem with customer specific product prices.
So you should try it for the request like that:

<GetEcomData ExternalUserId="CT002715" AccessUserCustomerNumber="20000">
  <tables>
    <Products type="filter">
      <Product>
        <ProductId>1900-S</ProductId>
        <ProductVariantId></ProductVariantId>
        <ProductNumber>1900-S</ProductNumber>
        <ProductIdentifier>1900-S..LANG1</ProductIdentifier>
        <CurrencyCode>DKK</CurrencyCode>
        <Quantity>20</Quantity>
      </Product>
    </Products>
  </tables>
</GetEcomData>

Let me know how it goes. We are also working to solve that for orders.
Best regards, Dmitrij

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitrij

Thank you, we will test the subscriber attached to this task, and I will let you know how it goes.

Just a quick information about the order calculation, that I did not give in last description. When we calculate the order, it gives a different price, so it might be something else here:

Product information shows 126,87 DKK pr. unit

Order calculation shows 170 DKK pr. unit.

It would be expected to be 150 DKK pr. unit for both.

Hope this helps you.

Br Chris

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitrij

The subscriber you sent me worked for calculating product prices on product info pages, so that's indeed a step forward. 

Only thing missing now is correct order calculation.

BR Chris

 

You must be logged in to post in the forum