public function cuentaTransferencias($id)
 {
     $cuenta = UsersBanco::find($id);
     $transferencias = $cuenta->UserBancoTransferencia;
     $banco = Bancos::find($cuenta->banco_id);
     $data = array('transferencias' => $transferencias, 'user' => $cuenta->usuario, 'banco' => $banco);
     return View::make('Backend/cuentas.transferencias', $data);
 }
 public function getTransferenciaBanco($id)
 {
     $trans = UserBancoTransferencia::find($id);
     $cuenta = UsersBanco::find($trans->userbanco_id);
     $banco = Bancos::find($cuenta->banco_id);
     $usuario = User::find($cuenta->user_id);
     $data = array('detalles' => $trans, 'user' => $usuario, 'cuenta' => $cuenta, 'banco' => $banco);
     return View::make('Backend/usuarios/historial/detalle_transferencia_banco', $data);
 }
Exemplo n.º 3
0
 /**
  * Valida una cuenta corriente.
  * Devuelve el digito de control si es correcta
  * En caso contrario devuelve un mensaje de error
  * 
  * @param string $b El código del banco
  * @param string $o El código de la oficina
  * @param string $c La cuenta corriente
  * @return string EL dígito de control calculado o error
  */
 public function ValidaCC($b, $o, $c)
 {
     //Validar Banco
     $banco = new Bancos();
     $rows = $banco->cargaCondicion("IDBanco", "CodigoBanco='{$b}'");
     unset($banco);
     if (${$rows}[0]['IDBanco'] == '') {
         $this->_errores[] = "El banco indicado no existe.";
     }
     //Validar Oficina
     $oficina = new BancosOficinas();
     $rows = $oficina->cargaCondicion("ID", "IDBanco='{$b}' and IDOficina='{$o}'");
     unset($oficina);
     if ($rows[0]['ID'] == '') {
         $this->_errores[] = "La Oficina bancaria indicada no existe.";
     }
     if (strlen($c) < 10) {
         $this->_errores[] = "La cuenta corriente debe tener 10 dígitos";
     }
     $dc = $b . $o . $c == '000000000000000000' ? $dc = '00' : ($dc = $this->getDigitoControl($b . $o, $c));
     return $dc;
 }
Exemplo n.º 4
0
 public function getCuentaBancaria($id)
 {
     $cuenta = UsersBanco::find($id);
     $banco = Bancos::find($cuenta->banco_id);
     return Response::json(['success' => true, 'banco' => $banco, 'cuenta' => $cuenta]);
 }
Exemplo n.º 5
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     $parametros = Input::get();
     $reglas = array('id' => 'required|integer');
     $validator = Validator::make($parametros, $reglas);
     if (!$validator->fails()) {
         Bancos::destroy($parametros['id']);
         $res['data'] = Bancos::All();
         $respuesta = json_encode(array('error' => false, 'mensaje' => '', 'respuesta' => $res));
     } else {
         $respuesta = json_encode(array('error' => true, 'mensaje' => 'No hay parametros o estan mal.', 'respuesta' => null));
     }
     $final_response = Response::make($respuesta, 200);
     $final_response->header('Content-Type', "application/json; charset=utf-8");
     return $final_response;
 }
Exemplo n.º 6
0
 public function getPayments($id)
 {
     $numCuentas = NumCuentas::all();
     $bancos = Bancos::all();
     $title = 'Pago de publicación';
     $pub = Publicaciones::find($id);
     return View::make('publications.payments')->with('title', $title)->with('pub_id', $id)->with('numCuentas', $numCuentas)->with('bancos', $bancos)->with('pub', $pub);
 }
 public function modifyAccount($id)
 {
     $title = "Modificar cuenta | pasillo24";
     $bancos = Bancos::get();
     $acc = NumCuentas::find($id);
     return View::make('admin.modifyAccount')->with('title', $title)->with('acc', $acc)->with('bancos', $bancos)->with('id', $id);
 }
 public function agenciaBancariaAction()
 {
     $tblBancos = new Bancos();
     $rsBancos = $tblBancos->buscar();
     $this->view->bancos = $rsBancos;
     $tblUf = new Uf();
     $rsUf = $tblUf->buscar(array(), array("Sigla ASC"));
     $this->view->ufs = $rsUf;
     $tblMecanismo = new Mecanismo();
     $rsMecanismo = $tblMecanismo->buscar(array("Status = ?" => 1), array("Descricao ASC"));
     $this->view->mecanismos = $rsMecanismo;
     $tblArea = new Area();
     $rsArea = $tblArea->buscar(array(), array("Descricao ASC"));
     $this->view->areas = $rsArea;
 }
Exemplo n.º 9
0
 /**
  * Si el cliente tiene recibos pendientes de cobro,
  * no se puede descatalogar
  * 
  * Si se descataloga, se borra de las rutas de venta y de reparto
  */
 public function validaLogico()
 {
     parent::validaLogico();
     if ($this->NombreComercial == "") {
         $this->NombreComercial = $this->RazonSocial;
     }
     if ($this->Vigente == 0) {
         // Si el cliente tiene recibos pendientes de cobro no se puede descatalogar
         $recibosPtes = $this->getPteCobro();
         if ($recibosPtes['Recibos'] > 0) {
             $this->_errores[] = "El cliente tiene {$recibosPtes['Recibos']} recibos pendientes de cobro por importe de {$recibosPtes['Importe']}. No se puede descatalogar";
             $this->Vigente = 1;
         }
         // Al descatalogar se borra de las rutas de venta y de reparto
         // Borrar de las rutas de venta
         $rutaVenta = new RutasVentas();
         $rutaVenta->queryDelete("IDCliente='{$this->IDCliente}'");
         unset($rutaVenta);
         // Borrar de las rutas de reparto
         $condicion = "IDDirec in (select d.IDDirec from ErpClientesDentrega d left join ErpClientes c on d.IDCliente=c.IDCliente where c.IDCliente='{$this->IDCliente}')";
         $rutaReparto = new RutasRepartoDetalle();
         $rutaReparto->queryDelete($condicion);
         unset($rutaReparto);
     }
     // Calcular el dígito de control de la C/C
     $banco = new Bancos();
     $this->setDigito($banco->ValidaCC($this->Banco, $this->Oficina, $this->Cuenta));
     unset($banco);
     // Comprobar unicidad del login para la web
     if ($this->Login != '') {
         $cli = new Clientes();
         $rows = $cli->cargaCondicion("IDCliente", "IDCLiente<>'{$this->IDCliente}' and Login='******'");
         unset($cli);
         if ($rows[0]['IDCliente'] != '') {
             $this->_errores[] = "El login indicado ya está siendo usado por otro cliente.";
         }
     }
 }
Exemplo n.º 10
0
<?php

/* @var $this BancosCuentasController */
/* @var $model BancosCuentas */
/* @var $form CActiveForm */
?>

<div class="form">

<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'bancos-cuentas-form', 'enableAjaxValidation' => true));
?>

<?php 
$elBanco = Bancos::model()->findByPk($_GET['idBanco']);
?>

<div class="row">
	<div class="span2"></div>
	<div class="span8">
		<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $elBanco, 'attributes' => array('nombre')));
?>
	</div>
	<div class="span2"></div>
</div>

	<p class="note">Campos con <span class="required">*</span> son requeridos.</p>

	<?php 
echo $form->errorSummary($model);
Exemplo n.º 11
0
 public function getProcesePurchase($id)
 {
     $title = "Metodo de pago | Nia Boutique.com";
     $fac = Facturas::find($id);
     $x = FacturaItem::where('factura_id', '=', $id)->sum('item_qty');
     $aux = FacturaItem::where('factura_id', '=', $id)->get(array('item_id', 'item_qty', 'item_talla', 'item_color', 'item_precio'));
     $i = 0;
     $auxT = 0;
     $auxQ = 0;
     $p = '';
     foreach ($aux as $a) {
         $b = Items::where('item.id', '=', $a->item_id)->first();
         $p = $p . $b->item_nomb . ', ';
         $b->qty = $a->item_qty;
         $b->precio = $a->item_precio;
         $b->item_talla = Tallas::where('id', '=', $a->item_talla)->pluck('talla_desc');
         $b->item_color = Colores::where('id', '=', $a->item_color)->pluck('color_desc');
         $auxT = $auxT + $b->qty * $b->item_precio;
         $auxQ = $auxQ + $b->qty;
         $aux = Misc::where('item_id', '=', $a->item_id)->where('deleted', '=', 0)->first();
         $b->img = Images::where('misc_id', '=', $aux->id)->where('deleted', '=', 0)->first();
         $item[$i] = $b;
         $i++;
     }
     $total = 0;
     $method = 'hola';
     $bancos = Bancos::where('deleted', '=', 0)->get();
     return View::make('indexs.showCart')->with('title', $title)->with('method', $method)->with('total', $total)->with('items', $item)->with('id', $id)->with('bancos', $bancos);
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Bancos the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Bancos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 13
0
 public function postElimBank()
 {
     if (Request::ajax()) {
         $id = Input::get('id');
         $banco = Bancos::find($id);
         $banco->deleted = 1;
         if ($banco->save()) {
             return Response::json(array('type' => 'success', 'msg' => 'Banco eliminado satisfactoriamente'));
         } else {
             return Response::json(array('type' => 'danger', 'msg' => 'Error al eliminar el banco'));
         }
     }
 }