void voucherItem::sPopulateMenu(QMenu *pMenu, XTreeWidgetItem *selected) { QAction *menuItem; if ( (selected->rawValue("action") == "REC") && (selected->text(4) == "No") ) { menuItem = pMenu->addAction(tr("Correct Receipt..."), this, SLOT(sCorrectReceiving())); menuItem->setEnabled(_privileges->check("EnterReceipts")); menuItem = pMenu->addAction(tr("Split Receipt..."), this, SLOT(sSplitReceipt())); menuItem->setEnabled(_privileges->check("EnterReceipts")); } }
void voucherItem::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected) { int menuItem; if (selected->text(3) == "No") { menuItem = pMenu->insertItem(tr("Correct Receipt..."), this, SLOT(sCorrectReceiving()), 0); if (!_privileges->check("EnterReceipts")) pMenu->setItemEnabled(menuItem, FALSE); menuItem = pMenu->insertItem(tr("Split Receipt..."), this, SLOT(sSplitReceipt()), 0); if (!_privileges->check("EnterReceipts")) pMenu->setItemEnabled(menuItem, FALSE); } }
void dspUninvoicedReceivings::sPopulateMenu(QMenu *pMenu) { int menuItem; if(_privileges->check("MaintainUninvoicedReceipts")) { if(_porecv->altId() < 3) { menuItem = pMenu->insertItem(tr("Mark as Invoiced..."), this, SLOT(sMarkAsInvoiced()), 0); menuItem = pMenu->insertItem(tr("Correct Receiving..."), this, SLOT(sCorrectReceiving()), 0); if(_porecv->altId() == 2) pMenu->setItemEnabled(menuItem, false); } if (_porecv->altId() == 3) menuItem = pMenu->insertItem(tr("Create Credit Memo..."), this, SLOT(sCreateCreditMemo()), 0); } }