Hi there,
When downloading the Current XML for an order from the backend, the result is different from the standard order XML. I think it's because of this code:
private void GetCurrentXml(Settings settings) { Order order = (Order)Ribbon.DataContext.DataSource; var logger = new Logger(settings); string xml = new OrderXmlGenerator().GenerateOrderXml(settings, order, new OrderXmlGeneratorSettings { AddOrderFieldsToRequest = true, AddOrderLineFieldsToRequest = true, CreateOrder = true, Beautify = true, LiveIntegrationSubmitType = SubmitType.DownloadedFromBackEnd, ReferenceName = "OrdersPut" }, logger); StreamFile(xml, $"Order_{order.Id}.xml"); }
This code is not setting all properies of OrderXmlGeneratorSettings which GenerateOrderXml needs. It's missing at least these:
- ErpControlsDiscount
- ErpControlsShipping
- ErpShippingItemType
- ErpShippingItemKey
- CalculateOrderUsingProductNumber
Without these, the way shiping and discounts are generated is different (for example, ErpShippingItemKey is not added to the order XML).
Can this be fixed in LI? Maybe BuildOrderXml should gets its data from the currentSettings parameter instead of the settings parameter (which is the partially populated OrderXmlGeneratorSettings instance)?
Thanks!
Imar