/**
  * Переопределяем события после изменения статуса
  * резерва оплаты для заказов ТУ
  * 
  * @param type $new_status
  */
 public function afterChangeStatus($new_status)
 {
     $success = false;
     $time = time();
     switch ($new_status) {
         case self::STATUS_CANCEL:
             //Отмена заказа заказчиком то отменяем заказ если была попытка зарезервировать
             if ($_SESSION['uid'] == $this->reserve_data['emp_id']) {
                 require_once ABS_PATH . "/classes/billing.php";
                 $billing = new billing($this->reserve_data['emp_id']);
                 $billing->cancelReserveByOrder('reserves', $this->reserve_data['id']);
             }
             $success = true;
             break;
         case self::STATUS_ERR:
             $this->getOrderHistory()->reservePriceErr();
             break;
         case self::STATUS_RESERVE:
             //После успешного резервирования средств
             //переводим заказ в статус начала работы
             $src_id = @$this->reserve_data['src_id'];
             $success = $this->db()->update($this->TABLE_TSERVICE_ORDER, array('status' => TServiceOrderModel::STATUS_ACCEPT, 'accept_date' => date('Y-m-d H:i:s', $time)), 'id = ?i', $src_id);
             if ($success) {
                 $orderModel = TServiceOrderModel::model();
                 $order = $orderModel->getShortCard($src_id);
                 if ($order) {
                     //@todo: можно передать просто $this ?
                     $reserveInstance = ReservesModelFactory::getInstance(ReservesModelFactory::TYPE_TSERVICE_ORDER);
                     if ($reserveInstance) {
                         $reserveInstance->setSrcObject($orderModel);
                         $reserveInstance->setReserveData($this->reserve_data);
                         $order['reserve'] = $reserveInstance;
                     }
                     $this->getOrderHistory()->reservePriceSuccess($this->reserve_data['price']);
                     $order['reserve_data'] = $this->reserve_data;
                     $reservesSmail = new ReservesSmail();
                     $reservesSmail->attributes(array('order' => $order));
                     $reservesSmail->onReserveOrder();
                     //Генерируем документы
                     require_once ABS_PATH . '/classes/DocGen/DocGenReserves.php';
                     $doc = new DocGenReserves($order);
                     $doc->generateSpecification();
                 }
             }
             break;
         case self::STATUS_PAYED:
         case self::STATUS_ARBITRAGE:
             //@todo: генерируем документ когда резерв закрыт после всех выплат
             $src_id = @$this->reserve_data['src_id'];
             $orderModel = TServiceOrderModel::model();
             $order = $orderModel->getShortCard($src_id);
             if ($order) {
                 $this->getOrderHistory();
                 require_once ABS_PATH . '/classes/DocGen/DocGenReserves.php';
                 $order['reserve_data'] = $this->reserve_data;
                 $order['reserve'] = $this;
                 $doc = new DocGenReserves($order);
                 $doc->generateActServiceEmp();
                 $doc->generateAgentReport();
             }
         default:
             $success = true;
     }
     return $success;
 }