function populate() { $worder = new MFWorkorderCollection(); $worder->setParams(); $sh = new SearchHandler($worder, false); $sh->addConstraint(new Constraint('status', 'in', "('R')")); $this->setSearchLimit($sh); $sh->setOrderBy('wo_number'); $worder->load($sh); $this->contents = $worder; }
public function getWorkOrders($stitem_id = '') { if (empty($stitem_id)) { return array(); } $mfworkorders = new MFWorkorderCollection(); $sh = new SearchHandler($mfworkorders, false); $sh->addConstraint(new Constraint('stitem_id', '=', $stitem_id)); $sh->setOrderby('wo_number', 'DESC'); $mfworkorders->load($sh); return $mfworkorders->getAssoc('wo_number'); }
public function getWorkOrders() { // This gets all Work Orders if ($this->worders) { return $this->worders; } $mfworders = new MFWorkorderCollection(); $sh = new SearchHandler($mfworders, false); $sh->addConstraint(new Constraint('stitem_id', '=', $this->id)); $sh->addConstraint(new Constraint('status', '!=', 'C')); $sh->setOrderby('required_by'); $mfworders->load($sh); if ($mfworders) { $this->worders = $mfworders; return $this->worders; } else { return array(); } }
public function showFulfilled() { $mfworkorders = new MFWorkorderCollection($this->_templateobject); $sh = new SearchHandler($mfworkorders); $sh->extract(); $sh->addConstraint(new Constraint('status', '=', 'O')); $sh->addConstraint(new Constraint('made_qty', '>=', '(order_qty)')); $sh->extractOrdering(); $sh->extractPaging(); $mfworkorders->load($sh); $this->view->set('clickaction', 'view'); $this->view->set('mfworkorders', $mfworkorders); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['viewAll'] = array('tag' => 'View', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'index')); $sidebar->addList('All Works Orders', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }