Developer forum

Forum » Integration » Integration Framework -> NAV (Currency and discounts)

Integration Framework -> NAV (Currency and discounts)

Magnus Holmberg
Reply

Hi,

Our customer would like to use discounts and therefor we wonder how this will work with the integration framework connected to NAV? Anyone have suggestion how this should be implemented?

They also would like to uset mutiple currencies like Swedish Crowns and Norwegian Crowns also via integration framework and NAV. Suggestion how to set this up?

The site is today working with Integration Framework to NAV and imports customers and products. And exporting orders to NAV.

Best regards.
/Magnus


Replies

 
Jonas Krarup Dam
Reply
This post has been marked as an answer

Hi Magnus,

It sounds like you are running batch integration, so I will answer under the assumption that there is no live integration.

Discounts:

Regarding discounts, this should be implemented in the example NAV code, so that discounts that are configured in Dynamicweb are exported to NAV, and created correctly on the resulting orders.

This means that you should be able to simply use the usual dynamicweb discount providers as you would if there where no integration. It is possible that some changes would need to be made to the NAV code, but that depends entirely on the specific implementation.

Currencies:

the NAV example code also includes functionality to export currencies from NAV, including conversion rates. This means that you should be able to run the site with multiple currencies, using the conversion rates from NAV.

I am not 100% sure if the NAV example code contains functionality to handle orders in different currencies, but I am sure that the information about which currency an order is placed in, is included when an order is exported. This means that your NAV developers should be able to create the orders with the right currency in the NAV tables - they just have to "respect" the prices that come from dynamicweb, since there is a risk of the conversion rate being different in the dynamicweb database.

I hope this helps you.

 

Regards, Jonas

Votes for this answer: 1
 
Magnus Holmberg
Reply

Hi again =)

Here is an example how a order and orderline with discount is sent to NAV through the batch integration (se attached file, navintegration.xml and the other for whole file).
But does not work.

Our NAV partner says in the NAV example code looks at OrderLineParentLineID.

Got any ideas?

 
Jonas Krarup Dam
Reply

Hi Magnus,

That is correct - when exporting a discount, the NAV code needs the OrderLineParentLineID.

Since this field is not included in the NavIntegration.xml (which looks like it's an export of an order from dynamicweb), I'm guessing that the column is missing in the mappings in the data integration activity that is being used.

If you add a mapping for that column, it should be included, and the NAV partner should have the information they need.

 
Magnus Holmberg
Reply

The OrderLineParentLineID is already mapped (see attached file)

Even if we have orderlines with discount everycolumn [OrderLineParentLineID]  in the EcomOrderLines tabell is empty.

Shouldnt this line have an OrderLineParentLineID?

OrderLineID    OrderLineDiscountID    OrderLineOrderID    OrderLineParentLineID
OL14670        SALESDISCNT23        WEB21997   

 

Best regards.
/Magnus

orderlineparentid.png
 
Jonas Krarup Dam
Reply

Oh - I see the problem.

The discount you are working with is an order discount, not a product discount.

order discounts have orderLineType =1

Product discounts have orderLineType=3

Order discounts are not associated with a specific product. As I understand it, there is no way to set up such a discount in NAV (please let me know if I'm wrong - I'm not an NAV expert). for this reason, importing these discounts has not been implemented in the NAV example code.

you can fix this by setting up discounts in dynamicweb that are associated with a specific orderline such as ProductDiscounts.

Or you can ask your NAV developers to extend the example code in some way, to handle these discounts that are not associated with a product.

 

Regards, Jonas

 

 
Magnus Holmberg
Reply

Which of theese discounts should work?
Only the first one thats named Product discount?












Regards
/Magnus

 
Jonas Krarup Dam
Reply

These should work:

 




 

I think


 

might work, but it's a bit of a special case, so if you need it you may want to test it out.

Regards, Jonas

 
Magnus Holmberg
Reply

A quick test of and .
 

Discounttype OrderLineID   OrderLineOrderID   OrderLineParentLineID   OrderLineType   OrderLineDiscountID
Product quantity discount OL16109 CART9109 NULL 3 SALESDISCNT25
  OL16108 CART9109 NULL 0 NULL
OL16117 CART9110 OL16110 3 SALESDISCNT25
  OL16110 CART9110 NULL 0 NULL

 

/Magnus

 
Jonas Krarup Dam
Reply

This is the problem with a system that evolves over time  - it's not always consistent :-)

I think this is a bug/mistake, and we're discussing if this should be changed, but we have to consider if this will have consequences for existing solutions.

otherwise, you may consider looking at the discount matrix for discounts - this has been released in 8.5, and should be more consistent in its behaviour. That means that as long as you select "Orderline discount" for "apply as", it should work with the integration.

With regards to the product quantity discount, I will have to discuss it with my collegues and get back to you.

 

/Jonas

 

You must be logged in to post in the forum