Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Amazon Integration Change
private void SetSOHeaderObjectsData(PrepareAndImportOrdersParams orderParams)
{
SOOrder newOrder = new SOOrder();
if (orderParams.objSOOrderEntry.sosetup.Current != null)
{
if (orderParams.objSOAmazonSetup.GuestCustID.HasValue)
{
newOrder.OrderType = orderParams.objSOAmazonSetup.OrderType;
newOrder = (SOOrder)orderParams.objSOOrderEntry.Document.Cache.Insert(newOrder);
newOrder.CustomerID = orderParams.objSOAmazonSetup.GuestCustID;
newOrder.CuryID = orderParams.objSOAmazonSetup.DefaultCurrency;
}
else
throw new PXException(SOMessages.guestCustomerErrorMsg);
}
AssignValueAsPerIntegrationMapping(orderParams.objliUsrMapping, newOrder, orderParams.ObjCurrentOrder, null, orderParams.objSOOrderEntry.Document.View.Name);
newOrder.OrderDesc = !string.IsNullOrEmpty(orderParams.ObjCurrentOrder.FulfillmentChannel) ?
orderParams.ObjCurrentOrder.FulfillmentChannel == SOConstants.fulfillmentChannelAFN ?
string.IsNullOrEmpty(newOrder.OrderDesc) ? SOMessages.fbaOrder : newOrder.OrderDesc + " - " + SOMessages.fbaOrder :
orderParams.ObjCurrentOrder.FulfillmentChannel == SOConstants.fulfillmentChannelMFN ?
string.IsNullOrEmpty(newOrder.OrderDesc) ? SOMessages.fbmOrder : newOrder.OrderDesc + " - " + SOMessages.fbmOrder :
newOrder.OrderDesc : newOrder.OrderDesc;
newOrder.DefaultSiteID = orderParams.objSOAmazonSetup.DfltWarehouseID;
SOOrderAmazonExt newOrderExt = newOrder.GetExtension<SOOrderAmazonExt>();
if (newOrderExt != null)
{
newOrderExt.UsrAmazonOrderID = orderParams.ObjCurrentOrder.AmazonOrderId;
}
orderParams.objSOOrderEntry.Document.Current = newOrder;
orderParams.objSOOrderEntry.Document.Update(orderParams.objSOOrderEntry.Document.Current);
}
#region CustID
[CustomerActive(DescriptionField = typeof(Customer.acctName), DisplayName = "Customer ID")]
[PXDefault()]
public virtual int? GuestCustID { get; set; }
public abstract class guestCustID : IBqlField { }
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment