Beispiel #1
0
 protected function afterLoad()
 {
     //распаковываем  данные из detail
     $xml = simplexml_load_string($this->detail);
     $this->mfo = (string) $xml->mfo[0];
     parent::afterLoad();
 }
Beispiel #2
0
 protected function afterLoad()
 {
     if (strlen($this->detail) > 0) {
         //распаковываем  данные из detail
         $xml = simplexml_load_string($this->detail);
         $this->url = (string) $xml->url[0];
         $this->address = (string) $xml->address[0];
         $this->phone = (string) $xml->phone[0];
     }
     parent::afterLoad();
 }
Beispiel #3
0
 protected function afterLoad()
 {
     //распаковываем  данные из detail
     $xml = simplexml_load_string($this->detail);
     $this->code = (string) $xml->code[0];
     $this->inn = (string) $xml->inn[0];
     $this->city = (string) $xml->city[0];
     $this->street = (string) $xml->street[0];
     $this->bank = (string) $xml->bankaccount1->bank[0];
     $this->bankaccount = (string) $xml->bankaccount1->account[0];
     parent::afterLoad();
 }
Beispiel #4
0
 protected function beforeSave()
 {
     parent::beforeSave();
     //упаковываем  данные в detail
     $this->detail = "<detail><priceopt>{$this->priceopt}</priceopt>";
     $this->detail .= "<priceret>{$this->priceret}</priceret>";
     $this->detail .= "<code>{$this->code}</code>";
     $this->detail .= "<uktzed>{$this->uktzed}</uktzed>";
     $this->detail .= "<barcode>{$this->barcode}</barcode>";
     $this->detail .= "<description>{$this->description}</description>";
     $this->detail .= "</detail>";
     return true;
 }
Beispiel #5
0
 /**
  *
  *
  * @param mixed $document    Ссылка  на  документ
  * @param mixed $account_id  Синтетический  счет
  * @param mixed $amount      Сумма. Отрицательная если  счет  идет по  кредиту
  */
 public function __construct($document, $account_id, $amount)
 {
     parent::__construct();
     if ($document instanceof \ZippyERP\ERP\Entity\Doc\Document) {
         $this->document_id = $document->document_id;
         $this->document_date = $document->document_date;
     } else {
         throw new \ZippyERP\System\Exception("Не задан документ для субконто");
     }
     if ($account_id > 0) {
         $this->account_id = $account_id;
     } else {
         throw new \ZippyERP\System\Exception("Не задан счет для субконто");
     }
     if ($account_id > 0) {
         $this->amount = $amount;
     } else {
         throw new \ZippyERP\System\Exception("Не задана ссумма для субконто");
     }
 }
Beispiel #6
0
 /**
  * Возвращает  пользователя   по  хешу
  * 
  * @param mixed $md5hash
  */
 public static function getByHash($md5hash)
 {
     $conn = \ZCL\DB\DB::getConnect();
     $arr = User::find('md5hash=' . Entity::qstr($md5hash));
     if (count($arr) == 0) {
         return null;
     }
     $arr = array_values($arr);
     return $arr[0];
 }