void apOpenItem::sClose() { if (_mode == cNew) sReleaseNumber(); reject(); }
apOpenItem::apOpenItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_docDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDueDate())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate())); connect(_vend, SIGNAL(newId(int)), this, SLOT(sPopulateVendInfo(int))); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_docNumber, SIGNAL(textEdited(QString)), this, SLOT(sReleaseNumber())); _cAmount = 0.0; _apopenid = -1; _seqiss = 0; _apapply->addColumn( tr("Type"), _dateColumn, Qt::AlignCenter,true, "doctype"); _apapply->addColumn( tr("Doc. #"), -1, Qt::AlignLeft, true, "docnumber"); _apapply->addColumn( tr("Apply Date"), _dateColumn, Qt::AlignCenter,true, "apapply_postdate"); _apapply->addColumn( tr("Amount"), _moneyColumn, Qt::AlignRight, true, "apapply_amount"); _apapply->addColumn( tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "currabbr"); if (omfgThis->singleCurrency()) _apapply->hideColumn("currabbr"); _terms->setType(XComboBox::APTerms); _journalNumber->setEnabled(FALSE); _altAccntid->setType(GLCluster::cRevenue | GLCluster::cExpense); }
void employee::sHandleButtons() { _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); if(_NumberGen != -1 && _code->text().toInt() != _NumberGen) sReleaseNumber(); }
arOpenItem::arOpenItem(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _commprcnt = 0.0; _save = _buttonBox->button(QDialogButtonBox::Save); _save->setDisabled(true); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustInfo(int))); connect(_cust, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate())); connect(_docDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDueDate())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_amount, SIGNAL(valueChanged()), this, SLOT(sCalculateCommission())); connect(_amount, SIGNAL(editingFinished()), this, SLOT(sDetermineTaxAmount())); connect(_taxzone, SIGNAL(newID(int)), this, SLOT(sDetermineTaxAmount())); connect(_docNumber, SIGNAL(textEdited(QString)), this, SLOT(sReleaseNumber())); _last = -1; _aropenid = -1; _seqiss = 0; _docType->append(0, tr("Credit Memo"), "C"); _docType->append(1, tr("Debit Memo"), "D"); _docType->append(2, tr("Invoice"), "I"); _docType->append(3, tr("Customer Deposit"), "R"); _arapply->addColumn(tr("Type"), _dateColumn, Qt::AlignCenter,true, "doctype"); _arapply->addColumn(tr("Doc. #"), -1, Qt::AlignLeft, true, "docnumber"); _arapply->addColumn(tr("Apply Date"), _dateColumn, Qt::AlignCenter,true, "arapply_postdate"); _arapply->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter,true, "arapply_distdate"); _arapply->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "arapply_applied"); _arapply->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, !omfgThis->singleCurrency(), "currabbr"); _arapply->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight, true, "baseapplied"); _printOnPost->setVisible(false); _cust->setType(CLineEdit::ActiveCustomers); _terms->setType(XComboBox::ARTerms); _salesrep->setType(XComboBox::SalesReps); _altSalescatid->setType(XComboBox::SalesCategoriesActive); _rsnCode->setType(XComboBox::ReasonCodes); _journalNumber->setEnabled(false); _altAccntid->setType(GLCluster::cRevenue | GLCluster::cExpense); }
void apOpenItem::sClose() { XSqlQuery deleteOpenItem; if (_mode == cNew) { // Handle new placeholder documents that get orphaned when document is cancelled (#23873) if (_apopenid != -1){ deleteOpenItem.prepare("DELETE FROM apopen WHERE apopen_id = :apopenid;"); deleteOpenItem.bindValue(":apopenid", _apopenid); deleteOpenItem.exec(); } sReleaseNumber(); } reject(); }
void employee::reject() { if (DEBUG) qDebug("employee::reject() entered with _mode %d and _origmode %d", _mode, _origmode); if (_origmode == cNew) { XSqlQuery delq; delq.prepare("DELETE FROM emp WHERE (emp_id=:empid);"); delq.bindValue(":empid", _empid); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting Employee"), delq, __FILE__, __LINE__); if(_NumberGen != -1) sReleaseNumber(); } XDialog::reject(); }
apOpenItem::apOpenItem(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_docDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDueDate())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate())); connect(_vend, SIGNAL(newId(int)), this, SLOT(sPopulateVendInfo(int))); connect(_amount, SIGNAL(editingFinished()), this, SLOT(sDetermineTaxAmount())); connect(_taxzone, SIGNAL(newID(int)), this, SLOT(sDetermineTaxAmount())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_docNumber, SIGNAL(textEdited(QString)), this, SLOT(sReleaseNumber())); connect(_usePrepaid, SIGNAL(toggled(bool)), this, SLOT(sToggleAccount())); connect(_amount, SIGNAL(valueChanged()), this, SLOT(sCalcBalance())); _cAmount = 0.0; _apopenid = -1; _seqiss = 0; _docType->append(0, tr("Credit Memo"), "C"); _docType->append(1, tr("Debit Memo"), "D"); _docType->append(2, tr("Voucher"), "V"); _apapply->addColumn( tr("Type"), _dateColumn, Qt::AlignCenter,true, "doctype"); _apapply->addColumn( tr("Doc. #"), -1, Qt::AlignLeft, true, "docnumber"); _apapply->addColumn( tr("Apply Date"), _dateColumn, Qt::AlignCenter,true, "apapply_postdate"); _apapply->addColumn( tr("Amount"), _moneyColumn, Qt::AlignRight, true, "apapply_amount"); _apapply->addColumn( tr("Currency"),_currencyColumn, Qt::AlignLeft, !omfgThis->singleCurrency(), "currabbr"); _printOnPost->setVisible(false); _terms->setType(XComboBox::APTerms); _journalNumber->setEnabled(false); _accntId->setType(GLCluster::cRevenue | GLCluster::cExpense); sToggleAccount(); }
void arOpenItem::sClose() { XSqlQuery deleteARDocument; if (_mode == cNew) { if(_aropenid != -1){ deleteARDocument.prepare("DELETE FROM aropen WHERE aropen_id = :aropenid;"); deleteARDocument.bindValue(":aropenid", _aropenid); deleteARDocument.exec(); } if(_seqiss) sReleaseNumber(); if(_last != -1) { done(_last); return; } } reject(); }