<table width="100%"> <?php $this->load->view('impresion/datos_basicos_consulta'); ?> <tr><th colspan="2">Incapacidad Médica</th></tr> <tr><td> <table width="100%" border="1" cellspacing="2" cellpadding="2"> <tr> <th align="left">Fecha Inicio:</th><td><?php echo $incapacidad['fecha_inicio']; ?> </td> </tr> <tr> <th align="left">Duración:</th><td> <?php echo numtoletras($incapacidad['duracion']); ?> (<?php echo $incapacidad['duracion']; ?> ) DÍAS</td> <tr> <tr> <th align="left">Finaliza el:</th><td> <?php echo suma_fechas($incapacidad['fecha_inicio'], $incapacidad['duracion']); ?> </td> <tr> <th align="left">Diagnóstico:</th><td><?php echo $incapacidad['id_diagnostico']; ?>
<?php echo print_r($remision); ?> <h4>Servicio de Consulta Externa - Consulta de Control</h4> <table width="100%"> <?php $this->load->view('impresion/datos_basicos_consulta'); ?> <tr><th colspan="2">Solicitud de Cita de Control</th></tr> <tr><td> <table width="100%" border="1"> <tr> <td class="negrita">Dias de Espera para Solicitar Cita:</td> <td><?php echo numtoletras($remision['dias_cita_control']); ?> (<?php echo $remision['dias_cita_control']; ?> ) DÍAS</td> </tr> <tr> <td class="negrita">Programar Cita Después del:</td> <td><?php echo suma_fechas($remision['fecha_solicitud'], $remision['dias_cita_control']); ?> </td> </tr> <tr> <td class="negrita">Observación:</td>
<tr> <td style="width:15%;text-align:center;font-size:10px;">' . $d["cantidad"] . '</td> <td style="width:70%;font-size:10px;">' . $d["nombre"] . '</td> <td style="width:15%;text-align:right;font-size:10px;">' . number_format($d["total"], 2) . '</td> </tr>'; } $html .= '<tr> <td style="width:15%;text-align:center;font-size:10px;"> </td> <td style="width:70%;text-align:right;font-size:10px;"><strong>Total:</strong></td> <td style="width:15%;text-align:right;font-size:10px;">' . number_format($total, 2) . '</td> </tr> </table> </div> <br/> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>2.</strong>El contratante pagará al contratado conforme el servicio señalado en la cláusula anterior cuyo detalle fue previamente aprobado en presupuesto que se anexa, las cantidades y forma de acuerdo a lo siguiente: $' . number_format($total, 2) . ' (' . numtoletras($total) . ') por concepto de renta garantizándose con la firma del contrato y un anticipo de ' . number_format($pagado, 2) . ' (' . numtoletras($pagado) . ') y debiéndose liquidar el saldo el día ' . varFechaRest($fechaEve) . ' para la entrega del servicio.</div> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>3.</strong>El contratado se obliga de acuerdo a la descripción señalada en la cláusula primera a entregar el equipo en óptimo estado en la fecha y hora convenidas y a tener a su personal de guardia para cualquier necesidad requerida en el evento.</div> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>4.</strong>El contratante asume la responsabilidad del mobiliario y equipo relativa a su personal e invitados para cualquier eventualidad que pudiese ocurrir durante la celebración del evento. Así mismo el contratante releva al contratado acerca de cualquier afectación por causas de origen natural o técnico no controladas por el segundo y comprendidas en su servicio.</div> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>5.</strong>En caso de existir algún daño o faltante en el equipo, éste lo pagará el contratado a precio de costo de reposición del equipo señalado. Se deberá dejar un depósito del 10% por faltantes o daños que en caso de no requerirse se devolverá al finalizar el evento.</div> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>6.</strong>Los precios incluyen la instalación del equipo.</div> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>7.</strong>En caso de cualquier eventualidad ajena a la voluntad del contratado que lo imposibilite a la entrega o realización del evento, éste se compromete a entregar la cantidad recibida en depósito o anticipo por apartado de fecha, sin ninguna otra responsabilidad para el contratante.</div> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>8.</strong>En caso de cancelación del contrato por causas imputables al contratante, éste perderá el anticipo entregado al contratado por causa de reservado de fecha.</div> <div style="width:100%; padding:5 20px; font-size:10px;text-align:justify;"> <strong>9.</strong>Este contrato está regido por las políticas de contratación y las políticas de renta de mantelería incluidas en su presupuesto inicial, las cuales se dan por comprendidas y aceptadas con la firma de el presente contrato.</div>
$consultaDirec = mysql_query("SELECT Nombre_completo FROM cat_director WHERE anio = {$hoy}"); while ($rows = mysql_fetch_array($consultaDirec)) { $VarDirector = $rows['Nombre_completo']; } $fecha = date('Y/m/j'); $i = strtotime($fecha); $dia = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m", $i), date("d", $i), date("Y", $i)), 0); if ($dia >= 4) { $nuevafecha = strtotime('+4 day', strtotime($fecha)); $nuevafecha = date('j/m/Y', $nuevafecha); } else { $nuevafecha = strtotime('+1 day', strtotime($fecha)); $nuevafecha = date('j/m/Y', $nuevafecha); } $hoy = date("Y-m-d H:i:s"); $VarIimporteLetra = numtoletras($VarImporte); function numtoletras($xcifra) { $xarray = array(0 => "Cero", 1 => "UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE", "VEINTI", 30 => "TREINTA", 40 => "CUARENTA", 50 => "CINCUENTA", 60 => "SESENTA", 70 => "SETENTA", 80 => "OCHENTA", 90 => "NOVENTA", 100 => "CIENTO", 200 => "DOSCIENTOS", 300 => "TRESCIENTOS", 400 => "CUATROCIENTOS", 500 => "QUINIENTOS", 600 => "SEISCIENTOS", 700 => "SETECIENTOS", 800 => "OCHOCIENTOS", 900 => "NOVECIENTOS"); // $xcifra = trim($xcifra); $xlength = strlen($xcifra); $xpos_punto = strpos($xcifra, "."); $xaux_int = $xcifra; $xdecimales = "00"; if (!($xpos_punto === false)) { if ($xpos_punto == 0) { $xcifra = "0" . $xcifra; $xpos_punto = strpos($xcifra, "."); } $xaux_int = substr($xcifra, 0, $xpos_punto);
</div> <br/> <div style="width:100%; padding:5 20px; font-size:12px;text-align:justify;"> <strong>4.- </strong>La fecha de realización del evento es para el <?php echo varFechaAbr($fechaEve); ?> . </div> <br/> <div style="width:100%; padding:5 20px; font-size:12px;text-align:justify;"> <strong>5.- </strong>El precio que como contraperstación al uso y goce del salón "BICHOS" y que deberá pagar al arrendatario o el arrendador será la cantidad de <strong>$<?php echo $porpagar . ".00"; ?> </strong> son:(<?php echo numtoletras($porpagar); ?> ) por salón, pagaderos de la siguiente manera 50% anticipo por separacion y el 50% restante 15 dias hábiles antes de la realización del evento en caso de incumplimiento, el arrendatario se sujetará a la pena establecida a la claúsula 6 bichos entregará al arrendatario el recibo correspondiente a los anticipos. </div> <br/> <div style="width:100%; padding:5 20px; font-size:12px;text-align:justify;"> <strong>6.- </strong>En caso de que el arrendatario cambie la fecha de evento se le cobrará una penalización de $500.00 y por su cancelacion de evento será de $1,500.00 la penalización. Cantidades que serán retenidas por daños y prejuicios. </div> <br/> <div style="width:100%; padding:5 20px; font-size:12px;text-align:justify;"> <strong>7.- </strong> El arrendador podrá cancelar en cualquier momento el evento social por causa de fuerza mayor, para lo cual se obliga a devolver
public function postRecibos() { if (!empty(Input::get('recibo'))) { require_once "dompdf/dompdf_config.inc.php"; $operacion = $this->response->getOperacion(Input::get('folio'), Input::get('expediente')); $descripciones_efectivo = Estatica::getObjetos($this->mysqli->query('select * from descripcion_efectivo where fk_operacion=' . Input::get('folio'))); $descripciones_cheque = Estatica::getObjetos($this->mysqli->query('select * from descripcion_cheque where fk_operacion=' . Input::get('folio'))); $descripciones_transferencia = Estatica::getObjetos($this->mysqli->query('select * from descripcion_transferencia where fk_operacion=' . Input::get('folio'))); $descripciones_convenio = Estatica::getObjetos($this->mysqli->query('select * from descripcion_convenio where fk_operacion=' . Input::get('folio'))); $capital = 0; $actualizacion = 0; $gas_admon_cob = 0; $interes_aplicable = 0; $moratorios = 0; $total = 0; for ($abono = 0; $abono < count($operacion['abonos_mensualidad']); $abono++) { $capital += $operacion['abonos_mensualidad'][$abono]['abono']->pago_capital; $actualizacion += $operacion['abonos_mensualidad'][$abono]['abono']->actualizacion; $gas_admon_cob += $operacion['abonos_mensualidad'][$abono]['abono']->gas_admon_cob; $interes_aplicable += $operacion['abonos_mensualidad'][$abono]['abono']->interes_aplicable; $moratorios += $operacion['abonos_mensualidad'][$abono]['abono']->moratorios; } $total += $interes_aplicable + $gas_admon_cob + $moratorios + $actualizacion; // return numtoletras($total); $recibo = null; $nombre = null; if (Input::get('recibo') == 1) { // return View::make('cobranza/reportes/reciboPosterior2014')->with('info', array('operacion'=>$operacion, 'total'=>numtoletras($total)) )->render(); if (strtotime($operacion['fecha_contrato']->fecha_realizacion) >= strtotime('2014-01-01')) { $recibo = View::make('cobranza/reportes/reciboPosterior2014')->with('info', array('operacion' => $operacion, 'total' => numtoletras($total)))->render(); } else { $recibo = View::make('cobranza/reportes/reciboAntes2014')->with('info', array('operacion' => $operacion, 'total' => numtoletras($total))); } $nombre = "recibo_folio_" . Input::get('folio'); } else { if (Input::get('recibo') == 2) { $capital = 0; for ($abono = 0; $abono < count($operacion['abonos_mensualidad']); $abono++) { $capital += $operacion['abonos_mensualidad'][$abono]['abono']->pago_capital; } $recibo = View::make('cobranza/reportes/reciboAuxiliar')->with('info', array('operacion' => $operacion, 'total' => $capital))->render(); $nombre = "recAuxiliar_folio_" . Input::get('folio'); } else { $recibo = View::make('cobranza/reportes/prefactura')->with('info', array('descripciones_efectivo' => $descripciones_efectivo, 'descripciones_cheque' => $descripciones_cheque, 'descripciones_transferencia' => $descripciones_transferencia, 'descripciones_convenio' => $descripciones_convenio, 'expediente' => Input::get('expediente'), 'abonos' => $operacion['abonos_mensualidad'], 'plazo' => $operacion['plazo'])); $nombre = "prefactura"; } } $dompdf = new DOMPDF(); $dompdf->set_paper('A4', 'landscape'); $dompdf->load_html($recibo); $dompdf->render(); $dompdf->stream($nombre . ".pdf"); } else { return View::make('cobranza/reportes/recibosContrato')->with('operaciones', $this->response->getOperaciones(Input::get('contratos'))); } }
public function getDoc($expediente) { $cliente = $this->mysqli->query('select * from expediente, cliente where id_expediente="' . $expediente . '" and cliente.rfc=expediente.fk_rfc')->fetch_object(); //$cliente = DB::table('expediente')->where('id_expediente', $expediente)->join('cliente', 'cliente.rfc', '=', 'expediente.fk_rfc')->get()[0]; $lote = $this->mysqli->query('select * from expediente, solicitud, contrato, contrato_lote, lote, manzana, desarrollo where expediente.id_expediente="' . $expediente . '" and solicitud.fk_expediente=expediente.id_expediente and contrato.fk_solicitud=solicitud.id_solicitud and contrato_lote.fk_contrato=contrato.id_contrato and lote.id_lote=contrato_lote.fk_lote and manzana.id_manzana=lote.fk_manzana and desarrollo.id_desarrollo=manzana.fk_desarrollo')->fetch_object(); //$lote=DB::table('expediente')->where('id_expediente', $expediente)->join('solicitud', 'fk_expediente', '=','expediente.id_expediente')->join('contrato', 'contrato.fk_solicitud', '=','solicitud.id_solicitud')->join('contrato_lote','contrato_lote.fk_contrato', '=' ,'contrato.id_contrato')->join('lote','lote.id_lote', '=', 'contrato_lote.fk_lote')->join('manzana', 'manzana.id_manzana', '=', 'lote.fk_manzana')->join('desarrollo', 'desarrollo.id_desarrollo', '=', 'manzana.fk_desarrollo')->get()[0]; $contrato = $this->mysqli->query('select * from contrato where id_contrato=' . $lote->id_contrato)->fetch_object(); $categoria = $this->mysqli->query('select * from categoria where id_categoria=' . '"' . $lote->fk_categoria . '"')->fetch_object(); //$categoria = DB::table('categoria')->where('id_categoria', $lote->fk_categoria)->get()[0]; $cuenta = $this->mysqli->query('select * from cuenta where fk_contrato=' . $lote->id_contrato)->fetch_object(); //$cuenta = DB::table('cuenta')->where('fk_contrato', $lote->id_contrato)->get()[0]; $enganches = Estatica::getObjetos($this->mysqli->query('select * from enganche_parcial where fk_cuenta=' . $cuenta->id_cuenta)); //$enganches = DB::table('enganche_parcial')->where('fk_cuenta', $cuenta->id_cuenta)->get(); $partesContrato = DB::table('parte_contrato')->where('fk_desarrollo', $lote->fk_desarrollo)->get(); $ala_Firma = 0; $textoEnganches = ''; $bool_no_parciales = true; for ($e = 0; $e < count($enganches); $e++) { if (strtotime($enganches[$e]->fecha_promesa) > strtotime($contrato->fecha_realizacion)) { $textoEnganches = $textoEnganches . " Complemento de enganche por \$" . round($enganches[$e]->importe, 2) . ' ' . numtoletras(round($enganches[$e]->importe, 2)) . " que depositara en la fecha " . $enganches[$e]->fecha_promesa; $bool_no_parciales = false; } else { $ala_Firma += $enganches[$e]->importe; } } if ($bool_no_parciales == true) { $textoEnganches = 'Ningun enganche parcial.'; } $PHPWord = new PHPWord(); if ($lote->tipo_operacion == 1) { $document = $PHPWord->loadTemplate(dirname(__FILE__) . '/PHPWord/contrato_contado.docx'); } else { $document = $PHPWord->loadTemplate(dirname(__FILE__) . '/PHPWord/Plantilla_Contrato_Credito.docx'); $document->setValue('Plazo', $lote->plazo); $document->setValue('DiaCorte', $lote->dia_corte); $document->setValue('PlazoLetra', numtoletras_2($lote->plazo)); $lote->fecha_inicial_pago = explode('-', $lote->fecha_inicial_pago); $document->setValue('IniciaDia', $lote->fecha_inicial_pago[2]); for ($parte = 0; $parte < count($partesContrato); $parte++) { $document->setValue('Parte' . ($parte + 1), $partesContrato[$parte]->texto); } $document->setValue('MesInicia', $this->mes($lote->fecha_inicial_pago[1])); $document->setValue('AnioInicia', $lote->fecha_inicial_pago[0]); } $document->setValue('Contrato', $expediente); $document->setValue('Cliente', $cliente->nombre . " " . $cliente->ape_pate . " " . $cliente->ape_mate); $document->setValue('CP', $cliente->cp); if ($cliente->estado_civil == 1) { $document->setValue('Edo_Civil', 'Soltero'); $document->setValue('Regimen', ' '); } else { $document->setValue('Edo_Civil', 'Casado'); if ($cliente->regimenMatrimonial == 1) { $document->setValue('Regimen', ' bajo el regimen de Bienes mancomunados'); } else { $document->setValue('Regimen', 'bajo el regimen de Bienes separados'); } } $document->setValue('Profesion', $cliente->profesion); $document->setValue('RFC', $cliente->rfc); $document->setValue('CURP', $cliente->curp); $document->setValue('Tel_Casa', $cliente->telefono); $document->setValue('Tel_Celular', $cliente->movil); $document->setValue('Email', $cliente->email); $document->setValue('Calle', $cliente->calle); $document->setValue('No', $cliente->numero_casa); $document->setValue('Colonia', $cliente->colonia); $document->setValue('Nacionalidad', $cliente->nacionalidad); $document->setValue('Desarrollo', $lote->nombre); $document->setValue('Lote', $lote->lote); $document->setValue('LoteLetra', numtoletras_2($lote->lote)); $document->setValue('Manzana', $lote->num_letra); $document->setValue('ManzanaLetra', numtoletras_2($lote->num_letra)); $document->setValue('MtNorte', $lote->metlinor); $document->setValue('LindaNorte', $lote->metlinor); $document->setValue('MtSur', $lote->metlinsur); $document->setValue('LindaSur', $lote->lindasur); $document->setValue('MtOriente', $lote->metlinoeste); $document->setValue('LindaOriente', $lote->lindaoriente); $document->setValue('MtPoniente', $lote->metlineste); $document->setValue('LindaPoniente', $lote->lindaponiente); $document->setValue('Total', round($categoria->precio * $lote->superficie), 2); $document->setValue('TotalLetra', numtoletras(round($categoria->precio * $lote->superficie), 2)); $document->setValue('Precio_Metro', round($categoria->precio, 2)); $document->setValue('PrecioMetroLetra', numtoletras(round($categoria->precio, 2))); $document->setValue('Superficie', round($lote->superficie, 2)); $document->setValue('SuperficieLetra', numtoletras_2(round($lote->superficie, 2))); $document->setValue('SaldoFinanciar', round($cuenta->saldo_inicial)); $document->setValue('SaldoFinanciarLetra', numtoletras(round($cuenta->saldo_inicial))); $document->setValue('Enganche', round($ala_Firma)); $document->setValue('EngancheLetra', numtoletras(round($ala_Firma))); $document->setValue('Complementos', $textoEnganches); $lote->fecha_realizacion = explode("-", $lote->fecha_realizacion); $document->setValue('Dia', $lote->fecha_realizacion[2]); $document->setValue('Mes', $this->mes($lote->fecha_realizacion[1])); $document->setValue('Anio', $lote->fecha_realizacion[0]); $document->setValue('Referencia', $lote->fk_referencia); $document->setValue('Municipio', $cliente->municipio); $document->setValue('Complemento', $cliente->estado); if ($lote->tipo_operacion == 1) { $document->save($expediente . '_Contado.docx'); } else { $document->save($expediente . '_Credito.docx'); } }
?> )" class="btn btn-danger btn-xs" ><span class="glyphicon glyphicon-trash"></span></button> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <td class="highrow"><strong>Total En Letras</strong></td> <td class="highrow text-left"> <div align="left" id="total_en_letras_otro_motivo"> <?php echo numtoletras($total_detalle); //numtoletras($total_detalle); ?> </div> </td> <td class="highrow text-right"></td> </tr> <tr> <td class=""></td> <td class=" text-right"><strong>Total Q.</strong></td> <td class=" text-right"> <div align="right" id="total_en_numeros_otro_motivo"> <?php echo number_format($total_detalle, 2, '.', ''); //number_format($total_detalle,2,'.','');
$VardescQuincenas = $import / $quincena; } $VarImporte = number_format($Importe, 2); $importe = number_format($import, 2); $intereses = number_format($inter, 2); $VardescQuincena = number_format($VardescQuincenas, 2); $Varsubtotal = number_format($Varsubtotals, 2); //$importe = number_format($importe,2); //$importe = number_format($importe,2); $hoy = date("Y"); $consultaDirec = mysql_query("SELECT Nombre_completo FROM cat_director WHERE anio = {$hoy}"); while ($rows = mysql_fetch_array($consultaDirec)) { $VarDirector = $rows['Nombre_completo']; } $VarIimporteLetra = numtoletras($VarImporte); $VarIimporteQuincenaLetra = numtoletras($VardescQuincena); $VarAntiAval1 = CalculaEdad($AntiAval1); $VarAntiAval2 = CalculaEdad($AntiAval2); function CalculaEdad($fecha) { list($Y, $m, $d) = explode("-", $fecha); return date("md") < $m . $d ? date("Y") - $Y - 1 : date("Y") - $Y; } function numtoletras($xcifra) { $xarray = array(0 => "Cero", 1 => "UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE", "VEINTI", 30 => "TREINTA", 40 => "CUARENTA", 50 => "CINCUENTA", 60 => "SESENTA", 70 => "SETENTA", 80 => "OCHENTA", 90 => "NOVENTA", 100 => "CIENTO", 200 => "DOSCIENTOS", 300 => "TRESCIENTOS", 400 => "CUATROCIENTOS", 500 => "QUINIENTOS", 600 => "SEISCIENTOS", 700 => "SETECIENTOS", 800 => "OCHOCIENTOS", 900 => "NOVECIENTOS"); // $xcifra = trim($xcifra); $xlength = strlen($xcifra); $xpos_punto = strpos($xcifra, "."); $xaux_int = $xcifra;
<form name="forma1" action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <input type="text" name="cantidad" value="<?php echo isset($_POST['cantidad']) ? $_POST['cantidad'] : ''; ?> " size="50" maxlength="21"> <input type="submit" name="boton1" value="Convertir..."> <br> <textarea cols="70" rows="5"> <?php echo isset($_POST['cantidad']) ? numtoletras($_POST['cantidad']) : ''; ?> </textarea> </form> </body> </html> <?php function numtoletras($xcifra) { $xarray = array(0 => "Cero", 1 => "UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE", "VEINTI", 30 => "TREINTA", 40 => "CUARENTA", 50 => "CINCUENTA", 60 => "SESENTA", 70 => "SETENTA", 80 => "OCHENTA", 90 => "NOVENTA", 100 => "CIENTO", 200 => "DOSCIENTOS", 300 => "TRESCIENTOS", 400 => "CUATROCIENTOS", 500 => "QUINIENTOS", 600 => "SEISCIENTOS", 700 => "SETECIENTOS", 800 => "OCHOCIENTOS", 900 => "NOVECIENTOS"); $xcifra = trim($xcifra); $xlength = strlen($xcifra); $xpos_punto = strpos($xcifra, "."); $xaux_int = $xcifra; $xdecimales = "00"; if (!($xpos_punto === false)) {
public function getDocapartado($apartado) { $Apartado = $this->mysqli->query('select * from apartado where fk_expediente="' . $apartado . '"')->fetch_object(); $lote = $this->mysqli->query('select lote.lote, manzana.num_letra, lote.superficie,desarrollo.nombre, categoria.precio from lote, manzana, desarrollo, categoria where lote.id_lote=' . $Apartado->fk_lote . ' and lote.fk_manzana=manzana.id_manzana and desarrollo.id_desarrollo=manzana.fk_desarrollo and lote.fk_categoria = categoria.id_categoria')->fetch_object(); $cliente = $this->mysqli->query('select * from cliente where rfc="' . $Apartado->fk_rfc . '"')->fetch_object(); $PHPWord = new PHPWord(); $document = $PHPWord->loadTemplate(dirname(__FILE__) . '/PHPWord/Plantilla_recibo_apartado.docx'); $fecha_apartado = explode('-', $Apartado->fecha); $document->setValue('Dia', $fecha_apartado[2]); $document->setValue('Mes', $fecha_apartado[1]); $document->setValue('Año', $fecha_apartado[0]); $document->setValue('Expediente', $apartado); if ($cliente->tipo == 1) { $nombre_cliente = $cliente->nombre . " " . $cliente->ape_pate . " " . $cliente->ape_mate; } else { $nombre_cliente = $cliente->denominacion; } $document->setValue('Cliente', $nombre_cliente); $document->setValue('Ife', $cliente->clave_elector); $document->setValue('CURP', $cliente->curp); $document->setValue('RFC', $cliente->rfc); $document->setValue('Domicilio', $cliente->calle . " " . $cliente->numero_casa . ' Colonia ' . $cliente->colonia); $document->setValue('Telefono1', $cliente->telefono); $document->setValue('Telefono2', $cliente->movil); $document->setValue('Email', $cliente->email); $document->setValue('Cantidad', $Apartado->monto_apartado); $document->setValue('CantidadLetra', numtoletras($Apartado->monto_apartado)); $document->setValue('Lote', $lote->lote); $document->setValue('Manzana', $lote->num_letra); $document->setValue('Desarrollo', $lote->nombre); $document->setValue('PrecioMetro', $lote->precio); $document->setValue('Superficie', $lote->superficie); $document->setValue('Importe', ceil($lote->precio * $lote->superficie)); $document->setValue('Observaciones', $Apartado->observaciones); $document->save($apartado . '_reciboAparto.docx'); header("Content-disposition: attachment; filename={$apartado}._reciboAparto.docx"); header("Content-type: application/octet-stream"); readfile(url($apartado . '_reciboAparto.docx')); exit; }
$nc = $_GET['nc']; $q = "SELECT sum(total) as total FROM nota_credito_d WHERE active = 1 AND nota_credito_id={$nc}"; $q1 = dbQuery($q); $q2 = dbFetchAssoc($q1); echo $q2['total'] . "|" . numtoletras($q2['total']); break; case "cambiar_totales_nc_con_otro_motivo": $nc = $_GET['nc']; $q = "SELECT sum(total) as total FROM nota_credito_d WHERE active = 1 AND nota_credito_id={$nc}"; $q1 = dbQuery($q); $q2 = dbFetchAssoc($q1); echo $q2['total'] . "|" . numtoletras($q2['total']); break; case "num_to_letras": $numero = $_GET['numero']; echo numtoletras($numero); break; case "eliminar_factura": $id_factura = $_GET['id_factura']; $q = "UPDATE factura SET active = 0, fecha_modifica=now(), usuario_id={$usuario_id} WHERE id={$id_factura}"; $result = dbQuery($q); $pd = "UPDATE factura_d SET active = 0, fecha_modifica=now(), usuario_id={$usuario_id} WHERE factura_id={$id_factura}"; dbQuery($pd); if ($result) { echo "exito"; } else { echo "fracaso"; } break; case "verificar_si_existe_nota_credito_a_la_factura": $id_fact = $_GET['id_fact'];