public function complete() { if ($this->canceled || $this->complete) { return false; } $this->complete = 1; $block = \Money\Wallet\Block::get('Money\\Transfer:' . $this->id, 'data'); if ($block) { $block->delete(); } $wallets = \App::$cur->money->getUserWallets($this->to_user_id); $text = 'Перевод средств от ' . $this->user->name() . '.' . ($this->comment ? ' Комментарий:' . $this->comment : ''); $wallets[$this->currency_id]->diff($this->amount, $text); \App::$cur->users->AddUserActivity($this->to_user_id, 4, $text . '<br />' . (double) $this->amount . ' ' . $wallets[$this->currency_id]->currency->acronym()); $this->save(); return true; }