viewCheckRun::viewCheckRun(QWidget* parent, const char* name, Qt::WFlags fl) : QMainWindow(parent, name, fl) { setupUi(this); connect(_check, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(sHandleItemSelection())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_postCheck, SIGNAL(clicked()), this, SLOT(sPost())); connect(_printCheck, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_printCheckRun, SIGNAL(clicked()), this, SLOT(sPrintCheckRun())); connect(_printEditList, SIGNAL(clicked()), this, SLOT(sPrintEditList())); connect(_replace, SIGNAL(clicked()), this, SLOT(sReplace())); connect(_replaceAll, SIGNAL(clicked()), this, SLOT(sReplaceAll())); connect(_void, SIGNAL(clicked()), this, SLOT(sVoid())); _check->setRootIsDecorated(TRUE); _check->addColumn(tr("Void"), _ynColumn, Qt::AlignCenter ); _check->addColumn(tr("Misc."), _ynColumn, Qt::AlignCenter ); _check->addColumn(tr("Prt'd"), _ynColumn, Qt::AlignCenter ); _check->addColumn(tr("Chk./Voucher/RA #"), _itemColumn, Qt::AlignCenter ); _check->addColumn(tr("Recipient/Invc./CM #"), -1, Qt::AlignLeft ); _check->addColumn(tr("Check Date") , _dateColumn, Qt::AlignCenter ); _check->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight ); _check->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft ); if (omfgThis->singleCurrency()) _check->hideColumn(7); connect(omfgThis, SIGNAL(checksUpdated(int, int, bool)), this, SLOT(sFillList(int))); sFillList(); }
void viewCheckRun::sFillList() { QMenu * printMenu = new QMenu; if (_vendorgroup->isAll()) printMenu->addAction(tr("Check Run..."), this, SLOT(sPrintCheckRun())); printMenu->addAction(tr("Edit List"), this, SLOT(sPrintEditList())); _print->setMenu(printMenu); QMenu * postMenu = new QMenu; if (_vendorgroup->isAll()) postMenu->addAction(tr("Post All..."), this, SLOT(sPostChecks())); _postCheck->setMenu(postMenu); MetaSQLQuery mql = mqlLoad("checkRegister", "detail"); ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); params.append("showTotal"); params.append("newOnly"); params.append("showDetail"); _vendorgroup->appendValue(params); q = mql.toQuery(params); _check->populate(q); if (q.lastError().type() != QSqlError::NoError) { systemError(this, q.lastError().databaseText(), __FILE__, __LINE__); return; } }
void viewCheckRun::sHandleItemSelection() { XTreeWidgetItem *selected = _check->currentItem(); bool select = false; if (! selected) { _void->setEnabled(FALSE); _delete->setEnabled(FALSE); _replace->setEnabled(FALSE); select = true; _edit->setEnabled(FALSE); return; } if (selected->rawValue("checkhead_void").toBool()) { _void->setEnabled(FALSE); _delete->setEnabled(TRUE); _replace->setEnabled(TRUE); _edit->setEnabled(FALSE); } else if (! selected->rawValue("checkhead_void").isNull() && ! selected->rawValue("checkhead_void").toBool()) { // This was not allowing voiding of ACH checks. No strong case could be // made to disallow this since ACH is manuall at this time. Should that // requirement change this is the original line //_void->setEnabled(selected->rawValue("checkhead_ach_batch").isNull()); _void->setEnabled(true); _delete->setEnabled(FALSE); _replace->setEnabled(FALSE); select = selected->rawValue("checkhead_ach_batch").isNull(); _edit->setEnabled(selected->rawValue("checkhead_misc").toBool() && ! selected->rawValue("checkhead_printed").toBool()); } QMenu * printMenu = new QMenu; if (select) printMenu->addAction(tr("Selected Check..."), this, SLOT(sPrint())); if (_vendorgroup->isAll()) printMenu->addAction(tr("Check Run..."), this, SLOT(sPrintCheckRun())); printMenu->addAction(tr("Edit List"), this, SLOT(sPrintEditList())); _print->setMenu(printMenu); QMenu * postMenu = new QMenu; if (selected->rawValue("checkhead_printed").toBool() && _privileges->check("PostPayments")) postMenu->addAction(tr("Selected Check..."), this, SLOT(sPost())); if (_vendorgroup->isAll()) postMenu->addAction(tr("All Checks..."), this, SLOT(sPostChecks())); _postCheck->setMenu(postMenu); }
packingListBatch::packingListBatch(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_add, SIGNAL(clicked()), this, SLOT(sAddSO())); connect(_addTO, SIGNAL(clicked()), this, SLOT(sAddTO())); connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deletePrinted, SIGNAL(clicked()), this, SLOT(sClearPrinted())); connect(_pack, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_printBatch, SIGNAL(clicked()), this, SLOT(sPrintBatch())); connect(_printEditList, SIGNAL(clicked()), this, SLOT(sPrintEditList())); connect(_printPackingList, SIGNAL(clicked()), this, SLOT(sPrintPackingList())); setAcceptDrops(TRUE); _pack->addColumn(tr("Order #"), 80, Qt::AlignCenter, true, "order_number" ); _pack->addColumn(tr("Type"), 40, Qt::AlignCenter, true, "pack_head_type" ); _pack->addColumn(tr("Shipment #"), 80, Qt::AlignCenter, true, "shipment_number" ); _pack->addColumn(tr("Customer #"), _itemColumn, Qt::AlignLeft, true, "number" ); _pack->addColumn(tr("Customer Name"), -1, Qt::AlignLeft, true, "name" ); _pack->addColumn(tr("Ship Via"), 80, Qt::AlignLeft, true, "shipvia"); _pack->addColumn(tr("Hold Type"), _dateColumn, Qt::AlignCenter, true, "f_holdtype" ); _pack->addColumn(tr("Printed"), _dateColumn, Qt::AlignCenter, true, "pack_printed" ); if (_privileges->check("MaintainPackingListBatch")) { _add->setEnabled(TRUE); _addTO->setEnabled(TRUE); _deletePrinted->setEnabled(TRUE); connect(_pack, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } if (_privileges->check("PrintPackingLists")) { _printBatch->setEnabled(TRUE); connect(_pack, SIGNAL(valid(bool)), _printPackingList, SLOT(setEnabled(bool))); } _addTO->setVisible(_metrics->boolean("MultiWhs")); sFillList(); sHandleAutoUpdate(_autoUpdate->isChecked()); }