コード例 #1
0
ファイル: supplierorderlist.php プロジェクト: Niqpue/zippyerp
 /**
  *
  * @param mixed $docid  Документ  должен  быть  показан  в  просмотре
  * @return DocList
  */
 public function __construct($docid = 0)
 {
     parent::__construct();
     $filter = Filter::getFilter("SupplierOrderList");
     $this->add(new Form('filter'))->setSubmitHandler($this, 'filterOnSubmit');
     $this->filter->add(new DropDownChoice('statelist', SupplierOrder::getStatesList()));
     $this->filter->add(new DropDownChoice('supplierlist', Customer::findArray('customer_name')));
     $this->filter->add(new CheckBox('notpayed'));
     if (strlen($filter->state) > 0) {
         $this->filter->statelist->setValue($filter->state);
     }
     if (strlen($filter->supplier) > 0) {
         $this->filter->supplierlist->setValue($filter->supplier);
     }
     $this->filter->notpayed->setChecked($filter->notpayed);
     $doclist = $this->add(new DataView('doclist', new DocSODataSource(), $this, 'doclistOnRow'));
     $doclist->setSelectedClass('success');
     $doclist->Reload();
     $this->add(new \ZippyERP\ERP\Blocks\DocView('docview'))->setVisible(false);
     if ($docid > 0) {
         $this->docview->setVisible(true);
         $this->docview->setDoc(Document::load($docid));
         $this->doclist->setSelectedRow($docid);
         $doclist->Reload();
     }
     $this->add(new \Zippy\Html\DataList\Paginator('pag', $doclist));
 }
コード例 #2
0
ファイル: contract.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 TextInput('amount'));
     $this->docform->add(new Date('created', time()));
     $this->docform->add(new DropDownChoice('customer', Customer::findArray("customer_name", "")));
     $this->docform->add(new Date('startdate', time()));
     $this->docform->add(new Date('enddate', time()));
     $this->docform->add(new TextArea('description'));
     $this->docform->add(new SubmitButton('submit'))->setClickHandler($this, 'submitOnClick');
     $this->docform->add(new Button('cancel'))->setClickHandler($this, 'cancelOnClick');
     if ($docid > 0) {
         //загружаем   содержимок  документа настраницу
         $this->_doc = Document::load($docid);
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->created->setDate($this->_doc->document_date);
         $this->docform->startdate->setDate($this->_doc->headerdata['startdate']);
         $this->docform->enddate->setDate($this->_doc->headerdata['enddate']);
         $this->docform->description->setText($this->_doc->headerdata['description']);
         $this->docform->amount->setText(H::fm($this->_doc->headerdata['amount']));
         $this->docform->customer->setValue($this->_doc->headerdata['customer']);
     } else {
         $this->_doc = Document::create('Contract');
         $this->docform->document_number->setText($this->_doc->nextNumber());
     }
 }
コード例 #3
0
ファイル: doclist.php プロジェクト: Niqpue/zippyerp
 /**
  *
  * @param mixed $docid  Документ  должен  быть  показан  в  просмотре
  * @return DocList
  */
 public function __construct($docid = 0)
 {
     parent::__construct();
     $filter = Filter::getFilter("doclist");
     if ($filter->to == null) {
         $filter->to = time();
         $filter->from = time() - 7 * 24 * 3600;
         $filter->page = 1;
     }
     $this->add(new Form('filter'))->setSubmitHandler($this, 'filterOnSubmit');
     $this->filter->add(new Date('from', $filter->from));
     $this->filter->add(new Date('to', $filter->to));
     $this->filter->add(new DropDownChoice('docgroup', H::getDocGroups()));
     $this->filter->add(new CheckBox('onlymy'))->setChecked($filter->onlymy == true);
     $this->filter->add(new TextInput('searchnumber'));
     if (strlen($filter->docgroup) > 0) {
         $this->filter->docgroup->setValue($filter->docgroup);
     }
     $doclist = $this->add(new DataView('doclist', new DocDataSource(), $this, 'doclistOnRow'));
     $doclist->setSelectedClass('success');
     $this->add(new Paginator('pag', $doclist));
     $doclist->setPageSize(10);
     $filter->page = $this->doclist->setCurrentPage($filter->page);
     $doclist->Reload();
     $this->add(new \ZippyERP\ERP\Blocks\DocView('docview'))->setVisible(false);
     if ($docid > 0) {
         $this->docview->setVisible(true);
         $this->docview->setDoc(Document::load($docid));
         $this->doclist->setSelectedRow($docid);
         $doclist->Reload();
     }
 }
コード例 #4
0
ファイル: revaluationret.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 Date('document_date', time()));
     $this->docform->add(new DropDownChoice('store'))->setChangeHandler($this, 'OnChangeStore');
     $this->docform->store->setOptionList(Store::findArray("storename", "store_type=" . Store::STORE_TYPE_RET));
     $this->docform->add(new SubmitLink('addrow'))->setClickHandler($this, 'addrowOnClick');
     $this->docform->add(new SubmitButton('savedoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new SubmitButton('execdoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new Button('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     $this->add(new Form('editdetail'))->setVisible(false);
     $this->editdetail->add(new AutocompleteTextInput('edititem'))->setAutocompleteHandler($this, 'OnAutocompleteItem');
     $this->editdetail->edititem->setChangeHandler($this, 'OnChangeItem');
     $this->editdetail->add(new TextInput('editprice'))->setText("0");
     $this->editdetail->add(new Label('qtystock'));
     $this->editdetail->add(new SubmitButton('saverow'))->setClickHandler($this, 'saverowOnClick');
     $this->editdetail->add(new Button('cancelrow'))->setClickHandler($this, 'cancelrowOnClick');
     if ($docid > 0) {
         //загружаем   содержимок  документа на страницу
         $this->_doc = Document::load($docid);
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->document_date->setDate($this->_doc->document_date);
         $this->docform->store->setValue($this->_doc->headerdata['store']);
         foreach ($this->_doc->detaildata as $item) {
             $stock = new Stock($item);
             $this->_itemlist[$stock->stock_id] = $stock;
         }
     } else {
         $this->_doc = Document::create('RevaluationRet');
     }
     $this->docform->add(new DataView('detail', new \Zippy\Html\DataList\ArrayDataSource(new \Zippy\Binding\PropertyBinding($this, '_itemlist')), $this, 'detailOnRow'))->Reload();
 }
コード例 #5
0
ファイル: tasklist.php プロジェクト: Niqpue/zippyerp
 public function __construct($task_id = 0)
 {
     parent::__construct();
     $this->_taskds = new EDS('\\ZippyERP\\ERP\\Entity\\Task');
     $this->add(new Panel('listtab'));
     $this->listtab->add(new Form('filterform'))->setSubmitHandler($this, 'OnFilter');
     $this->listtab->filterform->add(new DropDownChoice('filterproject', Project::findArray('projectname'), 0));
     $this->listtab->filterform->add(new DropDownChoice('filterassignedto', Task::getAssignedList(), 0));
     $this->listtab->filterform->add(new DropDownChoice('filterstatus', Task::getStatusList(), -1));
     $this->listtab->filterform->add(new DropDownChoice('filtersorting'));
     //форма   поиска  по  коду
     $this->listtab->add(new Form('searchform'))->setSubmitHandler($this, 'OnSearch');
     $this->listtab->searchform->add(new TextInput('searchcode'));
     $this->listtab->add(new DataView('tasklist', $this->_taskds, $this, 'tasklistOnRow'));
     $this->add(new Panel('contenttab'))->setVisible(false);
     $this->contenttab->add(new Label('showtaskname'));
     $this->contenttab->add(new Form('editform'))->setSubmitHandler($this, 'OnEdit');
     $this->contenttab->editform->add(new DropDownChoice('editstatus', Task::getStatusList(), 0));
     $this->contenttab->editform->add(new DropDownChoice('editassignedto', Task::getAssignedList(), 0));
     $this->contenttab->add(new DataView('dw_msglist', new ArrayDataSource(new Prop($this, '_msglist')), $this, 'dw_msglistOnRow'));
     $this->contenttab->add(new Form('addmsgform'))->setSubmitHandler($this, 'OnMsgSubmit');
     $this->contenttab->addmsgform->add(new TextArea('addmsg'));
     $this->contenttab->add(new DataView('dw_files', new ArrayDataSource(new Prop($this, '_fileslist')), $this, 'dw_filesOnRow'));
     $this->contenttab->add(new Form('addfileform'))->setSubmitHandler($this, 'OnFileSubmit');
     $this->contenttab->addfileform->add(new File('addfile'));
     $this->contenttab->addfileform->add(new TextInput('adddescfile'));
     $this->contenttab->add(new ClickLink('tolist'))->setClickHandler($this, 'tolistOnClick');
     //$this->_taskds->setWhere('task_id=' . ($task_id > 0 ? $task_id : 0 ));
     //$this->listtab->tasklist->Reload();
     if ($task_id > 0) {
         $this->_task = Task::load($task_id);
         $this->OpenTask();
     }
 }
コード例 #6
0
ファイル: revaluationretsum.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 Date('document_date'))->setDate(time());
     $this->docform->add(new SubmitButton('execdoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new Button('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     $this->docform->add(new DropDownChoice('store', Store::findArray("storename", "store_type = " . Store::STORE_TYPE_RET_SUM)))->setAjaxChangeHandler($this, 'ajaxUpdateActual');
     $this->docform->add(new DropDownChoice('type'));
     $this->docform->add(new TextInput('summa'));
     $this->docform->add(new Label('actual'));
     if ($docid > 0) {
         //загружаем   содержимок  документа настраницу
         $this->_doc = Document::load($docid);
         if ($this->_doc == null) {
             App::RedirectError('Докумен не найден');
         }
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->document_date->setDate($this->_doc->document_date);
         $this->docform->store->setValue($this->_doc->headerdata['store_id']);
         $this->docform->type->setValue($this->_doc->headerdata['type']);
         $this->docform->summa->setText(H::fm($this->_doc->headerdata['summa']));
         $this->updateActual();
     } else {
         $this->_doc = Document::create('RevaluationRetSum');
         $this->docform->document_number->setText($this->_doc->nextNumber());
     }
 }
コード例 #7
0
ファイル: customerlist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new Panel('customertable'))->setVisible(true);
     $this->customertable->add(new DataView('customerlist', new \ZCL\DB\EntityDataSource('\\ZippyERP\\ERP\\Entity\\Customer'), $this, 'customerlistOnRow'))->Reload();
     $this->customertable->add(new ClickLink('addnew'))->setClickHandler($this, 'addOnClick');
     $this->customertable->add(new ClickLink('addf'))->setClickHandler($this, 'addOnClick');
     $this->add(new Form('customerdetail'))->setVisible(false);
     $this->customerdetail->add(new TextInput('editcustomername'));
     $this->customerdetail->add(new TextInput('editcode'));
     $this->customerdetail->add(new TextInput('editinn'));
     $this->customerdetail->add(new TextInput('editlic'));
     $this->customerdetail->add(new TextInput('editfaddress'));
     $this->customerdetail->add(new TextInput('editladdress'));
     $this->customerdetail->add(new TextInput('editphone'));
     $this->customerdetail->add(new TextInput('editemail'));
     $this->customerdetail->add(new DropDownChoice('editbank', \ZippyERP\ERP\Entity\Bank::findArray('bank_name', '', 'bank_name')));
     $this->customerdetail->add(new TextInput('editbankaccount'));
     $this->customerdetail->add(new DropDownChoice('cust_type'));
     $this->customerdetail->add(new SubmitButton('save'))->setClickHandler($this, 'saveOnClick');
     $this->customerdetail->add(new Button('cancel'))->setClickHandler($this, 'cancelOnClick');
     $this->add(new Panel('editcontacts'))->setVisible(false);
     $this->editcontacts->add(new Label('cname'));
     $this->editcontacts->add(new ClickLink('toclist', $this, 'OnToCList'));
     $this->add(new \ZippyERP\ERP\Blocks\Contact('contactdetail', $this, 'OnContactDetail'))->setVisible(false);
     $this->add(new \ZippyERP\ERP\Blocks\ContactView('contactview'))->setVisible(false);
     $this->_cds = new \ZCL\DB\EntityDataSource('\\ZippyERP\\ERP\\Entity\\Contact', '');
     $this->editcontacts->add(new DataView('contactlist', $this->_cds, $this, 'contactlistOnRow'));
     $this->editcontacts->add(new Form('newcontactform'))->setSubmitHandler($this, 'OnNewContactform');
     $this->editcontacts->newcontactform->add(new AutocompleteTextInput('choicecontact'))->setAutocompleteHandler($this, "onAutoCompleteContact");
     $this->editcontacts->newcontactform->add(new ClickLink('addnewcontact'))->setClickHandler($this, 'OnAddNewcontact');
 }
コード例 #8
0
ファイル: groupitemlist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new Panel('groupitemtable'))->setVisible(true);
     $this->groupitemtable->add(new DataView('groupitemlist', new \ZCL\DB\EntityDataSource('\\ZippyERP\\ERP\\Entity\\GroupItem'), $this, 'groupitemlistOnRow'))->Reload();
     $this->groupitemtable->add(new ClickLink('addnew'))->setClickHandler($this, 'addOnClick');
     $this->add(new Form('groupitemdetail'))->setVisible(false);
     $this->groupitemdetail->add(new TextInput('editgroupitemname'));
     $this->groupitemdetail->add(new SubmitButton('save'))->setClickHandler($this, 'saveOnClick');
     $this->groupitemdetail->add(new Button('cancel'))->setClickHandler($this, 'cancelOnClick');
 }
コード例 #9
0
ファイル: warranty.php プロジェクト: Niqpue/zippyerp
 public function __construct($docid = 0, $basedocid = 0)
 {
     parent::__construct();
     $this->add(new Form('docform'));
     $this->docform->add(new TextInput('document_number'));
     $this->docform->add(new Date('document_date'))->setDate(time());
     $this->docform->add(new TextInput('customer'));
     $this->docform->add(new SubmitLink('addrow'))->setClickHandler($this, 'addrowOnClick');
     $this->docform->add(new SubmitButton('savedoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new SubmitButton('execdoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new Button('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     $this->add(new Form('editdetail'))->setVisible(false);
     $this->editdetail->add(new TextInput('editquantity'))->setText("1");
     $this->editdetail->add(new TextInput('editprice'));
     $this->editdetail->add(new TextInput('editsn'));
     $this->editdetail->add(new TextInput('editwarranty'));
     $this->editdetail->add(new AutocompleteTextInput('edittovar'))->setAutocompleteHandler($this, "OnAutoItem");
     $this->editdetail->add(new Button('cancelrow'))->setClickHandler($this, 'cancelrowOnClick');
     $this->editdetail->add(new SubmitButton('submitrow'))->setClickHandler($this, 'saverowOnClick');
     if ($docid > 0) {
         //загружаем   содержимок  документа настраницу
         $this->_doc = Document::load($docid);
         if ($this->_doc == null) {
             App::RedirectError('Докумен не найден');
         }
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->customer->setText($this->_doc->headerdata['customer']);
         $this->docform->document_date->setDate($this->_doc->document_date);
         foreach ($this->_doc->detaildata as $item) {
             $item = new Item($item);
             $this->_tovarlist[$item->item_id] = $item;
         }
     } else {
         $this->_doc = Document::create('Warranty');
         $this->docform->document_number->setText($this->_doc->nextNumber());
         if ($basedocid > 0) {
             //создание на  основании
             $basedoc = Document::load($basedocid);
             if ($basedoc instanceof Document) {
                 $this->_basedocid = $basedocid;
                 if ($basedoc->meta_name == 'RetailIssue' || $basedoc->meta_name == 'GoodsIssue') {
                     $this->docform->customer->setText($basedoc->headerdata['customername']);
                     foreach ($basedoc->detaildata as $item) {
                         $item = new Item($item);
                         $this->_tovarlist[$item->item_id] = $item;
                     }
                 }
             }
         }
     }
     $this->docform->add(new DataView('detail', new \Zippy\Html\DataList\ArrayDataSource(new \Zippy\Binding\PropertyBinding($this, '_tovarlist')), $this, 'detailOnRow'))->Reload();
 }
コード例 #10
0
ファイル: obsaldo.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->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'));
 }
コード例 #11
0
 public function __construct()
 {
     parent::__construct();
     $this->add(new Panel('alistpanel'));
     $this->_empds = new APDataSource();
     $this->alistpanel->add(new DataView('alist', $this->_empds, $this, 'alistOnRow'))->Reload();
     $this->add(new Panel('doclist'))->setVisible(false);
     $this->doclist->add(new ClickLink('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     $this->doclist->add(new DataView('dlist', new \Zippy\Html\DataList\ArrayDataSource($this, "_dlist"), $this, 'dlistOnRow'));
     $this->doclist->dlist->setSelectedClass('success');
     $this->doclist->add(new Label("empname1"));
     $this->add(new \ZippyERP\ERP\Blocks\DocView('docview'))->setVisible(false);
 }
コード例 #12
0
ファイル: projectlist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->_projectds = new EDS('\\ZippyERP\\ERP\\Entity\\Project');
     $this->_taskds = new EDS('\\ZippyERP\\ERP\\Entity\\Task');
     $this->add(new Panel('listtab'));
     $this->listtab->add(new ClickLink('addnew'))->setClickHandler($this, 'addnewOnClick');
     $this->listtab->add(new DataView('projectlist', $this->_projectds, $this, 'projectlistOnRow'))->Reload();
     $this->add(new Panel('edittab'))->setVisible(false);
     $editform = $this->edittab->add(new Form('editform'));
     $editform->add(new TextInput('editprojectname'));
     $editform->add(new Date('editstartdate', time()));
     $editform->add(new Date('editenddate', time()));
     $editform->add(new TextArea('editdesc'));
     $editform->add(new AutocompleteTextInput('editbase'))->setAutocompleteHandler($this, 'editbaseOnAutocomplete');
     $editform->add(new SubmitButton('save'))->setClickHandler($this, 'saveOnClick');
     $editform->add(new Button('cancel'))->setClickHandler($this, 'cancelOnClick');
     $this->add(new Panel('contenttab'))->setVisible(false);
     $this->contenttab->add(new DataView('dw_msglist', new ArrayDataSource(new Prop($this, '_msglist')), $this, 'dw_msglistOnRow'));
     $this->contenttab->add(new Form('addmsgform'))->setSubmitHandler($this, 'OnMsgSubmit');
     $this->contenttab->addmsgform->add(new TextArea('addmsg'));
     $this->contenttab->add(new DataView('dw_files', new ArrayDataSource(new Prop($this, '_fileslist')), $this, 'dw_filesOnRow'));
     $this->contenttab->add(new Form('addfileform'))->setSubmitHandler($this, 'OnFileSubmit');
     $this->contenttab->addfileform->add(new File('addfile'));
     $this->contenttab->addfileform->add(new TextInput('adddescfile'));
     $this->contenttab->add(new Label('showname'));
     $this->contenttab->add(new Label('showdesc'));
     $this->contenttab->add(new ClickLink('tolist'))->setClickHandler($this, 'cancelOnClick');
     //задачи
     $this->add(new Panel('taskstab'))->setVisible(false);
     $this->taskstab->add(new Panel('tasklisttab'));
     $this->taskstab->add(new ClickLink('tolist2'))->setClickHandler($this, 'cancelOnClick');
     $this->taskstab->add(new Label('showname2'));
     $this->taskstab->tasklisttab->add(new ClickLink('taskaddnew'))->setClickHandler($this, 'addnewtaskOnClick');
     $this->taskstab->tasklisttab->add(new ClickLink('togantt'))->setClickHandler($this, 'toogleGantt');
     $this->taskstab->tasklisttab->add(new DataView('tasklist', $this->_taskds, $this, 'tasklistOnRow'));
     $this->add(new Panel('edittasktab'))->setVisible(false);
     $edittaskform = $this->edittasktab->add(new Form('edittaskform'));
     $edittaskform->add(new TextInput('edittaskname'));
     $edittaskform->add(new TextInput('edittaskhours'));
     $edittaskform->add(new Date('edittaskstartdate'));
     $edittaskform->add(new TextArea('edittaskdesc'));
     $edittaskform->add(new DropDownChoice('edittaskstatus', Task::getStatusList(), 0));
     $edittaskform->add(new DropDownChoice('edittaskspriority', Task::getPriorityList(), 3));
     $edittaskform->add(new DropDownChoice('editassignedto', Task::getAssignedList(), 0));
     $edittaskform->add(new SubmitButton('tasksave'))->setClickHandler($this, 'tasksaveOnClick');
     $edittaskform->add(new Button('taskcancel'))->setClickHandler($this, 'taskcancelOnClick');
     $this->taskstab->add(new Panel('ganttab'))->setVisible(false);
     $this->taskstab->ganttab->add(new ClickLink('fromgantt'))->setClickHandler($this, 'toogleGantt');
     $this->taskstab->ganttab->add(new \ZCL\Gantt\Gantt('gantt'))->setAjaxEvent($this, 'OnGantt');
 }
コード例 #13
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'));
 }
コード例 #14
0
ファイル: itemlist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new Form('filter'))->setSubmitHandler($this, 'OnSubmit');
     $this->filter->add(new TextInput('searchkey'));
     $this->filter->add(new DropDownChoice('group', GroupItem::getList()));
     $this->add(new Panel('itemtable'))->setVisible(true);
     $this->itemtable->add(new DataView('itemlist', new ItemDataSource($this), $this, 'itemlistOnRow'))->Reload();
     $this->itemtable->add(new ClickLink('addnew'))->setClickHandler($this, 'addOnClick');
     $this->itemtable->itemlist->setPageSize(10);
     $this->itemtable->add(new \Zippy\Html\DataList\Paginator('pag', $this->itemtable->itemlist));
     $this->itemtable->itemlist->reload();
     $this->add(new \ZippyERP\ERP\Blocks\Item('itemdetail', $this, 'OnDetail'))->setVisible(false);
 }
コード例 #15
0
ファイル: itemactivity.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('store', Store::findArray("storename", "")));
     $this->filter->add(new AutocompleteTextInput('item'))->setAutocompleteHandler($this, 'OnAutoItem');
     $this->add(new Panel('detail'))->setVisible(false);
     $this->detail->add(new RedirectLink('print', "movereport"));
     $this->detail->add(new RedirectLink('html', "movereport"));
     $this->detail->add(new RedirectLink('word', "movereport"));
     $this->detail->add(new RedirectLink('excel', "movereport"));
     $this->detail->add(new Label('preview'));
 }
コード例 #16
0
ファイル: contactlist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new Form('filter'))->setSubmitHandler($this, "onFilter");
     $this->filter->add(new TextInput('search'));
     $this->add(new Panel('contacttable'))->setVisible(true);
     $this->_ds = new \ZCL\DB\EntityDataSource('\\ZippyERP\\ERP\\Entity\\Contact');
     $this->contacttable->add(new DataView('contactlist', $this->_ds, $this, 'contactlistOnRow'));
     $this->contacttable->contactlist->setPageSize(10);
     $this->contacttable->add(new Paginator('pag', $this->contacttable->contactlist));
     $this->contacttable->contactlist->setSelectedClass('success');
     $this->contacttable->contactlist->Reload();
     $this->contacttable->add(new ClickLink('addnew'))->setClickHandler($this, 'addOnClick');
     $this->add(new \ZippyERP\ERP\Blocks\Contact('contactdetail', $this, 'OnDetail'))->setVisible(false);
     $this->add(new \ZippyERP\ERP\Blocks\ContactView('contactview'))->setVisible(false);
 }
コード例 #17
0
ファイル: transferorder.php プロジェクト: Niqpue/zippyerp
 public function __construct($docid = 0, $basedocid = 0)
 {
     parent::__construct();
     $this->add(new Form('docform'));
     $this->docform->add(new TextInput('document_number'));
     $this->docform->add(new Date('document_date', time()));
     $this->docform->add(new DropDownChoice('bankaccount', \ZippyERP\ERP\Entity\MoneyFund::findArray('title', "ftype=1")));
     $this->docform->add(new CheckBox('tax'));
     $this->docform->add(new AutocompleteTextInput('customer'))->setAutocompleteHandler($this, "OnAutoContragent");
     $this->docform->add(new TextInput('amount'));
     $this->docform->add(new TextInput('nds'));
     $this->docform->add(new AutocompleteTextInput('basedoc'))->setAutocompleteHandler($this, 'OnAutocomplete');
     $this->docform->add(new TextArea('notes'));
     $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->_doc = Document::load($docid);
         if ($this->_doc == null) {
             App::RedirectError('Докумен не найден');
         }
         $this->docform->amount->setText($this->_doc->amount / 100);
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->document_date->setDate($this->_doc->document_date);
         $this->docform->nds->setText($this->_doc->headerdata['nds'] / 100);
         $this->docform->notes->setText($this->_doc->headerdata['notes']);
         $this->docform->bankaccount->setValue($this->_doc->headerdata['bankaccount']);
         $this->docform->tax->setValue($this->_doc->headerdata['tax']);
         $this->docform->basedoc->setKey($this->_doc->headerdata['basedoc']);
         $this->docform->basedoc->setText($this->_doc->headerdata['basedocname']);
         $this->docform->customer->setKey($this->_doc->headerdata['customer']);
         $this->docform->customer->setText($this->_doc->headerdata['customername']);
     } else {
         $this->_doc = Document::create('TransferOrder');
         $this->docform->document_number->setText($this->_doc->nextNumber());
         if ($basedocid > 0) {
             //создание на  основании
             $basedoc = Document::load($basedocid);
             if ($basedoc instanceof Document) {
                 $this->_basedocid = $basedocid;
             }
         }
     }
 }
コード例 #18
0
ファイル: employeelist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new Panel('employeetable'))->setVisible(true);
     $this->employeetable->add(new DataView('employeelist', new EDS('\\ZippyERP\\ERP\\Entity\\employee'), $this, 'employeelistOnRow'))->Reload();
     $this->employeetable->add(new ClickLink('addnew'))->setClickHandler($this, 'addOnClick');
     $this->add(new Form('employeedetail'))->setVisible(false);
     $this->employeedetail->add(new AutocompleteTextInput('editcontact'))->setAutocompleteHandler($this, "onContact");
     $this->employeedetail->add(new SubmitButton('save'))->setClickHandler($this, 'saveOnClick');
     $this->employeedetail->add(new Button('cancel'))->setClickHandler($this, 'cancelOnClick');
     $this->employeedetail->add(new DropDownChoice('editdepartment', Department::findArray('department_name', '', 'department_name')));
     $this->employeedetail->add(new DropDownChoice('editposition', Position::findArray('position_name', '', 'position_name')));
     $this->employeedetail->add(new TextInput('editlogin'));
     $this->employeedetail->add(new ClickLink('opencontact'))->setClickHandler($this, 'OpenOnClick');
     $this->employeedetail->add(new ClickLink('showcontact'))->setClickHandler($this, 'ShowOnClick');
     $this->employeedetail->add(new ClickLink('addcontact'))->setClickHandler($this, 'AddContactOnClick');
     $this->add(new \ZippyERP\ERP\Blocks\Contact('contactdetail', $this, 'OnDetail'))->setVisible(false);
     $this->add(new \ZippyERP\ERP\Blocks\ContactView('contactview'))->setVisible(false);
 }
コード例 #19
0
ファイル: storelist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $storepanel = $this->add(new Panel('storetable'));
     $storepanel->add(new DataView('storelist', new \ZCL\DB\EntityDataSource('\\ZippyERP\\ERP\\Entity\\Store'), $this, 'storelistOnRow'));
     $storepanel->add(new ClickLink('storeadd'))->setClickHandler($this, 'storeaddOnClick');
     $this->add(new Form('storeform'))->setVisible(false);
     $this->storeform->add(new TextInput('storeeditname'));
     $this->storeform->add(new TextArea('storeeditdesc'));
     $this->storeform->add(new DropDownChoice('storeedittype'));
     $this->storeform->add(new SubmitButton('storesave'))->setClickHandler($this, 'storesaveOnClick');
     $this->storeform->add(new Button('storecancel'))->setClickHandler($this, 'storecancelOnClick');
     $itempanel = $this->add(new Panel('itemtable'));
     $itempanel->setVisible(false);
     $itempanel->add(new DataView('itemlist', new StockDataSource($this), $this, 'itemlistOnRow'));
     $itempanel->itemlist->setPageSize(10);
     $itempanel->add(new Paginator('pag', $itempanel->itemlist));
     $storepanel->storelist->Reload();
 }
コード例 #20
0
ファイル: bankstatement.php プロジェクト: Niqpue/zippyerp
 public function __construct($docid = 0)
 {
     parent::__construct();
     $this->add(new Form('docform'));
     $this->docform->add(new Date('document_date', time()));
     $this->docform->add(new TextInput('document_number'));
     $this->docform->add(new DropDownChoice('bankaccount', \ZippyERP\ERP\Entity\MoneyFund::findArray('title', "ftype=1")));
     $this->docform->add(new SubmitLink('addrow'))->setClickHandler($this, 'addrowOnClick');
     $this->docform->add(new SubmitButton('savedoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new SubmitButton('execdoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new Button('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     $this->add(new Form('editdetail'))->setVisible(false);
     $this->editdetail->add(new DropDownChoice('editoptype', BS::getTypes()))->setChangeHandler($this, 'typeOnClick');
     $this->editdetail->add(new AutocompleteTextInput('editcustomer'))->setAutocompleteHandler($this, "OnAutoContragent");
     $this->editdetail->add(new DropDownChoice('editpayment'))->setOptionList(\ZippyERP\ERP\Consts::getTaxesList());
     $this->editdetail->editpayment->setVisible(false);
     $docinput = $this->editdetail->add(new AutocompleteTextInput('editdoc'));
     $docinput->setAutocompleteHandler($this, 'OnDocAutocomplete');
     $docinput->setAjaxChangeHandler($this, 'OnDocChange');
     $this->editdetail->add(new TextInput('editamount'))->setText("1");
     $this->editdetail->add(new TextInput('editnds'))->setText("0");
     $this->editdetail->add(new TextInput('editcomment'));
     $this->editdetail->add(new CheckBox('editnoentry'));
     $this->editdetail->add(new Button('cancelrow'))->setClickHandler($this, 'cancelrowOnClick');
     $this->editdetail->add(new SubmitButton('submitrow'))->setClickHandler($this, 'saverowOnClick');
     if ($docid > 0) {
         //загружаем   содержимок  документа на страницу
         $this->_doc = Document::load($docid);
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->bankaccount->setValue($this->_doc->headerdata['bankaccount']);
         $this->docform->document_date->setText(date('Y-m-d', $this->_doc->document_date));
         foreach ($this->_doc->detaildata as $item) {
             $entry = new Entry($item);
             $this->_list[$entry->entry_id] = $entry;
         }
         $this->docform->document_date->setText(date('Y-m-d', $this->_doc->document_date));
     } else {
         $this->_doc = Document::create('BankStatement');
     }
     $this->docform->add(new DataView('detail', new \Zippy\Html\DataList\ArrayDataSource(new \Zippy\Binding\PropertyBinding($this, '_list')), $this, 'detailOnRow'));
     $this->docform->detail->Reload();
 }
コード例 #21
0
ファイル: custpayments.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new Panel('clistpanel'));
     $this->clistpanel->add(new Form('clistfilter'))->setSubmitHandler($this, 'clistfilterOnSubmit');
     $this->clistpanel->clistfilter->add(new DropDownChoice('clistsort'));
     $this->clistpanel->clistfilter->add(new CheckBox('clistshowall'));
     $this->_custds = new CPDataSource();
     $this->clistpanel->add(new DataView('clist', $this->_custds, $this, 'clistOnRow'))->Reload();
     $this->add(new Panel('doclist'))->setVisible(false);
     $this->doclist->add(new ClickLink('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     $this->doclist->add(new DataView('dlist', new \Zippy\Html\DataList\ArrayDataSource($this, "_dlist"), $this, 'dlistOnRow'));
     $this->doclist->dlist->setSelectedClass('success');
     $this->doclist->add(new Label("custname1"));
     $this->add(new Panel('invoicelist'))->setVisible(false);
     $this->invoicelist->add(new ClickLink('backtolist2'))->setClickHandler($this, 'backtolistOnClick');
     $this->invoicelist->add(new DataView('ilist', new \Zippy\Html\DataList\ArrayDataSource($this, "_ilist"), $this, 'ilistOnRow'));
     $this->invoicelist->add(new Label("custname2"));
     $this->add(new \ZippyERP\ERP\Blocks\DocView('docview'))->setVisible(false);
 }
コード例 #22
0
ファイル: taxinvoicelist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $filter = Filter::getFilter("taxinvoicelist");
     if ($filter->to == null) {
         $filter->to = time();
         $filter->from = time() - 7 * 24 * 3600;
     }
     $this->add(new Form('filter'))->setSubmitHandler($this, 'filterOnSubmit');
     $this->filter->add(new Date('from', $filter->from));
     $this->filter->add(new Date('to', $filter->to));
     $this->filter->add(new CheckBox('notchecked'))->setChecked($filter->notchecked == true);
     if (strlen($filter->docgroup) > 0) {
         $this->filter->docgroup->setValue($filter->docgroup);
     }
     $doclist = $this->add(new DataView('doclist', new TaxListDataSource(), $this, 'doclistOnRow'));
     $doclist->setSelectedClass('success');
     $doclist->Reload();
     $this->add(new \ZippyERP\ERP\Blocks\DocView('docview'))->setVisible(false);
 }
コード例 #23
0
ファイル: finresult.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 Date('created'))->setDate(time());
     $this->docform->add(new SubmitButton('execdoc'))->setClickHandler($this, 'savedocOnClick');
     $this->docform->add(new Button('backtolist'))->setClickHandler($this, 'backtolistOnClick');
     if ($docid > 0) {
         //загружаем   содержимок  документа настраницу
         $this->_doc = Document::load($docid);
         if ($this->_doc == null) {
             App::RedirectError('Докумен не найден');
         }
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->created->setDate($this->_doc->document_date);
     } else {
         $this->_doc = Document::create('FinResult');
         $this->docform->document_number->setText($this->_doc->nextNumber());
     }
 }
コード例 #24
0
ファイル: cashreceiptin.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 Date('document_date', time()));
     $this->docform->add(new DropDownChoice('optype', CRIN::getTypes(), 1))->setChangeHandler($this, 'optypeOnChange');
     $this->docform->add(new Label('lblopdetail'));
     $this->docform->add(new AutocompleteTextInput('opdetail'))->setAutocompleteHandler($this, 'opdetailOnAutocomplete');
     $this->docform->add(new TextInput('amount'));
     $this->docform->add(new TextInput('nds'));
     $this->docform->add(new AutocompleteTextInput('basedoc'))->setAutocompleteHandler($this, 'basedocOnAutocomplete');
     $this->docform->add(new TextArea('notes'));
     $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');
     $this->optypeOnChange(null);
     if ($docid > 0) {
         //загружаем   содержимое  документа на страницу
         $this->_doc = Document::load($docid);
         $this->docform->document_number->setText($this->_doc->document_number);
         $this->docform->document_date->setDate($this->_doc->document_date);
         $this->docform->amount->setText($this->_doc->amount / 100);
         $this->docform->optype->setValue($this->_doc->headerdata['optype']);
         $this->optypeOnChange(null);
         $this->docform->opdetail->setKey($this->_doc->headerdata['opdetail']);
         $this->docform->opdetail->setText($this->_doc->headerdata['opdetailname']);
         $this->docform->nds->setText($this->_doc->headerdata['nds'] / 100);
         $this->docform->notes->setText($this->_doc->headerdata['notes']);
         $basedocid = $this->_doc->headerdata['basedoc'];
         if ($basedocid > 0) {
             $base = Document::load($basedocid);
             $this->docform->basedoc->setKey($basedocid);
             $this->docform->basedoc->setValue($base->document_number);
         }
     } else {
         $this->_doc = Document::create('CashReceiptIn');
     }
 }
コード例 #25
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();
 }
コード例 #26
0
ファイル: main.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
 }
コード例 #27
0
ファイル: customerorder.php プロジェクト: Niqpue/zippyerp
 public function beforeRender()
 {
     parent::beforeRender();
     $this->calcTotal();
 }
コード例 #28
0
ファイル: taxinvoice.php プロジェクト: Niqpue/zippyerp
 public function beforeRender()
 {
     parent::beforeRender();
     $this->calcTotal();
     App::$app->getResponse()->addJavaScript("var _nds = " . H::nds() . ";var nds_ = " . H::nds(true) . ";");
 }
コード例 #29
0
ファイル: invoice.php プロジェクト: Niqpue/zippyerp
 public function beforeRender()
 {
     parent::beforeRender();
     $this->docform->totalnds->setVisible($this->docform->isnds->isChecked());
     $this->calcTotal();
     if ($this->docform->isnds->isChecked()) {
         App::$app->getResponse()->addJavaScript("var _nds = " . H::nds() . ";var nds_ = " . H::nds(true) . ";");
     } else {
         App::$app->getResponse()->addJavaScript("var _nds = 0;var nds_ = 0;");
     }
 }
コード例 #30
0
ファイル: accountlist.php プロジェクト: Niqpue/zippyerp
 public function __construct()
 {
     parent::__construct();
     $this->add(new DataView('list', new ArrayDataSource(Account::find("", "cast(acc_code as char)")), $this, 'listOnRow'))->Reload();
 }