
Atronics wrote:One of our sites with multiple warehouses wants to see SoH available, as a total figure, in warehouses other than the one in which the PO Generation form is being created. For some items it would be preferable to ship the item from another location, rather than purchase it. How can I add this new column to the grid?
// Add the column to the grid.
poGenerationform.ProductsJiwaGrid.AddColumn("OtherSOH", new FarPoint.Win.Spread.CellType.NumberCellType(), "SOH other Warehouses", 8, false, true, true, true, 0, false, false, 0, false);
// Lock the column
poGenerationform.ProductsJiwaGrid.LockColumn(true, "OtherSOH", -1);
// Add a handler for when a form is read to populate the other SOH column
poGenerationform.PurchaseOrderGeneration.ReadEnd += PurchaseOrderGeneration_ReadEnd;
// Add a handler for when the user clicks the GetCandidatesUltraButton
poGenerationform.GetCandidatesUltraButton.Click += GetCandidatesUltraButton_Click;
private void PopulateOtherSOHColumn(JiwaFinancials.Jiwa.JiwaPurchaseOrderGenerationUI.MainForm poGenerationForm)
{
for(int row = 0; row < poGenerationForm.ProductsJiwaGrid.ActiveSheet.RowCount; row++)
{
string purchaseOrderKey = poGenerationForm.ProductsJiwaGrid.get_GridText("PurchaseOrderKey", row).ToString();
string purchaseOrderLineKey = poGenerationForm.ProductsJiwaGrid.get_GridText("PurchaseOrderLineKey", row).ToString();
if(purchaseOrderKey.Trim().Length > 0 && purchaseOrderLineKey.Trim().Length > 0)
{
JiwaFinancials.Jiwa.JiwaPurchaseOrderGeneration.PurchaseOrder purchaseOrder = poGenerationForm.PurchaseOrderGeneration.PurchaseOrders[purchaseOrderKey];
JiwaFinancials.Jiwa.JiwaPurchaseOrderGeneration.Line purchaseOrderLine = purchaseOrder.Lines[purchaseOrderLineKey];
decimal SOHOtherWarehouses = GetSOHOtherWarehouses(purchaseOrderLine.Inventory.InventoryID, poGenerationForm.PurchaseOrderGeneration.LogicalWarehouseResidingIn.IN_LogicalID);
poGenerationForm.ProductsJiwaGrid.set_GridText("OtherSOH", row, SOHOtherWarehouses);
}
}
}


Return to Technical and or Programming
Users browsing this forum: No registered users and 4 guests