At a quick guess call read on order levels first.
Which Mike has just confirmed.
private void Check_MinSOH(JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLine item)
{
System.Diagnostics.Debugger.Launch();
JiwaFinancials.Jiwa.JiwaApplication.Manager manager = item.Manager;
JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory = manager.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaInventory.Inventory>(null);
inventory.Read(item.InventoryID);
foreach(JiwaFinancials.Jiwa.JiwaInventory.Month month in inventory.Months)
{
if (month.Index == System.DateTime.Now.Month)
{
foreach (JiwaFinancials.Jiwa.JiwaApplication.Inventory.Warehouse.PhysicalWarehouse phys in item.Manager.PhysicalWarehouseCollection)
{
foreach (JiwaFinancials.Jiwa.JiwaApplication.Inventory.Warehouse.LogicalWarehouse loglwarehouse in phys.LogicalWarehouseCollection)
{
if (loglwarehouse.IN_LogicalID == item.SalesOrderLines.SalesOrder.LogicalWarehouseResidingIn.IN_LogicalID)
{
JiwaFinancials.Jiwa.JiwaInventory.OrderLevel orderLevel = inventory.OrderLevels.RetrieveOrderLevel(month, loglwarehouse);
MessageBox.Show(orderLevel.MinSOHUnits.ToString());
}
}
}
}
}
}
private void Check_MinSOH(JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLine item)
{
System.Diagnostics.Debugger.Launch();
JiwaFinancials.Jiwa.JiwaApplication.Manager manager = item.Manager;
JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory = manager.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaInventory.Inventory>(null);
inventory.Read(item.InventoryID);
inventory.OrderLevels.Read(); ///*****************Line Added*********************************
foreach(JiwaFinancials.Jiwa.JiwaInventory.Month month in inventory.Months)
{
if (month.Index == System.DateTime.Now.Month)
{
foreach (JiwaFinancials.Jiwa.JiwaApplication.Inventory.Warehouse.PhysicalWarehouse phys in item.Manager.PhysicalWarehouseCollection)
{
foreach (JiwaFinancials.Jiwa.JiwaApplication.Inventory.Warehouse.LogicalWarehouse loglwarehouse in phys.LogicalWarehouseCollection)
{
if (loglwarehouse.IN_LogicalID == item.SalesOrderLines.SalesOrder.LogicalWarehouseResidingIn.IN_LogicalID)
{
JiwaFinancials.Jiwa.JiwaInventory.OrderLevel orderLevel = inventory.OrderLevels.RetrieveOrderLevel(month, loglwarehouse);
MessageBox.Show(orderLevel.MinSOHUnits.ToString());
}
}
}
}
}
}
/me grumbles :/
Return to Technical and or Programming
Users browsing this forum: No registered users and 27 guests