Skip to content

Instantly share code, notes, and snippets.

@ArveSystad
Created August 26, 2014 10:28
Show Gist options
  • Select an option

  • Save ArveSystad/4b10336969b93c3da9f3 to your computer and use it in GitHub Desktop.

Select an option

Save ArveSystad/4b10336969b93c3da9f3 to your computer and use it in GitHub Desktop.
private List<LineItem> GetSplitShipmentLineItems(Shipment shipment)
{
List<LineItem> items = Shipment.GetShipmentLineItems(shipment);
return items.Select(x => new LineItem
{
CatalogEntryId = x.CatalogEntryId,
ExtendedPrice = x.ExtendedPrice / x.Quantity * Shipment.GetLineItemQuantity(shipment, x.LineItemId), // Need the extended price for this shipment
Quantity = Shipment.GetLineItemQuantity(shipment, x.LineItemId),
}).ToList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment