public function getItems($start, $count, $sortfield = null, $asc = null) { return Document::find($this->getWhere(), "created ", "desc"); }
public function invoiceOnClick($sender) { $customer = $sender->getOwner()->getDataItem(); $this->invoicelist->custname2->setText($customer->customer_name); $this->_ilist = Document::find('datatag=' . $customer->customer_id . " and (meta_name='Invoice' or meta_name='PurchaseInvoice') and state <> " . Document::STATE_CLOSED . " and state <> " . Document::STATE_EXECUTED, 'document_id asc'); $this->invoicelist->ilist->Reload(); $this->clistpanel->setVisible(false); $this->invoicelist->setVisible(true); }
/** * список связанных документов * */ public function ConnectedDocList() { $where = "document_id in (select doc1 from erp_docrel where doc2={$this->document_id}) or document_id in (select doc2 from erp_docrel where doc1={$this->document_id})"; return Document::find($where); }
public function getItems($start, $count, $sortfield = null, $asc = null) { $docs = Document::find($this->getWhere(), "created ", "desc", $count, $start); //$l = Traversable::from($docs); //$l = $l->where(function ($doc) {return $doc->document_id == 169; }) ; //$l = $l->select(function ($doc) { return $doc; })->asArray() ; return $docs; }