Developer forum

Forum » Integration » LiveIntegration when order is sumitted, then price is wrong in DW and receipt on orderline

LiveIntegration when order is sumitted, then price is wrong in DW and receipt on orderline

Jan Sangill
Reply

Hi,
I have an issue with live integration and my shop.
It seems the creation of an order sets the standard price for an orderline, and not the discountet price from BC. Discounts are handled by BC.

I can see in my log that what is sent to the BC is "almost" correct.

02-16-2024 03:10:45.348 : DebugInfo: Updating order with ID: ORDER5043. Complete: True. Order submitted from the backend: False
02-16-2024 03:10:45.348 : DebugInfo: Request CalculateOrder (ID: ORDER5043, CreateOrder: True) sent: '<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<tables source="LiveIntegration" submitType="LiveOrderOrCart" referenceName="OrdersPut">
  <table tableName="EcomOrders">....OrderLines under here

      <column columnName="OrderLineQuantity">83</column>   
      <column columnName="OrderLinePriceWithoutVat">19944.07</column> WRONG PRICE
      <column columnName="OrderLineUnitPriceWithoutVat">122.84</column> CORRECT PRICE
      <column columnName="NetPrice">240.29</column> What is NetPrice taken from?

The Response to this is:
   <column columnName="OrderLineQuantity"><![CDATA[83]]></column>
      <column columnName="OrderLinePriceWithoutVat"><![CDATA[19,944.07]]></column>WRONG PRICE
      <column columnName="OrderLineUnitPriceWithoutVat"><![CDATA[240.29]]></column>WRONG PRICE

The totalprice is correct when it is completed for the Order, butr the orderlines are wrong. This only happens when discounts from ERP.

Any ideas?


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jan,

can you check the Live integration logs if you get correct price for the GetProductsInfo request for this product and customer?
Have you checked the Live integration checkbox "ERP controls discount calculations"?

BR, Dmitrij

 
Jan Sangill
Reply

Hi Dmitriy,
"Have you checked the Live integration checkbox "ERP controls discount calculations"?" - Yes.
The GetProductsInfo returns all correct.
Regards
Jan

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jan,

that is strange that it works for the GetProductsInfo and doesn't for the CalculateOrder since it is the same code that is used to calculate the lowest prices in the GetProductsInfo and CalculateOrder requests, so maybe there is some difference in the Currency/Quantity which may be different in those requests?
Do you have some external apps installed in BC that might affect the lowest prices calculations or implemented custom event subscribers to the Dynamicweb Plugin unit?
BR, Dmitrij

 
Jan Sangill
Reply

Hi Dmitriy,

We do have custom event subscribers, but in my test they have been disabled. Or so they told me. I will confirm this.
And get back to you.

 
Jan Sangill
Reply

Hi again.

I have had a time to look at it again - and the ERP guys swears that the endpoint I am calling have no custom code in regards to Dynamicweb anymore on it.
I have attached 3 files.

A send request to Order. If I send without CreateOrder then the numbers are different than if CreateOrder true.

If I use the "Ecom:Order:OrderLine.UnitPrice.PriceWithoutVAT" tag - before creating the order - everything is shown correct here. When creating the order, then this tag and the amount is not working. Moreover, the tags like Ecom:Order.PriceWithoutFees.PriceWithoutVATFormatted is also different. I am sure other tags seem different also, because of the change in unitprice.

Does that make sense? Try and look at the three files and let me know your thoughts. 

All help is appreciated

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jan,

I can not find out the problem using the information provided. 
Can you check if you run the request and get the correct unit price from it
(make a new request in the Endpoint Management and check the response):
<GetEcomData ExternalUserId="13" AccessUserCustomerNumber="74782258">
  <tables>
    <Products type="filter">
      <Product>
        <ProductId>83309300862</ProductId>
        <ProductVariantId />
        <ProductNumber>83309300862</ProductNumber>
        <ProductIdentifier>83309300862</ProductIdentifier>
        <CurrencyCode>DKK</CurrencyCode>
        <Quantity>80</Quantity>
      </Product>
    </Products>
  </tables>
</GetEcomData>

Do you use/have you activated the New Prices feature in BC or is it a regular/not new prices calculations used in BC?

BR, Dmitrij

 
Jan Sangill
Reply

Hi, if I call this:

<GetEcomData ExternalUserId="13" AccessUserCustomerNumber="74782258" VatCountryCode="DK" VatPostingGroup="">
  <tables>
    <Products type="filter" unitPrices="true">
      <Product>
        <ProductId>83309300862</ProductId>
        <ProductVariantId></ProductVariantId>
        <ProductNumber>83309300862</ProductNumber>
        <ProductUnitId>Unit_STK</ProductUnitId>
        <ProductIdentifier>83309300862..LANG1</ProductIdentifier>
        <CurrencyCode>DKK</CurrencyCode>
        <Quantity>80</Quantity>
      </Product>
    </Products>
  </tables>
</GetEcomData>

I get this (correct price):

<?xml version="1.0" encoding="utf-8"?>
<tables version="1.2.0.36_NAV23.0.16637.0">
  <table tableName="EcomProducts">
    <item table="EcomProducts">
      <column columnName="ProductId"><![CDATA[83309300862]]></column>
      <column columnName="ProductVariantId"><![CDATA[]]></column>
      <column columnName="ProductIdentifier"><![CDATA[83309300862..LANG1]]></column>
      <column columnName="ProductNumber"><![CDATA[83309300862]]></column>
      <column columnName="ProductName"><![CDATA[PROFILPLATTE HM 60.8X30.6X1.5 SUPERPRO HWE PROFIL NR. PL19813 ]]></column>
      <column columnName="ProductPrice"><![CDATA[126.521488800000012]]></column>
      <column columnName="ProductPriceWithVat"><![CDATA[158.152]]></column>
      <column columnName="ProductStock"><![CDATA[0]]></column>
      <column columnName="ProductCurrencyCode"><![CDATA[]]></column>
      <column columnName="ProductItemDiscGroup"><![CDATA[833093]]></column>
      <column columnName="ProductVendorNo"><![CDATA[]]></column>
      <column columnName="ProductVendorItemNo"><![CDATA[PL19813]]></column>
      <column columnName="ProductLeadTimeCalculation"><![CDATA[0D]]></column>
      <column columnName="ProductBlocked"><![CDATA[No]]></column>
      <column columnName="ProductMinimumOrderQuantity"><![CDATA[6]]></column>
      <column columnName="ProductOrderMultiple"><![CDATA[0]]></column>
      <column columnName="ProductItemCategoryCode"><![CDATA[W6-7]]></column>
      <column columnName="ProductDynMinQtySales"><![CDATA[6]]></column>
      <column columnName="ProductDynCalcCostprice"><![CDATA[151.67]]></column>
      <column columnName="ProductDynWebItem"><![CDATA[No]]></column>
      <column columnName="ProductDynReorderItem"><![CDATA[Yes]]></column>
      <column columnName="ProductDynFabrikat"><![CDATA[JUNGET]]></column>
      <column columnName="ProductDynSalesQuantity"><![CDATA[1]]></column>
      <column columnName="ProductDefaultUnitId"><![CDATA[Unit_STK]]></column>
    </item>
  </table>
  <table tableName="EcomPrices">
    <item table="EcomPrices">
      <column columnName="PriceProductId"><![CDATA[83309300862]]></column>
      <column columnName="PriceUserCustomerNumber"><![CDATA[74782258]]></column>
      <column columnName="PriceProductUnitId"><![CDATA[Unit_STK]]></column>
      <column columnName="PriceQuantity"><![CDATA[1]]></column>
      <column columnName="PriceAmount"><![CDATA[126.521488800000012]]></column>
      <column columnName="PriceAmountWithVat"><![CDATA[158.152]]></column>
    </item>
  </table>
</tables>

They are using the old price calculations

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jan,
Can you explain what is not right with more details?
Does it mean that CalculateOrder request and GetProductsInfo works correct but CreateOrder returns wrong prices (wrong total order prices)?
Can you send me all your custom subscribers code if you have any implemented, maybe them are making a differences/problems?
Can you create an order in BC manually with the same customer, product, qty, currency and compare its prices with the returned from Dynamicweb Codeunit?
If possible it would be helpful to see some the screens/video on how the discounts are setup for this item/customer in BC and how the created order and its prices is looked in BC,
you can email that to dbe@dynamicweb-cms.com
BR, Dmitrij

 
Jan Sangill
Reply

I will return with this one. Much information to gather.

 
Jan Sangill
Reply

Hi Dmitriy,

After a lot back and forth with the ERP guys, we finally managed to find the issue. It was indeed in the ERP customizations. Thank you for the assistance.

 

You must be logged in to post in the forum