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 generateReport() { $myfirm = \ZippyERP\System\System::getOptions("firmdetail"); $myaccount = \ZippyERP\ERP\Entity\MoneyFund::load($this->headerdata['bankaccount']); $mybank = \ZippyERP\ERP\Entity\Bank::load($myaccount->bank); $customer = \ZippyERP\ERP\Entity\Customer::load($this->headerdata['customer']); $cbank = \ZippyERP\ERP\Entity\Bank::load($customer->bank); $header = array('date' => date('d.m.Y', $this->document_date), 'myname' => $myfirm['name'], 'mycode' => $myfirm['code'], 'mybankaccount' => $myaccount->bankaccount, 'mybank' => $mybank->bank_name, 'mybankcode' => $mybank->mfo, 'cname' => $customer->customer_name, 'ccode' => $customer->code, 'cbankaccount' => $customer->bankaccount, 'cbank' => $cbank->bank_name, 'cbankcode' => $cbank->mfo, "document_number" => $this->document_number, "document_date" => date('Y.m.d', $this->document_date), "notes" => $this->headerdata['notes'], "amount" => H::fm($this->amount), "amountstr" => \ZippyERP\ERP\Util::ucfirst(\ZippyERP\ERP\Util::money2str($this->amount / 100))); $report = new \ZippyERP\ERP\Report('transferorder.tpl'); $html = $report->generate($header, array()); return $html; }
public function generateReport() { $i = 1; $detail = array(); foreach ($this->detaildata as $value) { $detail[] = array("no" => $i++, "itemname" => $value['itemname'], "measure" => $value['measure_name'], "quantity" => $value['quantity'] / 1000, "price" => H::fm($value['price']), "pricends" => H::fm($value['pricends']), "amount" => H::fm($value['amount'])); } $bank = \ZippyERP\ERP\Entity\Bank::load($f->bank); //$customer = \ZippyERP\ERP\Entity\Customer::load($this->headerdata["customer"]); $header = array('date' => date('d.m.Y', $this->document_date), "account" => $f->bankaccount, "bank" => $bank->bank_name, "mfo" => $bank->mfo, "address" => $firm['city'] . ', ' . $firm['street'], "customername" => $this->headerdata["customername"], "document_number" => $this->document_number, "base" => $this->base, "paydate" => date('d.m.Y', $this->headerdata["payment_date"]), "totalnds" => H::fm($this->headerdata["totalnds"]), "total" => H::fm($this->headerdata["total"])); $report = new \ZippyERP\ERP\Report('purchaseinvoice.tpl'); $html = $report->generate($header, $detail); return $html; }
public function generateReport() { $i = 1; $detail = array(); $total = 0; foreach ($this->detaildata as $value) { $detail[] = array("no" => $i++, "tovar_name" => $value['itemname'], "measure" => $value['measure_name'], "quantity" => $value['quantity'] / 1000, "price" => H::fm($value['price']), "amount" => H::fm($value['quantity'] / 1000 * $value['price'])); $total += $value['quantity'] / 1000 * $value['price']; } $firm = \ZippyERP\System\System::getOptions("firmdetail"); $f = \ZippyERP\ERP\Entity\MoneyFund::findOne('ftype = 1'); $bank = \ZippyERP\ERP\Entity\Bank::load($f->bank); // $customer = \ZippyERP\ERP\Entity\Customer::load($this->headerdata["customer"]); $header = array('date' => date('d.m.Y', $this->document_date), "firmname" => $firm['name'], "firmcode" => $firm['code'], "account" => $f->bankaccount, "bank" => $bank->bank_name, "mfo" => $bank->mfo, "address" => $firm['city'] . ', ' . $firm['street'], "customername" => $this->headerdata["customername"], "document_number" => $this->document_number, "base" => $this->base, "paydate" => date('d.m.Y', $this->headerdata["payment_date"]), "total" => H::fm($total), "totalnds" => H::fm($total + $this->headerdata["totalnds"]), "summa" => Util::ucfirst(Util::money2str($total + $this->headerdata["nds"] / 100, '.', ''))); $report = new \ZippyERP\ERP\Report('invoice.tpl'); $html = $report->generate($header, $detail); return $html; }
public function deleteOnClick($sender) { Bank::delete($sender->owner->getDataItem()->bank_id); $this->banktable->banklist->Reload(); }
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']); }