Beispiel #1
0
menuSchedule::menuSchedule(GUIClient *Pparent) :
 QObject(Pparent)
{
  setObjectName("msModule");
  parent = Pparent;
  
  toolBar = new QToolBar(tr("Schedule Tools"));
  toolBar->setObjectName("Schedule Tools");
  toolBar->setIconSize(QSize(32, 32));
  parent->addToolBar(toolBar);

  mainMenu = new QMenu(parent);
  plannedOrdersMenu = new QMenu(parent);
  plannedOrdersMrpMenu = new QMenu(parent);
  reportsMenu = new QMenu(parent);
  reportsPlannedMenu = new QMenu(parent);

  mainMenu->setObjectName("menu.sched");
  plannedOrdersMenu->setObjectName("menu.sched.plannedorders");
  plannedOrdersMrpMenu->setObjectName("menu.sched.plannedordersmrp");
  reportsMenu->setObjectName("menu.sched.reports");
  reportsPlannedMenu->setObjectName("menu.sched.reportsplanned");

  actionProperties acts[] = {
  
    // Schedule | Schedule  
    { "menu",	tr("&Scheduling"), (char*)plannedOrdersMenu,	mainMenu,	"true",	NULL, NULL, true	, NULL },
    { "ms.createPlannedOrder", tr("&New Planned Order..."), SLOT(sCreatePlannedOrder()), plannedOrdersMenu, "CreatePlannedOrders", NULL, NULL, true , NULL },
    { "separator", NULL, NULL, plannedOrdersMenu, "true", NULL, NULL, true , NULL },
 
    // Schedule | Schedule | MRP
    { "menu",	tr("Run &MRP"), (char*)plannedOrdersMrpMenu,	plannedOrdersMenu,	"true",	NULL, NULL, true	, NULL },
    { "ms.runMRPByPlannerCode", tr("by &Planner Code..."), SLOT(sCreatePlannedReplenOrdersByPlannerCode()), plannedOrdersMrpMenu, "CreatePlannedOrders", QPixmap(":/images/runMrpByPlannerCode.png"), toolBar, true , tr("Run MRP by Planner Code") },
    { "ms.runMRPByItem", tr("by &Item..."), SLOT(sCreatePlannedReplenOrdersByItem()), plannedOrdersMrpMenu, "CreatePlannedOrders", NULL, NULL, true , NULL },
    
    { "separator", NULL, NULL, plannedOrdersMenu, "true", NULL, NULL, true , NULL },
    { "ms.firmPlannedOrdersByPlannerCode", tr("&Firm Planned Orders..."), SLOT(sFirmPlannedOrdersByPlannerCode()), plannedOrdersMenu, "FirmPlannedOrders", NULL, NULL, true , NULL },
    { "ms.releasePlannedOrdersByPlannerCode", tr("&Release Planned Orders..."), SLOT(sReleasePlannedOrdersByPlannerCode()),  plannedOrdersMenu, "ReleasePlannedOrders", NULL, NULL, true , NULL },
    { "separator", NULL, NULL, plannedOrdersMenu, "true", NULL, NULL, true , NULL },
    { "ms.deletePlannedOrder", tr("&Delete Planned Order..."), SLOT(sDeletePlannedOrder()),plannedOrdersMenu, "DeletePlannedOrders", NULL, NULL, true , NULL },
    { "ms.deletePlannedOrdersByPlannerCode", tr("Delete Planned Order&s..."), SLOT(sDeletePlannedOrdersByPlannerCode()), plannedOrdersMenu, "DeletePlannedOrders", NULL, NULL, true , NULL },
    { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL },
  
    // Schedule | Report
    { "menu",	tr("&Reports"), (char*)reportsMenu, mainMenu, "true", NULL, NULL, true , NULL },
  
    // Schedule | Report | Planned Orders
    { "menu",	tr("Planned &Orders"), (char*)reportsPlannedMenu, reportsMenu, "true", NULL, NULL, true , NULL },
    { "ms.dspPlannedOrdersByPlannerCode", tr("by &Planner Code..."), SLOT(sDspPlannedOrdersByPlannerCode()), reportsPlannedMenu, "ViewPlannedOrders", QPixmap(":/images/dspPlannedOrdersByPlannerCode.png"), toolBar, true , tr("Planned Orders by Planner Code") },
    { "ms.dspPlannedOrdersByItem", tr("by &Item..."), SLOT(sDspPlannedOrdersByItem()), reportsPlannedMenu, "ViewPlannedOrders", NULL, NULL, true , NULL },
    
    { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL },
    { "ms.dspRunningAvailability", tr("&Running Availability..."), SLOT(sDspRunningAvailability()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL },
    { "ms.dspTimePhasedAvailabiltiy", tr("&Time-Phased Availability..."), SLOT(sDspTimePhasedAvailability()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL },
    { "ms.dspMRPDetail", tr("&MRP Detail..."), SLOT(sDspMRPDetail()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL },
    { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL },
    { "ms.dspExpediteExceptionsByPlannerCode", tr("E&xpedite Exceptions..."), SLOT(sDspExpediteExceptionsByPlannerCode()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL },
    { "ms.dspReorderExceptionsByPlannerCode", tr("Reorder &Exceptions..."), SLOT(sDspReorderExceptionsByPlannerCode()),reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL },

    { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL },
    { "ms.setup",	tr("&Setup..."),	SLOT(sSetup()),	mainMenu,	NULL,	NULL,	NULL,	true, NULL}

  };
  addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0]));

  parent->populateCustomMenu(mainMenu, "Schedule");
  QAction * m = parent->menuBar()->addMenu(mainMenu);
  if(m)
    m->setText(tr("Sche&dule"));
}
Beispiel #2
0
moduleMS::moduleMS(OpenMFGGUIClient *Pparent) :
 QObject(Pparent, "msModule")
{
  parent = Pparent;
  
  toolBar = new QToolBar(tr("M/S Tools"));
  toolBar->setObjectName("M/S Tools");
  toolBar->setIconSize(QSize(32, 32));
  if (_preferences->boolean("ShowMSToolbar"))
    parent->addToolBar(toolBar);


//  Scheduling
  planningMenu = new QMenu();

  parent->actions.append( new Action( parent, "ms.listProductionPlans", tr("List Production Plans..."),
                                      this, SLOT(sListProductionPlans()),
                                      planningMenu, (_privleges->check("MaintainPlannedSchedules") || _privleges->check("ViewPlannedSchedules")) ) );

  parent->actions.append( new Action( parent, "ms.newProductionPlan", tr("New Production Plan..."),
                                      this, SLOT(sNewProductionPlan()),
                                      planningMenu, _privleges->check("MaintainPlannedSchedules") ) );

//  Planned Ordered
  plannedOrdersMenu = new QMenu();

  parent->actions.append( new Action( parent, "ms.createPlannedOrder", tr("Create Planned Order..."),
                                      this, SLOT(sCreatePlannedOrder()),
                                      plannedOrdersMenu, _privleges->check("CreatePlannedOrders") ) );

  plannedOrdersMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.runMPSByPlannerCode", tr("Run MPS by Planner Code..."),
                                      this, SLOT(sRunMPSByPlannerCode()),
                                      plannedOrdersMenu, _privleges->check("CreatePlannedOrders")));

  parent->actions.append( new Action( parent, "ms.runMRPByPlannerCode", tr("Run MRP by Planner Code..."),
                                      this, SLOT(sCreatePlannedReplenOrdersByPlannerCode()),
                                      plannedOrdersMenu, _privleges->check("CreatePlannedOrders"),
									  QPixmap(":/images/runMrpByPlannerCode.png"), toolBar ) );

  parent->actions.append( new Action( parent, "ms.runMRPByItem", tr("Run MRP by Item..."),
                                      this, SLOT(sCreatePlannedReplenOrdersByItem()),
                                      plannedOrdersMenu, _privleges->check("CreatePlannedOrders") ) );

  plannedOrdersMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.firmPlannedOrdersByPlannerCode", tr("Firm Planned Orders by Planner Code..."),
                                      this, SLOT(sFirmPlannedOrdersByPlannerCode()),
                                      plannedOrdersMenu, _privleges->check("FirmPlannedOrders") ) );

  parent->actions.append( new Action( parent, "ms.releasePlannedOrdersByPlannerCode", tr("Release Planned Orders by Planner Code..."),
                                      this, SLOT(sReleasePlannedOrdersByPlannerCode()),
                                      plannedOrdersMenu, _privleges->check("ReleasePlannedOrders") ) );

  plannedOrdersMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.deletePlannedOrdersByPlannerCode", tr("Delete Planned Orders by Planner Code..."),
                                      this, SLOT(sDeletePlannedOrdersByPlannerCode()),
                                      plannedOrdersMenu, _privleges->check("DeletePlannedOrders") ) );

  parent->actions.append( new Action( parent, "ms.deletePlannedOrder", tr("Delete Planned Order..."),
                                      this, SLOT(sDeletePlannedOrder()),
                                      plannedOrdersMenu, _privleges->check("DeletePlannedOrders") ) );

//  Buffer Management
  bufferManagementMenu = new QMenu();

  parent->actions.append( new Action( parent, "ms.runBufferStatusByItem", tr("Run Buffer Status by Item..."),
                                      this, SLOT(sCreateBufferStatusByItem()),
                                      bufferManagementMenu, _privleges->check("CreateBufferStatus") ) );

  parent->actions.append( new Action( parent, "ms.runBufferStatusByPlannerCode", tr("Run Buffer Status by Planner Code..."),
                                      this, SLOT(sCreateBufferStatusByPlannerCode()),
                                      bufferManagementMenu, _privleges->check("CreateBufferStatus") ) );

  bufferManagementMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspInventoryBufferStatusByItemGroup", tr("Inventory Buffer Status by Item Group..."),
                                      this, SLOT(sDspInventoryBufferStatusByItemGroup()),
                                      bufferManagementMenu, _privleges->check("ViewInventoryBufferStatus") ) );

  parent->actions.append( new Action( parent, "ms.dspInventoryBufferStatusByClassCode", tr("Inventory Buffer Status by Class Code..."),
                                      this, SLOT(sDspInventoryBufferStatusByClassCode()),
                                      bufferManagementMenu, _privleges->check("ViewInventoryBufferStatus") ) );

  parent->actions.append( new Action( parent, "ms.dspInventoryBufferStatusByPlannerCode", tr("Inventory Buffer Status by Planner Code..."),
                                      this, SLOT(sDspInventoryBufferStatusByPlannerCode()),
                                      bufferManagementMenu, _privleges->check("ViewInventoryBufferStatus") ) );

  bufferManagementMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspCapacityBufferStatusByWorkCenter", tr("Capacity Buffer Status by Work Center..."),
                                      this, SLOT(sDspCapacityBufferStatusByWorkCenter()),
                                      bufferManagementMenu, _privleges->check("ViewWorkCenterBufferStatus") && _metrics->boolean("Routings") ) );

  bufferManagementMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspWoBufferStatusByItemGroup", tr("Work Order Buffer Status by Item Group..."),
                                      this, SLOT(sDspWoBufferStatusByItemGroup()),
                                      bufferManagementMenu, (_privleges->check("MaintainWorkOrders") || _privleges->check("ViewWorkOrders")) ) );

  parent->actions.append( new Action( parent, "ms.dspWoBufferStatusByClassCode", tr("Work Order Buffer Status by Class Code..."),
                                      this, SLOT(sDspWoBufferStatusByClassCode()),
                                      bufferManagementMenu, (_privleges->check("MaintainWorkOrders") || _privleges->check("ViewWorkOrders")) ) );

  parent->actions.append( new Action( parent, "ms.dspWoBufferStatusByPlannerCode", tr("Work Order Buffer Status by Planner Code..."),
                                      this, SLOT(sDspWoBufferStatusByPlannerCode()),
                                      bufferManagementMenu, (_privleges->check("MaintainWorkOrders") || _privleges->check("ViewWorkOrders")) ) );

  parent->actions.append( new Action( parent, "ms.dspWoOperationBufrStsByWorkCenter", tr("W/O Operation Buffer Status by Work Center..."),
                                      this, SLOT(sDspWoOperationBufrStsByWorkCenter()),
                                      bufferManagementMenu, (_privleges->check("MaintainWoOperations") || _privleges->check("ViewWoOperations")) &&  _metrics->boolean("Routings") ) );

  bufferManagementMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspPoLineItemsByBufferStatus", tr("P/O Items by Buffer Status..."),
                                      this, SLOT(sDspPoItemsByBufferStatus()),
                                      bufferManagementMenu, _privleges->check("ViewPurchaseOrders") ) );

//  Displays
  displaysMenu = new QMenu();

  parent->actions.append( new Action( parent, "ms.dspPlannedOrdersByItem", tr("Planned Orders by Item..."),
                                      this, SLOT(sDspPlannedOrdersByItem()),
                                      displaysMenu, _privleges->check("ViewPlannedOrders") ) );

  parent->actions.append( new Action( parent, "ms.dspPlannedOrdersByPlannerCode", tr("Planned Orders by Planner Code..."),
                                      this, SLOT(sDspPlannedOrdersByPlannerCode()),
                                      displaysMenu, _privleges->check("ViewPlannedOrders"),
									  QPixmap(":/images/dspPlannedOrdersByPlannerCode.png"), toolBar ) );

  parent->actions.append( new Action( parent, "ms.dspMPSDetail", tr("MPS Detail..."),
                                      this, SLOT(sDspMPSDetail()),
                                      displaysMenu, _privleges->check("ViewMPS") ) );

  displaysMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspRoughCutByWorkCenter", tr("Rough Cut Capacity Plan by Work Center..."),
                                      this, SLOT(sDspRoughCutByWorkCenter()),
                                      displaysMenu, _privleges->check("ViewRoughCut") && _metrics->boolean("Routings") ) );

  parent->actions.append( new Action( parent, "ms.dspTimePhasedRoughCutByWorkCenter", tr("Time-Phased Rough Cut Capacity Plan by Work Center..."),
                                      this, SLOT(sDspTimePhasedRoughCutByWorkCenter()),
                                      displaysMenu, _privleges->check("ViewRoughCut") && _metrics->boolean("Routings") ) );

  displaysMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspPlannedRevenue/ExpensesByPlannerCode", tr("Planned Revenue/Expenses by Planner Code..."),
                                      this, SLOT(sDspPlannedRevenueExpensesByPlannerCode()),
                                      displaysMenu, (_privleges->check("ViewPlannedOrders") && _privleges->check("ViewCosts") && _privleges->check("ViewListPrices")) ) );

  parent->actions.append( new Action( parent, "ms.dspTimePhasedPlannedRevenue/ExpensesByPlannerCode", tr("Time-Phased Planned Revenue/Expenses by Planner Code..."),
                                      this, SLOT(sDspTimePhasedPlannedREByPlannerCode()),
                                      displaysMenu, (_privleges->check("ViewPlannedOrders") && _privleges->check("ViewCosts") && _privleges->check("ViewListPrices")) ) );

  displaysMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspTimePhasedAvailabiltiy", tr("Time-Phased Availability..."),
                                      this, SLOT(sDspTimePhasedAvailability()),
                                      displaysMenu, _privleges->check("ViewInventoryAvailability") ) );

  parent->actions.append( new Action( parent, "ms.dspRunningAvailability", tr("Running Availability..."),
                                      this, SLOT(sDspRunningAvailability()),
                                      displaysMenu, _privleges->check("ViewInventoryAvailability") ) );

  parent->actions.append( new Action( parent, "ms.dspMRPDetail", tr("MRP Detail..."),
                                      this, SLOT(sDspMRPDetail()),
                                      displaysMenu, _privleges->check("ViewInventoryAvailability") ) );

  displaysMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.dspExpediteExceptionsByPlannerCode", tr("Expedite Exceptions by Planner Code..."),
                                      this, SLOT(sDspExpediteExceptionsByPlannerCode()),
                                      displaysMenu, _privleges->check("ViewInventoryAvailability") ) );

  parent->actions.append( new Action( parent, "ms.dspReorderExceptionsByPlannerCode", tr("Reorder Exceptions by Planner Code..."),
                                      this, SLOT(sDspReorderExceptionsByPlannerCode()),
                                      displaysMenu, _privleges->check("ViewInventoryAvailability") ) );

//  Reports
  reportsMenu = new QMenu();

  parent->actions.append( new Action( parent, "ms.rptPlannedOrdersByItem", tr("Planned Orders by Item..."),
                                      this, SLOT(sRptPlannedOrdersByItem()),
                                      reportsMenu, _privleges->check("ViewPlannedOrders") ) );

  parent->actions.append( new Action( parent, "ms.rptPlannedOrdersByPlannerCode", tr("Planned Orders by Planner Code..."),
                                      this, SLOT(sRptPlannedOrdersByPlannerCode()),
                                      reportsMenu, _privleges->check("ViewPlannedOrders") ) );

  parent->actions.append( new Action( parent, "ms.rptMPSDetail", tr("MPS Detail..."),
                                      this, SLOT(sRptMPSDetail()),
                                      reportsMenu, _privleges->check("ViewMPS") ) );

  reportsMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.rptRoughCutByWorkCenter", tr("Rough Cut Capacity Plan by Work Center..."),
                                      this, SLOT(sRptRoughCutByWorkCenter()),
                                      reportsMenu, _privleges->check("ViewRoughCut") && _metrics->boolean("Routings") ) );

  parent->actions.append( new Action( parent, "ms.rptTimePhasedRoughCutByWorkCenter", tr("Time-Phased Rough Cut Capacity Plan by Work Center..."),
                                      this, SLOT(sRptTimePhasedRoughCutByWorkCenter()),
                                      reportsMenu, _privleges->check("ViewRoughCut") && _metrics->boolean("Routings") ) );

  reportsMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.rptPlannedRevenue/ExpensesByPlannerCode", tr("Planned Revenue/Expenses by Planner Code..."),
                                      this, SLOT(sRptPlannedRevenueExpensesByPlannerCode()),
                                      reportsMenu, _privleges->check("ViewPlannedOrders") ) );

  parent->actions.append( new Action( parent, "ms.rptTimePhasedPlannedRevenue/ExpensesByPlannerCode", tr("Time-Phased Planned Revenue/Expenses by Planner Code..."),
                                      this, SLOT(sRptTimePhasedPlannedREByPlannerCode()),
                                      reportsMenu, _privleges->check("ViewPlannedOrders") ) );

  reportsMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.rptTimePhasedAvailabiltiy", tr("Time-Phased Availability..."),
                                      this, SLOT(sRptTimePhasedAvailability()),
                                      reportsMenu, _privleges->check("ViewInventoryAvailability") ) );

  parent->actions.append( new Action( parent, "ms.rptRunningAvailability", tr("Running Availability..."),
                                      this, SLOT(sRptRunningAvailability()),
                                      reportsMenu, _privleges->check("ViewInventoryAvailability") ) );

  parent->actions.append( new Action( parent, "ms.rptMRPDetail", tr("MRP Detail..."),
                                      this, SLOT(sRptMRPDetail()),
                                      reportsMenu, _privleges->check("ViewInventoryAvailability") ) );

  reportsMenu->insertSeparator();

  parent->actions.append( new Action( parent, "ms.rptExpediteExceptionsByPlannerCode", tr("Expedite Exceptions by Planner Code..."),
                                      this, SLOT(sRptExpediteExceptionsByPlannerCode()),
                                      reportsMenu, _privleges->check("ViewInventoryAvailability") ) );

  parent->actions.append( new Action( parent, "ms.rptReorderExceptionsByPlannerCode", tr("Reorder Exceptions by Planner Code..."),
                                      this, SLOT(sRptReorderExceptionsByPlannerCode()),
                                      reportsMenu, _privleges->check("ViewInventoryAvailability") ) );


//  Master Information
  masterInfoMenu = new QMenu();

  parent->actions.append( new Action( parent, "ms.plannerCodes", tr("Planner Codes..."),
                                      this, SLOT(sPlannerCodes()),
                                      masterInfoMenu, (_privleges->check("MaintainPlannerCodes") && _privleges->check("ViewPlannerCodes")) ) );

  parent->actions.append( new Action( parent, "ms.warehouseWeek", tr("Warehouse Week..."),
                                      this, SLOT(sWarehouseWeek()),
                                      masterInfoMenu, _privleges->check("MaintainWarehouseWorkWeek") ) );

  parent->actions.append( new Action( parent, "ms.warehouseCalendarExceptions", tr("Warehouse Calendar Exceptions..."),
                                      this, SLOT(sWarehouseCalendarExceptions()),
                                      masterInfoMenu, (_privleges->check("MaintainWarehouseCalendarExceptions") || _privleges->check("ViewWarehouseCalendarExceptions")) ) );

  mainMenu = new QMenu();
  mainMenu->insertItem(tr("Planning"), planningMenu);
  mainMenu->insertItem(tr("Scheduling"), plannedOrdersMenu);
  if (_metrics->boolean("BufferMgt"))
    mainMenu->insertItem(tr("Buffer Management"), bufferManagementMenu);
  mainMenu->insertItem(tr("Displays"), displaysMenu);
  mainMenu->insertItem(tr("Reports"), reportsMenu);
  mainMenu->insertItem(tr("Master Information"), masterInfoMenu);
  parent->populateCustomMenu(mainMenu, "M/S");
  parent->menuBar()->insertItem(tr("&M/S"), mainMenu);
}
Beispiel #3
0
menuSchedule::menuSchedule(GUIClient *Pparent) :
 QObject(Pparent, "msModule")
{
  parent = Pparent;
  
  toolBar = new QToolBar(tr("Schedule Tools"));
  toolBar->setObjectName("Schedule Tools");
  toolBar->setIconSize(QSize(32, 32));
  if (_preferences->boolean("ShowMSToolbar"))
    parent->addToolBar(toolBar);

  mainMenu = new QMenu(parent);
  planningMenu = new QMenu(parent);
  plannedOrdersMenu = new QMenu(parent);
  plannedOrdersMrpMenu = new QMenu(parent);
  capacityPlanMenu = new QMenu(parent);
  capacityPlanTpPrdMenu = new QMenu(parent);
  bufferMenu = new QMenu(parent);
  bufferRunMenu = new QMenu(parent);
  bufferInvMenu = new QMenu(parent);
  bufferWoMenu = new QMenu(parent);
  reportsMenu = new QMenu(parent);
  reportsPlannedMenu = new QMenu(parent);
  masterInfoMenu = new QMenu(parent);

  mainMenu->setObjectName("menu.sched");
  planningMenu->setObjectName("menu.sched.planning");
  plannedOrdersMenu->setObjectName("menu.sched.plannedorders");
  plannedOrdersMrpMenu->setObjectName("menu.sched.plannedordersmrp");
  capacityPlanMenu->setObjectName("menu.sched.capacityplan");
  capacityPlanTpPrdMenu->setObjectName("menu.sched.capacityplantpprd");
  bufferMenu->setObjectName("menu.sched.buffer");
  bufferRunMenu->setObjectName("menu.sched.bufferrun");
  bufferInvMenu->setObjectName("menu.sched.bufferinv");
  bufferWoMenu->setObjectName("menu.sched.bufferwo");
  reportsMenu->setObjectName("menu.sched.reports");
  reportsPlannedMenu->setObjectName("menu.sched.reportsplanned");
  masterInfoMenu->setObjectName("menu.sched.masterinfo");

  actionProperties acts[] = {
  
    // Schedule | Planning
    { "menu",	tr("&Production Plan"), (char*)planningMenu,	mainMenu,	true,	NULL, NULL, true	, NULL },
    { "ms.newProductionPlan", tr("&New..."), SLOT(sNewProductionPlan()), planningMenu, _privileges->check("MaintainPlannedSchedules"), NULL, NULL, true , NULL },
    { "ms.listProductionPlans", tr("&List..."), SLOT(sListProductionPlans()), planningMenu, _privileges->check("MaintainPlannedSchedules") || _privileges->check("ViewPlannedSchedules"), NULL, NULL, true , NULL },

    // Schedule | Schedule  
    { "menu",	tr("&Scheduling"), (char*)plannedOrdersMenu,	mainMenu,	true,	NULL, NULL, true	, NULL },
    { "ms.createPlannedOrder", tr("&New Planned Order..."), SLOT(sCreatePlannedOrder()), plannedOrdersMenu, _privileges->check("CreatePlannedOrders"), NULL, NULL, true , NULL },
    { "separator", NULL, NULL, plannedOrdersMenu, true, NULL, NULL, true , NULL },
    { "ms.runMPSByPlannerCode", tr("Run M&PS..."), SLOT(sRunMPSByPlannerCode()),plannedOrdersMenu, _privileges->check("CreatePlannedOrders"), NULL, NULL, true , NULL },
 
    // Schedule | Schedule | MRP
    { "menu",	tr("Run &MRP"), (char*)plannedOrdersMrpMenu,	plannedOrdersMenu,	true,	NULL, NULL, true	, NULL },
    { "ms.runMRPByPlannerCode", tr("by &Planner Code..."), SLOT(sCreatePlannedReplenOrdersByPlannerCode()), plannedOrdersMrpMenu, _privileges->check("CreatePlannedOrders"), new QPixmap(":/images/runMrpByPlannerCode.png"), toolBar, true , "Run MRP by Planner Code" },
    { "ms.runMRPByItem", tr("by &Item..."), SLOT(sCreatePlannedReplenOrdersByItem()), plannedOrdersMrpMenu, _privileges->check("CreatePlannedOrders"), NULL, NULL, true , NULL },
    
    { "separator", NULL, NULL, plannedOrdersMenu, true, NULL, NULL, true , NULL },
    { "ms.firmPlannedOrdersByPlannerCode", tr("&Firm Planned Orders..."), SLOT(sFirmPlannedOrdersByPlannerCode()), plannedOrdersMenu, _privileges->check("FirmPlannedOrders"), NULL, NULL, true , NULL },
    { "ms.releasePlannedOrdersByPlannerCode", tr("&Release Planned Orders..."), SLOT(sReleasePlannedOrdersByPlannerCode()),  plannedOrdersMenu, _privileges->check("ReleasePlannedOrders"), NULL, NULL, true , NULL },
    { "separator", NULL, NULL, plannedOrdersMenu, true, NULL, NULL, true , NULL },
    { "ms.deletePlannedOrder", tr("&Delete Planned Order..."), SLOT(sDeletePlannedOrder()),plannedOrdersMenu, _privileges->check("DeletePlannedOrders"), NULL, NULL, true , NULL },
    { "ms.deletePlannedOrdersByPlannerCode", tr("Delete Planned Order&s..."), SLOT(sDeletePlannedOrdersByPlannerCode()), plannedOrdersMenu, _privileges->check("DeletePlannedOrders"), NULL, NULL, true , NULL },
    { "separator", NULL, NULL, mainMenu, true, NULL, NULL, true , NULL },

    // Schedule | Constraint Management
    { "menu",	tr("Cons&traint Management"), (char*)bufferMenu,	mainMenu,	true,	NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
  
    // Schedule | Buffer Status | Run
    { "menu",	tr("&Update Status"), (char*)bufferRunMenu,	bufferMenu,	true,	NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.runBufferStatusByPlannerCode", tr("by &Planner Code..."), SLOT(sCreateBufferStatusByPlannerCode()), bufferRunMenu, _privileges->check("CreateBufferStatus"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.runBufferStatusByItem", tr("by &Item..."), SLOT(sCreateBufferStatusByItem()), bufferRunMenu, _privileges->check("CreateBufferStatus"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
 
    { "separator", NULL, NULL, bufferMenu, true, NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
  
    // Schedule | Contsraint Management | Inventory Status
    { "menu",	tr("&Inventory"), (char*)bufferInvMenu,	bufferMenu,	true,	NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspInventoryBufferStatusByPlannerCode", tr("by &Planner Code..."), SLOT(sDspInventoryBufferStatusByPlannerCode()), bufferInvMenu, _privileges->check("ViewInventoryBufferStatus"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspInventoryBufferStatusByClassCode", tr("by &Class Code..."), SLOT(sDspInventoryBufferStatusByClassCode()), bufferInvMenu, _privileges->check("ViewInventoryBufferStatus"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspInventoryBufferStatusByItemGroup", tr("by &Item Group..."), SLOT(sDspInventoryBufferStatusByItemGroup()), bufferInvMenu, _privileges->check("ViewInventoryBufferStatus"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspPoLineItemsByBufferStatus", tr("&Purchase Order..."), SLOT(sDspPoItemsByBufferStatus()), bufferMenu, _privileges->check("ViewPurchaseOrders"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },

    // Schedule | Gostraint Management | Work Order Status
    { "menu",	tr("&Work Order"), (char*)bufferWoMenu,	bufferMenu,	true,	NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspWoBufferStatusByPlannerCode", tr("by &Planner Code..."), SLOT(sDspWoBufferStatusByPlannerCode()), bufferWoMenu, _privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspWoBufferStatusByClassCode", tr("by &Class Code..."), SLOT(sDspWoBufferStatusByClassCode()), bufferWoMenu, _privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspWoBufferStatusByItemGroup", tr("by &Item Group..."), SLOT(sDspWoBufferStatusByItemGroup()), bufferWoMenu, _privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
  
    { "separator", NULL, NULL, bufferMenu, true, NULL, NULL,  _metrics->boolean("Routings") &&  _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspCapacityBufferStatusByWorkCenter", tr("&Capacity..."), SLOT(sDspCapacityBufferStatusByWorkCenter()), bufferMenu, _privileges->check("ViewWorkCenterBufferStatus"), NULL, NULL, _metrics->boolean("Routings") && _metrics->boolean("BufferMgt") , NULL },
    { "ms.dspWoOperationBufrStsByWorkCenter", tr("W/O &Operation..."), SLOT(sDspWoOperationBufrStsByWorkCenter()), bufferMenu, _privileges->check("MaintainWoOperations") || _privileges->check("ViewWoOperations"), NULL , NULL, _metrics->boolean("Routings") && _metrics->boolean("BufferMgt")  , NULL },  
  
    // Schedule | Capacity Plannning
    { "menu",	tr("&Capacity Planning"), (char*)capacityPlanMenu,	mainMenu,	true,	NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "cp.dspTimePhasedCapacityByWorkCenter", tr("Time-Phased &Capacity..."), SLOT(sDspTimePhasedCapacityByWorkCenter()), capacityPlanMenu, _privileges->check("ViewWorkCenterCapacity"), NULL, NULL, _metrics->boolean("Routings") , NULL },
    { "cp.dspTimePhasedLoadByWorkCenter", tr("Time-Phased &Load..."), SLOT(sDspTimePhasedLoadByWorkCenter()), capacityPlanMenu, _privileges->check("ViewWorkCenterLoad"), NULL, NULL, _metrics->boolean("Routings") , NULL },
    { "cp.dspTimePhasedAvailableCapacityByWorkCenter", tr("Time-Phased &Available Capacity..."), SLOT(sDspTimePhasedAvailableCapacityByWorkCenter()), capacityPlanMenu, _privileges->check("ViewWorkCenterCapacity"), NULL, NULL, _metrics->boolean("Routings") , NULL },
    { "separator", NULL, NULL, capacityPlanMenu, true, NULL, NULL,  _metrics->boolean("Routings") , NULL },

    // Schedule | Capacity Plannning | Time Phased Production
    { "menu",	tr("Time-Phased &Production"), (char*)capacityPlanTpPrdMenu,	capacityPlanMenu,	true,	NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "cp.dspTimePhasedProductionByPlannerCode", tr("by &Planner Code..."), SLOT(sDspTimePhasedProductionByPlannerCode()), capacityPlanTpPrdMenu, _privileges->check("ViewProduction"), NULL, NULL, true , NULL },
    { "cp.dspTimePhasedProductionByItem", tr("by &Item..."), SLOT(sDspTimePhasedProductionByItem()), capacityPlanTpPrdMenu, _privileges->check("ViewProduction"), NULL, NULL, true , NULL },

    { "cp.dspTimePhasedDemandByPlannerCode", tr("Time-Phased &Demand..."), SLOT(sDspTimePhasedDemandByPlannerCode()), capacityPlanMenu, _privileges->check("ViewProductionDemand"), NULL, NULL, true , NULL },
    { "separator", NULL, NULL, capacityPlanMenu, true, NULL, NULL, _metrics->boolean("Routings") && _metrics->boolean("BufferMgt") , NULL },
    { "cp.dspCapacityBufferStatusByWorkCenter", tr("Capacity &Buffer Status..."), SLOT(sDspCapacityBufferStatusByWorkCenter()), capacityPlanMenu, _privileges->check("ViewWorkCenterBufferStatus"), NULL, NULL, _metrics->boolean("Routings") && _metrics->boolean("BufferMgt") , NULL },
  
    // Schedule | Report
    { "menu",	tr("&Reports"), (char*)reportsMenu, mainMenu, true, NULL, NULL, true , NULL },
  
    // Schedule | Report | Planned Orders
    { "menu",	tr("Planned &Orders"), (char*)reportsPlannedMenu, reportsMenu, true, NULL, NULL, true , NULL },
    { "ms.dspPlannedOrdersByPlannerCode", tr("by &Planner Code..."), SLOT(sDspPlannedOrdersByPlannerCode()), reportsPlannedMenu, _privileges->check("ViewPlannedOrders"), new QPixmap(":/images/dspPlannedOrdersByPlannerCode.png"), toolBar, true , "Planned Orders by Planner Code" },
    { "ms.dspPlannedOrdersByItem", tr("by &Item..."), SLOT(sDspPlannedOrdersByItem()), reportsPlannedMenu, _privileges->check("ViewPlannedOrders"), NULL, NULL, true , NULL },
    
    { "separator", NULL, NULL, reportsMenu, true, NULL, NULL, true , NULL },
    { "ms.dspRunningAvailability", tr("&Running Availability..."), SLOT(sDspRunningAvailability()), reportsMenu, _privileges->check("ViewInventoryAvailability"), NULL, NULL, true , NULL },
    { "ms.dspTimePhasedAvailabiltiy", tr("&Time-Phased Availability..."), SLOT(sDspTimePhasedAvailability()), reportsMenu, _privileges->check("ViewInventoryAvailability"), NULL, NULL, true , NULL },
    { "ms.dspMPSDetail", tr("MP&S Detail..."), SLOT(sDspMPSDetail()), reportsMenu, _privileges->check("ViewMPS"), NULL, NULL, true , NULL },
    { "ms.dspMRPDetail", tr("&MRP Detail..."), SLOT(sDspMRPDetail()), reportsMenu, _privileges->check("ViewInventoryAvailability"), NULL, NULL, true , NULL },
    { "separator", NULL, NULL, reportsMenu, true, NULL, NULL, true , NULL },
    { "ms.dspExpediteExceptionsByPlannerCode", tr("E&xpedite Exceptions..."), SLOT(sDspExpediteExceptionsByPlannerCode()), reportsMenu, _privileges->check("ViewInventoryAvailability"), NULL, NULL, true , NULL },
    { "ms.dspReorderExceptionsByPlannerCode", tr("Reorder &Exceptions..."), SLOT(sDspReorderExceptionsByPlannerCode()),reportsMenu, _privileges->check("ViewInventoryAvailability"), NULL, NULL, true , NULL },
    { "separator", NULL, NULL, reportsMenu, true, NULL, NULL, _metrics->boolean("Routings") , NULL },
    { "ms.dspRoughCutByWorkCenter", tr("Rough &Cut Capacity Plan..."), SLOT(sDspRoughCutByWorkCenter()), reportsMenu, _privileges->check("ViewRoughCut"), NULL, NULL,  _metrics->boolean("Routings") , NULL },
    { "ms.dspTimePhasedRoughCutByWorkCenter", tr("Time-P&hased Rough Cut Capacity Plan..."), SLOT(sDspTimePhasedRoughCutByWorkCenter()), reportsMenu, _privileges->check("ViewRoughCut"), NULL, NULL,  _metrics->boolean("Routings") , NULL },
    { "separator", NULL, NULL, reportsMenu, true, NULL, NULL, _metrics->boolean("Routings") , NULL },
    { "ms.dspPlannedRevenue/ExpensesByPlannerCode", tr("P&lanned Revenue/Expenses..."), SLOT(sDspPlannedRevenueExpensesByPlannerCode()), reportsMenu, _privileges->check("ViewPlannedOrders") && _privileges->check("ViewCosts") && _privileges->check("ViewListPrices"), NULL, NULL, _metrics->boolean("Routings") , NULL },
    { "ms.dspTimePhasedPlannedRevenue/ExpensesByPlannerCode", tr("Time-Ph&ased Planned Revenue/Expenses..."), SLOT(sDspTimePhasedPlannedREByPlannerCode()),  reportsMenu, _privileges->check("ViewPlannedOrders") && _privileges->check("ViewCosts") && _privileges->check("ViewListPrices"), NULL, NULL, _metrics->boolean("Routings") , NULL },
    { "separator", NULL, NULL, mainMenu, true, NULL, NULL, true , NULL },
    
    //  Master Information
    { "menu",	tr("&Master Information"), (char*)masterInfoMenu, mainMenu, true, NULL, NULL, true , NULL },
    { "ms.plannerCodes", tr("&Planner Codes..."), SLOT(sPlannerCodes()), masterInfoMenu, _privileges->check("MaintainPlannerCodes") && _privileges->check("ViewPlannerCodes"), NULL, NULL, true , NULL },
    { "ms.warehouseWeek", tr("Warehouse &Week..."), SLOT(sWarehouseWeek()),masterInfoMenu, _privileges->check("MaintainWarehouseWorkWeek"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "ms.warehouseCalendarExceptions", tr("Warehouse Calendar &Exceptions..."), SLOT(sWarehouseCalendarExceptions()), masterInfoMenu, _privileges->check("MaintainWarehouseCalendarExceptions") || _privileges->check("ViewWarehouseCalendarExceptions"), NULL, NULL, _metrics->boolean("BufferMgt") , NULL },
    { "cp.workCenters", tr("Work &Centers..."), SLOT(sWorkCenters()), masterInfoMenu, _privileges->check("MaintainWorkCenters") && _privileges->check("ViewWorkCenters"), NULL, NULL, _metrics->boolean("Routings") , NULL },
  };
  addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0]));

  parent->populateCustomMenu(mainMenu, "Schedule");
  parent->menuBar()->insertItem(tr("Sche&dule"), mainMenu);
}