public function __construct(Cotizacion $invitacion, $articulos) { $this->invitacion = $invitacion; $this->usuario_adq = \InfoDirectivos::getResponsable('ADQ'); $this->articulos = $articulos; parent::__construct('P', 'mm', 'Letter'); }
public function Footer() { $usuario_adq = \InfoDirectivos::getResponsable('ADQ'); $usuario_csg = \InfoDirectivos::getResponsable('CSG'); $usuario_sad = \InfoDirectivos::getResponsable('SAD'); $this->SetFont('Arial', '', 8); $this->SetY(-15); $this->Cell(90, 4, 'ELABORO', 0, 0, 'C'); $this->Cell(90, 4, 'REVISO', 0, 0, 'C'); $this->Cell(90, 4, 'AUTORIZO', 0, 1, 'C'); $this->Cell(90, 4, $usuario_adq->prefijo . ' ' . utf8_decode($usuario_adq->nombre), 0, 0, 'C'); $this->Cell(90, 4, $usuario_csg->prefijo . ' ' . utf8_decode($usuario_csg->nombre), 0, 0, 'C'); $this->Cell(90, 4, $usuario_sad->prefijo . ' ' . utf8_decode($usuario_sad->nombre), 0, 1, 'C'); $this->Cell(90, 4, utf8_decode($usuario_adq->cargo), 0, 0, 'C'); $this->Cell(90, 4, utf8_decode($usuario_csg->cargo), 0, 0, 'C'); $this->Cell(90, 4, utf8_decode($usuario_sad->cargo), 0, 1, 'C'); }
private function getUserId($legacy_user) { if ($legacy_user == 'Presupuesto' || $legacy_user == '' || $legacy_user == 'Supervision') { $usuario = \InfoDirectivos::getResponsable('PRESU'); $user_id = $usuario->id; } elseif ($legacy_user == 'Contabilidad' || $legacy_user == 'Archivo' || $legacy_user == 'Blanca') { $usuario = \InfoDirectivos::getResponsable('CONTA'); $user_id = $usuario->id; } elseif ($legacy_user == 'Recepcion') { //Buscar primer usuario con rol recepcion $user_id = 345; } else { $user_id = User::whereLegacyUsername($legacy_user)->pluck('id'); } if (empty($user_id)) { $user_id = 3; } return $user_id; }
public function Footer() { $this->SetFont('Arial', '', 8); $this->SetY(-20); //Jefe Unidad Adquisiciones $usuario_adq = \InfoDirectivos::getResponsable('ADQ'); $this->MultiCell(55, 4, utf8_decode($usuario_adq->nombre), 'T', 'C'); $this->MultiCell(55, 4, utf8_decode($usuario_adq->cargo), 0, 'C'); //Sec. Administrativo $usuario_sad = \InfoDirectivos::getResponsable('SAD'); if ($this->solicita->username != $usuario_sad->username) { $this->SetXY(67, -20); $this->MultiCell(45, 4, utf8_decode($usuario_sad->nombre), 'T', 'C'); $this->SetX(67); $this->MultiCell(45, 4, utf8_decode($usuario_sad->cargo), 0, 'C'); //AUTORIZA } //Solicita $this->SetXY(-55, -20); $this->MultiCell(50, 4, utf8_decode($this->solicita->nombre), 'T', 'C'); $this->SetX(-55); $this->MultiCell(50, 4, utf8_decode($this->solicita->cargo), 0, 'C'); //Dueño del proyecto if (!empty($this->autoriza)) { if ($this->autoriza->username != $usuario_sad->username) { $this->SetXY(114, -20); $this->MultiCell(45, 4, utf8_decode($this->autoriza->nombre), 'T', 'C'); $this->SetX(114); $this->MultiCell(45, 4, utf8_decode($this->autoriza->cargo), 0, 'C'); } } //Vo. Bo. if (!empty($this->vobo)) { $this->SetXY(-57, -40); $this->MultiCell(50, 4, utf8_decode($this->vobo->nombre), 'T', 'C'); $this->SetX(-57); $this->MultiCell(50, 4, utf8_decode($this->vobo->cargo), 0, 'C'); } }
private function crearCuadro($req, $fecha_cuadro) { //Creación de cuadros if ($req->estatus == 'Cotizada' || $req->estatus == 'Autorizada' || $req->estatus == 'Pagada') { $estatus_cuadro = 'Terminado'; } else { $estatus_cuadro = ''; } $user_adq = \InfoDirectivos::getResponsable('ADQ'); $user_csg = \InfoDirectivos::getResponsable('CSG'); $user_sad = \InfoDirectivos::getResponsable('SAD'); $cuadro = new Cuadro(); $cuadro->req_id = $req->id; $cuadro->fecha_cuadro = $fecha_cuadro; $cuadro->estatus = $estatus_cuadro; $cuadro->elabora = $user_adq->id; //Suministros $cuadro->revisa = $user_csg->id; //Serv. Generales $cuadro->autoriza = $user_sad->id; //SAD $cuadro->save(); return $cuadro->id; }
public function chequeRtf($id) { $egreso = Egreso::findOrFail($id); $egreso->load('proyectos.fondos', 'proyectos.urg'); $arr_rms = []; if (count($egreso->rms) > 0) { foreach ($egreso->rms as $rm) { $arr_rms[$rm->rm] = ['cog' => $rm->cog->cog, 'monto' => 0]; } foreach ($egreso->rms as $rm) { $arr_rms[$rm->rm]['monto'] += $rm->pivot->monto; } } $fecha_texto = \Utility::fecha_texto($egreso->fecha); $nat = new Nat(round($egreso->monto, 2), ''); $monto_letra = $nat->convertir(); $presu = \InfoDirectivos::getResponsable('PRESU')->iniciales; $cfin = \InfoDirectivos::getResponsable('FIN')->iniciales; $elabora = \Auth::user()->iniciales; return view('egresos.formCheque', compact('egreso', 'monto_letra', 'fecha_texto', 'presu', 'cfin', 'elabora', 'arr_rms')); }
public function importarSolicitudes() { $solicitudes_legacy = $this->consultarSolicitudesLegacy(); foreach ($solicitudes_legacy as $sol_legacy) { $benef = \DB::connection('legacy_benef')->table('tbl_benef')->where('benef_id', '=', $sol_legacy->benef_id)->value('benef'); $benef_id = Benef::whereBenef($benef)->pluck('id'); $proyecto = Proyecto::whereProyecto($sol_legacy->proy)->first(['id', 'urg_id']); //Determinar el ID del usuario solicitante $solicita_id = User::whereLegacyUsername($sol_legacy->solicita)->pluck('id'); //Determinar el usuario responsable if ($sol_legacy->responsable == 'Presupuesto') { $usuario = \InfoDirectivos::getResponsable('PRESU'); $user_id = $usuario->id; } elseif ($sol_legacy->responsable == 'Contabilidad') { $usuario = \InfoDirectivos::getResponsable('CONTA'); $user_id = $usuario->id; } elseif ($sol_legacy->responsable == 'Recepcion') { //Buscar primer usuario con rol recepcion $user_id = 2; } else { $user_id = User::whereLegacyUsername($sol_legacy->responsable)->pluck('id'); } if (empty($sol_legacy->inventariable)) { $inventariable = 0; } else { $inventariable = 1; } $sol_nueva = new Solicitud(); $sol_nueva->fecha = $sol_legacy->fecha; $sol_nueva->benef_id = $benef_id; $sol_nueva->tipo_solicitud = $sol_legacy->tipo_solicitud; $sol_nueva->urg_id = $proyecto->urg_id; $sol_nueva->proyecto_id = $proyecto->id; $sol_nueva->concepto = $sol_legacy->concepto; $sol_nueva->obs = $sol_legacy->obs . ' #SIGI: ' . $sol_legacy->solicitud_id; $sol_nueva->no_documento = $sol_legacy->no_documento; $sol_nueva->no_afin = $sol_legacy->id_afin; $sol_nueva->monto = $sol_legacy->monto; $sol_nueva->solicita = $solicita_id; $sol_nueva->estatus = $sol_legacy->estatus; $sol_nueva->user_id = $user_id; //responsable $sol_nueva->monto_pagado = $sol_legacy->monto_pagado; $sol_nueva->viaticos = $sol_legacy->viaticos; $sol_nueva->inventariable = $inventariable; $sol_nueva->save(); if ($sol_nueva->estatus != 'Cancelada') { if ($sol_legacy->tipo_solicitud != 'Vale') { $rms_solicitud = $this->consutlarRMs($sol_legacy->solicitud_id); foreach ($rms_solicitud as $rm_legacy) { $rm_id = Rm::whereRm($rm_legacy->rm)->value('id'); $sol_nueva->rms()->attach($rm_id, ['monto' => $rm_legacy->monto]); } } else { //Buscar si tiene capturado el objetivo $objs_solicitud = $this->consultarObjetivos($sol_legacy->solicitud_id); if (count($objs_solicitud) > 0) { foreach ($objs_solicitud as $obj_legacy) { $objetivo_id = Objetivo::whereObjetivo($obj_legacy->objetivo)->pluck('id'); if (empty($obj_legacy)) { dd($obj_legacy); } $sol_nueva->objetivos()->attach($objetivo_id, ['monto' => $obj_legacy->monto]); } } else { //Si no, asigna primer objetivo que encuentre en el proyecto $objetivo_id = Rm::whereProyectoId($sol_nueva->proyecto_id)->pluck('objetivo_id'); if (empty($objetivo_id->objetivo_id)) { $objetivo_id = 1; } $sol_nueva->objetivos()->attach($objetivo_id, ['monto' => $sol_nueva->monto]); } } } } }
public function Footer() { $this->SetFont('Arial', '', 6); $this->SetXY(10, 220); $this->Cell(200, 3, 'CONDICIONES DE PAGO y ENTREGA DE BIENES', 1, 1, 'C', true); $this->Cell(25, 3, 'FECHA DE ENTREGA:', 1, 0, 'L', true); $this->Cell(47, 3, utf8_decode($this->oc->condiciones->fecha_entrega), 1, 0, 'L'); $this->Cell(24, 3, 'LUGAR DE ENTREGA:', 1, 0, 'L', true); $this->MultiCell(79, 3, utf8_decode($this->oc->condiciones->lugar_entrega), 1); $this->SetXY(10, 226); $this->Cell(35, 3, 'PAGO DE CONTADO', 1, 0, 'L'); $this->Cell(10, 3, 'PAGO:', 1, 0, 'L', true); $this->Cell(51, 3, utf8_decode($this->oc->condiciones->pago), 1, 1, 'L'); $this->Cell(35, 3, 'PAGO EN PARCIALIDADES', 1, 0, 'L'); $this->Cell(27, 3, 'No. DE PARCIALIDADES:', 1, 0, 'L', true); $this->Cell(10, 3, $this->oc->condiciones->no_parcialidades, 1, 0, 'L'); $this->Cell(33, 3, 'PORCENTAJE DE ANTICIPO:', 1, 0, 'L', true); $this->Cell(70, 3, $this->oc->condiciones->porcentaje_anticipo . '%', 1, 0, 'L'); $this->SetXY(185, 223); $this->Cell(25, 3, 'FIANZAS', 1, 2, 'C', true); $this->Cell(25, 3, 'a) ANTICIPO', 1, 2, 'L'); $this->Cell(25, 3, 'b) CUMPLIMIENTO', 1, 2, 'L'); //Observaciones $this->SetXY(10, 233); $this->Line($this->GetX(), $this->GetY(), $this->GetX(), 245); $this->Line(210, $this->GetY(), 210, 245); $this->MultiCell(200, 3, 'No. Req. ' . $this->oc->req->req . ' ' . utf8_decode($this->oc->condiciones->obs) . "\nSolicita: " . utf8_decode($this->oc->req->user->nombre) . ' (' . $this->oc->req->user->email . ')', "T"); $this->SetXY(10, 245); $this->Cell(200, 3, 'OBSERVACIONES', 1, 1, 'C', true); //Firmas $usuario_adq = \InfoDirectivos::getResponsable('ADQ'); $usuario_csg = \InfoDirectivos::getResponsable('CSG'); $usuario_sad = \InfoDirectivos::getResponsable('SAD'); $this->SetFont('Arial', '', 7); $this->SetXY(10, -20); $this->Cell(46, 3, utf8_decode('ELABORÓ'), 'T', 2, 'C'); $this->MultiCell(46, 3, $usuario_adq->prefijo . ' ' . utf8_decode($usuario_adq->nombre), 0, 'C'); $this->SetX(10); $this->MultiCell(46, 3, utf8_decode($usuario_adq->cargo), 0, 'C'); $this->SetX(10); $this->SetXY(60, -20); $this->Cell(46, 3, utf8_decode('REVISÓ'), 'T', 2, 'C'); $this->MultiCell(46, 3, $usuario_csg->prefijo . ' ' . utf8_decode($usuario_csg->nombre), 0, 'C'); $this->SetX(60); $this->MultiCell(46, 3, utf8_decode($usuario_csg->cargo), 0, 'C'); $this->SetX(60); $this->SetXY(115, -20); $this->Cell(46, 3, utf8_decode('AUTORIZÓ'), 'T', 2, 'C'); $this->MultiCell(46, 3, $usuario_sad->prefijo . ' ' . utf8_decode($usuario_sad->nombre), 0, 'C'); $this->SetX(115); $this->MultiCell(46, 3, utf8_decode($usuario_sad->cargo), 0, 'C'); $this->SetX(115); $this->SetXY(165, -20); $this->Cell(45, 3, 'NOMBRE Y FIRMA DEL PROVEEDOR', 'T', 2, 'C'); $this->MultiCell(45, 3, 'Acepto los terminos y condiciones que se especifican en el reveso de la presente Orden de Compra', 0, 'C'); }
public function crearPdf() { $this->AliasNbPages(); $this->SetAutoPageBreak(true, 45); $this->AddPage(); $usuario_finanzas = \InfoDirectivos::getResponsable('FIN'); $usuario_presu = \InfoDirectivos::getResponsable('PRESU'); $this->SetFont('Arial', 'B', 11); $this->SetX(25); $this->Cell(180, 5, 'OFICIO NO.' . $this->solicitud->no_documento, 0, 2, 'R'); $this->Ln(5); $this->SetX(25); $this->Cell(180, 5, utf8_decode($usuario_finanzas->prefijo . " " . $usuario_finanzas->nombre), 0, 2, "L"); $this->Cell(180, 5, utf8_decode($usuario_finanzas->cargo), 0, 2, "L"); $this->Cell(180, 5, "CUCEI", 0, 2, "L"); $this->Cell(180, 5, "P R E S E N T E", 0, 2, "L"); $this->Cell(180, 5, utf8_decode("At'n. " . $usuario_presu->prefijo . " " . $usuario_presu->nombre), 0, 2, "R"); $this->Cell(180, 5, utf8_decode($usuario_presu->cargo), 0, 2, "R"); $this->Ln(); $this->SetFont('Arial', '', 10); $this->SetX(25); $this->Cell(71, 4, 'Por medio del presente solicito el tramite de:', 0, 0, 'L'); $this->SetFont('Arial', 'B', 10); $this->Cell(70, 4, $this->solicitud->tipo_solicitud, 0, 1, 'L'); $this->SetFont('Arial', '', 10); $this->Ln(); $this->SetX(25); $this->Cell(60, 4, 'Dicho recurso se solicita para:', 0, 2, 'L'); $this->SetFont('Arial', '', 9); $this->MultiCell(180, 3.5, utf8_decode($this->solicitud->concepto), 0, "L"); $this->Ln(5); $this->SetX(25); $this->Cell(28, 4, 'Cheque a favor de:', 0, 0, 'L'); $this->SetFont('Arial', 'B', 10); $this->MultiCell(145, 4, utf8_decode($this->solicitud->benef->benef), "B", 'L'); $this->SetFont('Arial', '', 10); $this->Ln(); $this->SetX(25); $this->Cell(28, 4, 'Por el monto de:', 0, 0, 'L'); $this->SetFont('CenturyGothic', '', '10'); $this->Cell(145, 4, "\$ " . number_format($this->solicitud->monto, 2), "B", 1, 'L'); $this->SetFont('Arial', '', 10); $this->Ln(); if (!empty($this->solicitud->obs)) { $this->Ln(3); $this->SetX(25); $this->Cell(28, 3.5, 'Observaciones:', 0, 0, 'L'); $this->SetFont('Arial', '', 9); $this->MultiCell(155, 3.5, utf8_decode($this->solicitud->obs), 0, "L"); $this->Ln(); } $this->SetX(25); $this->SetFont('Arial', '', 10); $this->Cell(180, 4, "URES: " . $this->solicitud->urg->urg . " " . utf8_decode($this->solicitud->urg->d_urg), 0, 2, "L"); $this->Cell(180, 4, "Proyecto: " . $this->solicitud->proyecto->proyecto . " " . utf8_decode($this->solicitud->proyecto->d_proyecto), 0, 2, "L"); $this->Cell(180, 4, "Fondo: " . $this->solicitud->proyecto->fondos->first()->fondo, 0, 2, "L"); $this->Ln(); $this->SetFont('Arial', '', 10); $this->SetX(25); if (count($this->solicitud->objetivos) > 0) { $this->MultiCell(60, 5, "Desglose por Objetivo:", 1, 'C'); $this->SetFont('CenturyGothic', '', '10'); foreach ($this->solicitud->objetivos as $obj) { $this->SetX(25); $this->Cell(40, 5, $obj->objetivo, 1, 0, 'C'); $this->Cell(20, 5, number_format($obj->pivot->monto, 2), 1, 1, 'R'); } } else { $y_tabla_rm_inicio = $this->GetY(); $this->SetFont('CenturyGothic', '', '10'); $i = 0; foreach ($this->solicitud->rms as $rm) { switch ($i) { case 0: $this->SetXY(25, $y_tabla_rm_inicio); $this->Cell(58, 5, "Desglose por RM/Cuenta", 1, 2, 'C'); break; case 6: $y_tabla_rm_fin = $this->GetY(); $this->SetXY(85, $y_tabla_rm_inicio); $this->Cell(58, 5, "Desglose por RM/Cuenta", 1, 1, 'C'); break; case 12: $this->SetXY(145, $y_tabla_rm_inicio); $this->Cell(58, 5, "Desglose por RM/Cuenta", 1, 1, 'C'); break; } if ($i < 6) { $x_total = 25; $this->SetX(25); } elseif ($i >= 6 || $i < 12) { $x_total = 85; $this->SetX(85); } else { $x_total = 145; $this->SetX(145); } $this->Cell(20, 5, $rm->rm, 1, 0, "C"); $this->Cell(15, 5, $rm->cog->cog, 1, 0, "C"); $this->Cell(23, 5, number_format($rm->pivot->monto, 2), 1, 1, "R"); $i++; } } $this->SetFont('Arial', 'B', 10); $this->SetX($x_total); $this->Cell(35, 5, "TOTAL", 1, 0, "C"); $this->SetFont('CenturyGothic', '', '10'); $this->Cell(23, 5, number_format($this->solicitud->monto, 2), 1, 1, "R"); $this->SetFont('Arial', '', 11); if ($i > 6) { $this->SetY($y_tabla_rm_fin); } $this->Ln(); //Tabla Finanzas $this->SetFont('Arial', '', 9); $y_tabla = $this->GetY(); $this->SetXY(25, $y_tabla); $this->MultiCell(180, 4, utf8_decode('Uso Exlusivo Finanzas Coordinación de Finanzas'), 1, 'C'); $this->SetXY(25, $y_tabla + 4); //$pdf->MultiCell(30,4,"Tipo de Solicitud Capturada",1,'C'); $this->SetXY(25, $y_tabla + 4); $this->MultiCell(30, 4, 'No. Documento AFIN', 1, 'C'); $this->SetXY(55, $y_tabla + 4); $this->MultiCell(30, 4, 'No. Solicitud de Pago AFIN', 1, 'C'); $this->SetXY(85, $y_tabla + 4); $this->MultiCell(30, 4, 'No. de Facturas AFIN', 1, 'C'); $this->SetXY(115, $y_tabla + 4); $this->MultiCell(30, 4, "No. de Cheque\n ", 1, 'C'); $this->SetXY(145, $y_tabla + 4); $this->MultiCell(30, 4, "No. Pago AFIN\n ", 1, 'C'); $this->SetXY(175, $y_tabla + 4); $this->MultiCell(30, 4, utf8_decode('No. de Comprobación'), 1, 'C'); $this->SetX(25); $this->Cell(30, 5, '', 1, 0, 'C'); $this->Cell(30, 5, '', 1, 0, 'C'); $this->Cell(30, 5, '', 1, 0, 'C'); $this->Cell(30, 5, '', 1, 0, 'C'); $this->Cell(30, 5, '', 1, 0, 'C'); $this->Cell(30, 5, '', 1, 1, 'C'); //Fin de Tabla $this->SetAutoPageBreak(true, 5); //Tabla Vo.Bo.'s $this->SetFont('Arial', '', 8); $this->SetXY(-60, -20); $this->Cell(30, 4, utf8_decode('Revisó'), 0, 0, 'C'); $this->Cell(30, 4, 'Vo.Bo.', 0, 1, 'C'); $this->SetX(-60); $this->Cell(30, 4, $usuario_presu->iniciales, 0, 0, 'C'); $this->Cell(30, 4, $usuario_finanzas->iniciales, 0, 1, 'C'); //Fin de Tabla //Footer no repetitivo por fecha y # de solicitud $solicita = User::find($this->solicitud->solicita); $this->SetY(-44); $this->SetFont('Arial', '', 10); $fecha_texto = Utility::fecha_texto($this->solicitud->fecha); //Verificar si el responsable del proyecto es el solicitante if ($this->solicitud->autoriza == $this->solicitud->solicita || $this->solicitud->autoriza == 0) { $this->Cell(190, 5, "A T E N T A M E N T E", 0, 1, "C"); $this->SetFont('Arial', 'B', 10); $this->Cell(190, 4, utf8_decode("\"Piensa y Trabaja\""), 0, 1, 'C'); // if (!empty($LEYENDA)) { // $this->SetFont('Arial','BI',10); // $this->Cell(190,4,utf8_decode (""),0,1,'C');//Leyenda // } $this->SetFont('Arial', '', 10); $this->Cell(190, 4, utf8_decode("Guadalajara, Jalisco, a " . $fecha_texto), 0, 1, 'C'); $this->Ln(10); $this->MultiCell(190, 5, utf8_decode($solicita->prefijo . " " . $solicita->nombre), 0, 'C'); $this->MultiCell(190, 5, utf8_decode($solicita->cargo), 0, 'C'); } else { //Firma de solicitante y responsable $this->Cell(90, 5, "A T E N T A M E N T E", 10, 1, "L"); $this->SetFont('Arial', 'B', 10); $this->Cell(90, 4, utf8_decode("\"Piensa y Trabaja\""), 0, 1, 'L'); // if (!empty($LEYENDA)) { // $this->SetFont('Arial','BI',10); // $this->Cell(90,4,utf8_decode ("$LEYENDA"),0,1,'L'); // } $this->SetFont('Arial', '', 10); $this->Cell(90, 4, utf8_decode("Guadalajara, Jalisco, a " . $fecha_texto), 0, 1, 'L'); $this->Ln(11); $this->MultiCell(90, 5, utf8_decode($solicita->prefijo . " " . $solicita->nombre), 0, 'L'); $this->MultiCell(90, 5, utf8_decode($solicita->cargo), 0, 'L'); $autoriza = User::find($this->solicitud->autoriza); $this->SetXY(95, -20); $this->SetFont('Arial', '', 8); $this->Cell(65, 4, "AUTORIZA", 0, 2, "C"); $this->MultiCell(65, 4, utf8_decode($autoriza->prefijo . " " . $autoriza->nombre), 0, 'C'); $this->SetX(95); $this->MultiCell(65, 4, utf8_decode($autoriza->cargo), 0, 'C'); } $this->SetFont('Arial', '', 7); $this->SetXY(-40, -10); $this->Cell(35, 4, "Solicitud SIGI #" . $this->solicitud->id, 0, 1, "R"); $this->Output('Solicitud_' . $this->solicitud->id . '.pdf', 'I'); }