<tr> <td height="2" colspan="7" valign="top"><img src="../FacturaHTML/images/corteabajo_11.gif" alt="ok" width="740" height="2" /></td> </tr> <tr> <td colspan="7"></td> </tr> <tr> <td colspan="3" rowspan="3"> <table width="504" border="0" cellspacing="2" cellpadding="2"> <tr> <td colspan="3" class="boldcuerpo">Cantidad con letra</td> </tr> <tr> <td width="89"> </td> <td width="391"><span class="cuerpo"><?php echo strtoupper(num2String($data['total'])); ?> </span></td> </tr> </table> <p> </p> </td> <td rowspan="3" valign="top"><img src="../FacturaHTML/images/corteabajo_15.gif" alt="ok" width="3" height="60" /></td> <td height="2" class="boldcuerpo"><div align="right">Sub-Total:</div></td> <td valign="top"> </td> <td valign="top"> </td> <td valign="top"> </td> <td valign="top"> </td> <td valign="top"> </td> <td class="cuerpo"><div align="right">$ <?php echo $data['subTotal'];
function displayPDF($folio) { // $arr = $this->fetchData($folio); // $xml = $this->fetchXML($folio); if (is_array($arr)) { $pdf =& new PDF(); $pdf->AddPage(); if ($arr['estatus'] != 'VIGENTE') { $pdf->setSourceFile('../templates/factura_cancelada.pdf'); } else { $pdf->setSourceFile('../templates/factura_plantilla.pdf'); } $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx); $pdf->SetFont('Arial', '', 8); /* No. Factura */ $pdf->SetXY(170, 21); $pdf->SetTextColor(255, 0, 0); $pdf->Write(0, $arr['folio']); /* Lugar */ $pdf->SetXY(170, 25); $pdf->SetTextColor(0, 0, 0); $pdf->Write(0, "MEXICO, D.F."); /* FECHA */ $pdf->SetXY(170, 29); $pdf->SetTextColor(0, 0, 0); $pdf->Write(0, strftime("%d/%m/%Y %H:%M:%S", strtotime($arr['fecha']))); /* FACTURADO A */ $cp = $arr['Receptor']['codigoPostal'] != '' ? "C.P. " . $arr['Receptor']['codigoPostal'] : ''; $pdf->SetXY(55, 41); $pdf->MultiCell(0, 4, $arr['Receptor']['nombre'] . "\n" . $arr['Receptor']['rfc'] . "\n" . $arr['Receptor']['calle'] . "\n" . $arr['Receptor']['noExterior'] . " " . $arr['Receptor']['noInterior'] . "\n" . $arr['Receptor']['colonia'] . "\n" . $cp . " " . $arr['Receptor']['municipio'] . " " . $arr['Receptor']['estado']); $pdf->SetFont('Courier', '', 7); $posX = 40; $posY = 85; $pdf->SetXY($posX, $posY); for ($i = 0; $i < sizeof($arr['Conceptos']); $i++) { $pdf->SetXY($posX, $posY); $pdf->MultiCell(90, 3, utf8_decode($arr['Conceptos'][$i]['cantidad'])); $posY = $posY + 10; } $posX = 55; $posY = 85; $pdf->SetXY($posX, $posY); for ($i = 0; $i < sizeof($arr['Conceptos']); $i++) { $pdf->SetXY($posX, $posY); $pdf->MultiCell(80, 3, utf8_decode($arr['Conceptos'][$i]['descripcion'])); $posY = $posY + 10; } $posX = 145; $posY = 85; $pdf->SetXY($posX, $posY); for ($i = 0; $i < sizeof($arr['Conceptos']); $i++) { $pdf->SetXY($posX, $posY); $pdf->MultiCell(25, 3, utf8_decode(number_format($arr['Conceptos'][$i]['valorUnitario'], 2)), 0, 'R'); $posY = $posY + 10; } $posX = 175; $posY = 85; $pdf->SetXY($posX, $posY); for ($i = 0; $i < sizeof($arr['Conceptos']); $i++) { $pdf->SetXY($posX, $posY); $pdf->MultiCell(25, 3, utf8_decode(number_format($arr['Conceptos'][$i]['importe'], 2)), 0, 'R'); $posY = $posY + 10; } /* CANTIDAD CON LETRA */ $pdf->SetFont('Arial', '', 8); $posX = 40; $posY = 235; $pdf->SetXY($posX, $posY); $pdf->MultiCell(90, 3, strtoupper(num2String($arr['total']))); /* TOTALES */ $pdf->SetFont('Courier', '', 8); $posX = 170; $posY = 227; $pdf->SetXY($posX, $posY); $pdf->MultiCell(30, 6, '$ ' . number_format($arr['subTotal'], 2) . "\n" . '$ ' . number_format($arr['subTotal'] * 0.15, 2) . "\n" . '$ ' . number_format($arr['subTotal'] * 1.15, 2), 0, 'R'); /* CADENA ORIGINAL */ $pdf->SetFont('Arial', '', 3); $posX = 8; $posY = 246; $pdf->SetXY($posX, $posY); $pdf->Rotate(90); $pdf->MultiCell(235, 2, 'Cadena Original:' . "\n" . substr($arr['cadenaOriginal'], 0, 1850), 0, 'L'); $pdf->Rotate(0); /* SELLO DIGITAL */ $pdf->SetFont('Arial', '', 5); $posX = 206; $posY = 246; $pdf->SetXY($posX, $posY); $pdf->Rotate(90); $pdf->MultiCell(240, 2, 'Sello Digital:' . "\n" . $arr['sello'], 0, 'L'); $pdf->Rotate(0); $pdf->numAprobacion = $arr['noAprobacion']; $pdf->anoAprobacion = $arr['anoAprobacion']; $pdf->noCertificado = $arr['noCertificado'] != '' ? $arr['noCertificado'] : $xml['noCertificado']; $pdf->Output('factura' . $row['folio'] . '-' . $arr['fecha'] . '.pdf', 'I'); } else { echo "No existe el folio indicado"; } }