示例#1
0
packingListBatch::packingListBatch(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_add,		     SIGNAL(clicked()), this, SLOT(sAddSO()));
  connect(_addTO,	     SIGNAL(clicked()), this, SLOT(sAddTO()));
  connect(_autoUpdate,	 SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool)));
  connect(_delete,	     SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_deletePrinted,    SIGNAL(clicked()), this, SLOT(sClearPrinted()));
  connect(_pack, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_printBatch,       SIGNAL(clicked()), this, SLOT(sPrintBatch()));
  connect(_printEditList,    SIGNAL(clicked()), this, SLOT(sPrintEditList()));
  connect(_printPackingList, SIGNAL(clicked()), this, SLOT(sPrintPackingList()));

  setAcceptDrops(TRUE);

  _pack->addColumn(tr("Order #"),       80,           Qt::AlignCenter, true, "order_number" );
  _pack->addColumn(tr("Type"),		40,           Qt::AlignCenter, true, "pack_head_type" );
  _pack->addColumn(tr("Shipment #"),    80,           Qt::AlignCenter, true, "shipment_number" );
  _pack->addColumn(tr("Customer #"),    _itemColumn,  Qt::AlignLeft,   true, "number"   );
  _pack->addColumn(tr("Customer Name"), -1,           Qt::AlignLeft,   true, "name"   );
  _pack->addColumn(tr("Ship Via"),      80,           Qt::AlignLeft,   true, "shipvia");
  _pack->addColumn(tr("Hold Type"),     _dateColumn,  Qt::AlignCenter, true, "f_holdtype" );
  _pack->addColumn(tr("Printed"),       _dateColumn,  Qt::AlignCenter, true, "pack_printed" );

  if (_privileges->check("MaintainPackingListBatch"))
  {
    _add->setEnabled(TRUE);
    _addTO->setEnabled(TRUE);
    _deletePrinted->setEnabled(TRUE);
    connect(_pack, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
  }

  if (_privileges->check("PrintPackingLists"))
  {
    _printBatch->setEnabled(TRUE);
    connect(_pack, SIGNAL(valid(bool)), _printPackingList, SLOT(setEnabled(bool)));
  }

  _addTO->setVisible(_metrics->boolean("MultiWhs"));

  sFillList();
  sHandleAutoUpdate(_autoUpdate->isChecked());
}
示例#2
0
void dspBacklogByParameterList::sPopulateMenu(QMenu *pMenu)
{
  QList <QTreeWidgetItem*> selected = _soitem->selectedItems();

  int menuItem;

  if (selected.size() == 1)
  {
    menuItem = pMenu->insertItem(tr("Edit Order..."), this, SLOT(sEditOrder()), 0);
    if (!_privileges->check("MaintainSalesOrders"))
      pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("View Order..."), this, SLOT(sViewOrder()), 0);
    if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders")))
      pMenu->setItemEnabled(menuItem, FALSE);

    if (_soitem->altId() != -1)
    {
      pMenu->insertSeparator();

      menuItem = pMenu->insertItem(tr("Edit Item..."), this, SLOT(sEditItem()), 0);
      if (!_privileges->check("MaintainSalesOrders"))
        pMenu->setItemEnabled(menuItem, FALSE);

      menuItem = pMenu->insertItem(tr("View Item..."), this, SLOT(sViewItem()), 0);
      if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders")))
        pMenu->setItemEnabled(menuItem, FALSE);
    }
  }

  if (_soitem->id() > 0)
  {
    pMenu->insertSeparator();

    menuItem = pMenu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0);
    if (!_privileges->check("PrintPackingLists"))
      pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("Add to Packing List Batch..."), this, SLOT(sAddToPackingListBatch()), 0);
    if (!_privileges->check("MaintainPackingListBatch"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
}
void dspPartiallyShippedOrders::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int)
{
  QAction *menuItem;

  menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder()));
  menuItem->setEnabled(_privileges->check("MaintainSalesOrders"));

  menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder()));
  menuItem->setEnabled(_privileges->check("MaintainSalesOrders") ||
                       _privileges->check("ViewSalesOrders"));

  pMenu->addSeparator();

  if ( (list()->currentItem()->text(0) != "P") && (list()->currentItem()->text(0) != "C") )
  {
    menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList()));
    menuItem->setEnabled(_privileges->check("PrintPackingLists"));
  }
}
示例#4
0
void dspSummarizedBacklogByWarehouse::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  if (_so->id() != -1)
  {
    menuItem = pMenu->insertItem(tr("Inventory Availability by Sales Order..."), this, SLOT(sInventoryAvailabilityBySalesOrder()), 0);
    if (!_privileges->check("ViewInventoryAvailability"))
      pMenu->setItemEnabled(menuItem, FALSE);

    pMenu->insertSeparator();
  
    menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
    if (!_privileges->check("MaintainSalesOrders"))
      pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);
    if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders")))
      pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("Reschedule..."), this, SLOT(sReschedule()), 0);
    if (!_privileges->check("MaintainSalesOrders"))
      pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("Delete..."), this, SLOT(sDelete()), 0);
    if (!_privileges->check("MaintainSalesOrders"))
      pMenu->setItemEnabled(menuItem, FALSE);

  }

  if (_so->altId() > -1 ||
      (_so->id() != -1 && _so->currentItem()->text(2) != tr("Pack") &&
       _so->currentItem()->text(2) != tr("Credit")))
  {
    if (_so->id() != -1)
      pMenu->insertSeparator();

    menuItem = pMenu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0);
    if (!_privileges->check("PrintPackingLists"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
}
示例#5
0
void dspPartiallyShippedOrders::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  menuItem = pMenu->insertItem(tr("Edit Order..."), this, SLOT(sEditOrder()), 0);
  if (!_privileges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("View Order..."), this, SLOT(sViewOrder()), 0);
  if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders")))
    pMenu->setItemEnabled(menuItem, FALSE);

  pMenu->insertSeparator();

  if ( (_so->currentItem()->text(0) != "P") && (_so->currentItem()->text(0) != "C") )
  {
    menuItem = pMenu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0);
    if (!_privileges->check("PrintPackingLists"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
}
示例#6
0
void openSalesOrders::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
  if (!_privleges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);

  menuItem = pMenu->insertItem(tr("Copy..."), this, SLOT(sCopy()), 0);
  if (!_privleges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("Reschedule..."), this, SLOT(sReschedule()), 0);
  if (!_privleges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("Delete..."), this, SLOT(sDelete()), 0);
  if (!_privleges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  pMenu->insertSeparator();

  menuItem = pMenu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0);
  if (!_privleges->check("PrintPackingLists"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("Add to Packing List Batch..."), this, SLOT(sAddToPackingListBatch()), 0);
  if (!_privleges->check("MaintainPackingListBatch"))
    pMenu->setItemEnabled(menuItem, FALSE);

  if (_metrics->boolean("EnableBatchManager"))
  {
    menuItem = pMenu->insertItem(tr("Email Order Acknowledgment..."), this, SLOT(sDeliver()), 0);
  }

  menuItem = pMenu->insertItem(tr("Print Sales Order Form..."), this, SLOT(sPrintForms()), 0); 

}
示例#7
0
void dspSummarizedBacklogByWarehouse::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int)
{
  QAction *menuItem;

  if (list()->id() != -1)
  {
    menuItem = pMenu->addAction(tr("Inventory Availability by Sales Order..."), this, SLOT(sInventoryAvailabilityBySalesOrder()));
    if (!_privileges->check("ViewInventoryAvailability"))
      menuItem->setEnabled(false);

    pMenu->addSeparator();
  
    menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
    if (!_privileges->check("MaintainSalesOrders"))
      menuItem->setEnabled(false);

    menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView()));
    if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders")))
      menuItem->setEnabled(false);

    menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete()));
    if (!_privileges->check("MaintainSalesOrders"))
      menuItem->setEnabled(false);

  }

  if (list()->altId() > -1 ||
      (list()->id() != -1 && list()->currentItem()->text(2) != tr("Pack") &&
       list()->currentItem()->text(2) != tr("Credit")))
  {
    if (list()->id() != -1)
      pMenu->addSeparator();

    menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList()));
    if (!_privileges->check("PrintPackingLists"))
      menuItem->setEnabled(false);
  }
}
示例#8
0
void openSalesOrders::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
  if (!_privileges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);

  menuItem = pMenu->insertItem(tr("Copy..."), this, SLOT(sCopy()), 0);
  if (!_privileges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("Delete..."), this, SLOT(sDelete()), 0);
  if (!_privileges->check("MaintainSalesOrders"))
    pMenu->setItemEnabled(menuItem, FALSE);

  pMenu->insertSeparator();

  menuItem = pMenu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0);
  if (!_privileges->check("PrintPackingLists"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("Add to Packing List Batch..."), this, SLOT(sAddToPackingListBatch()), 0);
  if (!_privileges->check("MaintainPackingListBatch"))
    pMenu->setItemEnabled(menuItem, FALSE);

  menuItem = pMenu->insertItem(tr("Print Sales Order Form..."), this, SLOT(sPrintForms()), 0); 
  
  pMenu->insertSeparator();

  pMenu->insertItem(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus()), 0);
  pMenu->insertItem(tr("Shipments..."), this, SLOT(sShipment()), 0);

}
示例#9
0
menuSales::menuSales(GUIClient *pParent) :
  QObject(pParent)
{
  setObjectName("soModule");
  parent = pParent;

  toolBar = new QToolBar(tr("Sales Tools"));
  toolBar->setObjectName("Sales Tools");
  toolBar->setIconSize(QSize(32, 32));
  parent->addToolBar(toolBar);

  mainMenu = new QMenu(parent);
  quotesMenu = new QMenu(parent);
  ordersMenu = new QMenu(parent);
  billingMenu = new QMenu(parent);
  billingInvoicesMenu = new QMenu(parent);
  billingCreditMemosMenu= new QMenu(parent);
  billingFormsMenu= new QMenu(parent);
  returnsMenu= new QMenu(parent);
  lookupMenu = new QMenu(parent);
  lookupQuoteMenu = new QMenu(parent);
  lookupSoMenu = new QMenu(parent);
  formsMenu = new QMenu(parent);
  reportsMenu = new QMenu(parent);
  analysisMenu = new QMenu(parent);
  prospectMenu = new QMenu(parent);
  customerMenu = new QMenu(parent);
  pricingReportsMenu = new QMenu(parent);
  pricingMenu = new QMenu(parent);
  pricingUpdateMenu = new QMenu(parent);
  utilitiesMenu = new QMenu(parent);

  mainMenu->setObjectName("menu.sales");
  quotesMenu->setObjectName("menu.sales.quotes");
  ordersMenu->setObjectName("menu.sales.orders");
  billingMenu->setObjectName("menu.sales.billing");
  billingInvoicesMenu->setObjectName("menu.sales.billinginvoices");
  billingCreditMemosMenu->setObjectName("menu.sales.billingcreditmemos");
  billingFormsMenu->setObjectName("menu.sales.billingforms");
  returnsMenu->setObjectName("menu.sales.returns");
  lookupMenu->setObjectName("menu.sales.lookup");
  lookupQuoteMenu->setObjectName("menu.sales.lookupquote");
  lookupSoMenu->setObjectName("menu.sales.lookupso");
  formsMenu->setObjectName("menu.sales.forms");
  reportsMenu->setObjectName("menu.sales.reports");
  analysisMenu->setObjectName("menu.sales.analysis");
  prospectMenu->setObjectName("menu.sales.prospect");
  customerMenu->setObjectName("menu.sales.customer");
  pricingReportsMenu->setObjectName("menu.sales.pricingreports");
  pricingMenu->setObjectName("menu.sales.pricing");
  pricingUpdateMenu->setObjectName("menu.sales.pricingupdate");
  utilitiesMenu->setObjectName("menu.sales.utilities");

  actionProperties acts[] = {
    // Sales | Quotes
    { "menu",	tr("&Quote"),	(char*)quotesMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.newQuote", tr("&New..."),	SLOT(sNewQuote()), quotesMenu, "MaintainQuotes",	NULL, NULL, true, NULL },
    { "so.listQuotes", tr("&List..."),	SLOT(sQuotes()), quotesMenu, "MaintainQuotes ViewQuotes",	NULL, NULL, true, NULL },
    
    // Sales | Sales Order
    { "menu",	tr("&Sales Order"),	(char*)ordersMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.newSalesOrder", 	     tr("&New..."),		SLOT(sNewSalesOrder()),   ordersMenu, "MaintainSalesOrders", NULL, NULL,	 true, NULL },
    { "so.listOpenSalesOrders",      tr("&List Open..."),	SLOT(sOpenSalesOrders()), ordersMenu, "MaintainSalesOrders ViewSalesOrders",	QPixmap(":/images/listOpenSalesOrders.png"), toolBar,  true, tr("List Open Sales Orders") },

    // Sales | Billing
    { "menu",	tr("&Billing"),     (char*)billingMenu,		mainMenu,	"true",	NULL, NULL, true, NULL },
    
    // Sales | Billing | Invoice
    { "menu",	tr("&Invoice"),   (char*)billingInvoicesMenu,	billingMenu,	"true",	NULL, NULL, true, NULL },
    { "so.uninvoicedShipments",		     tr("&Uninvoiced Shipments..."),			SLOT(sUninvoicedShipments()), 		billingInvoicesMenu, "SelectBilling",	 QPixmap(":/images/uninvoicedShipments"), toolBar, true, tr("Uninvoiced Shipments") },
    { "so.selectAllShippedOrdersForBilling", tr("Approve &All Shipped Orders for Billing..."),	SLOT(sSelectShippedOrdersForBilling()), billingInvoicesMenu, "SelectBilling",	NULL, NULL, true, NULL },
    { "so.selectOrderForBilling",	     tr("Approve &Order for Billing..."),			SLOT(sSelectOrderForBilling()),		billingInvoicesMenu, "SelectBilling",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	"true",		NULL, NULL, true, NULL },
    { "so.dspBillingSelections",	     tr("Billing &Approvals..."),	SLOT(sDspBillingSelections()), billingInvoicesMenu, "SelectBilling", QPixmap(":/images/billingSelections"), toolBar, true, tr("Billing Approvals") },
    { "so.createInvoices",	     tr("&Create Invoices..."),	SLOT(sCreateInvoices()), billingInvoicesMenu, "SelectBilling",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	"true",		NULL, NULL, true, NULL },
    { "so.listUnpostedInvoices",	     tr("&List Unposted Invoices..."),	SLOT(sUnpostedInvoices()), billingInvoicesMenu, "SelectBilling",	NULL, NULL,  true, NULL },
    { "so.postInvoices",		     tr("Post &Invoices..."),		SLOT(sPostInvoices()), billingInvoicesMenu, "PostMiscInvoices",	NULL, NULL, true, NULL },

    // Sales | Billing | Return
    { "menu",	tr("&Return"), (char*)billingCreditMemosMenu,	billingMenu,	"true",	NULL, NULL, true, NULL },
    { "so.newCreditMemo",		     tr("&New..."),		SLOT(sNewCreditMemo()), billingCreditMemosMenu, "MaintainCreditMemos",	NULL, NULL, true, NULL },
    { "so.listUnpostedCreditMemos",	     tr("&List Unposted..."),	SLOT(sUnpostedCreditMemos()), billingCreditMemosMenu, "MaintainCreditMemos ViewCreditMemos",	NULL, NULL, true, NULL },
    { "so.creditMemoEditList",		     tr("&Edit List..."),	SLOT(sCreditMemoEditList()), billingCreditMemosMenu, "MaintainCreditMemos ViewCreditMemos",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	billingCreditMemosMenu,	"true",		NULL, NULL, true, NULL },
    { "so.postCreditMemos",		     tr("&Post..."),	SLOT(sPostCreditMemos()), billingCreditMemosMenu, "PostARDocuments",	NULL, NULL, true, NULL },

    { "separator",	NULL,	NULL,	billingMenu,	"true",		NULL, NULL, true, NULL },
    
    // Sales | Billing | Forms
    { "menu",	tr("&Forms"), (char*)billingFormsMenu,	billingMenu,	"true",	NULL, NULL, true, NULL },
    { "so.printInvoices",		     tr("&Print Invoices..."),		SLOT(sPrintInvoices()), billingFormsMenu, "PrintInvoices",	NULL, NULL, true, NULL },
    { "so.reprintInvoices",		     tr("&Re-Print Invoices..."),	SLOT(sReprintInvoices()), billingFormsMenu, "PrintInvoices",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	billingFormsMenu,	"true",		NULL, NULL, true , NULL },
    { "so.printCreditMemos",		     tr("Print &Returns..."),	SLOT(sPrintCreditMemos()), billingFormsMenu, "PrintCreditMemos",	NULL, NULL, true, NULL },
    { "so.reprintCreditMemos",		     tr("Re-Print &Returns..."),	SLOT(sReprintCreditMemos()), billingFormsMenu, "PrintCreditMemos",	NULL, NULL, true, NULL },

    // Sales | Returns
    { "menu",	tr("&Return"),	(char*)returnsMenu,	mainMenu, "true",	NULL, NULL,  _metrics->boolean("EnableReturnAuth"), NULL },
    { "so.newReturn", tr("&New..."),	SLOT(sNewReturn()), returnsMenu, "MaintainReturns",	NULL, NULL, true, NULL },
    { "so.openReturns", tr("&List Open..."),	SLOT(sOpenReturns()), returnsMenu, "MaintainReturns ViewReturns",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	returnsMenu,	"true",		NULL, NULL, true , NULL },
    { "so.returnsWorkbench", tr("&Workbench..."),	SLOT(sReturnsWorkbench()), returnsMenu, "MaintainReturns ViewReturns",	NULL, NULL, true, NULL },

    { "separator",	NULL,	NULL,	mainMenu,	"true",		NULL, NULL, true, NULL },
    
    // Sales | Lookup
    { "menu",	tr("&Lookup"),           (char*)lookupMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    
    // Sales | Lookup | Quote Lookup
    { "menu",	tr("&Quote"),           (char*)lookupQuoteMenu,	lookupMenu,	"true",	NULL, NULL, true, NULL },
    { "so.dspQuoteLookupByCustomer", tr("by &Customer..."),	SLOT(sDspQuoteLookupByCustomer()), lookupQuoteMenu, "ViewQuotes",	NULL, NULL, true, NULL },
    { "so.dspQuoteOrderLookupByItem", tr("by &Item..."),	SLOT(sDspQuoteLookupByItem()), lookupQuoteMenu, "ViewQuotes",	NULL, NULL, true, NULL },
    
    // Sales | Lookup | Sales Order Lookup
    { "menu",	tr("&Sales Order"),           (char*)lookupSoMenu,	lookupMenu,	"true",	NULL, NULL, true, NULL },
    { "so.dspSalesOrderLookupByCustomerType", tr("by Customer &Type..."),	SLOT(sDspOrderLookupByCustomerType()), lookupSoMenu, "ViewSalesOrders",	NULL, NULL, true, NULL },
    { "so.dspSalesOrderLookupByCustomer", tr("by &Customer..."),	SLOT(sDspOrderLookupByCustomer()), lookupSoMenu, "ViewSalesOrders",	NULL, NULL, true, NULL },
    { "so.dspSalesOrderLookupByCustomerPO", tr("by Customer &PO..."),	SLOT(sDspOrderLookupByCustomerPO()), lookupSoMenu, "ViewSalesOrders",	NULL, NULL, true, NULL },
    { "so.dspSalesOrderLookupByItem", tr("by &Item..."),	SLOT(sDspOrderLookupByItem()), lookupSoMenu, "ViewSalesOrders",	NULL, NULL, true, NULL },
    
    { "separator",	NULL,	NULL,	lookupMenu,	"true",		NULL, NULL, true, NULL }, 
    { "so.dspSalesOrderStatus", tr("Sales Order S&tatus..."),	SLOT(sDspSalesOrderStatus()), lookupMenu, "ViewSalesOrders",	NULL, NULL, true, NULL },   
  
    // Sales | Forms
    { "menu",	tr("&Forms"),           (char*)formsMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.printSalesOrderForm", tr("Print Sales &Order Form..."),	SLOT(sPrintSalesOrderForm()), formsMenu, "MaintainSalesOrders ViewSalesOrders",	NULL, NULL, true, NULL },
    { "so.printReturnAuthForm", tr("Print &Return Auth. Form..."),	SLOT(sPrintReturnAuthForm()), formsMenu, "MaintainReturns",	NULL, NULL, _metrics->boolean("EnableReturnAuth"), NULL },
    { "separator",	NULL,	NULL,	formsMenu,	"true",		NULL, NULL, true , NULL }, 
    { "so.packingListBatch", tr("Packing &List Batch..."),	SLOT(sPackingListBatch()), formsMenu, "MaintainPackingListBatch ViewPackingListBatch",	NULL, NULL, true, NULL },
    { "so.printPackingList", tr("&Print Packing List..."),	SLOT(sPrintPackingList()), formsMenu, "PrintPackingLists",	NULL, NULL, true, NULL },


    // Sales | Reports
    { "menu",	tr("&Reports"),           (char*)reportsMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.dspSummarizedBacklogByWarehouse", tr("Su&mmarized Backlog..."),	SLOT(sDspSummarizedBacklogByWarehouse()), reportsMenu, "ViewSalesOrders",	QPixmap(":/images/dspSummarizedBacklogByWhse.png"), toolBar,  true, tr("Summarized Backlog") },

    // Sales | Reports | Backlog
    { "so.dspBacklog", tr("&Backlog..."),	SLOT(sDspBacklog()), reportsMenu, "ViewSalesOrders",	NULL, NULL, true, NULL },
    { "so.dspPartiallyShippedOrders", tr("&Partially Shipped Orders..."),	SLOT(sDspPartiallyShippedOrders()), reportsMenu, "ViewSalesOrders",	NULL, NULL, true, NULL },
    { "so.dspReservations", tr("Reservations by Item..."),	SLOT(sDspReservations()), reportsMenu, "ViewInventoryAvailability",	NULL, NULL, _metrics->boolean("EnableSOReservations"), NULL },    
    { "separator",	NULL,	NULL,	reportsMenu,	"true",		NULL, NULL, true, NULL },   
    
    // Sales | Reports | Inventory Availability
    { "so.dspInventoryAvailability", tr("Inventory &Availability..."),	SLOT(sDspInventoryAvailability()), reportsMenu, "ViewInventoryAvailability",	NULL, NULL, true, NULL },
    { "so.dspInventoryAvailabilityBySalesOrder", tr("Availability by &Sales Order..."),	SLOT(sDspInventoryAvailabilityBySalesOrder()), reportsMenu, "ViewInventoryAvailability",	NULL, NULL, true, NULL },
    { "so.dspInventoryAvailabilityByCustomerType", tr("Availability by &Customer Type..."),	SLOT(sDspInventoryAvailabilityByCustomerType()), reportsMenu, "ViewInventoryAvailability",	NULL, NULL, true, NULL },

    { "separator",	NULL,	NULL,	reportsMenu,	"true",		NULL, NULL, true, NULL },
    { "so.dspEarnedCommissions", tr("&Earned Commissions..."),	SLOT(sDspEarnedCommissions()), reportsMenu, "ViewCommissions",	NULL, NULL, true, NULL },
    { "so.dspBriefEarnedCommissions", tr("B&rief Earned Commissions..."),	SLOT(sDspBriefEarnedCommissions()), reportsMenu, "ViewCommissions",	NULL, NULL, true, NULL },
    { "so.dspTaxHistory", tr("Tax History..."),	SLOT(sDspTaxHistory()), reportsMenu, "ViewTaxReconciliations",	NULL, NULL, true, NULL },

    { "separator",	NULL,	NULL,	reportsMenu,	"true",		NULL, NULL, true, NULL },
    
    // Sales | Analysis
    { "menu",	tr("&Analysis"),           (char*)analysisMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "sa.dspBookings", tr("&Bookings..."), SLOT(sDspBookings()), analysisMenu, "ViewSalesOrders", NULL, NULL, true , NULL },
    { "sa.dspTimePhasedBookings", tr("T&ime Phased Bookings..."), SLOT(sDspTimePhasedBookings()), analysisMenu, "ViewSalesOrders", NULL, NULL, true , NULL },
    { "separator",	NULL,	NULL,	analysisMenu,	"true",		NULL, NULL, true, NULL },
    { "sa.dspSalesHistory", tr("Sales &History..."), SLOT(sDspSalesHistory()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL },
    { "sa.dspBriefSalesHistory", tr("Brie&f Sales History..."), SLOT(sDspBriefSalesHistory()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL },
    { "sa.dspSummarizedSalesHistory", tr("Summari&zed Sales History..."), SLOT(sDspSummarizedSales()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL },
    { "sa.dspTimePhasedSalesHistory", tr("Time &Phased Sales History..."), SLOT(sDspTimePhasedSales()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL },

    { "separator",	NULL,	NULL,	mainMenu,	"true",		NULL, NULL, true, NULL },

    // Sales | Prospect
    { "menu",	tr("&Prospect"),       (char*)prospectMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.enterNewProspect", tr("&New..."),	SLOT(sNewProspect()), prospectMenu, "MaintainProspectMasters",	NULL, NULL, true, NULL },
    { "so.prospects", tr("&List..."),	SLOT(sProspects()), prospectMenu, "MaintainProspectMasters ViewProspectMasters",	NULL, NULL, true, NULL },

    // Sales | Customer
    { "menu",	tr("&Customer"),       (char*)customerMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.enterNewCustomer", tr("&New..."),	SLOT(sNewCustomer()), customerMenu, "MaintainCustomerMasters",	NULL, NULL, true, NULL },
    { "so.customers", tr("&List..."),	SLOT(sCustomers()), customerMenu, "MaintainCustomerMasters ViewCustomerMasters",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	customerMenu,	"true",		NULL, NULL, true, NULL },
    { "so.customerWorkbench", tr("&Workbench..."),	SLOT(sCustomerWorkbench()), customerMenu, "MaintainCustomerMasters ViewCustomerMasters",	QPixmap(":/images/customerInformationWorkbench.png"), toolBar,  true, tr("Customer Workbench") }, 
    { "separator",	NULL,	NULL,	customerMenu,	"true",		NULL, NULL, true, NULL },
    { "so.customerGroups", tr("&Groups..."),	SLOT(sCustomerGroups()), customerMenu, "MaintainCustomerGroups ViewCustomerGroups",	NULL, NULL, true, NULL },
   
    // Sales | Pricing
    { "menu",	tr("Pricing"),       (char*)pricingMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.itemListPrice", tr("Item &List Price..."),	SLOT(sItemListPrice()), pricingMenu, "MaintainListPrices ViewListPrices",	NULL, NULL, true, NULL },
    { "so.updateListPricesByProductCategory", tr("&Update List Prices..."),	SLOT(sUpdateListPricesByProductCategory()), pricingMenu, "MaintainListPrices",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	pricingMenu,	"true",		NULL, NULL, true, NULL },
    { "so.pricingSchedules", tr("Pricing &Schedules..."),	SLOT(sPricingSchedules()), pricingMenu, "MaintainListPrices ViewListPrices",	NULL, NULL, true, NULL },
    { "so.updatePricingSchedules", tr("Update Pricing Schedules..."),	SLOT(sUpdatePrices()), pricingMenu, "UpdatePricingSchedules",	NULL, NULL, true, NULL },
    { "so.pricingScheduleAssignments", tr("Pricing Schedule Assi&gnments..."),	SLOT(sPricingScheduleAssignments()), pricingMenu, "AssignPricingSchedules",	NULL, NULL, true, NULL },
    { "so.sales", tr("S&ales..."),	SLOT(sSales()), pricingMenu, "CreateSales",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	pricingMenu,	"true",		NULL, NULL, true, NULL },

    // Sales | Pricing | Reports
    { "menu",	tr("&Reports"),	(char*)pricingReportsMenu,	pricingMenu,	"true",	NULL, NULL, true, NULL },
    { "so.dspPricesByCustomerType", tr("Item Prices by Customer &Type..."),	SLOT(sDspPricesByCustomerType()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL,	 true, NULL },
    { "so.dspPricesByCustomer", tr("Item Prices by &Customer..."),	SLOT(sDspPricesByCustomer()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL,	 true, NULL },
    { "so.dspPricesByItem", tr("Item Prices by &Item..."),	SLOT(sDspPricesByItem()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL,	 true, NULL },
    { "separator",	NULL,	NULL,	pricingReportsMenu,	"true",		NULL, NULL, true, NULL },
    { "so.dspFreightPricesByCustomerType", tr("Freight Prices by Customer &Type..."),	SLOT(sDspFreightPricesByCustomerType()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL,	 true, NULL },
    { "so.dspFreightPricesByCustomer", tr("Freight Prices by &Customer..."),	SLOT(sDspFreightPricesByCustomer()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL,	 true, NULL },
    
    { "separator",	NULL,	NULL,	mainMenu,	"true",		NULL, NULL, true, NULL },

    { "menu",	tr("&Utilities"),         (char*)utilitiesMenu,	mainMenu,	"true",	NULL, NULL, true, NULL },
    { "so.reassignCustomerTypeByCustomerType", tr("&Reassign Customer Type by Customer Type..."),	SLOT(sReassignCustomerTypeByCustomerType()), utilitiesMenu, "MaintainCustomerMasters",	NULL, NULL, true, NULL },
    { "so.updateCreditStatusByCustomer", tr("&Update Credit Status by Customer..."),	SLOT(sUpdateCreditStatusByCustomer()), utilitiesMenu, "MaintainCustomerMasters UpdateCustomerCreditStatus",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	utilitiesMenu,	"true",		NULL, NULL, true, NULL },
    { "so.purgeInvoices",		     tr("Purge &Invoices..."),		SLOT(sPurgeInvoices()), utilitiesMenu, "PurgeInvoices",	NULL, NULL, true, NULL },
    { "so.purgeCreditMemos",		     tr("Purge &Returns..."),	SLOT(sPurgeCreditMemos()), utilitiesMenu, "PurgeCreditMemos",	NULL, NULL, true, NULL },
    { "separator",	NULL,	NULL,	utilitiesMenu,	"true",		NULL, NULL, _metrics->boolean("EnableSOReservations"), NULL },
    { "so.allocateReservations", tr("Allocate Reser&vations..."), SLOT(sAllocateReservations()), utilitiesMenu, "MaintainReservations", NULL, NULL, _metrics->boolean("EnableSOReservations") , NULL },
    { "separator",	NULL,	NULL,	utilitiesMenu,	"true",		NULL, NULL, true, NULL },
    { "sa.archieveSalesHistory", tr("&Archive Sales History..."), SLOT(sArchiveSalesHistory()), utilitiesMenu, "ArchiveSalesHistory", NULL, NULL, true , NULL },
    { "sa.restoreSalesHistory", tr("Restore &Sales History..."), SLOT(sRestoreSalesHistory()), utilitiesMenu, "RestoreSalesHistory", NULL, NULL, true , NULL },

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

  };

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

  parent->populateCustomMenu(mainMenu, "Sales");
  QAction * m = parent->menuBar()->addMenu(mainMenu);
  if(m)
    m->setText(tr("S&ales"));
}
示例#10
0
void eventManager::sPopulateMenu(QMenu *menu)
{
  int menuItem;

  if (_event->currentItem()->text(5).length() == 0)
  {
    menuItem = menu->insertItem(tr("Acknowledge"), this, SLOT(sAcknowledge()), 0);
    if ( ((_currentUser->isChecked()) && (!_privileges->check("DispatchOwnEvents"))) ||
         ((_selectedUser->isChecked()) && (!_privileges->check("DispatchOtherEvents"))) )
        menu->setItemEnabled(menuItem, FALSE);
  }

  menuItem = menu->insertItem(tr("Delete"), this, SLOT(sDelete()), 0);
  if ( ((_currentUser->isChecked()) && (!_privileges->check("DeleteOwnEvents"))) ||
       ((_selectedUser->isChecked()) && (!_privileges->check("DeleteOtherEvents"))) )
      menu->setItemEnabled(menuItem, FALSE);

  // if multiple items are selected then keep the menu short
  QList<QTreeWidgetItem*> list = _event->selectedItems();
  if (list.size() > 1)
    return;

  if ( (_event->currentItem()->text(6) == "WoCreated") ||
       (_event->currentItem()->text(6) == "WoDueDateChanged") ||
       (_event->currentItem()->text(6) == "WoQtyChanged") )
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("Inventory Availability by Work Order..."), this, SLOT(sInventoryAvailabilityByWorkOrder()), 0);
  }
  
  else if ( (_event->currentItem()->text(6) == "POitemCreate") )
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("View Purchase Order Item..."), this, SLOT(sViewPurchaseOrderItem()), 0);
  }

  else if ( (_event->currentItem()->text(6) == "SoitemCreated") ||
            (_event->currentItem()->text(6) == "SoitemQtyChanged") ||
            (_event->currentItem()->text(6) == "SoitemSchedDateChanged") )
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("View Sales Order..."), this, SLOT(sViewSalesOrder()), 0);
    menuItem = menu->insertItem(tr("View Sales Order Item..."), this, SLOT(sViewSalesOrderItem()), 0);
    menuItem = menu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0);
  }

  else if (_event->currentItem()->text(6) == "SoCommentsChanged")
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("View Sales Order..."), this, SLOT(sViewSalesOrder()), 0);
    menuItem = menu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0);
  }

  else if (_event->currentItem()->text(6) == "QOHBelowZero")
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()), 0);
    menuItem = menu->insertItem(tr("View Inventory History..."), this, SLOT(sViewInventoryHistory()), 0);
    menuItem = menu->insertItem(tr("View Inventory Availability..."), this, SLOT(sViewInventoryAvailability()), 0);
  }

  else if (_event->currentItem()->text(6) == "RWoQtyRequestChange")
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("Recall Work Order"), this, SLOT(sRecallWo()), 0);
    menuItem = menu->insertItem(tr("Change W/O Quantity..."), this, SLOT(sChangeWoQty()), 0);
    menuItem = menu->insertItem(tr("Print W/O Traveler..."), this, SLOT(sPrintWoTraveler()), 0);
  }

  else if (_event->currentItem()->text(6) == "RWoDueDateRequestChange")
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("Recall Work Order"), this, SLOT(sRecallWo()), 0);
    menuItem = menu->insertItem(tr("Change W/O Due Date..."), this, SLOT(sChangeWoDueDate()), 0);
    menuItem = menu->insertItem(tr("Print W/O Traveler..."), this, SLOT(sPrintWoTraveler()), 0);
  }

  else if (_event->currentItem()->text(6) == "RWoRequestCancel")
  {
    menu->insertSeparator();

    menuItem = menu->insertItem(tr("Recall Work Order"), this, SLOT(sRecallWo()), 0);
    menuItem = menu->insertItem(tr("Delete Work Order..."), this, SLOT(sDeleteWorkOrder()), 0);
  }
}
示例#11
0
moduleSO::moduleSO(OpenMFGGUIClient *pParent) :
  QObject(pParent, "soModule")
{
  parent = pParent;

  toolBar = new QToolBar(tr("S/O Tools"));
  toolBar->setObjectName("S/O Tools");
  toolBar->setIconSize(QSize(32, 32));
  if (_preferences->boolean("ShowSOToolbar"))
    parent->addToolBar(toolBar);

  mainMenu		= new QMenu();
  ordersMenu		= new QMenu();
  billingMenu		= new QMenu();
  billingInvoicesMenu	= new QMenu();
  billingCreditMemosMenu= new QMenu();
  pricingDisplaysMenu	= new QMenu();
  pricingMenu		= new QMenu();
  displaysMenu		= new QMenu();
  reportsMenu		= new QMenu();
  masterInfoMenu	= new QMenu();
  utilitiesMenu		= new QMenu();

  struct actionProperties {
    const char*		actionName;
    const QString	actionTitle;
    const char*		slot;
    QMenu*		menu;
    bool		priv;
    QPixmap*		pixmap;
    QToolBar*		toolBar;
    bool		visible;
  };

  actionProperties acts[] = {
    { "menu",	tr("Orders"),	(char*)ordersMenu,	mainMenu,	true,	NULL, NULL, true},
    { "so.newSalesOrder", 	     tr("New Sales Order..."),		SLOT(sNewSalesOrder()),   ordersMenu, _privleges->check("MaintainSalesOrders"), NULL, NULL,	 true},
    { "so.listOpenSalesOrders",      tr("List Open Sales Orders..."),	SLOT(sOpenSalesOrders()), ordersMenu, (_privleges->check("MaintainSalesOrders") || _privleges->check("ViewSalesOrders")),	new QPixmap(":/images/listOpenSalesOrders.png"), toolBar,  true},
    { "so.rescheduleAllSoLineItems", tr("Reschedule all S/O Line Items..."),	SLOT(sRescheduleSoLineItems()),  ordersMenu, _privleges->check("MaintainSalesOrders"),	 NULL, NULL, true},
    { "so.dspCustomerInformation",   tr("Customer Information Workbench..."),	SLOT(sDspCustomerInformation()), ordersMenu, (_privleges->check("MaintainCustomerMasters") || _privleges->check("ViewCustomerMasters")), new QPixmap(":/images/customerInformationWorkbench.png"), toolBar,  true},
    { "separator",	NULL,	NULL,	ordersMenu,	true,		NULL, NULL, true},
    { "so.packingListBatch", tr("Packing List Batch..."),	SLOT(sPackingListBatch()), ordersMenu, (_privleges->check("MaintainPackingListBatch") || _privleges->check("ViewPackingListBatch")),	NULL, NULL, true},
    { "so.printPackingList", tr("Print Packing List..."),	SLOT(sPrintPackingList()), ordersMenu, _privleges->check("PrintPackingLists"),	NULL, NULL, true},
    { "so.deliverSalesOrder", tr("Schedule S/O for Email Delivery..."),	SLOT(sDeliverSalesOrder()), ordersMenu, _privleges->check("ViewSalesOrders") ,	NULL, NULL, _metrics->boolean("EnableBatchManager")},

    { "separator",	NULL,	NULL,	ordersMenu,	true,		NULL, NULL, true},

    { "so.newQuote", tr("New Quote..."),	SLOT(sNewQuote()), ordersMenu, _privleges->check("MaintainQuotes"),	NULL, NULL, true},
    { "so.listQuotes", tr("List Quotes..."),	SLOT(sQuotes()), ordersMenu, (_privleges->check("MaintainQuotes") || _privleges->check("ViewQuotes")),	NULL, NULL, true},

    { "menu",	tr("Billing"),     (char*)billingMenu,		mainMenu,	true,	NULL, NULL, true},
    { "menu",	tr("&Invoices"),   (char*)billingInvoicesMenu,	billingMenu,	true,	NULL, NULL, true},
    { "so.uninvoicedShipments",		     tr("Uninvoiced Shipments..."),			SLOT(sUninvoicedShipments()), 		billingInvoicesMenu, _privleges->check("SelectBilling"),	 new QPixmap(":/images/uninvoicedShipments"), toolBar, true},
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	true,		NULL, NULL, true},
    { "so.selectAllShippedOrdersForBilling", tr("Select All Shipped Orders for Billing..."),	SLOT(sSelectShippedOrdersForBilling()), billingInvoicesMenu, _privleges->check("SelectBilling"),	NULL, NULL, true},
    { "so.selectOrderForBilling",	     tr("Select Order for Billing..."),			SLOT(sSelectOrderForBilling()),		billingInvoicesMenu, _privleges->check("SelectBilling"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	true,		NULL, NULL, true},
    { "so.billingEditList",		     tr("Billing Edit List..."),	SLOT(sBillingEditList()), billingInvoicesMenu, _privleges->check("SelectBilling"),	NULL, NULL, true},
    { "so.dspBillingSelections",	     tr("Billing Selections..."),	SLOT(sDspBillingSelections()), billingInvoicesMenu, _privleges->check("SelectBilling"), new QPixmap(":/images/billingSelections"), toolBar, true},
    { "so.postBillingSelections",	     tr("Post Billing Selections..."),	SLOT(sPostBillingSelections()), billingInvoicesMenu, _privleges->check("SelectBilling"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	true,		NULL, NULL, true},
    { "so.listUnpostedInvoices",	     tr("List Unposted Invoices..."),	SLOT(sUnpostedInvoices()), billingInvoicesMenu, _privleges->check("SelectBilling"),	NULL, NULL,  true},
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	true,		NULL, NULL, true},
    { "so.printInvoices",		     tr("Print Invoices..."),		SLOT(sPrintInvoices()), billingInvoicesMenu, _privleges->check("PrintInvoices"),	NULL, NULL, true},
    { "so.printInvoicesByShipvia",	     tr("Print Invoices by Ship Via..."),	SLOT(sPrintInvoicesByShipvia()), billingInvoicesMenu, _privleges->check("PrintInvoices"),	NULL, NULL, true},
    { "so.reprintInvoices",		     tr("Re-Print Invoices..."),	SLOT(sReprintInvoices()), billingInvoicesMenu, _privleges->check("PrintInvoices"),	NULL, NULL, true},
    { "so.scheduleInvoiceForEmailDelivery",  tr("Schedule Invoice for Email Delivery..."),	SLOT(sDeliverInvoice()), billingInvoicesMenu, _privleges->check("PrintInvoices"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	true,		NULL, NULL, true},
    { "so.postInvoices",		     tr("Post Invoices..."),		SLOT(sPostInvoices()), billingInvoicesMenu, _privleges->check("PostMiscInvoices"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	billingInvoicesMenu,	true,		NULL, NULL, true},
    { "so.purgeInvoices",		     tr("Purge Invoices..."),		SLOT(sPurgeInvoices()), billingInvoicesMenu, _privleges->check("PurgeInvoices"),	NULL, NULL, true},

    { "menu",	tr("&Credit Memos"), (char*)billingCreditMemosMenu,	billingMenu,	true,	NULL, NULL, true},
    { "so.newCreditMemo",		     tr("New Credit Memo..."),		SLOT(sNewCreditMemo()), billingCreditMemosMenu, _privleges->check("MaintainCreditMemos"),	NULL, NULL, true},
    { "so.listUnpostedCreditMemos",	     tr("List Unposted Credit Memos..."),	SLOT(sUnpostedCreditMemos()), billingCreditMemosMenu, (_privleges->check("MaintainCreditMemos") || _privleges->check("ViewCreditMemos")),	NULL, NULL, true},
    { "so.creditMemoEditList",		     tr("Credit Memo Edit List..."),	SLOT(sCreditMemoEditList()), billingCreditMemosMenu, (_privleges->check("MaintainCreditMemos") || _privleges->check("ViewCreditMemos")),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	billingCreditMemosMenu,	true,		NULL, NULL, true},
    { "so.printCreditMemos",		     tr("Print Credit Memos..."),	SLOT(sPrintCreditMemos()), billingCreditMemosMenu, _privleges->check("PrintCreditMemos"),	NULL, NULL, true},
    { "so.reprintCreditMemos",		     tr("Re-Print Credit Memos..."),	SLOT(sReprintCreditMemos()), billingCreditMemosMenu, _privleges->check("PrintCreditMemos"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	billingCreditMemosMenu,	true,		NULL, NULL, true},
    { "so.postCreditMemos",		     tr("Post Credit Memos..."),	SLOT(sPostCreditMemos()), billingCreditMemosMenu, _privleges->check("PostARDocuments"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	billingCreditMemosMenu,	true,		NULL, NULL, true},
    { "so.purgeCreditMemos",		     tr("Purge Credit Memos..."),	SLOT(sPurgeCreditMemos()), billingCreditMemosMenu, _privleges->check("PurgeCreditMemos"),	NULL, NULL, true},

// START_RW
    { "separator",	NULL,	NULL,	billingMenu,	true,	NULL,	NULL,	_metrics->boolean("EnableExternalAccountingInterface")},
    { "so.exportAROpenItemsAndDistributions", tr("Export Unposted A/R Open Items and Distributions..."), SLOT(sPostAROpenAndDist()), billingMenu, _privleges->check("PostARDocuments"), NULL, NULL, _metrics->boolean("EnableExternalAccountingInterface")},
// END_RW

    { "menu",	tr("Item Pricing"),       (char*)pricingMenu,	mainMenu,	true,	NULL, NULL, true},
    { "so.itemListPrice", tr("Item List Price..."),	SLOT(sItemListPrice()), pricingMenu, (_privleges->check("MaintainListPrices") || _privleges->check("ViewListPrices")),	NULL, NULL, true},
    { "so.updateListPricesByProductCategory", tr("Update List Prices by Product Category..."),	SLOT(sUpdateListPricesByProductCategory()), pricingMenu, _privleges->check("MaintainListPrices"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	pricingMenu,	true,		NULL, NULL, true},
    { "so.pricingSchedules", tr("Pricing Schedules..."),	SLOT(sPricingSchedules()), pricingMenu, (_privleges->check("MaintainListPrices") || _privleges->check("ViewListPrices")),	NULL, NULL, true},
    { "so.pricingScheduleAssignments", tr("Pricing Schedule Assignments..."),	SLOT(sPricingScheduleAssignments()), pricingMenu, _privleges->check("AssignPricingSchedules"),	NULL, NULL, true},
    { "so.sales", tr("Sales..."),	SLOT(sSales()), pricingMenu, _privleges->check("CreateSales"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	pricingMenu,	true,		NULL, NULL, true},
    { "so.updatePricesByProductCategory", tr("Update Prices by Product Category..."),	SLOT(sUpdatePricesByProductCategory()), pricingMenu, _privleges->check("UpdatePricingSchedules"),	NULL, NULL, true},
    { "so.updatePricesByPricingSchedule", tr("Update Prices by Pricing Schedule..."),	SLOT(sUpdatePricesByPricingSchedule()), pricingMenu, _privleges->check("UpdatePricingSchedules"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	pricingMenu,	true,		NULL, NULL, true},

    { "menu",	tr("&Displays"),	(char*)pricingDisplaysMenu,	pricingMenu,	true,	NULL, NULL, true},
    { "so.dspPricesByItem", tr("Prices by Item..."),	SLOT(sDspPricesByItem()), pricingDisplaysMenu, _privleges->check("ViewCustomerPrices"), NULL, NULL,	 true},
    { "so.dspPricesByCustomer", tr("Prices by Customer..."),	SLOT(sDspPricesByCustomer()), pricingDisplaysMenu, _privleges->check("ViewCustomerPrices"), NULL, NULL,	 true},
    { "so.dspPricesByCustomerType", tr("Prices by Customer Type..."),	SLOT(sDspPricesByCustomerType()), pricingDisplaysMenu, _privleges->check("ViewCustomerPrices"), NULL, NULL,	 true},

    { "menu",	tr("Displays"),           (char*)displaysMenu,	mainMenu,	true,	NULL, NULL, true},
    { "so.dspSalesOrderLookupByCustomer", tr("Sales Order Lookup by Customer..."),	SLOT(sDspOrderLookupByCustomer()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "so.dspSalesOrderLookupByCustomerType", tr("Sales Order Lookup by Customer Type..."),	SLOT(sDspOrderLookupByCustomerType()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "so.dspSalesOrderLookupByItem", tr("Sales Order Lookup by Item..."),	SLOT(sDspOrderLookupByItem()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "so.dspSalesOrderLookupByCustomerPO", tr("Sales Order Lookup by Customer PO..."),	SLOT(sDspOrderLookupByCustomerPO()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	displaysMenu,	true,		NULL, NULL, true},
    { "so.dspQuoteLookupByCustomer", tr("Quote Lookup by Customer..."),	SLOT(sDspQuoteLookupByCustomer()), displaysMenu, _privleges->check("ViewQuotes"),	NULL, NULL, true},
    { "so.dspQuoteOrderLookupByItem", tr("Quote Lookup by Item..."),	SLOT(sDspQuoteLookupByItem()), displaysMenu, _privleges->check("ViewQuotes"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	displaysMenu,	true,		NULL, NULL, true},
    { "so.dspCustomersByCustomerType", tr("Customers by Customer Type..."),	SLOT(sDspCustomersByCusttype()), displaysMenu, (_privleges->check("MaintainCustomerMasters") || _privleges->check("ViewCustomerMasters")),	NULL, NULL, true},
    { "so.dspCustomersByCharacteristic", tr("Customers by Characteristic..."),	SLOT(sDspCustomersByCharacteristic()), displaysMenu, (_privleges->check("MaintainCustomerMasters") || _privleges->check("ViewCustomerMasters")),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	displaysMenu,	true,		NULL, NULL, true},
    { "so.dspInventoryAvailabilityByItem", tr("Inventory Availability by Item..."),	SLOT(sDspInventoryAvailabilityByItem()), displaysMenu, _privleges->check("ViewInventoryAvailability"),	NULL, NULL, true},
    { "so.dspInventoryAvailabilityBySalesOrder", tr("Inventory Availability by Sales Order..."),	SLOT(sDspInventoryAvailabilityBySalesOrder()), displaysMenu, _privleges->check("ViewInventoryAvailability"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	displaysMenu,	true,		NULL, NULL, true},
    { "so.dspSalesOrderStatus", tr("Sales Order Status..."),	SLOT(sDspSalesOrderStatus()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	displaysMenu,	true,		NULL, NULL, true},
    { "so.dspBacklogByItem", tr("Backlog by Item..."),	SLOT(sDspBacklogByItem()), displaysMenu, _privleges->check("ViewSalesOrders"), NULL, NULL,	 true},
    { "so.dspBacklogBySalesOrder", tr("Backlog by Sales Order..."),	SLOT(sDspBacklogBySalesOrder()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "so.dspBacklogByCustomer", tr("Backlog by Customer..."),	SLOT(sDspBacklogByCustomer()), displaysMenu, _privleges->check("ViewSalesOrders"), NULL, NULL,	 true},
    { "so.dspBacklogByCustomerType", tr("Backlog by Customer Type..."),	SLOT(sDspBacklogByCustomerType()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "so.dspBacklogByCustomerGroup", tr("Backlog by Customer Group..."),	SLOT(sDspBacklogByCustomerGroup()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "so.dspBacklogByProductCategory", tr("Backlog by Product Category..."),	SLOT(sDspBacklogByProductCategory()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	displaysMenu,	true,		NULL, NULL, true},
    { "so.dspSummarizedBacklogByWarehouse", tr("Summarized Backlog by Warehouse..."),	SLOT(sDspSummarizedBacklogByWarehouse()), displaysMenu, _privleges->check("ViewSalesOrders"),	new QPixmap(":/images/dspSummarizedBacklogByWhse.png"), toolBar,  true},
    { "so.dspPartiallyShippedOrders", tr("Partially Shipped Orders..."),	SLOT(sDspPartiallyShippedOrders()), displaysMenu, _privleges->check("ViewSalesOrders"),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	displaysMenu,	true,		NULL, NULL, true},
    { "so.dspEarnedCommissions", tr("Earned Commissions..."),	SLOT(sDspEarnedCommissions()), displaysMenu, _privleges->check("ViewCommissions"),	NULL, NULL, true},
    { "so.dspBriefEarnedCommissions", tr("Brief Earned Commissions..."),	SLOT(sDspBriefEarnedCommissions()), displaysMenu, _privleges->check("ViewCommissions"),	NULL, NULL, true},
    { "so.dspSummarizedTaxableSales", tr("Summarized Taxable Sales..."),	SLOT(sDspSummarizedTaxableSales()), displaysMenu, _privleges->check("ViewCommissions"),	NULL, NULL, true},

    { "menu",	tr("Reports"),            (char*)reportsMenu,	mainMenu,	true,	NULL, NULL, true},
    { "so.printSalesOrderForm", tr("Print Sales Order Form..."),	SLOT(sPrintSalesOrderForm()), reportsMenu, (_privleges->check("MaintainSalesOrders") || _privleges->check("ViewSalesOrders")),	NULL, NULL, true},

    { "menu",	tr("Master Information"), (char*)masterInfoMenu,	mainMenu,	true,	NULL, NULL, true},
    { "so.enterNewCustomer", tr("Enter New Customer..."),	SLOT(sNewCustomer()), masterInfoMenu, _privleges->check("MaintainCustomerMasters"),	NULL, NULL, true},
    { "so.searchForCustomer", tr("Search for Customer..."),	SLOT(sSearchForCustomer()), masterInfoMenu, (_privleges->check("MaintainCustomerMasters") || _privleges->check("ViewCustomerMasters")),	NULL, NULL, true},
    { "so.customers", tr("Customers..."),	SLOT(sCustomers()), masterInfoMenu, (_privleges->check("MaintainCustomerMasters") || _privleges->check("ViewCustomerMasters")),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	masterInfoMenu,	true,		NULL, NULL, true},
    { "so.customerGroups", tr("Customer Groups..."),	SLOT(sCustomerGroups()), masterInfoMenu, (_privleges->check("MaintainCustomerGroups") || _privleges->check("ViewCustomerGroups")),	NULL, NULL, true},
    { "so.customerTypes", tr("Customer Types..."),	SLOT(sCustomerTypes()), masterInfoMenu, (_privleges->check("MaintainCustomerTypes") || _privleges->check("ViewCustomerTypes")),	NULL, NULL, true},
    { "so.characteristics", tr("Characteristics..."),	SLOT(sCharacteristics()), masterInfoMenu, (_privleges->check("MaintainCharacteristics") || _privleges->check("ViewCharacteristics")),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	masterInfoMenu,	true,		NULL, NULL, true},
    { "so.enterNewProspect", tr("Enter New Prospect..."),	SLOT(sNewProspect()), masterInfoMenu, _privleges->check("MaintainProspectMasters"),	NULL, NULL, true},
    { "so.searchForProspect", tr("Search for Prospect..."),	SLOT(sSearchForProspect()), masterInfoMenu, (_privleges->check("MaintainProspects") || _privleges->check("ViewProspects")),	NULL, NULL, true},
    { "so.prospects", tr("Prospects..."),	SLOT(sProspects()), masterInfoMenu, (_privleges->check("MaintainProspectMasters") || _privleges->check("ViewProspectMasters")),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	masterInfoMenu,	true,		NULL, NULL, true},
    { "so.salesReps", tr("Sales Reps..."),	SLOT(sSalesReps()), masterInfoMenu, (_privleges->check("MaintainSalesReps") || _privleges->check("ViewSalesReps")),	NULL, NULL, true},
    { "so.shippingZones", tr("Shipping Zones..."),	SLOT(sShippingZones()), masterInfoMenu, (_privleges->check("MaintainShippingZones") || _privleges->check("ViewShippingZones")),	NULL, NULL, true},
    { "so.shipVias", tr("Ship Vias..."),	SLOT(sShipVias()), masterInfoMenu, (_privleges->check("MaintainShipVias") || _privleges->check("ViewShipVias")),	NULL, NULL, true},
    { "so.shippingChargeTypes", tr("Shipping Charge Types..."),	SLOT(sShippingChargeTypes()), masterInfoMenu, (_privleges->check("MaintainShippingChargeTypes") || _privleges->check("ViewShippingChargeTypes")),	NULL, NULL, true},
    { "so.taxCodes", tr("Tax Codes..."),	SLOT(sTaxCodes()), masterInfoMenu, (_privleges->check("MaintainTaxCodes") || _privleges->check("ViewTaxCodes")),	NULL, NULL, true},
    { "so.terms", tr("Terms..."),	SLOT(sTerms()), masterInfoMenu, (_privleges->check("MaintainTerms") || _privleges->check("ViewTerms")),	NULL, NULL, true},
    { "so.shippingForms", tr("Shipping Forms..."),	SLOT(sShippingForms()), masterInfoMenu, (_privleges->check("MaintainShippingForms") || _privleges->check("ViewShippingForms")),	NULL, NULL, true},
    { "so.salesCategories", tr("Sales Categories..."),	SLOT(sSalesCategories()), masterInfoMenu, (_privleges->check("MaintainSalesCategories")) || (_privleges->check("ViewSalesCategories")),	NULL, NULL, true},
    { "separator",	NULL,	NULL,	masterInfoMenu,	true,		NULL, NULL, true},
    { "so.salesAccountAssignments", tr("Sales Account Assignments..."),	SLOT(sSalesAccountAssignments()), masterInfoMenu, (_privleges->check("MaintainSalesAccount") || _privleges->check("ViewSalesAccount")),	NULL, NULL, true},
    { "so.arAccountAssignments", tr("A/R Account Assignments..."),	SLOT(sARAccountAssignments()), masterInfoMenu, (_privleges->check("MaintainSalesAccount") || _privleges->check("ViewSalesAccount")),	NULL, NULL, true},
    { "so.customerFormAssignments", tr("Customer Form Assignments..."),	SLOT(sCustomerFormAssignments()), masterInfoMenu, _privleges->check("MaintainCustomerMasters"),	NULL, NULL, true},

    { "menu",	tr("&Utilities"),         (char*)utilitiesMenu,	mainMenu,	true,	NULL, NULL, true},
    { "so.customerInformationExport", tr("Customer Information Export..."),	SLOT(sDspCustomerInformationExport()), utilitiesMenu, _privleges->check("MaintainCustomerMasters"),	NULL, NULL, true},
    { "so.reassignCustomerTypeByCustomerType", tr("Reassign Customer Type by Customer Type..."),	SLOT(sReassignCustomerTypeByCustomerType()), utilitiesMenu, _privleges->check("MaintainCustomerMasters"),	NULL, NULL, true},
    { "so.updateCreditStatusByCustomer", tr("Update Credit Status by Customer..."),	SLOT(sUpdateCreditStatusByCustomer()), utilitiesMenu, (_privleges->check("MaintainCustomerMasters") || _privleges->check("UpdateCustomerCreditStatus")),	NULL, NULL, true},

// START_RW
    { "so.exportCustomers", tr("Export Customers..."), SLOT(sExportCustomers()), utilitiesMenu, _privleges->check("ViewCustomerMasters"), NULL, NULL, _metrics->boolean("EnableExternalAccountingInterface")}
// END_RW
  };

  for (unsigned int i = 0; i < sizeof(acts) / sizeof(acts[0]); i++)
  {
    if (! acts[i].visible)
    {
      continue;
    }
    else if (acts[i].actionName == QString("menu"))
    {
      acts[i].menu->insertItem(acts[i].actionTitle, (QMenu*)(acts[i].slot));
    }
    else if (acts[i].actionName == QString("separator"))
    {
      acts[i].menu->addSeparator();
    }
    else if (acts[i].toolBar != NULL)
    {
      parent->actions.append( new Action( parent,
					  acts[i].actionName,
					  acts[i].actionTitle,
					  this,
					  acts[i].slot,
					  acts[i].menu,
					  acts[i].priv,
					  *(acts[i].pixmap),
					  acts[i].toolBar) );
    }
    else
    {
      parent->actions.append( new Action( parent,
					  acts[i].actionName,
					  acts[i].actionTitle,
					  this,
					  acts[i].slot,
					  acts[i].menu,
					  acts[i].priv ) );
    }
  }
  parent->populateCustomMenu(mainMenu, "S/O");
  parent->menuBar()->insertItem(tr("S/&O"), mainMenu);
}
void dspInventoryAvailabilityByCustomerType::sPopulateMenu(QMenu *pMenu,  QTreeWidgetItem *selected, int)
{
  XTreeWidgetItem * item = (XTreeWidgetItem*)selected;
  QAction *menuItem;
  
  if (list()->altId() == -2)
  {
    menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder()));
    if (!_privileges->check("MaintainSalesOrders"))
      menuItem->setEnabled(false);
    
    menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder()));
    if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders")))
      menuItem->setEnabled(false);
    
    pMenu->addSeparator();
    
    menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList()));
    if (!_privileges->check("PrintPackingLists"))
      menuItem->setEnabled(false);
    
    menuItem = pMenu->addAction(tr("Add to Packing List Batch"), this, SLOT(sAddToPackingListBatch()));
    if (!_privileges->check("MaintainPackingListBatch"))
      menuItem->setEnabled(false);
  }
  else if (list()->altId() != -1)
  {
    menuItem = pMenu->addAction("View Allocations...", this, SLOT(sViewAllocations()));
    if (item->rawValue("allocated").toDouble() == 0.0)
      menuItem->setEnabled(false);
    
    menuItem = pMenu->addAction("View Orders...", this, SLOT(sViewOrders()));
    if (item->rawValue("ordered").toDouble() == 0.0)
     menuItem->setEnabled(false);

    menuItem = pMenu->addAction("Running Availability...", this, SLOT(sRunningAvailability()));
    menuItem = pMenu->addAction("Substitute Availability...", this, SLOT(sViewSubstituteAvailability()));

    XSqlQuery qq;
    qq.prepare ("SELECT item_type "
             "FROM itemsite,item "
             "WHERE ((itemsite_id=:itemsite_id)"
             "AND (itemsite_item_id=item_id)"
             "AND (itemsite_wosupply));");
    qq.bindValue(":itemsite_id", list()->id());
    qq.exec();
    if (qq.next())
    {
      if (qq.value("item_type") == "P")
      {
        pMenu->addSeparator();
        menuItem = pMenu->addAction("Issue Purchase Order...", this, SLOT(sIssuePO()));
        if (!_privileges->check("MaintainPurchaseOrders"))
          menuItem->setEnabled(false);
      }
      else if (qq.value("item_type") == "M")
      {
        pMenu->addSeparator();
        menuItem = pMenu->addAction("Issue Work Order...", this, SLOT(sIssueWO()));
        if (!_privileges->check("MaintainWorkOrders"))
          menuItem->setEnabled(false);
      }
    }

    if(_metrics->boolean("EnableSOReservations"))
    {
      pMenu->addSeparator();

      pMenu->addAction(tr("Show Reservations..."), this, SLOT(sShowReservations()));
      pMenu->addSeparator();

      menuItem = pMenu->addAction(tr("Unreserve Stock"), this, SLOT(sUnreserveStock()));
      menuItem->setEnabled(_privileges->check("MaintainReservations"));
      menuItem = pMenu->addAction(tr("Reserve Stock..."), this, SLOT(sReserveStock()));
      menuItem->setEnabled(_privileges->check("MaintainReservations"));
      menuItem = pMenu->addAction(tr("Reserve Line Balance"), this, SLOT(sReserveLineBalance()));
      menuItem->setEnabled(_privileges->check("MaintainReservations"));
    }

    pMenu->addSeparator();
    menuItem = pMenu->addAction("Issue Count Tag...", this, SLOT(sIssueCountTag()));
    if (!_privileges->check("IssueCountTags"))
      menuItem->setEnabled(false);
  }
}