コード例 #1
0
ファイル: accountactivity.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new Form('filter'))->setSubmitHandler($this, 'OnSubmit');
     $this->filter->add(new Date('from', time() - 7 * 24 * 3600));
     $this->filter->add(new Date('to', time()));
     $this->filter->add(new DropDownChoice('acc', \ZippyERP\ERP\Entity\Account::findArrayEx("acc_code not in (select acc_pid  from erp_account_plan)", "acc_code")));
     $this->add(new Panel('detail'))->setVisible(false);
     $this->detail->add(new RedirectLink('print', ""));
     $this->detail->add(new RedirectLink('html', ""));
     $this->detail->add(new RedirectLink('word', ""));
     $this->detail->add(new RedirectLink('excel', ""));
     $this->detail->add(new Label('preview'));
 }
コード例 #2
0
ファイル: entrylist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $filter = Filter::getFilter("entrylist");
     $this->add(new Form('filter'))->setSubmitHandler($this, 'filterOnSubmit');
     $this->filter->add(new Date('from', strlen($filter->from) > 0 ? $filter->from : time() - 7 * 24 * 3600));
     $this->filter->add(new Date('to', strlen($filter->to) > 0 ? $filter->to : time()));
     $this->filter->add(new DropDownChoice('dt', \ZippyERP\ERP\Entity\Account::findArrayEx("acc_code not in (select acc_pid  from erp_account_plan)")));
     $this->filter->add(new DropDownChoice('ct', \ZippyERP\ERP\Entity\Account::findArrayEx("acc_code not in (select acc_pid  from erp_account_plan)")));
     if (strlen($filter->dt) > 0) {
         $this->filter->dt->setValue($filter->dt);
     }
     if (strlen($filter->ct) > 0) {
         $this->filter->ct->setValue($filter->ct);
     }
     $this->add(new DataView('entrylist', new EntryDataSource(), $this, 'entrylistOnRow'));
     $this->add(new \ZippyERP\ERP\Blocks\DocView('docview'))->setVisible(false);
     $this->add(new \Zippy\Html\DataList\Paginator("paginator", $this->entrylist));
     $this->entrylist->setPageSize(10);
     $this->entrylist->setSelectedClass('success');
     $this->entrylist->Reload();
 }
コード例 #3
0
ファイル: manualentry.php プロジェクト: Niqpue/zippyerp
 public function __construct($docid = 0)
 {
     parent::__construct();
     $this->add(new Form('docform'));
     $this->docform->add(new TextInput('document_number'));
     $this->docform->add(new TextArea('description'));
     $this->docform->add(new Date('document_date'));
     //проводки
     $this->docform->add(new DataView('acctable', new ArrayDataSource($this, '_entryarr'), $this, 'acctableOnRow'));
     $this->docform->add(new DropDownChoice('e_acclistd', Account::findArrayEx('acc_code not in(select acc_pid from erp_account_plan)', 'cast(acc_code as char)')));
     $this->docform->add(new DropDownChoice('e_acclistc', Account::findArrayEx('acc_code not in(select acc_pid from erp_account_plan)', 'cast(acc_code as char)')));
     $this->docform->add(new TextInput('e_accsumma'));
     $this->docform->add(new SubmitButton('addaccbtn'))->setClickHandler($this, 'addaccbtnOnClick');
     //ТМЦ
     $this->docform->add(new DataView('itemtable', new ArrayDataSource($this, '_itemarr'), $this, 'itemtableOnRow'));
     $this->docform->add(new DropDownChoice('e_storelist', Store::findArray('storename', 'store_type=' . Store::STORE_TYPE_OPT, 'storename')));
     $this->docform->add(new AutocompleteTextInput('e_itemlist'))->setAutocompleteHandler($this, "OnAutoItem");
     $this->docform->add(new TextInput('e_quantity'));
     $this->docform->add(new TextInput('e_price'));
     $this->docform->add(new DropDownChoice('e_itemop', new Bind($this, '_acclist')));
     $this->docform->add(new SubmitButton('additembtn'))->setClickHandler($this, 'additembtnOnClick');
     //Сотрудники
     $this->docform->add(new DataView('emptable', new ArrayDataSource($this, '_emparr'), $this, 'emptableOnRow'));
     $this->docform->add(new DropDownChoice('e_empop', new Bind($this, '_acclist')));
     $this->docform->add(new AutocompleteTextInput('e_emplist'))->setAutocompleteHandler($this, "OnAutoEmp");
     $this->docform->add(new TextInput('e_empamount'));
     $this->docform->add(new SubmitButton('addempbtn'))->setClickHandler($this, 'addempbtnOnClick');
     //контрагенты
     $this->docform->add(new DataView('ctable', new ArrayDataSource($this, '_carr'), $this, 'ctableOnRow'));
     $this->docform->add(new AutocompleteTextInput('e_сlist'))->setAutocompleteHandler($this, "OnAutoCont");
     $this->docform->add(new TextInput('e_сamount'));
     $this->docform->add(new SubmitButton('addсbtn'))->setClickHandler($this, 'addсbtnOnClick');
     $this->docform->add(new DropDownChoice('e_cop', new Bind($this, '_acclist')));
     //Денежные счета
     $this->docform->add(new DataView('ftable', new ArrayDataSource($this, '_farr'), $this, 'ftableOnRow'))->Reload();
     $this->docform->add(new DropDownChoice('e_flist', MoneyFund::findArray('title', '', 'title')));
     $this->docform->add(new TextInput('e_famount'));
     $this->docform->add(new SubmitButton('addfbtn'))->setClickHandler($this, 'addfbtnOnClick');
     $this->docform->add(new DropDownChoice('e_foper', new Bind($this, '_acclist')));
     $this->docform->add(new Button('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     $this->docform->add(new SubmitButton('savedoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new SubmitButton('execdoc'))->setClickHandler($this, 'savedocOnClick');
     if ($docid > 0) {
         //загружаем   содержимок  документа на страницу
         $this->_edited = true;
         $this->_doc = Document::load($docid);
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->description->setText($this->_doc->headerdata['description']);
         $this->docform->document_date->setText(date('Y-m-d', $this->_doc->document_date));
         $this->_entryarr = unserialize(base64_decode($this->_doc->headerdata['entry']));
         $this->_itemarr = unserialize(base64_decode($this->_doc->headerdata['item']));
         $this->_emparr = unserialize(base64_decode($this->_doc->headerdata['emp']));
         $this->_carr = unserialize(base64_decode($this->_doc->headerdata['c']));
         $this->_farr = unserialize(base64_decode($this->_doc->headerdata['f']));
         $this->docform->acctable->Reload();
         $this->updateAccList();
         $this->docform->itemtable->Reload();
         $this->docform->emptable->Reload();
         $this->docform->ftable->Reload();
         $this->docform->ctable->Reload();
     } else {
         $this->_doc = Document::create('ManualEntry');
         $this->docform->document_date->setDate(time());
     }
 }