Пример #1
0
void userPreferences::sEdit()
{
  ParameterList params;
  params.append("mode", "edit");
  params.append("hotkey", _hotkey->currentItem()->text(2));

  if (_currentUser->isChecked())
    params.append("currentUser");
  else
    params.append("username", _user->currentText());

  hotkey newdlg(this, "", TRUE);
  newdlg.set(params);
  
  if (newdlg.exec() != XDialog::Rejected)
  {
    _dirty = TRUE;
    sFillList();
  }
}
Пример #2
0
void financialLayout::sAddAccount()
{
  ParameterList params;
  params.append("mode", "new");
  params.append("flhead_id", _flheadid);
  params.append("flgrp_id", _layout->id());
  if (_income->isChecked())
    params.append("type", "income");
  else if (_balance->isChecked())
    params.append("type", "balance");
  else if (_cash->isChecked())
    params.append("type", "cash");
  else if (_adHoc->isChecked())
      params.append("type", "adHoc");
  
  financialLayoutItem newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != XDialog::Rejected)
    sFillList();
}
Пример #3
0
void projects::sCopy()
{
  if (DEBUG)
    qDebug("Project sCopy() Project ID: %d)", list()->id());  

  if (list()->id() == -1)
  {
    QMessageBox::information(this, tr("Project Copy"), tr("Please select a project to copy first"));
    return;
  }
  
  ParameterList params;
  params.append("prj_id", list()->id());
  
  projectCopy newdlg(parentWidget(), "", TRUE);
  newdlg.set(params);
  newdlg.exec();

  sFillList();
}
Пример #4
0
void arWorkBench::sViewAropen()
{
  ParameterList params;
  XTreeWidgetItem * item = static_cast<XTreeWidgetItem*>(_aropen->currentItem());
  if(_aropen->altId() == 1 && item)
  {
    params.append("invoiceNumber", item->text(1));
    dspInvoiceInformation * newdlg = new dspInvoiceInformation();
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else
  {
    params.append("mode", "view");
    params.append("aropen_id", _aropen->id());
    arOpenItem newdlg(this, "", TRUE);
    newdlg.set(params);
    newdlg.exec();
  }
}
Пример #5
0
void project::sNewTask()
{
  if (!_saved)
    sSave();
    
  ParameterList params;
  params.append("mode", "new");
  params.append("prj_id", _prjid);
  params.append("prj_owner_username", _owner->username());
  params.append("prj_username",   _assignedTo->username());
  params.append("prj_start_date",	_started->date());
  params.append("prj_due_date",	_due->date());
  params.append("prj_assigned_date",	_assigned->date());
  params.append("prj_completed_date",	_completed->date());

  task newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != XDialog::Rejected)
    sFillTaskList();
}
Пример #6
0
void invoiceItem::sListPrices()
{
  ParameterList params;
  params.append("cust_id",   _custid);
  //params.append("shipto_id", _shiptoid);
  params.append("item_id",   _item->id());
  params.append("warehous_id", _warehouse->id());
  params.append("qty",       _billed->toDouble() * _qtyinvuomratio);
  params.append("curr_id",   _price->id());
  params.append("effective", _price->effective());

  priceList newdlg(this);
  newdlg.set(params);
  if ( (newdlg.exec() == XDialog::Accepted) &&
       (_privileges->check("OverridePrice")) &&
       (!_metrics->boolean("DisableSalesOrderPriceOverride")) )
  {
    _price->setLocalValue(newdlg._selectedPrice * (_priceinvuomratio / _priceRatioCache));
  }
}
Пример #7
0
void todoList::sView()
{
  if (_todoList->altId() ==2)
    sViewIncident();
  else if (_todoList->altId() == 3)
    sViewTask();
  else if (_todoList->altId() == 4)
    sViewProject();
  else
  {
    ParameterList params;
    params.append("mode", "view");
    params.append("todoitem_id", _todoList->id());

    todoItem newdlg(this, "", TRUE);
    newdlg.set(params);

    newdlg.exec();
  }
}
Пример #8
0
void dspTimePhasedBookingsByProductCategory::sPrint()
{
  ParameterList params;
  params.append("print");
  _periods->getSelected(params);
  _warehouse->appendValue(params);
  _productCategory->appendValue(params);

  if (_salesDollars->isChecked())
    params.append("salesDollars");
  else if (_inventoryUnits->isChecked())
    params.append("inventoryUnits");
  else if (_capacityUnits->isChecked())
    params.append("capacityUnits");
  else
    params.append("altCapacityUnits");

  rptTimePhasedBookingsByProductCategory newdlg(this, "", TRUE);
  newdlg.set(params);
}
Пример #9
0
void login2::sOptions()
{
  ParameterList params;
  params.append("databaseURL", _databaseURL);

  if (_multipleConnections)
    params.append("dontSaveSettings");

  login2Options newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != QDialog::Rejected)
  {
    updateRecentOptions();
    _databaseURL = newdlg._databaseURL;
    populateDatabaseInfo();
    updateRecentOptions();
    updateRecentOptionsActions();
    _username->setFocus();
  }
}
Пример #10
0
void taxBreakdown::sLineTaxDetail()
{
  taxDetail newdlg(this, "", true);
  ParameterList params;

  params.append("order_type", _ordertype);
  params.append("order_id", _orderid);
  params.append("display_type", "L");
  params.append("curr_id", _taxcurrency->id());
  params.append("date",    _line->effective());
  params.append("subtotal",CurrDisplay::convert(_line->id(),
						_taxcurrency->id(),
						_line->localValue(),
						_line->effective()));
  params.append("readOnly");
  params.append("sense", _sense);

  if (newdlg.set(params) == NoError)
    newdlg.exec();
}
Пример #11
0
void customerGroup::sNew()
{
  ParameterList params;

  CRMAcctList newdlg(this, "", TRUE);
  newdlg.setSubtype(CRMAcctLineEdit::Cust);

  int custid;
  if ((custid = newdlg.exec()) != XDialog::Rejected)
  {
    q.prepare( "SELECT custgrpitem_id "
               "FROM custgrpitem "
               "WHERE ( (custgrpitem_custgrp_id=:custgrpitem_custgrp_id)"
               " AND (custgrpitem_cust_id=:custgrpitem_cust_id) );" );
    q.bindValue(":custgrpitem_custgrp_id", _custgrpid);
    q.bindValue(":custgrpitem_cust_id", custid);
    q.exec();
    if (q.first())
      return;
    else if (q.lastError().type() != QSqlError::None)
    {
      systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
      return;
    }

    q.prepare( "INSERT INTO custgrpitem "
               "(custgrpitem_custgrp_id, custgrpitem_cust_id) "
               "VALUES "
               "(:custgrpitem_custgrp_id, :custgrpitem_cust_id);" );
    q.bindValue(":custgrpitem_custgrp_id", _custgrpid);
    q.bindValue(":custgrpitem_cust_id", custid);
    q.exec();
    if (q.lastError().type() != QSqlError::None)
    {
      systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
      return;
    }

    sFillList();
  }
}
Пример #12
0
void taxBreakdown::sFreightTaxDetail()
{
  taxDetail newdlg(this, "", true);
  ParameterList params;

   params.append("curr_id", _taxcurrency->id());
   params.append("date",    _freight->effective());
   params.append("subtotal",CurrDisplay::convert(_freight->id(),
						_taxcurrency->id(),
						_freight->localValue(),
						_freight->effective()));
   params.append("sense", _sense);

  if (_ordertype == "S" || _ordertype == "Q" || _ordertype == "RA")
  {
   params.append("taxzone_id",  _taxzone->id());

   q.exec("SELECT getfreighttaxtypeid() as taxtype;");
	 if(q.first())
		params.append("taxtype_id", q.value("taxtype").toInt());  
  
   params.append("date",    _freight->effective());
  
   params.append("readOnly");
   if (newdlg.set(params) == NoError) 
	   newdlg.exec();
     
 }
 else if (_ordertype == "I" || _ordertype == "B" || _ordertype == "CM" || _ordertype == "TO")
 {
   q.exec("SELECT getfreighttaxtypeid() as taxtype;");
	 if(q.first())
	   params.append("taxtype_id", q.value("taxtype").toInt());  
   params.append("order_type", _ordertype);
   params.append("order_id", _orderid);
   params.append("display_type", "F");
   params.append("readOnly");
   if (newdlg.set(params) == NoError) 
	   newdlg.exec();  
 }
}
Пример #13
0
void WoCluster::sWoList()
{
  ParameterList params;
  params.append("wo_id", _woNumber->_id);
  params.append("woType", _woNumber->_woType);

  if (_woNumber->_warehouseid != -1)
    params.append("warehous_id", _woNumber->_warehouseid);

  woList newdlg(parentWidget(), "", TRUE);
  newdlg.set(params);
  
  int id = newdlg.exec();
  setId(id);

  if (id != -1)
  {
    _woNumber->setFocus();
    focusNextPrevChild(TRUE);
  }
}
Пример #14
0
void billingEditList::sEditBillingQty()

{ 

  ParameterList params;

  params.append("soitem_id", _cobill->altId());



  selectBillingQty newdlg(this, "", TRUE);

  newdlg.set(params);



  if (newdlg.exec() != QDialog::Rejected)

    sFillList();

}
Пример #15
0
void itemPricingScheduleItem::sEdit()
{
  ParameterList params;
  params.append("mode", "edit");
  params.append("ipsitem_id", _ipsitemid);
  params.append("ipsitemchar_id", _charprice->id());
  params.append("curr_id", _price->id());
  params.append("item_id", _item->id());

  characteristicPrice newdlg(this, "", true);
  newdlg.set(params);

  int result;
  if ((result = newdlg.exec()) != XDialog::Rejected)
  {
    if (result == -1)
      done(-1);
     else
      sFillList();
  }
}
Пример #16
0
void dspSummarizedBacklogByWarehouse::sPrint()
{
  ParameterList params;
  _warehouse->appendValue(params);
  _customerType->appendValue(params);
  _dates->appendValue(params);
  params.append("print");

  if (_showPrices->isChecked())
    params.append("showPrices");

  if (_shipDate->isChecked())
    params.append("orderByShipDate");
  else if (_packDate->isChecked())
    params.append("orderByPackDate");
  else if (_orderNumber->isChecked())
    params.append("orderByOrderNumber");

  rptSummarizedBacklogByWarehouse newdlg(this, "", TRUE);
  newdlg.set(params);
}
Пример #17
0
void dspSummarizedGLTransactions::sPrint()
{
  ParameterList params;
  _dates->appendValue(params);
  params.append("print");

  if (_unpostedTransactions->isChecked())
    params.append("unpostedTransactions");

  if (_postedTransactions->isChecked())
    params.append("postedTransactions");

  if (_selectedSource->isChecked())
    params.append("source", _source->currentText());

  if (_showUsername->isChecked())
    params.append("showUsernames");

  rptSummarizedGLTransactions newdlg(this, "", TRUE);
  newdlg.set(params);
}
Пример #18
0
void itemPricingSchedules::sCopy()
{
  q.prepare("SELECT copypricingschedule(:ipshead_id) AS result;");
  q.bindValue(":ipshead_id", _ipshead->id());
  q.exec();
  if (q.first())
  {
    ParameterList params;
    params.append("mode", "copy");
    params.append("ipshead_id", q.value("result").toInt());

    itemPricingSchedule newdlg(this, "", TRUE);
    newdlg.set(params);
    newdlg.exec();

    sFillList();
  }
  else if (q.lastError().type() != QSqlError::None)
	systemError(this,q.lastError().databaseText(),
                  __FILE__, __LINE__);
}
Пример #19
0
void updateOUTLevelByItem::sSubmit()
{
  if (_periods->topLevelItemCount() > 0)
  {
    ParameterList params;
    _warehouse->appendValue(params);
    params.append("action_name", "UpdateOUTLevel");
    params.append("item_id", _item->id());
    params.append("period_id_list", _periods->periodString());

    if (_leadTime->isChecked())
      params.append("leadtimepad", _leadTimePad->value());
    else if (_fixedDays->isChecked())
      params.append("fixedlookahead", _days->value());

    submitAction newdlg(this, "", TRUE);
    newdlg.set(params);
    if (newdlg.exec() == XDialog::Accepted)
      accept();
  }
}
Пример #20
0
void cashReceiptItem::sDiscount()
{
  ParameterList params;
  params.append("aropen_id", _aropenid);
  params.append("curr_id", _openAmount->id());
  if(_discountAmount->localValue() != 0.0)
    params.append("amount", _discountAmount->localValue());

  applyARDiscount newdlg(this, "", true);
  newdlg.set(params);

  if(newdlg.exec() != XDialog::Rejected)
  {
    _discountAmount->setLocalValue(newdlg._amount->localValue());
    if(_mode == cNew)
      _amountToApply->setLocalValue(_openAmount->localValue() - _discountAmount->localValue());
    else
      _amountToApply->setLocalValue(qMin(_amountToApply->localValue(),
                                         _openAmount->localValue() - _discountAmount->localValue()));
  }
}
Пример #21
0
void itemPricingSchedule::sNew()
{
  sSave(false);
  ParameterList params;
  params.append("mode", "new");
  params.append("ipshead_id", _ipsheadid);
  params.append("curr_id", _currency->id());
  params.append("updated", _updated);

  itemPricingScheduleItem newdlg(this, "", TRUE);
  newdlg.set(params);

  int result;
  if ((result = newdlg.exec()) != XDialog::Rejected)
  {
    if (result == -1)
      reject();
    else
      sFillList(result);
  }
}
Пример #22
0
void todoList::sEdit()
{
  if (_todoList->altId() ==2)
    sEditIncident();
  else if (_todoList->altId() == 3)
    sEditTask();
  else if (_todoList->altId() == 4)
    sEditProject();
  else
  {
    ParameterList params;
    params.append("mode", "edit");
    params.append("todoitem_id", _todoList->id());

    todoItem newdlg(this, "", TRUE);
    newdlg.set(params);

    if (newdlg.exec() != XDialog::Rejected)
      sFillList();
  }
}
Пример #23
0
void dspSummarizedSalesByItem::sPrint()
{
  ParameterList params;
  _warehouse->appendValue(params);
  _customerType->appendValue(params);
  _productCategory->appendValue(params);
  _dates->appendValue(params);
  params.append("print");

  if (_orderByItemNumber->isChecked())
    params.append("orderByItemNumber");

  if (_orderByQtyVolume->isChecked())
    params.append("orderByQtyVolume");

  if (_orderBySalesVolume->isChecked())
    params.append("orderBySalesVolume");

  rptSummarizedSalesByItem newdlg(this, "", TRUE);
  newdlg.set(params);
}
void postStandardJournalGroup::sPost()
{
  XSqlQuery postPost;
  if (!_distDate->isValid())
  {
    QMessageBox::critical( this, tr("Cannot Post Standard Journal Group"),
                           tr("You must enter a Distribution Date before you may post this Standard Journal Group.") );
    _distDate->setFocus();
    return;
  }

  postPost.prepare("SELECT postStandardJournalGroup(:stdjrnlgrp_id, :distDate, :reverse) AS result;");
  postPost.bindValue(":stdjrnlgrp_id", _stdjrnlgrp->id());
  postPost.bindValue(":distDate", _distDate->date());
  postPost.bindValue(":reverse", QVariant(_reverse->isChecked()));
  postPost.exec();
  if (postPost.first())
  {
    ParameterList params;
    params.append("mode", "postStandardJournal");
    params.append("glSequence", postPost.value("result"));
    if(_doSubmit)
      params.append("submit");

    glSeries newdlg(this, "", true);
    newdlg.set(params);
    newdlg.exec();
  }
  else
    ErrorReporter::error(QtCriticalMsg, this, tr("Error Posting Standard Journal Group"),
                       postPost, __FILE__, __LINE__);

  if (_captive)
    accept();
  {
    _stdjrnlgrp->setNull();
    _close->setText(tr("&Close"));
    _stdjrnlgrp->setFocus();
  }
}
Пример #25
0
void dspPlannedOrders::sReleaseOrder()
{
  if (list()->currentItem()->text(1) == "W/O")
  {
    ParameterList params;
    params.append("mode", "release");
    params.append("planord_id", list()->id());

    workOrder *newdlg = new workOrder();
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else if (list()->currentItem()->text(1) == "P/O")
  {
    ParameterList params;
    params.append("mode", "release");
    params.append("planord_id", list()->id());

    purchaseRequest newdlg(this, "", true);
    newdlg.set(params);

    if (newdlg.exec() == XDialog::Rejected)
      return;
  }
  else if (list()->currentItem()->text(1) == "T/O")
  {
    ParameterList params;
    params.append("mode", "releaseTO");
    params.append("planord_id", list()->id());

    transferOrder *newdlg = new transferOrder();
    if(newdlg->set(params) == NoError)
      omfgThis->handleNewWindow(newdlg);
    else
      delete newdlg;
  }
  QTreeWidgetItem * ci = list()->currentItem();
  if(ci)
    delete ci;
}
Пример #26
0
void postStandardJournal::sPost()
{
  if (!_distDate->isValid())
  {
    QMessageBox::critical( this, tr("Cannot Post Standard Journal"),
                           tr("You must enter a Distribution Date before you may post this Standard Journal.") );
    _distDate->setFocus();
    return;
  }

  q.prepare("SELECT postStandardJournal(:stdjrnl_id, :distDate, :reverse) AS result;");
  q.bindValue(":stdjrnl_id", _stdjrnl->id());
  q.bindValue(":distDate", _distDate->date());
  q.bindValue(":reverse", QVariant(_reverse->isChecked(), 0));
  q.exec();
  if (q.first())
  {
    ParameterList params;
    params.append("mode", "postStandardJournal");
    params.append("glSequence", q.value("result"));
    if(_doSubmit)
      params.append("submit");

    glSeries newdlg(this, "", TRUE);
    newdlg.set(params);
    newdlg.exec();
  }
  else
    systemError(this, tr("A System Error occurred at %1::%2.")
                      .arg(__FILE__)
                      .arg(__LINE__) );

  if (_captive)
    accept();
  {
    _stdjrnl->setNull();
    _close->setText(tr("&Close"));
    _stdjrnl->setFocus();
  }
}
Пример #27
0
void rptTimePhasedBookingsByCustomer::sSubmit()
{
  if (_periods->isPeriodSelected())
  {
    ParameterList params(buildParameters());
    params.append("report_name", "TimePhasedBookingsByCustomer");
    
    submitReport newdlg(this, "", TRUE);
    newdlg.set(params);

    if (newdlg.check() == cNoReportDefinition)
      QMessageBox::critical( this, tr("Report Definition Not Found"),
                             tr( "The report defintions for this report, \"TimePhasedBookingsByCustomer\" cannot be found.\n"
                                 "Please contact your Systems Administrator and report this issue." ) );
    else
      newdlg.exec();
  }
  else
    QMessageBox::critical( this, tr("Incomplete criteria"),
                           tr( "The criteria you specified is not complete. Please make sure all\n"
                               "fields are correctly filled out before running the report." ) );
}
Пример #28
0
void eventManager::sPrintPackingList()
{
  q.prepare( "SELECT coitem_cohead_id "
             "FROM coitem "
             "WHERE (coitem_id=:coitem_id);" );
  q.bindValue(":coitem_id", _event->currentItem()->text(0).toInt());
  q.exec();
  if (q.first())
  {
    ParameterList params;
    params.append("sohead_id", q.value("coitem_cohead_id").toInt());

    printPackingList newdlg(this, "", TRUE);
    newdlg.set(params);
    newdlg.exec();
  }
  else if (q.lastError().type() != QSqlError::None)
  {
    systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
}
Пример #29
0
void selectPayments::sSelect()
{
  _ignoreUpdates = true;
  bool update = false;
  QList<XTreeWidgetItem*> list = _apopen->selectedItems();
  XTreeWidgetItem * cursor = 0;
  XSqlQuery slct;
  slct.prepare("SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;");
  for(int i = 0; i < list.size(); i++)
  {
    cursor = (XTreeWidgetItem*)list.at(i);
    slct.bindValue(":apopen_id", _apopen->id());
    slct.exec();
    if (slct.first())
    {
      if (slct.value("apopen_status").toString() == "H")
	  {
		QMessageBox::critical( this, tr("Can not do Payment"), tr( "Item is On Hold" ) );
        return;
	  }
	  else
	  {
    ParameterList params;
    params.append("apopen_id", cursor->id());

    if(_bankaccnt->id() != -1)
      params.append("bankaccnt_id", _bankaccnt->id());

    selectPayment newdlg(this, "", TRUE);
    newdlg.set(params);
    if(newdlg.exec() != XDialog::Rejected)
      update = true;
  }
  _ignoreUpdates = false;
  if(update)
    sFillList();
}
  }
}
Пример #30
0
void purchaseOrderItem::sVendorItemNumberList()
{
  ParameterList params;

  q.prepare( "SELECT vend_id"
             "  FROM pohead, vend "
             " WHERE((pohead_vend_id=vend_id)"
             "   AND (pohead_id=:pohead_id));" );
  q.bindValue(":pohead_id", _poheadid);
  q.exec();
  if (q.first())
    params.append("vend_id", q.value("vend_id").toInt());
  if (!_vendorItemNumber->text().isEmpty())
    params.append("search", _vendorItemNumber->text());
  else if (_item->id() != -1)
    params.append("search", _item->itemNumber());
  itemSourceSearch newdlg(this, "", true);
  newdlg.set(params);

  if(newdlg.exec() == XDialog::Accepted)
  {
    int itemsrcid = newdlg.itemsrcId();
    if(itemsrcid != -1)
    {
      _inventoryItem->setChecked(TRUE);
      sPopulateItemSourceInfo(itemsrcid);
    }
    else
    {
      _nonInventoryItem->setChecked(TRUE);
      _expcat->setId(newdlg.expcatId());
      _vendorItemNumber->setText(newdlg.vendItemNumber());
      _vendorDescrip->setText(newdlg.vendItemDescrip());
      _manufName->setText(newdlg.manufName());
      _manufItemNumber->setText(newdlg.manufItemNumber());
      _manufItemDescrip->setText(newdlg.manufItemDescrip());
    }
  }
}