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

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

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

  q.prepare( "SELECT charass_id FROM charass WHERE (charass_target_id=:cust_id)" );
  q.bindValue(":cust_id", list()->id());
  q.exec();
  if (!(q.first()))
  {
    menuItem = pMenu->addAction(tr("New Characteristic..."), this, SLOT(sNewCharacteristic()));
    if (!_privileges->check("MaintainCustomerMasters"))
      menuItem->setEnabled(false);
  }
  else
  {
    menuItem = pMenu->addAction(tr("Edit Characteristic..."), this, SLOT(sEditCharacteristic()));
    if (!_privileges->check("MaintainCustomerMasters"))
      menuItem->setEnabled(false);
  }
}
Ejemplo n.º 2
0
address::address(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);

    connect(_editAddrUse, SIGNAL(clicked()), this, SLOT(sEdit()));
    connect(_viewAddrUse, SIGNAL(clicked()), this, SLOT(sView()));
    connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
    connect(_uses, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*)));
    connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
    connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
    connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));

    _uses->addColumn(tr("Used by"),	 50, Qt::AlignLeft );
    _uses->addColumn(tr("First Name\nor Number"),	 50, Qt::AlignLeft );
    _uses->addColumn(tr("Last Name\nor Name"),	 -1, Qt::AlignLeft );
    _uses->addColumn(tr("CRM Account"),	 80, Qt::AlignLeft );
    _uses->addColumn(tr("Phone"),	100, Qt::AlignLeft );
    _uses->addColumn(tr("Alternate"),	100, Qt::AlignLeft );
    _uses->addColumn(tr("Fax"),		100, Qt::AlignLeft );
    _uses->addColumn(tr("E-Mail"),	100, Qt::AlignLeft );
    _uses->addColumn(tr("Web Address"),	100, Qt::AlignLeft );

    _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft );
    _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft );
}
Ejemplo n.º 3
0
/*
 *  Constructs a opportunity as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
opportunity::opportunity(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);

  // signals and slots connections
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_deleteTodoItem, SIGNAL(clicked()), this, SLOT(sDeleteTodoItem()));
  connect(_editTodoItem, SIGNAL(clicked()), this, SLOT(sEditTodoItem()));
  connect(_newTodoItem, SIGNAL(clicked()), this, SLOT(sNewTodoItem()));
  connect(_todoList, SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick()));
  connect(_todoList, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this, SLOT(sPopulateTodoMenu(QMenu*)));
  connect(_todoList, SIGNAL(valid(bool)), this, SLOT(sHandleTodoPrivs()));
  connect(_viewTodoItem, SIGNAL(clicked()), this, SLOT(sViewTodoItem()));
  connect(_charass, SIGNAL(itemSelected(int)), _editCharacteristic, SLOT(animateClick()));
  connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
  connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
  connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));

  _probability->setValidator(0);
  
  _opheadid = -1;

  _todoList->addColumn(tr("Priority"),   _userColumn, Qt::AlignRight, true, "incdtpriority_name");
  _todoList->addColumn(tr("User"),       _userColumn, Qt::AlignLeft,  true, "usr_username" );
  _todoList->addColumn(tr("Name"),               100, Qt::AlignLeft,  true, "todoitem_name" );
  _todoList->addColumn(tr("Description"),         -1, Qt::AlignLeft,  true, "todoitem_description" );
  _todoList->addColumn(tr("Status"),   _statusColumn, Qt::AlignLeft,  true, "todoitem_status" );
  _todoList->addColumn(tr("Due Date"),   _dateColumn, Qt::AlignLeft,  true, "todoitem_due_date" );

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft,  true, "char_name" );
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft,  true, "charass_value" );
  _charass->addColumn(tr("Default"),        _ynColumn,   Qt::AlignCenter,true, "charass_default" );

  q.prepare("SELECT usr_id "
     "FROM usr "
     "WHERE (usr_username=CURRENT_USER);");
  q.exec();
  if (q.first())
  {
    _myUsrId = q.value("usr_id").toInt();
    _owner->setId(_myUsrId);
  }
  else if (q.lastError().type() != QSqlError::NoError)
  {
    systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
    close();
  }

  _saved = false;
}
Ejemplo n.º 4
0
crmaccount::crmaccount(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  _todoList = new todoList(this, "todoList", Qt::Widget);
  _todoListTab->layout()->addWidget(_todoList);
  _todoList->setCloseVisible(false);
  _todoList->list()->hideColumn("crmacct_number");
  _todoList->list()->hideColumn("crmacct_name");
  _todoList->parameterWidget()->setDefault(tr("Assigned"), QVariant(), true);
  _todoList->setParameterWidgetVisible(false);
  _todoList->setQueryOnStartEnabled(false);
  
  _contacts = new contacts(this, "contacts", Qt::Widget);
  _allPage->layout()->addWidget(_contacts);
  _contacts->setCloseVisible(false);
  _contacts->list()->hideColumn("crmacct_number");
  _contacts->list()->hideColumn("crmacct_name");
  _contacts->setParameterWidgetVisible(false);
  _contacts->setQueryOnStartEnabled(false);
  
  _oplist = new opportunityList(this, "opportunityList", Qt::Widget);
  _oplistTab->layout()->addWidget(_oplist);
  _oplist->setCloseVisible(false);
  _oplist->list()->hideColumn("crmacct_number");
  _oplist->parameterWidget()->setDefault(tr("User"), QVariant(), true);
  _oplist->setParameterWidgetVisible(false);
  _oplist->setQueryOnStartEnabled(false);
    
  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);

  _owner->setUsername(omfgThis->username());
  _owner->setType(UsernameLineEdit::UsersActive);
    
  connect(_close,		SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_competitor,		SIGNAL(clicked()), this, SLOT(sCompetitor()));
  connect(_deleteCharacteristic,SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));
  connect(_deleteReg,		SIGNAL(clicked()), this, SLOT(sDeleteReg()));
  connect(_editCharacteristic,	SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
  connect(_editReg,		SIGNAL(clicked()), this, SLOT(sEditReg()));
  connect(_newCharacteristic,	SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
  connect(_newReg,		SIGNAL(clicked()), this, SLOT(sNewReg()));
  connect(_partner,		SIGNAL(clicked()), this, SLOT(sPartner()));
  connect(_prospectButton,	SIGNAL(clicked()), this, SLOT(sProspect()));
  connect(_save,		SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_taxauthButton,	SIGNAL(clicked()), this, SLOT(sTaxAuth()));
  connect(omfgThis, SIGNAL(customersUpdated(int, bool)), this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(prospectsUpdated()),  this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(taxAuthsUpdated(int)),this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(vendorsUpdated()),    this, SLOT(sUpdateRelationships()));
  connect(_customer, SIGNAL(toggled(bool)), this, SLOT(sCustomerToggled()));
  connect(_prospect, SIGNAL(toggled(bool)), this, SLOT(sProspectToggled()));
  connect(_number, SIGNAL(lostFocus()), this, SLOT(sCheckNumber()));
  connect(_primaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); 	 
  connect(_secondaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); 	 
  connect(_allButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons()));
  connect(_customerButton, SIGNAL(clicked()), this, SLOT(sCustomer()));
  connect(_vendorButton, SIGNAL(clicked()), this, SLOT(sEditVendor()));
  connect(_contacts, SIGNAL(cntctDetached(int)), this, SLOT(sHandleCntctDetach(int)));

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name");
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft, true, "charass_value");
  
  _reg->addColumn(tr("Lot/Serial")  ,  _itemColumn,  Qt::AlignLeft, true, "ls_number" );
  _reg->addColumn(tr("Item")        ,  _itemColumn,  Qt::AlignLeft, true, "item_number" );
  _reg->addColumn(tr("Description") ,  -1,  	     Qt::AlignLeft, true, "item_descrip1" );
  _reg->addColumn(tr("Qty"       )  ,  _qtyColumn,   Qt::AlignLeft, true, "lsreg_qty" );
  _reg->addColumn(tr("Sold"        ),  _dateColumn,  Qt::AlignLeft, true, "lsreg_solddate" );
  _reg->addColumn(tr("Registered"  ),  _dateColumn,  Qt::AlignLeft, true, "lsreg_regdate" );
  _reg->addColumn(tr("Expires"   )  ,  _dateColumn,  Qt::AlignLeft, true, "lsreg_expiredate" );

  if (_preferences->boolean("XCheckBox/forgetful"))
    _active->setChecked(true);

  _NumberGen    = -1;
  _mode		= cNew;
  _crmacctId    = -1;
  _competitorId	= -1;
  _custId       = -1;
  _partnerId    = -1;
  _prospectId   = -1;
  _taxauthId    = -1;
  _vendId       = -1;
  _comments->setId(-1);
  _documents->setId(-1);
  _modal        = false;
  
  if (!_metrics->boolean("LotSerialControl"))
    _tab->removeTab(_tab->indexOf(_registrationsTab));

}
Ejemplo n.º 5
0
enum SetResponse incident::set(const ParameterList &pParams)
{
  XSqlQuery incidentet;
  XDialog::set(pParams);
  QVariant param;
  bool     valid;

  param = pParams.value("incdt_id", &valid);
  if (valid)
  {
    _incdtid = param.toInt();
    populate();
    _lotserial->setItemId(_item->id());
    _charass->setId(_incdtid);
  }

  param = pParams.value("mode", &valid);
  if (valid)
  {
    _mode = cNew;

    if (param.toString() == "new")
    {
      incidentet.exec("SELECT nextval('incdt_incdt_id_seq') AS incdt_id, "
             "fetchIncidentNumber() AS number;");
      if(incidentet.first())
      {
        _incdtid=incidentet.value("incdt_id").toInt();
        _number->setText(incidentet.value("number").toString());
        _comments->setId(_incdtid);
        _documents->setId(_incdtid);
        _charass->setId(_incdtid);
        _alarms->setId(_incdtid);
        _recurring->setParent(_incdtid, "INCDT");
        _print->hide();
        _project->setAllowedStatuses(ProjectLineEdit::Concept |  ProjectLineEdit::InProcess);
      }
      else
      {
        QMessageBox::critical( omfgThis, tr("Database Error"),
                               tr( "A Database Error occured in incident::New:"
                                   "\n%1" ).arg(incidentet.lastError().text()));
        reject();
      }
      // Characteristics update incident history so we have to save the incident first
      // when adding a characteristic in new mode otherwise we get foreign key errors
      QPushButton *newbutton = _charass->findChild<QPushButton*>("_newCharacteristic");
      disconnect(newbutton, SIGNAL(clicked()), _charass, SLOT(sNew()));
      connect(newbutton, SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
    }
    else if (param.toString() == "edit")
    {
      _mode = cEdit;

      _crmacct->setEnabled(true);
    }
    else if (param.toString() == "view")
    {
      _mode = cView;

      _crmacct->setEnabled(false);
      _cntct->setEnabled(false);
      _assignedTo->setEnabled(false);
      _category->setEnabled(false);
      _status->setEnabled(false);
      _resolution->setEnabled(false);
      _severity->setEnabled(false);
      _priority->setEnabled(false);
      _item->setReadOnly(true);
      _lotserial->setEnabled(false);
      _description->setEnabled(false);
      _notes->setEnabled(false);
      _deleteTodoItem->setEnabled(false);
      _editTodoItem->setEnabled(false);
      _newTodoItem->setEnabled(false);
      _charass->setReadOnly(true);
      _owner->setEnabled(false);

      _buttonBox->setStandardButtons(QDialogButtonBox::Close);
      _comments->setReadOnly(true);
      _documents->setReadOnly(true);
      _alarms->setReadOnly(true);
    }
  }

  param = pParams.value("crmacct_id", &valid);
  if (valid)
  {
    _crmacct->setId(param.toInt());
    _crmacct->setEnabled(false);
  }

  param = pParams.value("cntct_id", &valid);
  if (valid)
  {
    _cntct->setId(param.toInt());
  }

  param = pParams.value("prj_id", &valid);
  if (valid)
  {
    _project->setId(param.toInt());
  }
  
  param = pParams.value("aropen_id", &valid);
  if (valid)
  {
    _aropenid = param.toInt();
    incidentet.prepare("SELECT aropen_doctype, aropen_docnumber, "
              "       CASE WHEN (aropen_doctype='C') THEN :creditMemo"
              "            WHEN (aropen_doctype='D') THEN :debitMemo"
              "            WHEN (aropen_doctype='I') THEN :invoice"
              "            WHEN (aropen_doctype='R') THEN :cashdeposit"
              "            ELSE '' END AS docType "
              "FROM aropen "
              "WHERE (aropen_id=:aropen_id);");
    incidentet.bindValue(":aropen_id", _aropenid);
    incidentet.bindValue(":creditMemo", tr("Credit Memo"));
    incidentet.bindValue(":debitMemo", tr("Debit Memo"));
    incidentet.bindValue(":invoice", tr("Invoice"));
    incidentet.bindValue(":cashdeposit", tr("Customer Deposit"));
    incidentet.exec();
    if (incidentet.first())
    {
      if (_metrics->value("DefaultARIncidentStatus").toInt())
        _category->setId(_metrics->value("DefaultARIncidentStatus").toInt());
      _ardoctype=incidentet.value("aropen_doctype").toString();
      _docType->setText(incidentet.value("docType").toString());
      _docNumber->setText(incidentet.value("aropen_docnumber").toString());
      _description->setText(QString("%1 #%2").arg(incidentet.value("docType").toString()).arg(incidentet.value("aropen_docnumber").toString()));
    }
  }

  sHandleTodoPrivs();
  return NoError;
}
Ejemplo n.º 6
0
/*
 *  Constructs a customer as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
customer::customer(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
    setupUi(this);

    (void)statusBar();

    connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
    connect(_number, SIGNAL(lostFocus()), this, SLOT(sCheck()));
    connect(_number, SIGNAL(textEdited(const QString&)), this, SLOT(sNumberEdited()));
    connect(_salesrep, SIGNAL(newID(int)), this, SLOT(sPopulateCommission()));
    connect(_newShipto, SIGNAL(clicked()), this, SLOT(sNewShipto()));
    connect(_editShipto, SIGNAL(clicked()), this, SLOT(sEditShipto()));
    connect(_viewShipto, SIGNAL(clicked()), this, SLOT(sViewShipto()));
    connect(_deleteShipto, SIGNAL(clicked()), this, SLOT(sDeleteShipto()));
    connect(_shipto, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateShiptoMenu(QMenu*)));
    connect(_printShipto, SIGNAL(clicked()), this, SLOT(sPrintShipto()));
    connect(_downCC, SIGNAL(clicked()), this, SLOT(sMoveDown()));
    connect(_upCC, SIGNAL(clicked()), this, SLOT(sMoveUp()));
    connect(_viewCC, SIGNAL(clicked()), this, SLOT(sViewCreditCard()));
    connect(_editCC, SIGNAL(clicked()), this, SLOT(sEditCreditCard()));
    connect(_newCC, SIGNAL(clicked()), this, SLOT(sNewCreditCard()));
    connect(_ediProfile, SIGNAL(activated(int)), this, SLOT(sProfileSelected()));
    connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));
    connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
    connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
    connect(_deleteTaxreg, SIGNAL(clicked()), this, SLOT(sDeleteTaxreg()));
    connect(_editTaxreg,   SIGNAL(clicked()), this, SLOT(sEditTaxreg()));
    connect(_newTaxreg,    SIGNAL(clicked()), this, SLOT(sNewTaxreg()));
    connect(_viewTaxreg,   SIGNAL(clicked()), this, SLOT(sViewTaxreg()));
    connect(_soEdiProfile, SIGNAL(activated(int)), this, SLOT(sSoProfileSelected()));
    connect(_custtype, SIGNAL(currentIndexChanged(int)), this, SLOT(sFillCharacteristicList()));
    
    _custid = -1;
    _crmacctid = -1;

    _sellingWarehouse->setId(-1);

    _currency->setLabel(_currencyLit);
    
    _balanceMethod->insertItem(tr("Balance Forward"));
    _balanceMethod->insertItem(tr("Open Items"));

    _taxreg->addColumn(tr("Tax Authority"), 100, Qt::AlignLeft );
    _taxreg->addColumn(tr("Registration #"), -1, Qt::AlignLeft );

    _shipto->addColumn(tr("Default"),          _itemColumn,  Qt::AlignLeft );
    _shipto->addColumn(tr("Number"),           _itemColumn,  Qt::AlignLeft );
    _shipto->addColumn(tr("Name"),             150,          Qt::AlignLeft );
    _shipto->addColumn(tr("Address"),          150,          Qt::AlignLeft );
    _shipto->addColumn(tr("City, State, Zip"), -1,           Qt::AlignLeft );

    _cc->addColumn(tr("Sequence"),          _itemColumn,  Qt::AlignLeft );
    _cc->addColumn(tr("Type"),           _itemColumn,  Qt::AlignLeft );
    _cc->addColumn(tr("Number"),             150,          Qt::AlignRight );
    _cc->addColumn(tr("Active"),          -1,          Qt::AlignLeft );
    
    _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft );
    _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft );
  
    _custchar = new QStandardItemModel(0, 2, this);
    _custchar->setHeaderData( 0, Qt::Horizontal, tr("Characteristc"), Qt::DisplayRole);
    _custchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole);
    _chartempl->setModel(_custchar);
    CustCharacteristicDelegate * delegate = new CustCharacteristicDelegate(this);
    _chartempl->setItemDelegate(delegate);

    key = omfgThis->_key;
    if(!_metrics->boolean("CCAccept") || key.length() == 0 || key.isNull() || key.isEmpty())
    {
      _tab->removePage(_tab->page(10));
    }
    
    if (_metrics->boolean("EnableBatchManager"))
    {
      _ediProfile->append(-1, tr("No EDI"));
      _ediProfile->append(0, tr("Custom Email"));
    
      _soEdiProfile->append(-1, tr("No EDI"));
      _soEdiProfile->append(0, tr("Custom Email"));
    
      q.prepare("SELECT ediprofile_id, ediprofile_name"
                "  FROM ediprofile, ediform"
                " WHERE ((ediform_ediprofile_id=ediprofile_id)"
                "   AND  (ediform_type='invoice')) "
                "ORDER BY ediprofile_name; ");
      q.exec();
      while(q.next()) 
      {
        _ediProfile->append(q.value("ediprofile_id").toInt(), q.value("ediprofile_name").toString());
        _soEdiProfile->append(q.value("ediprofile_id").toInt(), q.value("ediprofile_name").toString());
      }
    }
    else
    {
      _tab->removePage(_tab->page(9));
      _tab->removePage(_tab->page(8));
    }
    
    //If not multi-warehouse hide whs control
    if (!_metrics->boolean("MultiWhs"))
    {
      _sellingWarehouseLit->hide();
      _sellingWarehouse->hide();
    }
}
Ejemplo n.º 7
0
opportunity::opportunity(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);

  connect(_crmacct, SIGNAL(newId(int)), this, SLOT(sHandleCrmacct(int)));
  connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
  connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave()));
  connect(_deleteTodoItem, SIGNAL(clicked()), this, SLOT(sDeleteTodoItem()));
  connect(_viewTodoItem, SIGNAL(clicked()), this, SLOT(sViewTodoItem()));
  connect(_editTodoItem, SIGNAL(clicked()), this, SLOT(sEditTodoItem()));
  connect(_newTodoItem, SIGNAL(clicked()), this, SLOT(sNewTodoItem()));
  connect(_todoList, SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick()));
  connect(_todoList, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this, SLOT(sPopulateTodoMenu(QMenu*)));
  connect(_todoList, SIGNAL(valid(bool)), this, SLOT(sHandleTodoPrivs()));
  connect(_deleteSale, SIGNAL(clicked()), this, SLOT(sDeleteSale()));
  connect(_viewSale, SIGNAL(clicked()), this, SLOT(sViewSale()));
  connect(_editSale, SIGNAL(clicked()), this, SLOT(sEditSale()));
  connect(_convertQuote, SIGNAL(clicked()), this, SLOT(sConvertQuote()));
  connect(_printSale, SIGNAL(clicked()), this, SLOT(sPrintSale()));
  connect(_salesList, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateSalesMenu(QMenu*)));
  connect(_salesList, SIGNAL(valid(bool)), this, SLOT(sHandleSalesPrivs()));
  connect(omfgThis,	SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillSalesList()));
  connect(omfgThis,	SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillSalesList()));
  connect(_charass, SIGNAL(itemSelected(int)), _editCharacteristic, SLOT(animateClick()));
  connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
  connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
  connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));
  connect(_assignedTo, SIGNAL(newId(int)), this, SLOT(sHandleAssigned()));

  _probability->setValidator(0);
  
  _opheadid = -1;
  _custid = -1;
  _prospectid = -1;
  
  _todoList->addColumn(tr("Active"),   _statusColumn, Qt::AlignRight, true, "todoitem_active");
  _todoList->addColumn(tr("Priority"),   _userColumn, Qt::AlignRight, true, "incdtpriority_name");
  _todoList->addColumn(tr("Owner"),      _userColumn, Qt::AlignLeft, false, "todoitem_owner_username");
  _todoList->addColumn(tr("Assigned"),   _userColumn, Qt::AlignLeft,  true, "todoitem_username" );
  _todoList->addColumn(tr("Name"),               100, Qt::AlignLeft,  true, "todoitem_name" );
  _todoList->addColumn(tr("Description"),         -1, Qt::AlignLeft,  true, "todoitem_description" );
  _todoList->addColumn(tr("Status"),   _statusColumn, Qt::AlignLeft,  true, "todoitem_status" );
  _todoList->addColumn(tr("Due Date"),   _dateColumn, Qt::AlignLeft,  true, "todoitem_due_date" );

  _salesList->addColumn(tr("Doc #"),       _orderColumn, Qt::AlignLeft,  true, "sale_number" );
  _salesList->addColumn(tr("Type"),                  -1, Qt::AlignLeft,  true, "sale_type" );
  _salesList->addColumn(tr("Date"),         _dateColumn, Qt::AlignLeft,  true, "sale_date" );
  _salesList->addColumn(tr("Ext. Price"),  _priceColumn, Qt::AlignRight, true, "sale_extprice");

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft,  true, "char_name" );
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft,  true, "charass_value" );
  _charass->addColumn(tr("Default"),        _ynColumn,   Qt::AlignCenter,true, "charass_default" );

  _owner->setUsername(omfgThis->username());
  _owner->setType(UsernameLineEdit::UsersActive);

  _assignedTo->setType(UsernameLineEdit::UsersActive);

  _saved = false;
}
Ejemplo n.º 8
0
incident::incident(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    _statusCodes << "N" << "F" << "C" << "A" << "R" << "L";
    setupUi(this);

    _incdtid = -1;
    _saved = false;
    _aropenid = -1;

    _print = _buttonBox->addButton(tr("Print"),QDialogButtonBox::ActionRole);
    _print->setObjectName("_print");
    _buttonBox->button(QDialogButtonBox::Save)->setObjectName("_save");

    if(!_privileges->check("EditOwner")) _owner->setEnabled(false);

    connect(_assignedTo,    SIGNAL(newId(int)),       this, SLOT(sAssigned()));
    connect(_buttonBox,     SIGNAL(rejected()),        this,       SLOT(sCancel()));
    connect(_crmacct,       SIGNAL(newId(int)),       this,       SLOT(sCRMAcctChanged(int)));
    connect(_deleteTodoItem, SIGNAL(clicked()),       this,       SLOT(sDeleteTodoItem()));
    connect(_editTodoItem,  SIGNAL(clicked()),        this,       SLOT(sEditTodoItem()));
    connect(_item,          SIGNAL(newId(int)),     _lotserial,   SLOT(setItemId(int)));
    connect(_newTodoItem,   SIGNAL(clicked()),        this,       SLOT(sNewTodoItem()));
    //connect(_return,      SIGNAL(clicked()),        this, SLOT(sReturn()));
    connect(_buttonBox,     SIGNAL(accepted()),        this,       SLOT(sSave()));
    connect(_print,         SIGNAL(clicked()),        this,       SLOT(sPrint()));
    connect(_todoList,      SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick()));
    connect(_todoList,      SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this,         SLOT(sPopulateTodoMenu(QMenu*)));
    connect(_todoList,      SIGNAL(valid(bool)),      this, SLOT(sHandleTodoPrivs()));
    connect(_viewAR,        SIGNAL(clicked()),        this, SLOT(sViewAR()));
    connect(_viewTodoItem,  SIGNAL(clicked()),        this,       SLOT(sViewTodoItem()));
    connect(_deleteCharacteristic,SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));
    connect(_editCharacteristic,	SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
    connect(_newCharacteristic,	SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
    connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool)));
    connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool)));
    connect(_charass, SIGNAL(itemSelected(int)), _editCharacteristic, SLOT(animateClick()));

    _severity->setType(XComboBox::IncidentSeverity);
    _priority->setType(XComboBox::IncidentPriority);
    _resolution->setType(XComboBox::IncidentResolution);
    _category->setType(XComboBox::IncidentCategory);
    _lotserial->setStrict(false);

    _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name");
    _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft, true, "charass_value");

    _incdthist->addColumn(tr("Username"),     _userColumn, Qt::AlignLeft, true, "incdthist_username");
    _incdthist->addColumn(tr("Date/Time"),_timeDateColumn, Qt::AlignLeft, true, "incdthist_timestamp");
    _incdthist->addColumn(tr("Description"),           -1, Qt::AlignLeft, true, "incdthist_descrip");

    _todoList->addColumn(tr("Priority"),      _userColumn, Qt::AlignRight, true, "incdtpriority_name");
    _todoList->addColumn(tr("Owner"),         _userColumn, Qt::AlignLeft, false, "todoitem_owner_username");
    _todoList->addColumn(tr("Assigned"),      _userColumn, Qt::AlignLeft,  true, "todoitem_username");
    _todoList->addColumn(tr("Name"),                  100, Qt::AlignLeft,  true, "todoitem_name");
    _todoList->addColumn(tr("Description"),            -1, Qt::AlignLeft,  true, "todoitem_description");
    _todoList->addColumn(tr("Status"),      _statusColumn, Qt::AlignLeft,  true, "todoitem_status");
    _todoList->addColumn(tr("Due Date"),      _dateColumn, Qt::AlignLeft,  true, "todoitem_due_date");

    _owner->setUsername(omfgThis->username());
    _owner->setType(UsernameLineEdit::UsersActive);
    _assignedTo->setType(UsernameLineEdit::UsersActive);

    if (_metrics->boolean("LotSerialControl"))
    {
        connect(_item, SIGNAL(valid(bool)), _lotserial, SLOT(setEnabled(bool)));
        connect(_item, SIGNAL(newId(int)),  _lotserial, SLOT(setItemId(int)));
    }
    else
        _lotserial->setVisible(false);

    if(!_metrics->boolean("IncidentsPublicPrivate"))
        _public->hide();
    _public->setChecked(_metrics->boolean("IncidentPublicDefault"));

    // because this causes a pop-behind situation we are hiding for now.
    //_return->hide();
}
Ejemplo n.º 9
0
vendor::vendor(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_crmacct,             SIGNAL(clicked()),                       this,         SLOT(sCrmAccount()));
  connect(_save,                SIGNAL(clicked()),                       this,         SLOT(sSave()));
  connect(_printAddresses,      SIGNAL(clicked()),                       this,         SLOT(sPrintAddresses()));
  connect(_newAddress,          SIGNAL(clicked()),                       this,         SLOT(sNewAddress()));
  connect(_editAddress,         SIGNAL(clicked()),                       this,         SLOT(sEditAddress()));
  connect(_viewAddress,         SIGNAL(clicked()),                       this,         SLOT(sViewAddress()));
  connect(_deleteAddress,       SIGNAL(clicked()),                       this,         SLOT(sDeleteAddress()));
  connect(_deleteTaxreg,        SIGNAL(clicked()),                       this,         SLOT(sDeleteTaxreg()));
  connect(_editTaxreg,          SIGNAL(clicked()),                       this,         SLOT(sEditTaxreg()));
  connect(_newTaxreg,           SIGNAL(clicked()),                       this,         SLOT(sNewTaxreg()));
  connect(_viewTaxreg,          SIGNAL(clicked()),                       this,         SLOT(sViewTaxreg()));
  connect(_next,                SIGNAL(clicked()),                       this,         SLOT(sNext()));
  connect(_previous,            SIGNAL(clicked()),                       this,         SLOT(sPrevious()));
  connect(_mainButton,          SIGNAL(clicked()),                       this,         SLOT(sHandleButtons()));
  connect(_altButton,           SIGNAL(clicked()),                       this,         SLOT(sHandleButtons()));
  connect(_checksButton,        SIGNAL(clicked()),                       this,         SLOT(sHandleButtons()));
  connect(_number,              SIGNAL(textEdited(const QString&)),      this,         SLOT(sNumberEdited()));
  connect(_number,              SIGNAL(editingFinished()),               this,         SLOT(sCheck()));
  connect(_newCharacteristic,   SIGNAL(clicked()),                       this,         SLOT(sNewCharacteristic()));
  connect(_editCharacteristic,  SIGNAL(clicked()),                       this,         SLOT(sEditCharacteristic()));
  connect(_deleteCharacteristic,SIGNAL(clicked()),                       this,         SLOT(sDeleteCharacteristic()));

  connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)),
          _contact2, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString)));

  connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)),
          _contact1, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString)));

  _defaultCurr->setLabel(_defaultCurrLit);

  QRegExp tmpregex = QRegExp(_metrics->value("EFTAccountRegex"));
  _accountValidator = new QRegExpValidator (tmpregex, this);
  tmpregex = QRegExp(_metrics->value("EFTRoutingRegex"));
  _routingValidator = new QRegExpValidator(tmpregex, this);

  _routingNumber->setValidator(_routingValidator);
  _achAccountNumber->setValidator(_accountValidator);

  _vendaddr->addColumn(tr("Number"),        70,              Qt::AlignLeft,   true,  "vendaddr_code");
  _vendaddr->addColumn(tr("Name"),          50,              Qt::AlignLeft,   true,  "vendaddr_name");
  _vendaddr->addColumn(tr("City"),          -1,              Qt::AlignLeft,   true,  "addr_city");
  _vendaddr->addColumn(tr("State"),         -1,              Qt::AlignLeft,   true,  "addr_state");
  _vendaddr->addColumn(tr("Country"),       -1,              Qt::AlignLeft,   true,  "addr_country");
  _vendaddr->addColumn(tr("Postal Code"),   -1,              Qt::AlignLeft,   true,  "addr_postalcode");

  _taxreg->addColumn(tr("Tax Authority"),   100,             Qt::AlignLeft,   true,  "taxauth_code");
  _taxreg->addColumn(tr("Tax Zone"),        100,             Qt::AlignLeft,   true,  "taxzone_code");
  _taxreg->addColumn(tr("Registration #"),  -1,              Qt::AlignLeft,   true,  "taxreg_number");

  _charass->addColumn(tr("Characteristic"), _itemColumn,     Qt::AlignLeft,   true,  "char_name" );
  _charass->addColumn(tr("Value"),          -1,              Qt::AlignLeft,   true,  "charass_value" );
  
  _accountType->append(0, "Checking", "K");
  _accountType->append(1, "Savings",  "C");

  _transmitStack->setCurrentIndex(0);
  if (_metrics->boolean("EnableBatchManager") &&
      ! (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")))
  {
    _checksButton->hide();
  }
  else if (! _metrics->boolean("EnableBatchManager") &&
           (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")))
  {
    _checksButton->hide();
    _transmitStack->setCurrentIndex(1);
  }
  else if (! _metrics->boolean("EnableBatchManager") &&
           ! (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")))
    ediTab->setVisible(false);
  // else defaults are OK

  if (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled") && omfgThis->_key.isEmpty())
    _checksButton->setEnabled(false);

  _account->setType(GLCluster::cRevenue | GLCluster::cExpense |
                    GLCluster::cAsset | GLCluster::cLiability);

  _vendid      = -1;
  _crmacctid   = -1;
  _ignoreClose = false;
  _NumberGen   = -1;
}