Example #1
0
 /**
  * Зачислить деньги после списания с резерва (или арбитража) (СБР).
  *
  * @param integer $fid				uid кому зачисляем
  * @param float   $sum				сумма
  * @param integer $money_type		тип денег
  * @param string $descr комменты к операции
  * @param string  $errors			возвращает массив ошибок
  * @param integer $op_code			код операции
  * @param string $comments комменты к операции для юзера.
  *
  * @return integer					id операции в account_operations
  */
 public function TransferReserved($fid, $sum, $money_type, $descr, &$errors, $op_code = 38, $comments = NULL)
 {
     global $DB;
     $user_account = new self();
     $user_account->GetInfo($fid);
     //Если в ФМ, то надо пополнять сразу
     $ammount = $money_type == 0 ? $sum : 0;
     $frl_accept_id = $DB->insert('account_operations', array('billing_id' => $user_account->id, 'op_code' => $op_code, 'ammount' => $ammount, 'descr' => $descr, 'comments' => $comments ? $comments : NULL, 'payment_sys' => $money_type, 'trs_sum' => $sum), 'id');
     // количество операций
     $_SESSION['account_operations'] = intval($_SESSION['account_operations']) + 1;
     return $frl_accept_id;
 }