void AropenLineEdit::setAllowedDocTypes(DocTypes ptypes) { QStringList typelist; _allowedTypes = ptypes; if (ptypes == AnyType) _typeClause = ""; else { if (_allowedTypes & CreditMemo) typelist << "'C'"; if (_allowedTypes & DebitMemo) typelist << "'D'"; if (_allowedTypes & Invoice) typelist << "'I'"; if (_allowedTypes & CashDeposit) typelist << "'R'"; _typeClause = "(aropen_doctype IN (" + typelist.join(", ") + "))" ; } switch (ptypes) { case CreditMemo: setTitles(tr("Credit Memo"), tr("Credit Memos")); break; case DebitMemo: setTitles(tr("Debit Memo"), tr("Debit Memos")); break; case Invoice: setTitles(tr("Invoice"), tr("Invoices")); break; case CashDeposit: setTitles(tr("Cash Deposit"), tr("Cash Deposits")); break; default: setTitles(tr("A/R Open Item"),tr("A/R Open Items"));break; } (void)buildExtraClause(); }
void OrderLineEdit::setExtraClause(const QString &pType, const QString &pClause) { if (pType == "" || pType.compare("All", Qt::CaseInsensitive) == 0 || pType.compare("Any", Qt::CaseInsensitive) == 0) { _poClause = _raClause = _soClause = _toClause = ""; _allClause = pClause; } else if (pType == "PO") _poClause = " (((orderhead_type='PO') AND (" + pClause + ")) OR (orderhead_type != 'PO'))"; else if (pType == "RA") _raClause = " (((orderhead_type='RA') AND (" + pClause + ")) OR (orderhead_type != 'RA'))"; else if (pType == "SO") _soClause = " (((orderhead_type='SO') AND (" + pClause + ")) OR (orderhead_type != 'SO'))"; else if (pType == "TO") _toClause = " (((orderhead_type='TO') AND (" + pClause + ")) OR (orderhead_type != 'TO'))"; else { QMessageBox::critical(this, tr("Invalid Order Type"), tr("%1 is not a valid Order Type.").arg(pType)); _allClause = _poClause = _raClause = _soClause = _toClause = ""; } VirtualClusterLineEdit::setExtraClause(buildExtraClause()); }
void WoLineEdit::setWarehouse(int pWarehouseid) { if (_warehouseid == pWarehouseid) return; _warehouseid = pWarehouseid; buildExtraClause(); }
void WoLineEdit::setType(int pWoType) { if (_woType == pWoType) return; _woType = pWoType; buildExtraClause(); }
void OrderLineEdit::setExtraClause(const OrderTypes pTypes, const QString &pClause) { if (pTypes == AnyType || ((pTypes & Purchase) && ((pTypes & Return) || ! _x_metrics->boolean("EnableReturnAuth")) && (pTypes & Sales) && ((pTypes & Transfer) || ! _x_metrics->boolean("MultiWhs")))) _allClause = pClause; else { // not else if because multiple flags can be set if (pTypes | Purchase) setExtraClause("PO", pClause); if (pTypes | Return) setExtraClause("RA", pClause); if (pTypes | Sales) setExtraClause("SO", pClause); if (pTypes | Transfer) setExtraClause("TO", pClause); } VirtualClusterLineEdit::setExtraClause(buildExtraClause()); }
void OrderLineEdit::setAllowedStatuses(const OrderLineEdit::OrderStatuses p) { if (p && (p != Unposted + Open + Closed)) { QStringList statusList; if (p & Unposted) statusList << "'U'"; if (p & Open) statusList << "'O'"; if (p & Closed) statusList << "'C'"; _statusClause = "(orderhead_status IN (" + statusList.join(", ") + "))"; } else _statusClause = ""; VirtualClusterLineEdit::setExtraClause(buildExtraClause()); _allowedStatuses = p; }
void OrderLineEdit::setAllowedTypes(const OrderTypes p) { if ((p & Purchase) && ((p & Return) || ! _x_metrics->boolean("EnableReturnAuth")) && (p & Sales) && ((p & Transfer) || ! _x_metrics->boolean("MultiWhs"))) { _typeClause = ""; _allowedTypes = AnyType; } else if (p) { QStringList typeList; if (p & Purchase) typeList << "'PO'"; if (p & Sales) typeList << "'SO'"; if (p & Transfer && _x_metrics->boolean("MultiWhs")) typeList << "'TO'"; if (p & Return) typeList << "'RA'"; _typeClause = "(orderhead_type IN (" + typeList.join(", ") + "))" ; _allowedTypes = p; } else { _typeClause = ""; _allowedTypes = AnyType; } VirtualClusterLineEdit::setExtraClause(buildExtraClause()); }
void ApopenLineEdit::setAllowedDocTypes(DocTypes ptypes) { QStringList typelist; _allowedTypes = ptypes; if (ptypes == AnyType) _typeClause = ""; else { if (_allowedTypes & CreditMemo) typelist << "'C'"; if (_allowedTypes & DebitMemo) typelist << "'D'"; if (_allowedTypes & Voucher) typelist << "'V'"; _typeClause = "(apopen_doctype IN (" + typelist.join(", ") + "))" ; } switch (ptypes) { case CreditMemo: setTitles(tr("Credit Memo"), tr("Credit Memos")); break; case DebitMemo: setTitles(tr("Debit Memo"), tr("Debit Memos")); break; case Voucher: setTitles(tr("Voucher"), tr("Voucher")); break; default: setTitles(tr("A/P Open Item"),tr("A/P Open Items")); break; } (void)buildExtraClause(); }
void AropenLineEdit::setCustId(int pCust) { _custId = pCust; _custClause = QString("aropen_cust_id=%1").arg(_custId); (void)buildExtraClause(); }
void ProjectLineEdit::setAllowedStatuses(const ProjectStatuses p) { _allowedStatuses = p; buildExtraClause(); }
void ProjectLineEdit::setType(ProjectType ptype) { _type = ptype; buildExtraClause(); }
void ProjectLineEdit::setExtraClause(const QString& pExt) { _prjExtraClause = pExt; buildExtraClause(); }
void CrmClusterLineEdit::setViewOwnPriv(const QString& priv) { _viewOwnPriv = priv; buildExtraClause(); sUpdateMenu(); }
void ApopenLineEdit::setVendId(int pVend) { _vendId = pVend; _vendClause = QString("apopen_vend_id=%1").arg(_vendId); (void)buildExtraClause(); }