Created
October 18, 2020 03:11
-
-
Save kulvirTAC/ed26f4312be394258b39a065d65e1054 to your computer and use it in GitHub Desktop.
Amazon Integration Change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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