void address::sEdit() { internalSave(); switch (_uses->altId()) { case 1: sEditContact(); break; case 2: sEditShipto(); break; case 3: sEditVendor(); break; case 4: sEditVendorAddress(); break; case 5: sEditWarehouse(); break; default: break; } // force AddressCluster to reload its data int tmpAddrId = _addr->id(); _addr->setId(-1); _addr->setId(tmpAddrId); sPopulate(); }
void address::sPopulateMenu(QMenu *pMenu) { int menuItem; QString editStr = tr("Edit..."); QString viewStr = tr("View..."); switch (_uses->altId()) { case 1: if (_privileges->check("MaintainContacts") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->insertItem(editStr, this, SLOT(sEditContact())); else if (_privileges->check("ViewContacts")) menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewContact())); break; case 2: // ship-to if (_privileges->check("MaintainShiptos") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->insertItem(editStr, this, SLOT(sEditShipto())); else if (_privileges->check("ViewShiptos")) menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewShipto())); break; case 3: // vendor /* comment out until we make vendor a XDialog or address a XMainWindow if (_privileges->check("MaintainVendors") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendor())); else if (_privileges->check("ViewVendors")) menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendor())); */ break; case 4: // vendaddr if (_privileges->check("MaintainVendorAddresses") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendorAddress())); else if (_privileges->check("ViewVendorAddresses")) menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendorAddress())); break; case 5: // warehouse if (_privileges->check("MaintainWarehouses") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->insertItem(editStr, this, SLOT(sEditWarehouse())); else if (_privileges->check("ViewWarehouses")) menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewWarehouse())); break; default: break; } }
void contact::sEditUse() { switch (_uses->altId()) { case 1: case 2: sEditCRMAccount(); break; case 3: case 4: sEditCustomer(); break; case 5: case 6: sEditVendor(); break; case 7: sEditProspect(); break; case 8: sEditShipto(); break; case 9: sEditVendorAddress(); break; case 10: sEditWarehouse(); break; case 11: sEditEmployee(); break; default: break; } }
void contact::sPopulateUsesMenu(QMenu* pMenu) { int menuItem; QString editStr = tr("Edit..."); QString viewStr = tr("View..."); QString detachStr = tr("Detach"); switch (_uses->altId()) { case 1: case 2: menuItem = pMenu->insertItem(editStr, this, SLOT(sEditCRMAccount())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCRMAccounts")); menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewCRMAccount())); pMenu->setItemEnabled(menuItem, _privileges->check("ViewCRMAccounts")); menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCRMAccounts")); break; case 3: case 4: menuItem = pMenu->insertItem(editStr, this, SLOT(sEditCustomer())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCustomerMasters")); menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewCustomer())); pMenu->setItemEnabled(menuItem, _privileges->check("ViewCustomerMasters")); menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCustomerMasters")); break; case 5: case 6: menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendor())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendors")); menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendor())); pMenu->setItemEnabled(menuItem, _privileges->check("ViewVendors")); menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendors")); break; case 7: menuItem = pMenu->insertItem(editStr, this, SLOT(sEditProspect())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainProspects")); menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewProspect())); pMenu->setItemEnabled(menuItem, _privileges->check("ViewProspects")); menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainProspects")); break; case 8: menuItem = pMenu->insertItem(editStr, this, SLOT(sEditShipto())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainShiptos")); menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewShipto())); pMenu->setItemEnabled(menuItem, _privileges->check("ViewShiptos")); menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainShiptos")); break; case 9: menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendorAddress())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendorAddresses")); menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendorAddress())); pMenu->setItemEnabled(menuItem, _privileges->check("ViewVendorAddresses")); menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendorAddresses")); break; case 10: menuItem = pMenu->insertItem(editStr, this, SLOT(sEditWarehouse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainWarehouses")); menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewWarehouse())); pMenu->setItemEnabled(menuItem, _privileges->check("ViewWarehouses")); menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse())); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainWarehouses")); break; default: break; } }
/* * Constructs a customer as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ customer::customer(QWidget* parent, const char* name, Qt::WFlags fl) : QMainWindow(parent, name, fl) { setupUi(this); (void)statusBar(); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_number, SIGNAL(lostFocus()), this, SLOT(sCheck())); connect(_number, SIGNAL(textEdited(const QString&)), this, SLOT(sNumberEdited())); connect(_salesrep, SIGNAL(newID(int)), this, SLOT(sPopulateCommission())); connect(_newShipto, SIGNAL(clicked()), this, SLOT(sNewShipto())); connect(_editShipto, SIGNAL(clicked()), this, SLOT(sEditShipto())); connect(_viewShipto, SIGNAL(clicked()), this, SLOT(sViewShipto())); connect(_deleteShipto, SIGNAL(clicked()), this, SLOT(sDeleteShipto())); connect(_shipto, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateShiptoMenu(QMenu*))); connect(_printShipto, SIGNAL(clicked()), this, SLOT(sPrintShipto())); connect(_downCC, SIGNAL(clicked()), this, SLOT(sMoveDown())); connect(_upCC, SIGNAL(clicked()), this, SLOT(sMoveUp())); connect(_viewCC, SIGNAL(clicked()), this, SLOT(sViewCreditCard())); connect(_editCC, SIGNAL(clicked()), this, SLOT(sEditCreditCard())); connect(_newCC, SIGNAL(clicked()), this, SLOT(sNewCreditCard())); connect(_ediProfile, SIGNAL(activated(int)), this, SLOT(sProfileSelected())); connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic())); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic())); connect(_deleteTaxreg, SIGNAL(clicked()), this, SLOT(sDeleteTaxreg())); connect(_editTaxreg, SIGNAL(clicked()), this, SLOT(sEditTaxreg())); connect(_newTaxreg, SIGNAL(clicked()), this, SLOT(sNewTaxreg())); connect(_viewTaxreg, SIGNAL(clicked()), this, SLOT(sViewTaxreg())); connect(_soEdiProfile, SIGNAL(activated(int)), this, SLOT(sSoProfileSelected())); connect(_custtype, SIGNAL(currentIndexChanged(int)), this, SLOT(sFillCharacteristicList())); _custid = -1; _crmacctid = -1; _sellingWarehouse->setId(-1); _currency->setLabel(_currencyLit); _balanceMethod->insertItem(tr("Balance Forward")); _balanceMethod->insertItem(tr("Open Items")); _taxreg->addColumn(tr("Tax Authority"), 100, Qt::AlignLeft ); _taxreg->addColumn(tr("Registration #"), -1, Qt::AlignLeft ); _shipto->addColumn(tr("Default"), _itemColumn, Qt::AlignLeft ); _shipto->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft ); _shipto->addColumn(tr("Name"), 150, Qt::AlignLeft ); _shipto->addColumn(tr("Address"), 150, Qt::AlignLeft ); _shipto->addColumn(tr("City, State, Zip"), -1, Qt::AlignLeft ); _cc->addColumn(tr("Sequence"), _itemColumn, Qt::AlignLeft ); _cc->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft ); _cc->addColumn(tr("Number"), 150, Qt::AlignRight ); _cc->addColumn(tr("Active"), -1, Qt::AlignLeft ); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft ); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft ); _custchar = new QStandardItemModel(0, 2, this); _custchar->setHeaderData( 0, Qt::Horizontal, tr("Characteristc"), Qt::DisplayRole); _custchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole); _chartempl->setModel(_custchar); CustCharacteristicDelegate * delegate = new CustCharacteristicDelegate(this); _chartempl->setItemDelegate(delegate); key = omfgThis->_key; if(!_metrics->boolean("CCAccept") || key.length() == 0 || key.isNull() || key.isEmpty()) { _tab->removePage(_tab->page(10)); } if (_metrics->boolean("EnableBatchManager")) { _ediProfile->append(-1, tr("No EDI")); _ediProfile->append(0, tr("Custom Email")); _soEdiProfile->append(-1, tr("No EDI")); _soEdiProfile->append(0, tr("Custom Email")); q.prepare("SELECT ediprofile_id, ediprofile_name" " FROM ediprofile, ediform" " WHERE ((ediform_ediprofile_id=ediprofile_id)" " AND (ediform_type='invoice')) " "ORDER BY ediprofile_name; "); q.exec(); while(q.next()) { _ediProfile->append(q.value("ediprofile_id").toInt(), q.value("ediprofile_name").toString()); _soEdiProfile->append(q.value("ediprofile_id").toInt(), q.value("ediprofile_name").toString()); } } else { _tab->removePage(_tab->page(9)); _tab->removePage(_tab->page(8)); } //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _sellingWarehouseLit->hide(); _sellingWarehouse->hide(); } }