I'm stuck on a simple issue. The SellPriceExGST set for an AddInventoryItem salesOrderLine is getting overidden with the inventory item pricing. I have tried setting a few differing properties and looked through the avilable salesOrderLine methods, but can't spot the solution.
Here's the code:
- Code: Select all
foreach (var item in items)
{
var inventory = _salesOrder.Manager.EntityFactory.CreateEntity<JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory>();
try { inventory.ReadRecordFromPartNo(item.ManufacturerPart); }
catch (Exception) { warnings.Add("Part not found: " + item.ManufacturerPart); continue; }
if (string.IsNullOrEmpty(inventory.InventoryID)) { warnings.Add("Part not found: " + item.ManufacturerPart); continue; }
object newKey = "";
_salesOrder.SalesOrderLines.AddInventoryItem(inventory.InventoryID, SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLineInventoryID, ref newKey);
var salesOrderLine = _salesOrder.SalesOrderLines[newKey.ToString()];
salesOrderLine.SellPriceExGST = item.SellEx;
salesOrderLine.QuantityOrdered = item.Quantity ?? 0;
}
Could you advise?
Cheers,
Neil