Ejemplo n.º 1
0
void dspVendorAPHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int)
{
  QAction *menuItem;

  XTreeWidgetItem * item = (XTreeWidgetItem*)pSelected;
  if (item->id() != -1)
  {
    menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("EditAPOpenItem"));

    pMenu->addAction(tr("View A/P Open..."), this, SLOT(sView()));

    menuItem = pMenu->addAction(tr("View G/L Series..."), this, SLOT(sViewGLSeries()));
    menuItem->setEnabled(_privileges->check("ViewGLTransactions"));

    if(item->altId() == -1 && item->text(1)==tr("Voucher"))
    {
      menuItem = pMenu->addAction(tr("View Voucher..."), this, SLOT(sViewVoucher()));
      menuItem->setEnabled(_privileges->check("ViewVouchers") || _privileges->check("MaintainVouchers"));

      if(item->rawValue("amount")==item->rawValue("balance"))
      {
        pMenu->addSeparator();
  
        menuItem = pMenu->addAction(tr("Void"), this, SLOT(sVoidVoucher()));
        menuItem->setEnabled(_privileges->check("VoidPostedVouchers"));
      }
    } 
  }
}
Ejemplo n.º 2
0
void dspVendorAPHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected)
{
  int menuItem;

  XTreeWidgetItem * item = (XTreeWidgetItem*)pSelected;
  if (item->id() != -1)
  {
    menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
    if (!_privileges->check("EditSalesHistory"))
      pMenu->setItemEnabled(menuItem, FALSE);

    pMenu->insertItem(tr("View A/P Open..."), this, SLOT(sView()), 0);

    menuItem = pMenu->insertItem(tr("View G/L Series..."), this, SLOT(sViewGLSeries()), 0);
    if (!_privileges->check("ViewGLTransactions"))
      pMenu->setItemEnabled(menuItem, FALSE);

    if(item->altId() == -1 && item->text(1)==tr("Voucher"))
    {
      menuItem = pMenu->insertItem(tr("View Voucher..."), this, SLOT(sViewVoucher()), 0);
      if (!_privileges->check("ViewVouchers"))
        pMenu->setItemEnabled(menuItem, FALSE);

      if(item->rawValue("amount")==item->rawValue("balance"))
      {
        pMenu->insertSeparator();
  
        menuItem = pMenu->insertItem(tr("Void"), this, SLOT(sVoidVoucher()), 0);
        if (!_privileges->check("MaintainAPMemos"))
          pMenu->setItemEnabled(menuItem, FALSE);
      }
    } 
  }
}
Ejemplo n.º 3
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"));
  }
}
Ejemplo n.º 4
0
void dspAPOpenItemsByVendor::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int)
{
  QString status(selected->text(1));
   
  QAction *menuItem;

  if (list()->currentItem()->text("f_doctype") == tr("Voucher"))
  {
    menuItem = pMenu->addAction(tr("View Voucher..."), this, SLOT(sViewVoucher()));
    menuItem->setEnabled(_privileges->check("ViewVouchers") || _privileges->check("MaintainVouchers"));
  }
  
  menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
  if (!_privileges->check("EditAPOpenItem"))
    menuItem->setEnabled(false);

  menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView()));
  XSqlQuery menu;
  menu.prepare("SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;");
  menu.bindValue(":apopen_id", list()->id());
  menu.exec();
  if (menu.first())
  {
    if(menu.value("apopen_status").toString() == "O")
    {
      menuItem = pMenu->addAction(tr("On Hold"), this, SLOT(sOnHold()));
      menuItem->setEnabled(_privileges->check("EditAPOpenItem"));
    }
    if(menu.value("apopen_status").toString() == "H") 
    {
      menuItem = pMenu->addAction(tr("Open"), this, SLOT(sOpen()));
      menuItem->setEnabled(_privileges->check("EditAPOpenItem"));
    }	
  }

  menuItem = pMenu->addAction(tr("Print..."), this, SLOT(sPrintItem()));
  if (!_privileges->check("EditAPOpenItem"))
    menuItem->setEnabled(false);

  if (list()->currentItem()->text("f_doctype") == tr("Credit Memo"))
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("Apply Credit Memo..."), this, SLOT(sApplyAPOpenCM()));
    menuItem->setEnabled(_privileges->check("ApplyAPMemos"));
  }
}
void selectPayments::sPopulateMenu(QMenu *pMenu,QTreeWidgetItem *selected)
{
  QString status(selected->text(1));
  QAction *menuItem;
  XTreeWidgetItem * item = (XTreeWidgetItem*)selected;

  if (_apopen->currentItem()->text("doctype") == tr("Voucher"))
  {
    menuItem = pMenu->addAction(tr("View Voucher..."), this, SLOT(sViewVoucher()));
    menuItem->setEnabled(_privileges->check("ViewVouchers") || _privileges->check("MaintainVouchers"));

    if(item->rawValue("selected") == 0.0)
    {
      menuItem = pMenu->addAction(tr("Void Voucher..."), this, SLOT(sVoidVoucher()));
      menuItem->setEnabled(_privileges->check("VoidPostedVouchers"));
    }
  }
  
  XSqlQuery menu;
  menu.prepare( "SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;");
  menu.bindValue(":apopen_id", _apopen->id());
  menu.exec();
  if (menu.first())
  {
    menuItem = pMenu->addAction(tr("Edit A/P Open..."), this, SLOT(sEdit()));
    menuItem->setEnabled(_privileges->check("EditAPOpenItem"));
    
    pMenu->addAction(tr("View A/P Open..."), this, SLOT(sView()));
    
    menuItem = pMenu->addAction(tr("View G/L Series..."), this, SLOT(sViewGLSeries()));
    menuItem->setEnabled(_privileges->check("ViewGLTransactions"));

    if(menu.value("apopen_status").toString() == "O")
    {
      menuItem = pMenu->addAction(tr("On Hold"), this, SLOT(sOnHold()));
      menuItem->setEnabled(_privileges->check("EditAPOpenItem"));
    }
    if(menu.value("apopen_status").toString() == "H")
    {
      menuItem = pMenu->addAction(tr("Open"), this, SLOT(sOpen()));
      menuItem->setEnabled(_privileges->check("EditAPOpenItem"));
    }
  }
}