Пример #1
0
void dspInvoiceRegister::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  if (_gltrans->altId() == 1)
  {
    menuItem = pMenu->insertItem(tr("View Invoice..."), this, SLOT(sViewInvoice()), 0);
    if (! _privileges->check("MaintainMiscInvoices") &&
        ! _privileges->check("ViewMiscInvoices"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }

  else if (_gltrans->altId() == 2)
  {
    menuItem = pMenu->insertItem(tr("View Credit Memo..."), this, SLOT(sViewCreditMemo()), 0);
    if (! _privileges->check("MaintainARMemos") &&
        ! _privileges->check("ViewARMemos"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
  else if (_gltrans->altId() == 3)
  {
    menuItem = pMenu->insertItem(tr("View Debit Memo..."), this, SLOT(sViewCreditMemo()), 0);
    if (! _privileges->check("MaintainARMemos") &&
        ! _privileges->check("ViewARMemos"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
  else if (_gltrans->altId() == 4)
  {
    menuItem = pMenu->insertItem(tr("View Customer Deposit..."), this, SLOT(sViewCreditMemo()), 0);
    if (! _privileges->check("MaintainARMemos") &&
        ! _privileges->check("ViewARMemos"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
}
Пример #2
0
void dspInvoiceRegister::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int)
{
  QAction *menuItem;

  if (list()->altId() == 1)
  {
    menuItem = pMenu->addAction(tr("View Invoice..."), this, SLOT(sViewInvoice()));
    if (! _privileges->check("MaintainMiscInvoices") &&
        ! _privileges->check("ViewMiscInvoices"))
      menuItem->setEnabled(false);
  }

  else if (list()->altId() == 2)
  {
    menuItem = pMenu->addAction(tr("View Credit Memo..."), this, SLOT(sViewCreditMemo()));
    if (! _privileges->check("MaintainARMemos") &&
        ! _privileges->check("ViewARMemos"))
      menuItem->setEnabled(false);
  }
  else if (list()->altId() == 3)
  {
    menuItem = pMenu->addAction(tr("View Debit Memo..."), this, SLOT(sViewCreditMemo()));
    if (! _privileges->check("MaintainARMemos") &&
        ! _privileges->check("ViewARMemos"))
      menuItem->setEnabled(false);
  }
  else if (list()->altId() == 4)
  {
    menuItem = pMenu->addAction(tr("View Customer Deposit..."), this, SLOT(sViewCreditMemo()));
    if (! _privileges->check("MaintainARMemos") &&
        ! _privileges->check("ViewARMemos"))
      menuItem->setEnabled(false);
  }
}
Пример #3
0
void dspARApplications::sPopulateMenu(QMenu* pMenu)
{
  int menuItem;

  if (_arapply->currentItem()->text(4) == "C")
  {
    menuItem = pMenu->insertItem(tr("View Source Credit Memo..."), this, SLOT(sViewCreditMemo()), 0);
    if (! _privileges->check("MaintainARMemos") &&
	! _privileges->check("ViewARMemos"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }

  if (_arapply->currentItem()->text(7) == "D")
  {
    menuItem = pMenu->insertItem(tr("View Apply-To Debit Memo..."), this, SLOT(sViewDebitMemo()), 0);
    if (! _privileges->check("MaintainARMemos") &&
	! _privileges->check("ViewARMemos"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
  else if (_arapply->currentItem()->text(7) == "I")
  {
    menuItem = pMenu->insertItem(tr("View Apply-To Invoice..."), this, SLOT(sViewInvoice()), 0);
    if (! _privileges->check("MaintainMiscInvoices") &&
	! _privileges->check("ViewMiscInvoices"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
}
Пример #4
0
void dspARApplications::sPopulateMenu(QMenu* pMenu, QTreeWidgetItem*, int)
{
  QAction *menuItem;

  if (list()->currentItem()->text(4) == "C")
  {
    menuItem = pMenu->addAction(tr("View Source Credit Memo..."), this, SLOT(sViewCreditMemo()));
    if (! _privileges->check("MaintainARMemos") &&
	! _privileges->check("ViewARMemos"))
      menuItem->setEnabled(false);
  }

  if (list()->currentItem()->text(7) == "D")
  {
    menuItem = pMenu->addAction(tr("View Apply-To Debit Memo..."), this, SLOT(sViewDebitMemo()));
    if (! _privileges->check("MaintainARMemos") &&
	! _privileges->check("ViewARMemos"))
      menuItem->setEnabled(false);
  }
  else if (list()->currentItem()->text(7) == "I")
  {
    menuItem = pMenu->addAction(tr("View Apply-To Invoice..."), this, SLOT(sViewInvoice()));
    if (! _privileges->check("MaintainMiscInvoices") &&
	! _privileges->check("ViewMiscInvoices"))
      menuItem->setEnabled(false);
  }
}
Пример #5
0
void dspAPApplications::sPopulateMenu(QMenu* pMenu)
{
  int menuItem;

  if (_apapply->currentItem()->rawValue("apapply_source_doctype") == "C")
  {
    menuItem = pMenu->insertItem(tr("View Source Credit Memo..."), this, SLOT(sViewCreditMemo()), 0);
    pMenu->setItemEnabled(menuItem,
                          _privileges->check("MaintainAPMemos") ||
                          _privileges->check("ViewAPMemos"));
  }
  else if (_apapply->currentItem()->rawValue("apapply_source_doctype") == "K")
  {
    menuItem = pMenu->insertItem(tr("View Source Check..."), this, SLOT(sViewCheck()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainPayments"));
  }

  if (_apapply->currentItem()->rawValue("apapply_target_doctype") == "D")
  {
    menuItem = pMenu->insertItem(tr("View Apply-To Debit Memo..."), this, SLOT(sViewDebitMemo()), 0);
    pMenu->setItemEnabled(menuItem,
                          _privileges->check("MaintainAPMemos") ||
                          _privileges->check("ViewAPMemos"));
  }
  else if (_apapply->currentItem()->rawValue("apapply_target_doctype") == "V")
  {
    menuItem = pMenu->insertItem(tr("View Apply-To Voucher..."), this, SLOT(sViewVoucher()), 0);
    pMenu->setItemEnabled(menuItem,
                          _privileges->check("MaintainVouchers") ||
                          _privileges->check("ViewVouchers"));
  }
}
Пример #6
0
dspCustomerInformation::dspCustomerInformation(QWidget* parent, Qt::WFlags fl)
    : QWidget(parent, fl)
{
  setupUi(this);

  connect(_arhist, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuArhist(QMenu*)));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_creditMemo, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuCreditMemo(QMenu*)));
  connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulate(int)));
  connect(_custList, SIGNAL(clicked()), _cust, SLOT(sEllipses()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_editCreditMemo, SIGNAL(clicked()), this, SLOT(sEditCreditMemo()));
  connect(_editInvoice, SIGNAL(clicked()), this, SLOT(sEditInvoice()));
  connect(_editOrder, SIGNAL(clicked()), this, SLOT(sEditOrder()));
  connect(_editQuote, SIGNAL(clicked()), this, SLOT(sEditQuote()));
  connect(_invoice, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuInvoice(QMenu*)));
  connect(_newCreditMemo, SIGNAL(clicked()), this, SLOT(sNewCreditMemo()));
  connect(_newInvoice, SIGNAL(clicked()), this, SLOT(sNewInvoice()));
  connect(_newOrder, SIGNAL(clicked()), this, SLOT(sNewOrder()));
  connect(_newQuote, SIGNAL(clicked()), this, SLOT(sNewQuote()));
  connect(_order, SIGNAL(valid(bool)), _viewOrder, SLOT(setEnabled(bool)));
  connect(_order, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuSalesOrder(QMenu*)));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_quote, SIGNAL(valid(bool)), _viewQuote, SLOT(setEnabled(bool)));
  connect(_quote, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuQuote(QMenu*)));
  connect(_viewCreditMemo, SIGNAL(clicked()), this, SLOT(sViewCreditMemo()));
  connect(_viewInvoice, SIGNAL(clicked()), this, SLOT(sViewInvoice()));
  connect(_viewOrder, SIGNAL(clicked()), this, SLOT(sViewOrder()));
  connect(_viewQuote, SIGNAL(clicked()), this, SLOT(sViewQuote()));
  connect(_convertQuote, SIGNAL(clicked()), this, SLOT(sConvertQuote()));

#ifndef Q_WS_MAC
  _custList->setMaximumWidth(25);
#endif

  // setup arhist list
  _arhist->addColumn(tr("Open"),      _orderColumn, Qt::AlignCenter );
  _arhist->addColumn(tr("Doc. Type"), _dateColumn,  Qt::AlignCenter );
  _arhist->addColumn(tr("Doc. #"),    _orderColumn, Qt::AlignRight  );
  _arhist->addColumn(tr("Doc. Date"), _dateColumn,  Qt::AlignCenter );
  _arhist->addColumn(tr("Due. Date"), _dateColumn,  Qt::AlignCenter );
  _arhist->addColumn(tr("Amount"),    _moneyColumn, Qt::AlignRight  );
  _arhist->addColumn(tr("Balance"),   _moneyColumn, Qt::AlignRight  );
  _arhist->addColumn(tr("Currency"),  _currencyColumn, Qt::AlignLeft);

  // setup Quote list
  _quote->addColumn(tr("Quote #"),    _orderColumn, Qt::AlignRight  );
  _quote->addColumn(tr("P/O Number"), _itemColumn,  Qt::AlignLeft   );
  _quote->addColumn(tr("Quote Date"), _dateColumn,  Qt::AlignCenter );
  if(_privleges->check("MaintainQuotes"))
  {
    connect(_quote, SIGNAL(valid(bool)), _editQuote, SLOT(setEnabled(bool)));
    connect(_quote, SIGNAL(itemSelected(int)), _editQuote, SLOT(animateClick()));
  }
  else
  {
    _newQuote->setEnabled(false);
    connect(_quote, SIGNAL(itemSelected(int)), _viewQuote, SLOT(animateClick()));
  }
  if (_privleges->check("ConvertQuotes"))
    connect(_quote, SIGNAL(valid(bool)), _convertQuote, SLOT(setEnabled(bool)));
  connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillQuoteList()));

  // setup Order list
  _order->addColumn(tr("S/O #"),            _orderColumn, Qt::AlignLeft   );
  _order->addColumn(tr("Cust. P/O Number"), _itemColumn,  Qt::AlignLeft   );
  _order->addColumn(tr("Ordered"),          _dateColumn,  Qt::AlignCenter );
  _order->addColumn(tr("Scheduled"),        _dateColumn,  Qt::AlignCenter );
  if(_privleges->check("MaintainSalesOrders"))
  {
    connect(_order, SIGNAL(valid(bool)), _editOrder, SLOT(setEnabled(bool)));
    connect(_order, SIGNAL(itemSelected(int)), _editOrder, SLOT(animateClick()));
  }
  else
  {
    _newOrder->setEnabled(false);
    connect(_order, SIGNAL(itemSelected(int)), _viewOrder, SLOT(animateClick()));
  }
  connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillOrderList()));

  // setup Invoice list
  _invoice->addColumn(tr("Posted"),     _ynColumn,    Qt::AlignCenter );
  _invoice->addColumn(tr("Open"),       _ynColumn,    Qt::AlignCenter );
  _invoice->addColumn(tr("Invoice #"),  _orderColumn, Qt::AlignLeft   );
  _invoice->addColumn(tr("S/O #"),      _orderColumn, Qt::AlignLeft   );
  _invoice->addColumn(tr("Invc. Date"), _dateColumn,  Qt::AlignCenter );
  _invoice->addColumn(tr("Amount"),     _moneyColumn, Qt::AlignRight  );
  _invoice->addColumn(tr("Balance"),    _moneyColumn, Qt::AlignRight  );
  _invoice->addColumn(tr("Currency"),   _currencyColumn, Qt::AlignLeft);
  if(_privleges->check("MaintainMiscInvoices"))
  {
    connect(_invoice, SIGNAL(valid(bool)), _editInvoice, SLOT(setEnabled(bool)));
    connect(_invoice, SIGNAL(itemSelected(int)), _editInvoice, SLOT(animateClick()));
  }
  else
  {
    _newInvoice->setEnabled(false);
    connect(_invoice, SIGNAL(itemSelected(int)), _viewInvoice, SLOT(animateClick()));
  }
  if(_privleges->check("MaintainMiscInvoices") || _privleges->check("ViewMiscInvoices"))
    connect(_invoice, SIGNAL(valid(bool)), _viewInvoice, SLOT(setEnabled(bool)));
  connect(omfgThis, SIGNAL(invoicesUpdated(int, bool)), this, SLOT(sFillInvoiceList()));

  // setup CreditMemo list
  _creditMemo->addColumn(tr("Posted"),    _ynColumn,    Qt::AlignCenter );
  _creditMemo->addColumn(tr("Open"),      _ynColumn,    Qt::AlignCenter );
  _creditMemo->addColumn(tr("Type"),      _ynColumn,    Qt::AlignCenter );
  _creditMemo->addColumn(tr("C/M #"),     _orderColumn, Qt::AlignLeft   );
  _creditMemo->addColumn(tr("Doc. Date"), _dateColumn,  Qt::AlignCenter );
  _creditMemo->addColumn(tr("Amount"),    _moneyColumn, Qt::AlignRight  );
  _creditMemo->addColumn(tr("Balance"),   _moneyColumn, Qt::AlignRight  );
  _creditMemo->addColumn(tr("Currency"),  _currencyColumn, Qt::AlignLeft);
  if(!_privleges->check("MaintainCreditMemos"))
    _newCreditMemo->setEnabled(false);
  connect(_creditMemo, SIGNAL(valid(bool)), this, SLOT(sCreditMemoSelected(bool)));
  connect(_creditMemo, SIGNAL(itemSelected(int)), _viewCreditMemo, SLOT(animateClick()));
  connect(omfgThis, SIGNAL(creditMemosUpdated()), this, SLOT(sFillCreditMemoList()));

  _payments->addColumn(tr("Type"),         _whsColumn,      Qt::AlignLeft  );
  _payments->addColumn(tr("Status"),       _whsColumn,      Qt::AlignLeft  );
  _payments->addColumn(tr("Timestamp"),    _timeDateColumn, Qt::AlignLeft  );
  _payments->addColumn(tr("Entered By"),   _userColumn,     Qt::AlignLeft  );
  _payments->addColumn(tr("Total Amount"), _moneyColumn,    Qt::AlignRight );
  _payments->addColumn(tr("Currency"),     _currencyColumn, Qt::AlignLeft  );
  _payments->addColumn(tr("S/O #"),        _orderColumn,    Qt::AlignLeft  );
  _payments->addColumn(tr("Reference"),    _orderColumn,    Qt::AlignLeft  );
  _payments->addColumn(tr("Allocated"),    _moneyColumn,    Qt::AlignRight );
  _payments->addColumn(tr("Currency"),     _currencyColumn, Qt::AlignLeft  );

  if (omfgThis->singleCurrency())
  {
    _arhist->hideColumn(7);
    _invoice->hideColumn(7);
    _creditMemo->hideColumn(6);
    _payments->hideColumn(5);
    _payments->hideColumn(8);
  }

  _edit->setEnabled(_privleges->check("MaintainCustomerMasters"));
}
Пример #7
0
void dspAROpenItems::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pItem, int)
{
  QAction *menuItem = 0;

  if (((XTreeWidgetItem *)pItem)->altId() < 4)
  {
    menuItem = pMenu->addAction(tr("Print..."), this, SLOT(sPrintItem()));
    if (((XTreeWidgetItem *)pItem)->altId() == 0)
    // Invoice
      menuItem->setEnabled(_privileges->check("ViewMiscInvoices") || _privileges->check("MaintainMiscInvoices"));
    else if (((XTreeWidgetItem *)pItem)->altId() == 1 && ((XTreeWidgetItem *)pItem)->id("docnumber") > -1)
    // Credit Memo
     menuItem->setEnabled(_privileges->check("ViewCreditMemos") || _privileges->check("MaintainCreditMemos"));
    else
    // Open Item
      menuItem->setEnabled(_privileges->check("ViewAROpenItems") || _privileges->check("EditAROpenItem"));
  }
      
  pMenu->addSeparator();
  if (((XTreeWidgetItem *)pItem)->altId() == 0 && ((XTreeWidgetItem *)pItem)->rawValue("posted") == 0)
  // Invoice
  {
    menuItem = pMenu->addAction(tr("Edit Invoice..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("MaintainMiscInvoices"));
  }
  else if (((XTreeWidgetItem *)pItem)->altId() == 1 && ((XTreeWidgetItem *)pItem)->id("docnumber") > -1)
  // Credit Memo
  {
    menuItem = pMenu->addAction(tr("Edit Credit Memo..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("MaintainCreditMemos"));
  }
  else if (((XTreeWidgetItem *)pItem)->id() > 0)
  // Open Item
  {
    menuItem = pMenu->addAction(tr("Edit Receivable Item..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("EditAROpenItem"));
  }
  else
  // Incident
  {
    menuItem = pMenu->addAction(tr("Edit Incident..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("MaintainAllIncidents"));
  }

  if (((XTreeWidgetItem *)pItem)->id() > 0)
  // Open Item
  {
    menuItem = pMenu->addAction(tr("View Receivable Item..."), this, SLOT(sView()));
    menuItem->setEnabled(_privileges->check("EditAROpenItem") || _privileges->check("ViewAROpenItems"));
  }
  
  if (((XTreeWidgetItem *)pItem)->altId() == 0)
  // Invoice
  {
    if(((XTreeWidgetItem *)pItem)->rawValue("posted") != 0)
    {
      menuItem = pMenu->addAction(tr("Void Posted Invoice..."), this, SLOT(sVoidInvoiceDetails()));
      menuItem->setEnabled(_privileges->check("VoidPostedInvoices"));

      menuItem = pMenu->addAction(tr("Edit Posted Invoice..."), this, SLOT(sEditInvoiceDetails()));
      menuItem->setEnabled(_privileges->check("MaintainMiscInvoices"));
    }

    menuItem = pMenu->addAction(tr("View Invoice..."), this, SLOT(sViewInvoiceDetails()));
    menuItem->setEnabled(_privileges->check("ViewMiscInvoices"));
  
    menuItem = pMenu->addAction(tr("View Invoice Information..."), this, SLOT(sViewInvoice()));
    menuItem->setEnabled(_privileges->check("ViewMiscInvoices"));
  }
  else if (((XTreeWidgetItem *)pItem)->altId() == 1 &&
           ((XTreeWidgetItem *)pItem)->id("docnumber") > -1)
  // Credit Memo
  {
    if(((XTreeWidgetItem *)pItem)->rawValue("posted") != 0)
    {
      menuItem = pMenu->addAction(tr("Void Posted Credit Memo..."), this, SLOT(sVoidCreditMemo()));
      menuItem->setEnabled(_privileges->check("VoidPostedARCreditMemos"));
    }

    menuItem = pMenu->addAction(tr("View Credit Memo..."), this, SLOT(sViewCreditMemo()));
    menuItem->setEnabled(_privileges->check("MaintainCreditMemos") || _privileges->check("ViewCreditMemos"));
  }
  else if (((XTreeWidgetItem *)pItem)->altId() == 4)
  // Incident
  {
    menuItem = pMenu->addAction(tr("View Incident..."), this, SLOT(sViewIncident()));
    menuItem->setEnabled(_privileges->check("ViewAllIncidents") || _privileges->check("MaintainAllIncidents"));
  }
  
  if (((XTreeWidgetItem *)pItem)->altId() < 2 &&
      ((XTreeWidgetItem *)pItem)->id() == -1 &&
      !((XTreeWidgetItem *)pItem)->rawValue("posted").toBool())
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost()));
    menuItem->setEnabled(_privileges->check("PostARDocuments"));
    
    if (((XTreeWidgetItem *)pItem)->altId() == 0)
    {
      menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteInvoice()));
      menuItem->setEnabled(_privileges->check("MaintainMiscInvoices"));
    }
    else
    {
      menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteCreditMemo()));
      menuItem->setEnabled(_privileges->check("MaintainCreditMemos"));
    }
  }
  
  if ((((XTreeWidgetItem *)pItem)->altId() == 1 || ((XTreeWidgetItem *)pItem)->altId() == 3) && 
      ((XTreeWidgetItem *)pItem)->rawValue("posted").toBool() && 
      ((XTreeWidgetItem *)pItem)->rawValue("open").toBool() )
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("Apply Credit Memo..."), this, SLOT(sApplyAropenCM()));
    menuItem->setEnabled(_privileges->check("ApplyARMemos"));
  }

  if ((((XTreeWidgetItem *)pItem)->id("ordernumber") > 0 && 
      ((XTreeWidgetItem *)pItem)->altId() == 0) )
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditSalesOrder()));
    menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders"));
    menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewSalesOrder()));
    menuItem->setEnabled(_privileges->check("ViewSalesOrders"));
    menuItem = pMenu->addAction(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus()));
    menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders"));
    menuItem = pMenu->addAction(tr("Shipments..."), this, SLOT(sShipment()));
    menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders"));
  }
  
  
  if ((((XTreeWidgetItem *)pItem)->altId() == 0 || 
      ((XTreeWidgetItem *)pItem)->altId() == 2) && 
      ((XTreeWidgetItem *)pItem)->rawValue("posted").toBool() && 
      ((XTreeWidgetItem *)pItem)->rawValue("open").toBool() )
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("New Cash Receipt..."), this, SLOT(sNewCashrcpt()));
    menuItem->setEnabled(_privileges->check("MaintainCashReceipts"));
  }

  if ((_metrics->boolean("CCAccept") &&
       ((XTreeWidgetItem *)pItem)->id("ccard_number") > 0) )
  {
    menuItem = pMenu->addAction(tr("Refund"), this, SLOT(sCCRefundCM()));
    menuItem->setEnabled( _privileges->check("ProcessCreditCards") &&
                          ((XTreeWidgetItem *)pItem)->rawValue("balance").toDouble() < 0);
  }

  if (((XTreeWidgetItem *)pItem)->id() > -1 && 
     ((XTreeWidgetItem *)pItem)->rawValue("posted").toBool() && 
     ((XTreeWidgetItem *)pItem)->rawValue("open").toBool() )
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("New Incident..."), this, SLOT(sIncident()));
    if (!_privileges->check("MaintainAllIncidents"))
      menuItem->setEnabled(false);
  }

}