function ImprimeCredito($id, $doc)
 {
     $data = new pegaso();
     $actstatus = $data->ActStatusImpresoCredito($id);
     $actruta = $data->ActRuta($id, $doc);
     $datostrans = $data->ObtieneDatosCredito($id);
     $cabecera = $data->OCL($doc);
     $detalle = $data->detalleOC($doc);
     $pdf = new FPDF('P', 'mm', 'Letter');
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 15);
     $pdf->SetTextColor(198, 23, 23);
     $pdf->SetXY(180, 5);
     $pdf->CELL(60, 5, $datostrans->CREDITO);
     $pdf->Image('app/views/images/headerpdf_cr.jpg', 10, 15, 205, 55);
     $pdf->SetFont('Arial', 'I', 11);
     $pdf->SetTextColor(14, 3, 3);
     $pdf->Ln(80);
     $pdf->Cell(60, 10, "Fecha: ");
     $pdf->Cell(60, 10, $datostrans->FECHA);
     $pdf->Ln(20);
     $pdf->Cell(60, 10, "Beneficiario: ");
     $pdf->Cell(60, 10, $datostrans->BENEFICIARIO);
     $pdf->Ln(20);
     $pdf->Cell(60, 10, "Documento: ");
     $pdf->Cell(60, 10, $datostrans->DOCUMENTO);
     $pdf->Ln(20);
     $pdf->Cell(60, 10, "Importe: ");
     $pdf->Cell(60, 10, "\$ " . $datostrans->MONTO);
     $pdf->Ln(20);
     $pdf->Cell(60, 10, "Fecha Realizacion: ");
     $pdf->Cell(60, 10, $datostrans->FECHA_APLI);
     $pdf->Ln(30);
     $pdf->Cell(60, 10, "_______________________          _______________________                              __________________");
     $pdf->Ln(5);
     $pdf->Cell(60, 10, "Nombre de quien Recibe                  Firma de Recibido                                                  Fecha de Recibo ");
     //$pdf->Output('Transferencia '.$datostrans->DOCUMENTO .'.pdf', 'i');
     /* Falta crear consulta que traiga el número de folio generado */
     $pdf->AddPage();
     $pdf->Image('app/views/images/headerpdf_cr.jpg', 10, 15, 205, 55);
     $pdf->SetFont('Arial', 'I', 12);
     $pdf->Ln(70);
     foreach ($cabecera as $t) {
         $tipo = $t->CAMPLIB2;
         if ($tipo == 'E') {
             $tipo = 'Entrega';
         } elseif ($tipo == 'R') {
             $tipo = 'Recoleccion';
         } else {
             $tipo = 'No reconocido';
         }
         $pdf->Cell(60, 10, "Fecha: ");
         $pdf->Cell(60, 10, $t->FECHAELAB);
         $pdf->Ln(12);
         $pdf->Cell(60, 10, "Documento: ");
         $pdf->Cell(60, 10, $t->CVE_DOC);
         $pdf->Ln(12);
         $pdf->Cell(60, 10, "Nombre: ");
         $pdf->Cell(60, 10, $t->NOMBRE);
         $pdf->Ln(8);
         $pdf->Cell(60, 10, "Direccion: ");
         $pdf->Cell(60, 10, $t->CALLE . " No Ext: " . $t->NUMEXT . " No. Int:" . $t->NUMINT . " Colonia: " . $t->COLONIA);
         $pdf->Ln(8);
         $pdf->Cell(60, 10, "Direccion 2: ");
         $pdf->Cell(60, 10, $t->CODIGO . $t->MUNICIPIO . " Telefono :" . $t->TELEFONO);
         $pdf->Ln(8);
         $pdf->Cell(60, 10, "Confirmado con: ");
         $pdf->Cell(60, 10, $t->CAMPLIB4);
         $pdf->Ln(8);
         $pdf->Cell(60, 10, "Realizado por: ");
         $pdf->Cell(60, 10, $tipo);
         $pdf->Ln(12);
     }
     $pdf->SetFont('Times', 'I', 9);
     $pdf->Cell(20, 7, 'Partida', 1);
     $pdf->Cell(23, 7, 'Pedido', 1);
     $pdf->Cell(33, 7, 'Articulo', 1);
     $pdf->Cell(70, 7, 'Descr', 1);
     $pdf->Cell(20, 7, 'Cantidad', 1);
     $pdf->Cell(25, 7, 'Total Partida', 1);
     $pdf->Ln();
     foreach ($detalle as $col) {
         $pdf->Cell(20, 7, $col->NUM_PAR, 1);
         $pdf->Cell(23, 7, $col->COTIZA, 1);
         $pdf->Cell(33, 7, $col->CVE_ART, 1);
         $pdf->Cell(70, 7, $col->DESCR, 1);
         $pdf->Cell(20, 7, $col->CANT, 1);
         $pdf->Cell(25, 7, $col->TOT_PARTIDA, 1);
         $pdf->Ln();
     }
     foreach ($cabecera as $t1) {
         $pdf->Output('Transferencia' . $t1->CVE_DOC . '.pdf', 'i');
     }
 }