/* * Constructs a openReturnAuthorizations as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ openReturnAuthorizations::openReturnAuthorizations(QWidget* parent, const char* name, Qt::WFlags fl) : QMainWindow(parent, name, fl) { setupUi(this); (void)statusBar(); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_ra, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_ra, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); connect(_expired, SIGNAL(clicked()), this, SLOT(sFillList())); statusBar()->hide(); _ra->addColumn(tr("S/O #"), _orderColumn, Qt::AlignLeft ); _ra->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft ); _ra->addColumn(tr("Customer"), -1, Qt::AlignLeft ); _ra->addColumn(tr("Disposition"), _itemColumn, Qt::AlignLeft ); _ra->addColumn(tr("Created"), _dateColumn, Qt::AlignCenter ); _ra->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter ); if (_privleges->check("MaintainReturns")) { connect(_ra, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_ra, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_ra, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_ra, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(omfgThis, SIGNAL(returnAuthorizationsUpdated()), this, SLOT(sFillList())); sFillList(); }
openReturnAuthorizations::openReturnAuthorizations(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_ra, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_ra, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_expired, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_unauthorized, SIGNAL(clicked()), this, SLOT(sFillList())); _ra->addColumn(tr("Return #"), _orderColumn, Qt::AlignLeft, true, "rahead_number" ); _ra->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "custnumber" ); _ra->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "rahead_billtoname" ); _ra->addColumn(tr("Disposition"), _itemColumn, Qt::AlignLeft, true, "disposition" ); _ra->addColumn(tr("Created"), _dateColumn, Qt::AlignCenter, true, "rahead_authdate" ); _ra->addColumn(tr("Expires"), -1, Qt::AlignCenter, true, "rahead_expiredate" ); if (_privileges->check("MaintainReturns")) { connect(_ra, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_ra, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_ra, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_ra, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(omfgThis, SIGNAL(returnAuthorizationsUpdated()), this, SLOT(sFillList())); }
returnAuthorizationWorkbench::returnAuthorizationWorkbench(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _codeGroup = new QButtonGroup(this); _codeGroup->addButton(_cust); _codeGroup->addButton(_custtype); _custInfo->hide(); _parameter->setType(ParameterGroup::CustomerType); // connect(_ra, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); // connect(_radue, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_codeGroup, SIGNAL(buttonClicked(int)), this, SLOT(sParameterTypeChanged())); connect(_queryReview, SIGNAL(clicked()), this, SLOT(sFillListReview())); connect(_queryDue, SIGNAL(clicked()), this, SLOT(sFillListDue())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_editdue, SIGNAL(clicked()), this, SLOT(sEditDue())); connect(_viewdue, SIGNAL(clicked()), this, SLOT(sViewDue())); connect(_printdue, SIGNAL(clicked()), this, SLOT(sPrintDue())); connect(_process, SIGNAL(clicked()), this, SLOT(sProcess())); connect(_radue, SIGNAL(valid(bool)), this, SLOT(sHandleButton())); connect(omfgThis, SIGNAL(returnAuthorizationsUpdated()), this, SLOT(sFillListReview())); connect(omfgThis, SIGNAL(returnAuthorizationsUpdated()), this, SLOT(sFillListDue())); _ra->addColumn(tr("Auth. #"), _orderColumn, Qt::AlignLeft, true, "rahead_number" ); _ra->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); _ra->addColumn(tr("Authorized"), _dateColumn, Qt::AlignRight, true, "rahead_authdate" ); _ra->addColumn(tr("Expires"), _dateColumn, Qt::AlignRight, true, "rahead_expiredate" ); _ra->addColumn(tr("Disposition"), _itemColumn, Qt::AlignRight, true, "disposition" ); _ra->addColumn(tr("Credit By"), _itemColumn, Qt::AlignRight, true, "creditmethod" ); _ra->addColumn(tr("Awaiting"), _itemColumn, Qt::AlignCenter, true, "awaiting" ); _radue->addColumn(tr("Auth. #"), _orderColumn, Qt::AlignLeft, true, "rahead_number" ); _radue->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); _radue->addColumn(tr("Authorized"), _dateColumn, Qt::AlignRight,true, "rahead_authdate"); _radue->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight,true, "amount" ); _radue->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight,true, "currency" ); _radue->addColumn(tr("Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight,true, "baseamount" ); _radue->addColumn(tr("Credit By"), _itemColumn, Qt::AlignRight,true, "creditmethod" ); if (!_privileges->check("MaintainReturns")) { _edit->hide(); _editdue->hide(); } if (_metrics->boolean("CCAccept") && _privileges->check("ProcessCreditCards")) { /* if (! CreditCardProcessor::getProcessor()) QMessageBox::warning(this, tr("Credit Card Processing error"), CreditCardProcessor::errorMsg()); */ } else { _creditcard->setChecked(false); _creditcard->hide(); } if (!_privileges->check("PostARDocuments")) { _postmemos->setChecked(false); _postmemos->setEnabled(false); } }