Exemplo n.º 1
0
 public function generateReport()
 {
     $employee = \ZippyERP\ERP\Entity\Employee::load($this->headerdata["employee"]);
     $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']));
     }
     $elist = self::expenceList();
     $header = array('date' => date('d.m.Y', $this->document_date), "employee" => $employee->shortname, "expenseamount" => H::fm($this->headerdata["expenseamount"]), "expensetype" => $elist[$this->headerdata["expensetype"]], "employee" => $employee->shortname, "document_number" => $this->document_number, "totalnds" => H::fm($this->headerdata["totalnds"]), "total" => H::fm($this->headerdata["total"]));
     $report = new \ZippyERP\ERP\Report('expensereport.tpl');
     $html = $report->generate($header, $detail);
     return $html;
 }
Exemplo n.º 2
0
 public function addempbtnOnClick($sender)
 {
     $id = $this->docform->e_emplist->getKey();
     $emp = Employee::load($id);
     $emp->op = $this->docform->e_empop->getValue();
     if ($emp->op == 0) {
         $this->setError('Не выбран  счет');
         return;
     }
     if (isset($this->_emparr[$id])) {
         $this->setError('Дублирование строки');
         return;
     }
     $emp->val = 100 * $this->docform->e_empamount->getText();
     $this->_emparr[$id] = $emp;
     $this->docform->emptable->Reload();
     $this->docform->e_empamount->setText('');
 }
Exemplo n.º 3
0
 public function getItem($id)
 {
     return Employee::load($id);
 }