dynamicweb / DynamicWeb

Make feature requests for Dynamicweb in Issues section of this repository
https://doc.dynamicweb.dev/documentation/fundamentals/support/feature-requests.html
GNU General Public License v3.0
1 stars 0 forks source link

Order Payment and Shipping Methods code fields in Data Integration #116

Closed nunoaguiar closed 1 month ago

nunoaguiar commented 1 month ago

Is your feature request related to a problem? Please describe. We integrate orders using Data Integration Jobs. It's normal in our world that an Order Payment method and Order Shipping method are updated in the ERP. Use cases:

For the Data Integration job to work, we need to change some field on the order (i.e. OrderShippingMethod) and then run a SQL script to find a matching EcomShipId to update the Order accordingly (getting the proper Id, label, ...)

Describe the solution you'd like In the EcomOrders table, have columns to store the PaymentTermsCode, PaymentCode, ShippingCode and all other ERP fields to do proper updates of data (instead of using the OrderShippingMethod and PaymentShippingMethod (or some other custom field) for it. image

In other words:

Describe alternatives you've considered We are already updating the EcomShippingMethod and EcomPaymentMethod, but that feels "dirty" as we replacing a friendly name (EcomShippingMethod - which should be matching EcomShippings.ShippingName), with a value from the ERP (which could be "FDXGRD") to then try to match it EcomShippings on a column called ShippingCode (not the ShippingName)

Right now our solution works, but seems "creative". We would like to have a way that is much more obvious to update a record (order, ledger...) with an ID coming from an external system, and then matching it on ours to find the relevant data (DW Id, which then could have web-friendly labels, icons/images, ...)

Best Regards, Nuno Aguiar

DynamicRas commented 1 month ago

Hi Nuno,

I don't like having BC specific fields on EcomOrder table. What about making an update job which has conditionals for each payment and shipping type from BC and then updating the EcomShippingMethod or EcomPaymentMethod accordingly?

BR Rasmus Sanggaard

nunoaguiar commented 1 month ago

Hi Rasmus,

We're open to any other solution. I'm also not a great fan of having BC (external id fields really) fields directly there, so allow me to rephrase.

Examples where we have this working in an acceptable way

Examples where we have this would need to be improved

Another possible solution is to have the logic be built in the Order Provider.

Summary Considering that we not always control what values we get from 3rd party source data, we need to be able to match some values (external Ids) to Dynamicweb Ids. We sometimes do this with table scripts. We talked about having the ability to do custom scripts for each column mapping as well. This "request" is about exposing more situations we're coming across that currently require "creative" solutions.

Does this help?

DynamicRas commented 1 month ago

Hi,

I think I need a bit more context. The Code, Terms Code and Term are BC specific fields used in the Live Integration to send field.

Are you using OData as source? Why would you need the methods updated in DW? Why do 3. party or BC or whatever not know the ID if the order was created in DW?

Could you describe the flow and what you are trying to achieve then we can try to think of a way to solve it.

BR Rasmus Sanggaard

nunoaguiar commented 1 month ago

Hi Rasmus,

| Are you using OData as source? XML, but the problem is not the source, but the Destination (DW)

| Why would you need the methods updated in DW? This is common for us (B2B scenarios):

Does that clarify the request?

BBR Nuno Aguiar

DynamicRas commented 1 month ago

Hi Nuno,

Ok, know I think I understand the problem. A solution could be that the Order Provider makes a lookup when updating shipping and payment ID and updates the corresponding fields accordingly, as you also suggested, would that work for you?

BR Rasmus Sanggaard

nunoaguiar commented 1 month ago

Hi Rasmus,

That works just fine.

BR Nuno Aguiar

DynamicRas commented 1 month ago

Hi,

Cool. We will take a look at it. DevOps #20551.

BR Rasmus Sanggaard

DWDBE commented 3 weeks ago

Hi Nuno

could you provide some sample source data you are using for the import? And it would be nice to see what columns are you updating, so maybe you can share the sql scripts or source code you use to solve that issue

BR, Dmitrij

nunoaguiar commented 3 weeks ago

Hi Dmitrij,

I don't have a source sample data with me, but I can rephrase it in a more technical term that may help you.

In the EcomOrders table (in 9.17.5) we have the following columns

Comparing with the UI

It's our understanding that the Code and Agent * fields are basically values coming from the ERP. In a way we use them as "external id" values.

That said, here's the issue we're running into

And this is where the complexity/problems begin

  1. We need table scripts to look up in the EcomShipping table what is the Shipping Id, Name, Description and all other relevant fields WHERE OrderShippingMethodCode = "FDXGRD"
  2. The Order Provider does not list all columns mentioned above image

What we're discussing is a better way to handle problem 1. above. I guess 2 is easy to solve :)

The same thing would happen with Payments methods (i.e. started with Credit Card, but needs to be converted to Invoice)

Does this help?

Nuno Aguiar

DWDBE commented 2 weeks ago

Hi Nuno, yes, thx for the help. How about the field: [OrderShippingProviderData] - that contains the order.ShippingProviderValues Does it needs to be cleared once the shipping provider is changed? Or should it be cleared only if the updated shipping provider type is not the same as was before? Or it is ok to not change that field value? BR, Dmitrij

nunoaguiar commented 2 weeks ago

Hi Dmitrij,

Good question. I'd say we'd want to clear it, because:

Thoughts? Nuno