Пример #1
0
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);
  }
}
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");
}
Пример #3
0
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");
}
Пример #4
0
void CLineEdit::setId(int pId)
{
  VirtualClusterLineEdit::setId(pId);
  if (model() && _id != -1)
  {
    if (model()->data(model()->index(0,ISCUSTOMER)).toBool())
    {
      setUiName("customer");
      setEditPriv("MaintainCustomerMasters");
      setViewPriv("ViewCustomerMasters");
      setNewPriv("MaintainCustomerMasters");
      _idColName="cust_id";
    }
    else
    {
      setUiName("prospect");
      setEditPriv("MaintainProspectMasters");
      setViewPriv("ViewProspectMasters");
      setNewPriv("MaintainProspectMasters");
      _idColName="prospect_id";
    }
    sUpdateMenu();

    _crmacctId = model()->data(model()->index(0,CRMACCT_ID)).toInt();

    emit newCrmacctId(_crmacctId);

    // Handle Credit Status
    QString status = model()->data(model()->index(0,CREDITSTATUS)).toString();

    if (!editMode() && status != "G")
    {
      if (status == "W")
        _menuLabel->setPixmap(QPixmap(":/widgets/images/credit_warn.png"));
      else
        _menuLabel->setPixmap(QPixmap(":/widgets/images/credit_hold.png"));

      return;
    }
  }

  if (_editMode)
    _menuLabel->setPixmap(QPixmap(":/widgets/images/edit.png"));
  else
    _menuLabel->setPixmap(QPixmap(":/widgets/images/magnifier.png"));
}
Пример #5
0
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");
}
Пример #6
0
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");
}
Пример #7
0
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");
}
Пример #8
0
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");
}
Пример #9
0
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"));
}
Пример #10
0
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");
}
Пример #11
0
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;
}
Пример #12
0
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;
}
Пример #13
0
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)));
}
Пример #14
0
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");
}
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");
}
Пример #16
0
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"));
  setUiName("returnAuthorization");
  setEditPriv("MaintainReturns");
  setViewPriv("ViewReturns");

  setValidator(new QIntValidator(0, 9999999, this));
  connect(this, SIGNAL(textChanged(const QString &)), this, SIGNAL(numberChanged(const QString &)));
}
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);
}
Пример #18
0
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;
}
Пример #19
0
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) ";
}
Пример #20
0
ShiptoEdit::ShiptoEdit(QWidget *pParent, const char *pName) :
   VirtualClusterLineEdit(pParent, "shiptoinfo", "shipto_id", "shipto_num", "shipto_name", "addr_line1", " (false) ", pName, "shipto_active")
{
  setTitles(tr("Ship To Address"), tr("Ship To Addresses"));
  setUiName("shipTo");
  setEditPriv("MaintainShiptos");
  setViewPriv("ViewShiptos");
  setNewPriv("MaintainShiptos");

  _custid = 0;
  setCustid(-1);

  _query = "SELECT shipto_id AS id, shipto_num AS number, shipto_name AS name, "
           "  addr_line1 AS description, "
           "  (addr_city || ', ' || addr_state || '  ' || addr_postalcode) AS csv,"
           "  shipto_active AS active "
           "FROM shiptoinfo "
           "  LEFT OUTER JOIN addr ON (shipto_addr_id=addr_id) "
           "WHERE (true) ";
}
Пример #21
0
PlanOrdLineEdit::PlanOrdLineEdit(QWidget* pParent, const char* pName) :
    VirtualClusterLineEdit(pParent, "planord", "planord_id", "formatPloNumber(planord_id)", "item_number", "(item_descrip1 ' ' item_descrip2)", 0, pName)
{
  setTitles(tr("Planned Order"), tr("Planned Orders"));
  setUiName("plannedOrder");
  setEditPriv("CreatePlannedOrders");
  setViewPriv("ViewPlannedOrders");
  setNewPriv("CreatePlannedOrders");

  _query = "SELECT planord_id AS id,"
           "       formatPloNumber(planord_id) AS number, "
           "       item_number AS name, "
           "       (item_descrip1 || ' ' || item_descrip2) AS description, "
           "       NULL AS active, "
           "       warehous_code, item_number, uom_name,"
           "       item_descrip1, item_descrip2 "
           "FROM planord "
           "  JOIN itemsite ON (planord_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) ";
}
Пример #22
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridInfo::setName(const QString& name)
{
    m_gridName = name;
    setUiName(name);
}