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'); }
public function __construct() { parent::__construct(); $this->add(new Form('detail')); $this->detail->add(new TextInput('name')); $this->detail->add(new TextInput('edrpou')); $this->detail->add(new TextInput('koatuu')); $this->detail->add(new TextInput('kopfg')); $this->detail->add(new TextInput('kodu')); $this->detail->add(new TextInput('kved')); $this->detail->add(new TextInput('gni')); $this->detail->add(new TextInput('inn')); $this->detail->add(new TextInput('city')); $this->detail->add(new TextInput('street')); $this->detail->add(new TextInput('phone')); $this->detail->add(new TextInput('manager')); $this->detail->add(new TextInput('accounter')); $this->detail->add(new TextInput('email')); $this->detail->add(new DropDownChoice('bank', \ZippyERP\ERP\Entity\Bank::findArray('bank_name', '', 'bank_name'))); $this->detail->add(new TextInput('bankaccount')); $this->detail->add(new SubmitButton('detailsave'))->setClickHandler($this, 'saveDetailOnClick'); $this->add(new Form('common')); $this->common->add(new Date('closeddate')); $this->common->add(new TextInput('nds')); $this->common->add(new CheckBox('hasnds')); $this->common->add(new CheckBox('simpletax')); $this->common->add(new CheckBox('juridical')); $this->common->add(new SubmitButton('commonsave'))->setClickHandler($this, 'saveCommonOnClick'); $detail = \ZippyERP\System\System::getOptions("firmdetail"); if (!is_array($detail)) { $detail = array(); } $this->detail->name->setText($detail['name']); $this->detail->edrpou->setText($detail['edrpou']); $this->detail->koatuu->setText($detail['koatuu']); $this->detail->kopfg->setText($detail['kopfg']); $this->detail->kodu->setText($detail['kodu']); $this->detail->kved->setText($detail['kved']); $this->detail->gni->setText($detail['gni']); $this->detail->inn->setText($detail['inn']); $this->detail->city->setText($detail['city']); $this->detail->street->setText($detail['street']); $this->detail->manager->setText($detail['manager']); $this->detail->accounter->setText($detail['accounter']); $this->detail->phone->setText($detail['phone']); $this->detail->email->setText($detail['email']); $f = \ZippyERP\ERP\Entity\MoneyFund::findOne('ftype = 1'); if ($f != null) { $this->detail->bank->setValue($f->bank); $this->detail->bankaccount->setText($f->bankaccount); } $common = \ZippyERP\System\System::getOptions("common"); if (!is_array($common)) { $common = array(); } $this->common->closeddate->setDate($common['closeddate']); $this->common->nds->setText($common['nds']); $this->common->hasnds->setChecked($common['hasnds']); $this->common->simpletax->setChecked($common['simpletax']); $this->common->juridical->setChecked($common['juridical']); }