/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $sol = Solicitud::findOrFail($id); $arr_tipos_solicitud['Reposicion'] = 'Reposicion (Reembolso)'; $arr_tipos_solicitud['Recibo'] = 'Recibo (Pago a Proveedor)'; $arr_tipos_solicitud['Vale'] = 'Vale (Gasto por Comprobar)'; $urgs = Urg::all(array('id', 'urg', 'd_urg')); foreach ($urgs as $urg) { $arr_urgs[$urg->id] = $urg->urg . ' - ' . $urg->d_urg; } $benefs = Benef::all(array('id', 'benef')); $benefs = $benefs->sortBy('benef'); foreach ($benefs as $benef) { $arr_benefs[$benef->id] = $benef->benef; } $arr_proyectos = \FiltroAcceso::getArrProyectos(); $vobos = FirmasSolRec::getUsersVoBo(); $arr_vobo[0] = 'Sin Vo. Bo.'; foreach ($vobos as $vobo) { $arr_vobo[$vobo->id] = $vobo->nombre . ' - ' . $vobo->cargo; } return view('solicitudes.formSolicitud')->with('sol', $sol)->with('tipos_solicitud', $arr_tipos_solicitud)->with('urgs', $arr_urgs)->with('proyectos', $arr_proyectos)->with('benefs', $arr_benefs)->with('arr_vobo', $arr_vobo); }
/** * Show the form for creating a new resource. * * @return Response */ public function create($destino, $porcentaje, $doc_type, $doc_id) { /** * @todo Seleccionar cuenta bancaria en función del proyecto */ $data['porcentaje'] = $porcentaje; $data['doc_type'] = $doc_type; $data['doc_id'] = $doc_id; $data['cuentas_bancarias'] = CuentaBancaria::all()->lists('cuenta_tipo_urg', 'id'); $data['cheque'] = \Consecutivo::nextCheque($data['cuentas_bancarias']->keys()[0]); $data['tipo_pago_sel'] = ''; if ($destino != 'reintegro') { //Pago con cargo al presupuesto $data['benefs'] = Benef::all()->sortBy('benef')->lists('benef', 'id'); $data['cuenta_id'] = 1; if ($porcentaje < 100) { $data['tipo_pago_sel'] = 'Parcial'; } /** * @todo Implementar lógica para determinar selección del tipo de pago * Si existen otros pagos: * Si Sum(monto_a_pagar_x_rm) + sum(otros_pagos) == totalAutorizado: * tipo_pago_sel = 'Finiquito'; * else: * tipo_pago_sel = 'Parcial'; * else: * tipo_pago_sel = ''; */ /** * @todo Si $doc->estatus == 'Pago Parcial' -> No listar 'Total' en tipo_pago */ $data['tipo_pago'] = ['Total' => 'Total', 'Parcial' => 'Parcial', 'Finiquito' => 'Finiquito']; } else { //Reintegros $data['benefs'] = Benef::whereId(1)->lists('benef', 'id'); $data['cuenta_id'] = 2; /** * @todo Si existen pagos, tipo_pago_sel = 'Reintegro Parcial' */ $data['tipo_pago'] = ['Reintegro Total' => 'Reintegro Total', 'Reintegro Parcial' => 'Reintegro Parcial']; } $doc = ''; $arr_rms = []; if ($doc_type == 'Solicitud') { $doc = Solicitud::findOrFail($doc_id); $doc->load('rms.cog', 'proyecto'); $data['concepto'] = $doc->concepto; //Creación de Arreglo foreach ($doc->rms as $rm) { $arr_rms[$rm->id] = ['rm' => $rm->rm, 'cog' => $rm->cog->cog, 'monto' => 0]; } //Suma por Rm foreach ($doc->rms as $rm) { $arr_rms[$rm->id]['monto'] += round($rm->pivot->monto, 2); } } if ($doc_type == 'Oc') { $doc = Oc::findOrFail($doc_id); $doc->load('articulos.rms.cog', 'req.proyecto'); $data['concepto'] = ''; //Creación de Arreglo foreach ($doc->articulos as $articulo) { foreach ($articulo->rms as $rm) { $arr_rms[$rm->id] = ['rm' => $rm->rm, 'cog' => $rm->cog->cog, 'monto' => 0]; } } //Suma por Rm foreach ($doc->articulos as $articulo) { foreach ($articulo->rms as $rm) { $arr_rms[$rm->id]['monto'] += round($rm->pivot->monto, 2); } } } $data['doc'] = $doc; $data['arr_rms'] = $arr_rms; return view('egresos.formGeneraEgreso')->with($data); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $egreso = Egreso::findOrFail($id); $cuentas = Cuenta::whereIn('tipo', ['Ejecutora'])->lists('cuenta', 'id')->all(); $cuentas_bancarias = CuentaBancaria::all()->lists('cuenta_tipo_urg', 'id'); $benefs = Benef::all()->sortBy('benef')->lists('benef', 'id'); $fecha = null; $cheque = null; return view('egresos.formEgreso', compact('egreso', 'fecha', 'cheque', 'cuentas', 'cuentas_bancarias', 'benefs')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $benefs = Benef::all(array('id', 'benef')); $benefs = $benefs->sortBy('benef'); foreach ($benefs as $benef) { $arr_benefs[$benef->id] = $benef->benef; } $invitacion = Cotizacion::findOrFail($id); return view('invita.formInvita')->with('cotizacion', $invitacion)->with('benefs', $arr_benefs)->with('req_id', $invitacion->req_id); }