Exemplo n.º 1
0
purchaseOrderItem::purchaseOrderItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

#ifndef Q_WS_MAC
  _vendorItemNumberList->setMaximumWidth(25);
#endif

  connect(_ordered, SIGNAL(lostFocus()), this, SLOT(sDeterminePrice()));
  connect(_inventoryItem, SIGNAL(toggled(bool)), this, SLOT(sInventoryItemToggled(bool)));
  connect(_item, SIGNAL(privateIdChanged(int)), this, SLOT(sFindWarehouseItemsites(int)));
  connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo(int)));
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_ordered, SIGNAL(lostFocus()), this, SLOT(sUpdateVendorQty()));
  connect(_vendorItemNumberList, SIGNAL(clicked()), this, SLOT(sVendorItemNumberList()));
  connect(_notesButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons()));

  _parentwo = -1;
  _parentso = -1;
  _itemsrcid = -1;

  _overriddenUnitPrice = false;

  _ordered->setValidator(omfgThis->qtyVal());

  _project->setType(ProjectLineEdit::PurchaseOrder);
  if(!_metrics->boolean("UseProjects"))
    _project->hide();

  _itemchar = new QStandardItemModel(0, 2, this);
  _itemchar->setHeaderData( 0, Qt::Horizontal, tr("Name"), Qt::DisplayRole);
  _itemchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole);

  _itemcharView->setModel(_itemchar);
  ItemCharacteristicDelegate * delegate = new ItemCharacteristicDelegate(this);
  _itemcharView->setItemDelegate(delegate);

  _minOrderQty->setValidator(omfgThis->qtyVal());
  _orderQtyMult->setValidator(omfgThis->qtyVal());
  _received->setValidator(omfgThis->qtyVal());
  _invVendorUOMRatio->setValidator(omfgThis->ratioVal());

  q.exec("SELECT DISTINCT 1,itemsrc_manuf_name FROM itemsrc;");
  _manufName->populate(q);
  _manufName->setCurrentText("");

  //If not multi-warehouse hide whs control
  if (!_metrics->boolean("MultiWhs"))
  {
    _warehouseLit->hide();
    _warehouse->hide();
  }
  //If not Revision Control, hide controls
  if (!_metrics->boolean("RevControl"))
   _tab->removePage(_tab->page(4));
   
  adjustSize();
}
Exemplo n.º 2
0
purchaseOrderItem::purchaseOrderItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
  setupUi(this);

#ifndef Q_WS_MAC
  _vendorItemNumberList->setMaximumWidth(25);
#endif

  connect(_ordered, SIGNAL(lostFocus()), this, SLOT(sDeterminePrice()));
  connect(_inventoryItem, SIGNAL(toggled(bool)), this, SLOT(sInventoryItemToggled(bool)));
  connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemSourceInfo(int)));
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_ordered, SIGNAL(lostFocus()), this, SLOT(sUpdateVendorQty()));
  connect(_vendorItemNumberList, SIGNAL(clicked()), this, SLOT(sVendorItemNumberList()));

  _parentwo = -1;
  _parentso = -1;

  _overriddenUnitPrice = false;

  _ordered->setValidator(omfgThis->qtyVal());

  _project->setType(ProjectLineEdit::PurchaseOrder);
  if(!_metrics->boolean("UseProjects"))
    _project->hide();

  _itemchar = new QStandardItemModel(0, 2, this);
  _itemchar->setHeaderData( 0, Qt::Horizontal, tr("Name"), Qt::DisplayRole);
  _itemchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole);

  _itemcharView->setModel(_itemchar);
  ItemCharacteristicDelegate * delegate = new ItemCharacteristicDelegate(this);
  _itemcharView->setItemDelegate(delegate);

  //If not multi-warehouse hide whs control
  if (!_metrics->boolean("MultiWhs"))
  {
    _warehouseLit->hide();
    _warehouse->hide();
  }
  //If not Revision Control, hide controls
  if (!_metrics->boolean("RevControl"))
   _tab->removePage(_tab->page(4));
   
  resize(minimumSize());
}