ParameterList rptTimePhasedBookingsByProductCategory::buildParameters() { ParameterList params; _productCategory->appendValue(params); _warehouse->appendValue(params); if(_inventoryUnits->isChecked()) params.append("inventoryUnits"); else if(_capacityUnits->isChecked()) params.append("capacityUnits"); else if(_altCapacityUnits->isChecked()) params.append("altCapacityUnits"); else if(_salesDollars->isChecked()) params.append("salesDollars"); XListViewItem *cursor = _periods->firstChild(); QList<QVariant> periodList; while (cursor) { if (cursor->isSelected()) periodList.append(cursor->id()); cursor = cursor->nextSibling(); } params.append("period_id_list", periodList); return params; }
void dspBacklogByCustomer::sPopulateMenu(Q3PopupMenu *pMenu) { int selectionCount = 0; bool multiSelection = FALSE; bool hasParents = FALSE; bool hasChildren = FALSE; for (XListViewItem *cursor = _soitem->firstChild(); cursor; cursor = cursor->itemBelow()) { if (cursor->isSelected()) { if ( (++selectionCount > 1) && (!multiSelection) ) multiSelection = TRUE; if ( (cursor->altId() == -1) && (!hasParents) ) hasParents = TRUE; if ( (cursor->altId() != -1) && (!hasChildren) ) hasChildren = TRUE; } } int menuItem; if (selectionCount == 1) { menuItem = pMenu->insertItem(tr("Edit Order..."), this, SLOT(sEditOrder()), 0); if (!_privleges->check("MaintainSalesOrders")) pMenu->setItemEnabled(menuItem, FALSE); menuItem = pMenu->insertItem(tr("View Order..."), this, SLOT(sViewOrder()), 0); if ((!_privleges->check("MaintainSalesOrders")) && (!_privleges->check("ViewSalesOrders"))) pMenu->setItemEnabled(menuItem, FALSE); if (hasChildren) { pMenu->insertSeparator(); menuItem = pMenu->insertItem(tr("Edit Item..."), this, SLOT(sEditItem()), 0); if (!_privleges->check("MaintainSalesOrders")) pMenu->setItemEnabled(menuItem, FALSE); menuItem = pMenu->insertItem(tr("View Item..."), this, SLOT(sViewItem()), 0); if ((!_privleges->check("MaintainSalesOrders")) && (!_privleges->check("ViewSalesOrders"))) pMenu->setItemEnabled(menuItem, FALSE); } } if (hasParents) { pMenu->insertSeparator(); menuItem = pMenu->insertItem(tr("Print Packing List..."), this, SLOT(sPrintPackingList()), 0); if (!_privleges->check("PrintPackingLists")) pMenu->setItemEnabled(menuItem, FALSE); menuItem = pMenu->insertItem(tr("Add to Packing List Batch..."), this, SLOT(sAddToPackingListBatch()), 0); if (!_privleges->check("MaintainPackingListBatch")) pMenu->setItemEnabled(menuItem, FALSE); } }
ParameterList rptTimePhasedProductionByPlannerCode::buildParameters() { ParameterList params; _plannerCode->appendValue(params); _warehouse->appendValue(params); XListViewItem *cursor = _periods->firstChild(); QList<QVariant> periodList; while (cursor) { if (cursor->isSelected()) periodList.append(cursor->id()); cursor = cursor->nextSibling(); } params.append("period_id_list", periodList); if (_capacityUnits->isChecked()) params.append("capacityUnits"); else if(_altCapacityUnits->isChecked()) params.append("altCapacityUnits"); else if(_inventoryUnits->isChecked()) params.append("inventoryUnits"); if(_showInactive->isChecked()) params.append("showInactive"); return params; }
void dspBacklogByCustomer::sPrintPackingList() { for (XListViewItem *cursor = _soitem->firstChild(); cursor; cursor = cursor->itemBelow()) { if ( (cursor->isSelected()) && (cursor->altId() == -1) ) { ParameterList params; params.append("sohead_id", cursor->id()); printPackingList newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } }
void dspBacklogByCustomer::sAddToPackingListBatch() { for (XListViewItem *cursor = _soitem->firstChild(); cursor; cursor = cursor->itemBelow()) { if ( (cursor->isSelected()) && (cursor->altId() == -1) ) { q.prepare("SELECT addToPackingListBatch(:sohead_id, :cosmisc_id) AS result;"); q.bindValue(":sohead_id", cursor->id()); q.bindValue(":cosmisc_id", cursor->altId()); q.exec(); if (q.lastError().type() != QSqlError::None) { systemError(this, q.lastError().databaseText(), __FILE__, __LINE__); return; } } } }
ParameterList rptTimePhasedBookingsByCustomer::buildParameters() { ParameterList params; _customerType->appendValue(params); XListViewItem *cursor = _periods->firstChild(); QList<QVariant> periodList; while (cursor) { if (cursor->isSelected()) periodList.append(cursor->id()); cursor = cursor->nextSibling(); } params.append("period_id_list", periodList); return params; }
void rptTimePhasedRoughCutByWorkCenter::sPrint() { if (_periods->isPeriodSelected()) { ParameterList params; if (_selectedWorkCenter->isChecked()) params.append("wkrcnt_id", _workCenters->id()); _warehouse->appendValue(params); XListViewItem *cursor = _periods->firstChild(); QList<QVariant> periodList; while (cursor) { if (cursor->isSelected()) periodList.append(cursor->id()); cursor = cursor->nextSibling(); } params.append("period_id_list", periodList); orReport report("TimePhasedRoughCutByWorkCenter", params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } if (_captive) accept(); } 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." ) ); }