Skip to content

Commit

Permalink
Include shipping address code from on order to BC
Browse files Browse the repository at this point in the history
  • Loading branch information
DWDBE committed Nov 18, 2024
1 parent 7a96c79 commit 1a84a8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.4.10</Version>
<Version>10.4.11</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>Live Integration</Title>
<Description>Live Integration</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static void AddCustomerInformation(Settings currentSettings, XmlElement
/// </summary>
/// <param name="orderNode">The order node.</param>
/// <param name="order">The order.</param>
private void AddOrderDeliveryInformation(XmlElement orderNode, Order order, User user)
private void AddOrderDeliveryInformation(OrderXmlGeneratorSettings settings, XmlElement orderNode, Order order, User user)
{
AddChildXmlNode(orderNode, "OrderDeliveryName",
!string.IsNullOrWhiteSpace(order.CustomerName) ? order.CustomerName : !string.IsNullOrWhiteSpace(user?.Name) ? user.Name : order.DeliveryName);
Expand All @@ -95,6 +95,14 @@ private void AddOrderDeliveryInformation(XmlElement orderNode, Order order, User
AddChildXmlNode(orderNode, "OrderDeliveryPhone", order.DeliveryPhone);
AddChildXmlNode(orderNode, "OrderDeliveryFax", order.DeliveryFax);
AddChildXmlNode(orderNode, "OrderDeliveryCompany", order.DeliveryCompany);
if (settings.CreateOrder && order.DeliveryAddressId > 0)
{
var address = UserManagementServices.UserAddresses.GetAddressById(order.DeliveryAddressId);
if (address is object)
{
AddChildXmlNode(orderNode, "OrderDeliveryAddressId", !string.IsNullOrEmpty(address.ExternalID) ? address.ExternalID : address.UniqueIdentifier);
}
}
}

/// <summary>
Expand Down Expand Up @@ -190,7 +198,7 @@ private XmlNode BuildOrderXml(Settings currentSettings, XmlDocument xmlDocument,
var user = UserManagementServices.Users.GetUserById(order.CustomerAccessUserId);

AddCustomerInformation(currentSettings, itemNode, order, user);
AddOrderDeliveryInformation(itemNode, order, user);
AddOrderDeliveryInformation(settings, itemNode, order, user);

// do not use order.Modified in XML unless the field can be ignored for hash calculation
AddChildXmlNode(itemNode, "CreateOrder", settings.CreateOrder.ToString());
Expand Down

0 comments on commit 1a84a8e

Please sign in to comment.