$pdf->Cell(25, 6, "PAGO", 1, "", "", $fill); $pdf->Cell(35, 6, "FECHA DE PAGO", 1, "", "", $fill); //cuerpo de la tabla $pdf->SetFillColor(224, 224, 224); $fill = false; $pdf->SetFont('', 'I'); $pdf->Ln(); while ($l = $tabla->NextRow()) { $fill = !$fill; $pdf->Cell(10, 6, $l['n_pago'], 1, "", "", $fill); $pdf->Cell(27, 6, '$' . $l['saldo_insoluto'], 1, "", "R", $fill); $pdf->Cell(30, 6, '$' . $l['capital_pagado'], 1, "", "R", $fill); $pdf->Cell(35, 6, round($l['tasa'], 2) . "%", 1, "", "C", $fill); $pdf->Cell(33, 6, '$' . $l['interes'], 1, "", "R", $fill); $pdf->Cell(25, 6, '$' . $l['pago'], 1, "", "R", $fill); $pdf->Cell(35, 6, $util->convierteFecha($l['fecha_corte']), 1, "", "C", $fill); $pdf->Ln(); } } else { $pdf->SetFont("Arial", "B", 8); $pdf->Cell(10, 6, "#", 1, "", "", $fill); $pdf->Cell(27, 6, "SALDO INSOLUTO", 1, "", "", $fill); $pdf->Cell(30, 6, "CAPITAL PAGADO", 1, "", "", $fill); $pdf->Cell(23, 6, "% INTERES ", 1, "", "", $fill); $pdf->Cell(23, 6, "INTERES", 1, "", "", $fill); $pdf->Cell(25, 6, "PAGO", 1, "", "", $fill); $pdf->Cell(35, 6, "FECHA DE PAGO", 1, "", "", $fill); $pdf->Cell(25, 6, "PAGO MAYOR", 1, "", "", $fill); //cuerpo de la tabla $pdf->SetFillColor(224, 224, 224); $fill = false;
<tbody> <tr> <td><?php echo $detPag['n_pago']; ?> </td> <td class="text-right">$<?php echo $detPag['saldo_insoluto']; ?> </td> <td><?php echo $detPag['ref_pago']; ?> </td> <td class="text-center"><?php echo $util->convierteFecha($detPag['fecha_corte']); ?> </td> </tr> </tbody> </table> <?php if ($acumulado > 0) { ?> <!-- Seccion que contiene los pagos anteriores--> <div class="row-fluid"> <h4><span class="semi-bold">DESGLOSE DE PAGO</span></h4> <table class="table table-bordered" style="color:#000"> <thead> <th>#</th> <th>FECHA</th>
$pdf->Cell(25, 6, "PAGO", 1, "", "", $fill); $pdf->Cell(35, 6, "FECHA DE CORTE", 1, "", "", $fill); //cuerpo de la tabla $pdf->SetFillColor(224, 224, 224); $fill = false; $pdf->SetFont('', 'I'); $tota = $total; $pdf->Ln(); $fecha = date('Y-m-d', strtotime($fecha . ' ' . $interval)); $pdf->Cell(10, 6, 1, 1, "", "", $fill); $pdf->Cell(30, 6, '$' . number_format($total, 2), 1, "", "", $fill); $pdf->Cell(30, 6, '$' . number_format($abono - $total * ($tasa / $tipop), 2), 1, "", "", $fill); $pdf->Cell(35, 6, $tasa / $tipop * 100 . '%', 1, "", "C", $fill); $pdf->Cell(25, 6, '$' . number_format($total * ($tasa / $tipop), 2), 1, "", "", $fill); $pdf->Cell(25, 6, '$' . number_format($abono, 2), 1, "", "", $fill); $pdf->Cell(35, 6, $util->convierteFecha($fecha), 1, "", "", $fill); $pdf->Ln(); $ffcorte = $fecha; $cpagado = $abono - $tota * ($tasa / $tipop); for ($i = 2; $i <= $nabon + 1; $i++) { $ffcorte = date('Y-m-d', strtotime($ffcorte . ' ' . $interval)); $fill = !$fill; $tota -= $cpagado; $tota = round($tota, 2); $cpagado = round($abono - $tota * ($tasa / $tipop), 2); $pdf->Cell(10, 6, $i, 1, "", "", $fill); $pdf->Cell(30, 6, '$' . number_format($tota, 2), 1, "", "", $fill); $pdf->Cell(30, 6, '$' . number_format($cpagado, 2), 1, "", "", $fill); $pdf->Cell(35, 6, $tasa / $tipop * 100 . "%", 1, "", "C", $fill); $pdf->Cell(25, 6, '$' . number_format(round($tota * ($tasa / $tipop), 2), 2), 1, "", "", $fill); $pdf->Cell(25, 6, '$' . number_format($cpagado + $tota * ($tasa / $tipop), 2), 1, "", "", $fill);
?> </td> <td>$<?php echo $l['capital_pagado']; ?> </td> <td>$<?php if ($l['pago_abono'] == 0.0) { echo $l['pago']; } else { echo $l['pago_abono']; } ?> </td> <td><?php echo $util->convierteFecha($l['fecha_corte']); ?> </td> </tr> <?php } } ?> </tbody> </table> </div> </div> <script> //imprime la tabla actual function imprimirTabla(){
function getTextContrato($idContrato) { $con = new Database(); $cifra = new CifraLetra(); $util = new cUtilerias(); //selecciona los gastos de investigacion del producto $sql = "select productos.gastos_investigacion from productos, contratos where\n id_contrato = '{$idContrato}' and contratos.id_pdt = productos.id_pdt;"; $gastos_investigacion = $con->Fetch($sql); //selecciona el texto del contrato $query = "select productos.contrato_txt from productos, contratos where\n id_contrato = '{$idContrato}' and contratos.id_pdt = productos.id_pdt"; $texto = $con->Fetch($query); //selecciona el nombre del cliente, el producto de prestamo, tasa de interes, monto del prestamo y demas parametros $query = "select c.razon, c.a_pat, c.a_mat, c.nombre,ct.monto,ct.plazo,p.nombre as producto,p.tasa_interes,DAY(ct.fecha_fin) as dia, MONTH(ct.fecha_fin) as mes,\n YEAR(ct.fecha_fin) as anio,ct.fecha_generacion,p.comision_apertura,p.comision_manejo_cta from clientes_todos as c, contratos as ct,productos as p\n where p.id_pdt = ct.id_pdt and c.id_cliente = ct.id_clte and ct.id_contrato = '{$idContrato}' "; $clte = $con->Fetch($query); $texto = str_replace("%cliente%", strtoupper($clte['razon'] . " " . $clte['nombre'] . " " . $clte['a_pat'] . " " . $clte['a_mat']), $texto); $os = $this->__textOS($idContrato); $tos = ""; $ncifra = $cifra->numtoletras($clte['monto']); $cabeceras = ""; $garantes = ""; $textoGarante = ""; while ($o = $os->NextRow()) { if ($clte['nombre'] == $o['nombre'] && $clte['a_pat'] == $o['a_pat'] && $clte['a_mat'] == $o['a_mat']) { } else { $tos = $tos . " " . $o['razon'] . $o['nombre'] . " " . $o['a_pat'] . " " . $o['a_mat'] . ","; $cabeceras = $cabeceras . "El GARANTE SOLIDARIO Y AVAL "; $garantes = $garantes . $o['razon'] . $o['nombre'] . " " . $o['a_pat'] . " " . $o['a_mat'] . " "; } } // $textoGarante=$cabeceras."\n".$garantes; $texto = str_replace('%obsol%', strtoupper($tos), $texto); $cat = $this->__getCat($idContrato); $texto = str_replace('%cat%', $cat, $texto); $texto = str_replace('%monto%', $clte['monto'], $texto); $texto = str_replace('%montop%', $ncifra, $texto); $texto = str_replace('%tinteres%', $clte['tasa_interes'] / 2 . "%", $texto); $texto = str_replace('%fecha%', $util->convierteFecha($clte['fecha_generacion']), $texto); $texto = str_replace('%fesha%', $this->__fechaContrato($clte['dia'], $clte['mes'], $clte['anio']), $texto); $texto = str_replace('%plazo%', $clte['plazo'], $texto); $texto = str_replace('%mnjcta%', $clte['comision_manejo_cta'], $texto); $texto = str_replace("%gastos_investigacion%", $gastos_investigacion, $texto); $texto = str_replace("%cabeceras%", $cabeceras, $texto); $texto = str_replace("%garantes%", $garantes, $texto); return $texto; }
<?php header('Content-Type: text/html; charset=utf-8'); session_start(); if (empty($_SESSION["sqPLD"])) { header("Location: ../"); } include_once '../controller/cUtilerias.php'; $cUtilerias = new cUtilerias(); // $inicio=date('Y-m-d'); $inicio = $cUtilerias->getDateMexico(); $fin = strtotime('+1 month', strtotime($inicio)); $fin = date('Y-m-d', $fin); $inicio = $cUtilerias->convierteFecha($inicio); $fin = $cUtilerias->convierteFecha($fin); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta charset="utf-8" /> <title>Sistema de Cartera - PLD | Emprever</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta content="" name="description" /> <meta content="" name="author" /> <!-- BEGIN PLUGIN CSS --> <link rel="icon" type="image/png" href="../logo.png" /> <link href="../assets/plugins/pace/pace-theme-flash.css" rel="stylesheet" type="text/css" media="screen"/> <link href="../assets/plugins/jquery-notifications/css/messenger.css" rel="stylesheet" type="text/css" media="screen"/> <link href="../assets/plugins/jquery-notifications/css/messenger-theme-future.css" rel="stylesheet" type="text/css" media="screen"/> <!-- BELOW CSS FILE IS NOT REQUIRED -->
?> <tr> <td><?php echo $l['id_persona']; ?> </td> <td><?php echo $l['id_contrato']; ?> </td> <td class="odd"><?php echo $l['razon'] . $l['cliente']; ?> </td> <td><?php echo $util->convierteFecha($l['fecha_inicio']); ?> </td> <td class="odd">$<?php echo $l['monto']; ?> </td> <td><?php echo $l['plazo']; ?> </td> <td class="odd" > <button class="btn btn-primary" data-toggle="tooltip" data-original-title="Ver contrato"onclick="showContrato('<?php echo $l['id_contrato']; ?> ')">
?> </td> <td><?php echo $ex['telefono_p']; ?> </td> <td><?php echo $ex['email']; ?> </td> <td><?php echo $ex['contrato']; ?> </td> <td><?php echo $util->convierteFecha($ex['fecha_contrato']); ?> </td> <td><?php echo $ex['monto_credito']; ?> </td> <td> <p class="btn btn-warning" data-toggle="modal" onclick="alertaManualExpedientes(<?php echo $ex['id_cliente']; ?> )"> Generar Alerta </p></td> </tr> <?php
</td> interes<td><?php echo $tasa / $tipop * 100; ?> %</td> interes2<td><?php echo '$' . number_format($total * ($tasa / $tipop), 2); ?> </td> pago<td><?php echo '$' . number_format($abono, 2); ?> </td> <td><?php $finicio = date('Y-m-d', strtotime($_POST['fecha'] . ' ' . $interval)); echo $util->convierteFecha($finicio); ?> </td> </tr> <?php $tota = $total; $cpagado = $abono - $tota * ($tasa / $tipop); $ffcorte = $finicio; for ($i = 2; $i <= $nabon + 1; $i++) { $ffcorte = date('Y-m-d', strtotime($ffcorte . ' ' . $interval)); $tota -= $cpagado; $tota = round($tota, 2); $cpagado = round($abono - $tota * ($tasa / $tipop), 2); if ($tota > 0) { ?>
function getTablaAmortizacion($total, $tasa, $tipop, $nabon, $abono, $fecha) { $util = new cUtilerias(); $datos = $this->getTis($tipop, $tasa); $tabla = array(); $i = 1; // $tabla[$i]=Array( // "#"=>'1', // 'saldo_insoluto'=>number_format($total,2), // "capital_pagado"=>number_format(($abono - ($total * ($tasa / $tipop))),2), // "interes_tiempo"=>($tasa/$tipop) * 100, // "interes"=>number_format(($total * ($tasa / $tipop)),2), // "pago"=>number_format($abono,2), // "fecha_corte"=> // $util->convierteFecha(date('Y-m-d',strtotime($fecha.' '.$datos['intervalo']))) // ); $tabla[$i] = array("#" => '1', 'saldo_insoluto' => round($total, 2), "capital_pagado" => $abono - $total * ($tasa / $tipop), "interes_tiempo" => $tasa / $tipop * 100, "interes" => $total * ($tasa / $tipop), "pago" => $abono, "fecha_corte" => $util->convierteFecha(date('Y-m-d', strtotime($fecha . ' ' . $datos['intervalo'])))); $tota = $total; $cpagado = $abono - $tota * ($tasa / $tipop); $ffcorte = $util->convierteFecha(date('Y-m-d', strtotime($fecha . ' ' . $datos['intervalo']))); for ($i = 2; $i <= $nabon + 1; $i++) { $ffcorte = date('Y-m-d', strtotime($ffcorte . ' ' . $datos['intervalo'])); $tota -= $cpagado; // $tota = round($tota,2); $tota = $tota; $cpagado = round($abono - $tota * ($tasa / $tipop), 2); if ($tota > 0) { $tabla[$i] = array("#" => $i, "saldo_insoluto" => round($tota, 2), "capital_pagado" => $cpagado, "interes_tiempo" => $tasa / $tipop * 100, "interes" => round($tota * ($tasa / $tipop), 2), "pago" => round($cpagado + $tota * ($tasa / $tipop), 2), "fecha_corte" => $util->convierteFecha($ffcorte)); if (round($cpagado + $tota * ($tasa / $tipop), 2) > $tota) { $i = $nabon + 1; } } else { break; } //fin else } //fin for return $tabla; }
{ // Position at 1.5 cm from bottom $this->SetY(-15); // Arial italic 8 $this->SetFont('Arial', 'I', 8); // Page number $this->Cell(0, 10, 'Pagina ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new ImprimeTabla(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times', '', 12); $pdf->Cell(50, 10, "NOMBRE/RAZON SOCIAL: " . strtoupper($det['razon'] . " " . $det['nombre'] . " " . $det['a_pat'] . " " . $det['a_mat'])); $pdf->Ln(); $pdf->Cell(50, 10, "FECHA DE NACIMIENTO/CONSTITUCION: " . $util->convierteFecha($det['fecha_nac'])); $pdf->Ln(); $sepso = "MASCULINO"; if ($det['sexo'] == 0) { $sepso = "FEMENINO"; } $pdf->Cell(100, 10, "GENERO: " . strtoupper($sepso)); $pdf->Cell(50, 10, "NACIONALIDAD: " . strtoupper($det['nacionalidad'])); $pdf->Ln(); $pdf->Cell(100, 10, "CURP: " . strtoupper($det['curp'])); $pdf->Cell(50, 10, "RFC: " . strtoupper($det['rfc'])); $pdf->Ln(); $pdf->Cell(100, 10, "CIUDAD DE NACIMIENTO/CONSTITUCION: " . strtoupper($det['ciudad'])); $pdf->Ln(); $pdf->Cell(100, 10, "PAIS DE NACIMIENTO/CONSTITUCION: MEXICO"); $pdf->Ln();