Exemple #1
0
vendor::vendor(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
  setupUi(this);

  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()));

  _defaultCurr->setLabel(_defaultCurrLit);

  _vendaddr->addColumn(tr("Number"),           70,  Qt::AlignLeft );
  _vendaddr->addColumn(tr("Name"),             150, Qt::AlignLeft );
  _vendaddr->addColumn(tr("City, State, Zip"), -1,  Qt::AlignLeft );

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

  _crmacctid = -1;
  _ignoreClose = false;
  _NumberGen = -1;
  
  if (!_metrics->boolean("EnableBatchManager"))
    _tabs->removePage(_tabs->page(_tabs->count()-1));
}
Exemple #2
0
vendor::vendor(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  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()));

  _defaultCurr->setLabel(_defaultCurrLit);
  _routingNumber->setValidator(new QIntValidator(100000000, 999999999, this));
  _achAccountNumber->setValidator(new QRegExpValidator(QRegExp("^\\d{4,17}$"), this));

  _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, "vendaddr_city");
  _vendaddr->addColumn(tr("State"),  -1, Qt::AlignLeft, true, "vendaddr_state");
  _vendaddr->addColumn(tr("Country"),-1, Qt::AlignLeft, true, "vendaddr_country");
  _vendaddr->addColumn(tr("Postal Code"),-1, Qt::AlignLeft, true, "vendaddr_zipcode");

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

  _crmacctid = -1;
  _ignoreClose = false;
  _NumberGen = -1;
  
  if (_metrics->boolean("EnableBatchManager") &&
      ! _metrics->boolean("ACHEnabled"))
    _transmitTabGroup->removeTab(_transmitTabGroup->indexOf(_checksTab));
  else if (! _metrics->boolean("EnableBatchManager") &&
           _metrics->boolean("ACHEnabled"))
    _purchaseOrderTab->setVisible(false);
  else if (! _metrics->boolean("EnableBatchManager") &&
           ! _metrics->boolean("ACHEnabled"))
    ediTab->setVisible(false);
  // else defaults are OK

  if (_metrics->boolean("ACHEnabled") && omfgThis->_key.isEmpty())
    _checksTab->setEnabled(false);
}
Exemple #3
0
vendor::vendor(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  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(lostFocus()), this, SLOT(sCheck()));

  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, "vendaddr_city");
  _vendaddr->addColumn(tr("State"),  -1, Qt::AlignLeft, true, "vendaddr_state");
  _vendaddr->addColumn(tr("Country"),-1, Qt::AlignLeft, true, "vendaddr_country");
  _vendaddr->addColumn(tr("Postal Code"),-1, Qt::AlignLeft, true, "vendaddr_zipcode");

  _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");

  _accountType->append(0, "Checking", "K");
  _accountType->append(1, "Savings",  "C");

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

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

  _vendid = -1;
}
Exemple #4
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();
    }
}