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(); }
CmLineEdit::CmLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "aropen", "aropen_id", "aropen_docnumber", "formatmoney(aropen_amount-aropen_paid- " //Subtract amount on existing checks "(SELECT COALESCE(SUM(checkhead_amount),0) " " FROM checkhead,checkitem " " WHERE ((checkhead_id=checkitem_checkhead_id) " " AND (NOT checkhead_posted) " " AND (NOT checkhead_void) " " AND (checkitem_aropen_id=aropen_id))) " ")" , 0, " AND (aropen_doctype='C') AND (aropen_open) " " AND aropen_amount - aropen_paid - " "(SELECT COALESCE(SUM(checkhead_amount),0) " " FROM checkhead,checkitem " " WHERE ((checkhead_id=checkitem_checkhead_id) " " AND (NOT checkhead_posted) " " AND (NOT checkhead_void) " " AND (checkitem_aropen_id=aropen_id))) > 0 " , pName) { setTitles(tr("Credit Memo"), tr("Credit Memos")); }
ItemLineEdit::ItemLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "item", "item_id", "item_number", "(item_descrip1 || ' ' || item_descrip2) ", 0, 0, pName) { setTitles(tr("Item"), tr("Items")); setUiName("item"); setEditPriv("MaintainItemMasters"); setViewPriv("ViewItemMasters"); setAcceptDrops(TRUE); _type = cUndefined; _defaultType = cUndefined; _useQuery = FALSE; _useValidationQuery = FALSE; _itemNumber = ""; _uom = ""; _itemType = ""; _id = -1; _configured = FALSE; _delegate = new ItemLineEditDelegate(this); connect(_aliasAct, SIGNAL(triggered()), this, SLOT(sAlias())); // Add alias if (_x_preferences) { if (!_x_preferences->boolean("ClusterButtons")) menu()->insertAction(menu()->actions().at(2),_aliasAct); } }
ImageClusterLineEdit::ImageClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "image", "image_id", "image_name", "image_descrip", 0, 0, pName) { setTitles(tr("Image"), tr("Images")); setUiName("image"); setEditPriv("MaintainImages"); setNewPriv("MaintainImages"); }
LotserialseqClusterLineEdit::LotserialseqClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "lsseq", "lsseq_id", "lsseq_number", 0, "lsseq_descrip", 0, pName) { setTitles(tr("Lot/Serial Sequence"), tr("Lot/Serial Sequences")); setUiName("lotSerialSequence"); setEditPriv("MaintainLotSerialSequences"); setViewPriv("ViewLotSerialSequences"); }
IncidentClusterLineEdit::IncidentClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "incdt", "incdt_id", "incdt_number::text", "incdt_assigned_username", "incdt_summary", 0, pName) { setTitles(tr("Incident"), tr("Incidents")); setUiName("incident"); setEditPriv("MaintainIncidents"); setNewPriv("AddIncidents"); setViewPriv("ViewIncidents"); }
OpportunityClusterLineEdit::OpportunityClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "ophead", "ophead_id", "ophead_name", "ophead_owner_username", "ophead_notes", 0, pName) { setTitles(tr("Opportunity"), tr("Opportunities")); setUiName("opportunity"); setEditPriv("MaintainOpportunities"); setNewPriv("MaintainOpportunities"); setViewPriv("ViewOpportunities"); }
EmpClusterLineEdit::EmpClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "emp", "emp_id", "emp_code", "emp_number", 0, 0, pName, "emp_active") { setTitles(tr("Employee"), tr("Employees")); setUiName("employee"); setEditPriv("MaintainEmployees"); setNewPriv("MaintainEmployees"); setViewPriv("ViewEmployees"); }
ExpenseLineEdit::ExpenseLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "expcat", "expcat_id", "expcat_code", "", "expcat_descrip", 0, pName, "expcat_active") { setTitles(tr("Expense Category"), tr("Expense Categories")); setUiName("expenseCategory"); setEditPriv("MaintainExpenseCategories"); setNewPriv("MaintainExpenseCategories"); setViewPriv("ViewExpenseCategories"); }
ShipmentClusterLineEdit::ShipmentClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "shiphead", "shiphead_id", "shiphead_number", "formatdate(shiphead_shipdate)", "shiphead_tracknum", 0, pName) { _type = All; setStrict(false); setType(SalesOrder); setTitles(tr("Shipment"), tr("Shipments")); }
void WoLineEdit::init() { setTitles(tr("Work Order"), tr("Work Orders")); setUiName("workOrder"); setEditPriv("MaintainWorkOrders"); setViewPriv("ViewWorkOrders"); setNewPriv("MaintainWorkOrders"); _warehouseid = -1; _qtyOrdered = 0.0; _qtyReceived = 0.0; _query = QString("SELECT wo_id AS id, " " wo_number::text || '-' || wo_subnumber::text AS number," " item_number AS name, " " (item_descrip1 || ' ' || item_descrip2) AS description, " " warehous_id," " warehous_code, item_id, item_number, uom_name," " item_descrip1, " " item_descrip2," " abs(wo_qtyord) AS wo_qtyord," " abs(wo_qtyrcv) AS wo_qtyrcv, " " CASE WHEN (wo_status = 'O') THEN '%3' " " WHEN (wo_status = 'E') THEN '%4' " " WHEN (wo_status = 'I') THEN '%5' " " WHEN (wo_status = 'R') THEN '%6' " " WHEN (wo_status = 'C') THEN '%7' " " END AS wo_status," " wo_duedate," " wo_startdate," " noNeg(abs(wo_qtyord) - abs(wo_qtyrcv)) AS balance, " " CASE WHEN (wo_qtyord >= 0) THEN " " '%1' " " ELSE " " '%2' " " END AS wo_method, " " CASE WHEN (wo_qtyord >= 0) THEN " " 'A' " " ELSE " " 'D' " " END AS method " "FROM wo " " JOIN itemsite ON (wo_itemsite_id=itemsite_id) " " JOIN item ON (itemsite_item_id=item_id) " " JOIN whsinfo ON (itemsite_warehous_id=warehous_id) " " JOIN uom ON (item_inv_uom_id=uom_id) " "WHERE (true) " ) .arg(tr("Assembly")) .arg(tr("Disassembly")) .arg(tr("Open")) .arg(tr("Exploded")) .arg(tr("In Process")) .arg(tr("Released")) .arg(tr("Closed")); }
VendorLineEdit::VendorLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "vendinfo", "vend_id", "vend_number", "vend_name", 0, 0, pName, "vend_active") { setTitles(tr("Vendor"), tr("Vendors")); setUiName("vendor"); setEditPriv("MaintainVendors"); setViewPriv("ViewVendors"); setNewPriv("MaintainVendors"); }
ProjectLineEdit::ProjectLineEdit(enum ProjectType pPrjType, QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "prj", "prj_id", "prj_number", "prj_name", 0, 0, pName) { setTitles(tr("Project"), tr("Projects")); setUiName("project"); setEditPriv("MaintainProjects"); setViewPriv("ViewProjects"); _type = pPrjType; }
RaLineEdit::RaLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "rahead", "rahead_id", "rahead_number", "rahead_billtoname", 0, pName) { setTitles(tr("Return Authorization"), tr("Return Authorizations")); setValidator(new QIntValidator(0, 9999999, this)); connect(this, SIGNAL(textChanged(const QString &)), this, SIGNAL(numberChanged(const QString &))); }
ProjectLineEdit::ProjectLineEdit(enum ProjectType pPrjType, QWidget *pParent, const char *pName) : CrmClusterLineEdit(pParent, "prj()", "prj_id", "prj_number", "prj_name", 0, 0, pName) { setTitles(tr("Project"), tr("Projects")); setUiName("project"); setEditPriv("MaintainAllProjects"); setViewPriv("ViewAllProjects"); _type = pPrjType; _allowedStatuses = 0x00; }
OpportunityClusterLineEdit::OpportunityClusterLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "ophead", "ophead_id", "ophead_name", 0, "ophead_notes", "ophead_owner_username", "ophead_username", 0, pName) { _objtype = "OPP"; setTitles(tr("Opportunity"), tr("Opportunities")); setUiName("opportunity"); setEditPriv("MaintainAllOpportunities"); setNewPriv("MaintainAllOpportunities"); setViewPriv("ViewAllOpportunities"); setEditOwnPriv("MaintainPersonalOpportunities"); setViewOwnPriv("ViewPersonalOpportunities"); }
CLineEdit::CLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "cust", "id", "number", "name", "description", 0, pName, "active") { _crmacctId = -1; _type = AllCustomers; _subtype = CRMAcctLineEdit::Cust; _canEdit = false; _editMode = false; if (! pName) setObjectName("CLineEdit"); setTitles(tr("Customer"), tr("Customers")); setUiName("customer"); setEditPriv("MaintainCustomerMasters"); setViewPriv("ViewCustomerMasters"); setNewPriv("MaintainCustomerMasters"); _query = " SELECT * FROM ( " " SELECT cust_id AS id, " " cust_number AS number, " " cust_name AS name," " addr_line1 AS description," " cust_active AS active, " " cust_creditstatus, " " crmacct_id, true AS iscustomer, " " addr.*, cntct.*, " " formatAddr(addr_line1, addr_line2, addr_line3, '', '') AS street " " FROM custinfo " " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) " " LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) " " LEFT OUTER JOIN crmacct ON (crmacct_cust_id=cust_id) " " UNION " " SELECT prospect_id AS id, " " prospect_number AS number," " prospect_name AS name," " addr_line1 AS description," " prospect_active AS active, " " 'G' AS cust_creditstatus, " " crmacct_id, false AS iscustomer, " " addr.*, cntct.*, " " formatAddr(addr_line1, addr_line2, addr_line3, '', '') AS street " " FROM prospect " " LEFT OUTER JOIN cntct ON (prospect_cntct_id=cntct_id) " " LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) " " LEFT OUTER JOIN crmacct ON (crmacct_prospect_id=prospect_id) " " ) cust " "WHERE (true) "; _modeAct = new QAction(tr("Edit Number"), this); _modeAct->setToolTip(tr("Sets number for editing")); _modeAct->setCheckable(true); connect(_modeAct, SIGNAL(triggered(bool)), this, SLOT(setEditMode(bool))); }
IncidentClusterLineEdit::IncidentClusterLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "incdt", "incdt_id", "incdt_number::text", "incdt_summary", 0, "incdt_owner_username", "incdt_assigned_username", 0, pName) { _objtype = "INCDT"; setTitles(tr("Incident"), tr("Incidents")); setUiName("incident"); setEditPriv("MaintainAllIncidents"); setNewPriv("MaintainAllIncidents"); setViewPriv("ViewAllIncidents"); setEditOwnPriv("MaintainPersonalIncidents"); setViewOwnPriv("ViewPersonalIncidents"); }
UsernameLineEdit::UsernameLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "usr", "usr_id", "usr_username", "usr_propername", 0, 0, pName) { setTitles(tr("User Name"), tr("User Names")); setType(UsersAll); if (_x_preferences) { if (!_x_preferences->boolean("ClusterButtons")) { menu()->removeAction(_infoAct); menu()->removeAction(menu()->actions().at(2)); } } }
OrderLineEdit::OrderLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "orderhead", "orderhead_id", "orderhead_number", "orderhead_type", "orderhead_status", pName) { setTitles(tr("Order"), tr("Orders")); connect(this, SIGNAL(newId(int)), this, SLOT(sNewId(int))); _query = "SELECT orderhead_id AS id, orderhead_number AS number," " orderhead_type AS name, orderhead_status AS description," " orderhead_from, orderhead_to " "FROM orderhead WHERE (TRUE) "; }
CRMAcctLineEdit::CRMAcctLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "crmacct", "crmacct_id", "crmacct_number", "crmacct_name", 0, "crmacct_owner_username", 0, 0, pName, "crmacct_active") { _objtype = "CRMA"; setTitles(tr("Account"), tr("Accounts")); setUiName("crmaccount"); setEditPriv("MaintainAllCRMAccounts"); setViewPriv("ViewAllCRMAccounts"); setNewPriv("MaintainAllCRMAccounts"); setEditOwnPriv("MaintainPersonalCRMAccounts"); setViewOwnPriv("ViewPersonalCRMAccounts"); setSubtype(Crmacct); }
LotserialLineEdit::LotserialLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "lsdetail", "lsdetail_id", "lsdetail_lotserial", "item_number", "lsdetail_created", 0, pName) { setTitles(tr("Lot/Serial Number"), tr("Lot/Serial Numbers")); _query = QString("SELECT lsdetail_id AS id, " " lsdetail_lotserial AS number, " " item_number AS name, " " lsdetail_created AS description " "FROM lsdetail, itemsite, item " "WHERE (lsdetail_itemsite_id=itemsite_id) " " AND (itemsite_item_id = item_id)"); _idClause = QString("AND (lsdetail_id=:id)"); _numClause = QString("AND (UPPER(lsdetail_lotserial)=UPPER(:number))"); _strict = true; }
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(); }
ProjectLineEdit::ProjectLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "prj", "prj_id", "prj_number", "prj_name", 0, "prj_owner_username", "prj_username", 0, pName) { _objtype = "J"; setTitles(tr("Project"), tr("Projects")); setUiName("project"); setEditPriv("MaintainAllProjects"); setNewPriv("MaintainAllProjects"); setViewPriv("ViewAllProjects"); setEditOwnPriv("MaintainPersonalProjects"); setViewOwnPriv("ViewPersonalProjects"); _type = Undefined; }
CRMAcctLineEdit::CRMAcctLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "crmacct", "crmacct_id", "crmacct_number", "crmacct_name", 0, 0, pName) { setTitles(tr("CRM Account"), tr("CRM Accounts")); setSubtype(Crmacct); _query = "SELECT crmacct_id AS id, crmacct_number AS number, crmacct_name AS name," " addr.*," " formatAddr(addr_line1, addr_line2, addr_line3, '', '') AS street," " cntct.* " " FROM crmacct LEFT OUTER JOIN" " cntct ON (crmacct_cntct_id_1=cntct_id) LEFT OUTER JOIN" " addr ON (cntct_addr_id=addr_id)" " WHERE (true ) "; }
LotserialLineEdit::LotserialLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "ls", "ls_id", "ls_number", "item_number", "item_id", 0, pName) { _itemid = -1; setTitles(tr("Lot/Serial Number"), tr("Lot/Serial Numbers")); _query = QString("SELECT ls_id AS id, " " ls_number AS number, " " item_id," " item_number AS name, " " ls_notes AS description " "FROM ls " " JOIN item ON (ls_item_id=item_id) " "WHERE (true) "); _strict = true; }
void MediaObject::loadingFinished(MediaGraph *mg) { if (mg == currentGraph()) { #ifndef QT_NO_PHONON_MEDIACONTROLLER //Title interface m_currentTitle = 0; setTitles(currentGraph()->titles()); #endif //QT_NO_PHONON_MEDIACONTROLLER HRESULT hr = mg->renderResult(); if (catchComError(hr)) { return; } if (m_oldHasVideo != currentGraph()->hasVideo()) { emit hasVideoChanged(currentGraph()->hasVideo()); } #ifndef QT_NO_PHONON_VIDEO if (currentGraph()->hasVideo()) { updateVideoGeometry(); } #endif //QT_NO_PHONON_VIDEO emit metaDataChanged(currentGraph()->metadata()); emit totalTimeChanged(totalTime()); //let's put the next state switch(m_nextState) { case Phonon::PausedState: pause(); break; case Phonon::PlayingState: play(); break; case Phonon::ErrorState: setState(Phonon::ErrorState); break; case Phonon::StoppedState: default: stop(); break; } } }
ContactClusterLineEdit::ContactClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "cntct", "cntct_id", "cntct_name", 0, "cntct_title", 0, pName, "cntct_active") { _searchAcctId = -1; setTitles(tr("Contact"), tr("Contacts")); setUiName("contact"); setEditPriv("MaintainContacts"); setViewPriv("ViewContacts"); _query = "SELECT cntct_id AS id, cntct_name AS number, cntct_title AS description, " " cntct_active AS active, " " cntct_first_name, cntct_last_name, crmacct_name, cntct_title, cntct_phone, " " cntct_phone2,cntct_fax, cntct_email, cntct_webaddr " "FROM cntct LEFT OUTER JOIN crmacct ON (cntct_crmacct_id = crmacct_id) " "WHERE (true) "; }
// ---------------------------------------------------------------------- void drawPidTables(const char *qual = "mvaTmMuon") { PidTable a; std::vector<string> charge; charge.push_back("Plus"); charge.push_back("Minus"); std::vector<string> sample; sample.push_back("pion"); sample.push_back("kaon"); sample.push_back("proton"); std::vector<string> ssample; ssample.push_back("#pi"); ssample.push_back("K"); ssample.push_back("p"); string name; double xbins[] = {0., 1.4, 2.4}; double ybins[] = {0., 4., 5., 7., 10., 15., 20., 50.}; TH2D *h2 = new TH2D("h2", "", 2, xbins, 7, ybins); h2->SetMinimum(0.0); h2->SetMaximum(0.001); gStyle->SetOptStat(0); for (int is = 0; is < sample.size(); ++is) { for (int iq = 0; iq < charge.size(); ++iq) { shrinkPad(0.15, 0.15, 0.2); a.clear(); name = Form("%s%sFakeRate-%s.dat", sample[is].c_str(), charge[iq].c_str(), qual); h2->Reset(); setTitles(h2, Form("|#eta(%s^{%s} )|", ssample[is].c_str(), (iq==0?"+":"-")), Form("p_{T}(%s^{%s} )", ssample[is].c_str(), (iq==0?"+":"-"))); a.readFromFile(name.c_str()); a.eff2d(h2); h2->Draw("colztext"); c0->SaveAs(Form("%s%sFakeRate-%s.pdf", sample[is].c_str(), charge[iq].c_str(), qual)); } } }
QuoteLineEdit::QuoteLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "quhead", "quhead_id", "quhead_number", "name", "quhead_billtoname", 0, pName) { setTitles(tr("Quote"), tr("Quotes")); _query = QString("SELECT quhead_id AS id, quhead_number AS number," " COALESCE(cust_number, prospect_number, '?') AS name," " quhead_billtoname AS description," " quhead_cust_id AS recip_id," " CASE WHEN cust_number IS NOT NULL THEN 'C'" " WHEN prospect_number IS NOT NULL THEN 'P'" " END AS recip_type " "FROM quhead" " LEFT OUTER JOIN custinfo ON (quhead_cust_id=cust_id)" " LEFT OUTER JOIN prospect ON (quhead_cust_id=prospect_id) " "WHERE true "); _recip_id = 0; _recip_type = QString::null; }