public function testingStoreFunction() { $usuario = Cuenta::where('rut', '=', '11.111.111-1')->first(); $this->be($usuario); $datos = ['rut' => '33.333.333-3', 'nombres' => 'NombreTest', 'apellido_paterno' => 'ApellidoPaternoTest', 'apellido_materno' => 'ApellidoMaternoTest', 'f_nacimiento' => '1980-01-01', 'f_incorporacion' => '2000-01-01', 'cargo' => 'Profesor', 'titulo' => 'Pedagogia en Ingles', 'telefono' => '+569 11223344', 'email' => '*****@*****.**', 'domicilio' => 'Test Street 123', 'sueldo_base' => '300000', 'id_afp' => '1', 'id_aseguradora' => '1', 'costo_plan_salud' => '10000', '_token' => csrf_token()]; $this->call('POST', 'empleados', $datos); $this->assertRedirectedTo('empleados'); }
public function testingStoreFunction() { $usuario = Cuenta::where('rut', '=', '11.111.111-1')->first(); $this->be($usuario); $datos = ['rut' => '44.444.444-4', 'nombres' => 'AFPTest', 'telefono' => '+569 11223344', 'link_envio' => '123.23.45.123', '_token' => csrf_token()]; $this->call('POST', 'afp', $datos); $this->assertRedirectedTo('afp'); }
public function activar(Request $request) { Cuenta::where('id', $request->cuenta_activa)->update(['active' => 1]); $cuenta_actualizada = Cuenta::where('active', 1)->get(); $returnHTML = view('informes/tabla_debe_haber')->with('cuenta_actualizada', $cuenta_actualizada)->render(); return response()->json(array('success' => true, 'html' => $returnHTML)); }
public function presupuesto(Request $request) { if ($request->ajax()) { $updatecuenta = new Cuenta(); $updatecuenta->where('id', $request->cuenta)->update(['active_pres' => 1]); $presupuesto = new Presupuesto(); $presupuesto->value = $request->presupuesto; $presupuesto->chart_id = $request->cuenta; $presupuesto->save(); $cuentas = DB::table('budgets')->join('charts', 'charts.id', '=', 'budgets.chart_id')->select('budgets.value', 'budgets.chart_id', 'charts.name')->where('budgets.cycle_id', null)->get(); $returnHTML = view('periodo_fiscal/cuentas_presupuesto')->with('cuentas_pres', $cuentas)->render(); return response()->json(['html' => $returnHTML]); } }
public function obtenerCuentas() { $cuentas = Cuenta::where('tipo', '!=', 0)->get(); for ($i = 0; $i < sizeof($cuentas); $i++) { $cuentas[$i]->id_cuenta = '<a type="button" class="btn btn-primary margin" href="editarCuenta/' . $cuentas[$i]->id_cuenta . '">Actualizar</a>'; switch ($cuentas[$i]->tipo) { case 1: $cuentas[$i]->tipo = "Administrador"; break; case 2: $cuentas[$i]->tipo = "Vendedor"; break; } } return $cuentas; }