Exemplo n.º 1
0
 function funtiondevolucionCi()
 {
     $ciId = $_POST['ciId'];
     $motivo = $_POST['motivoCancelacion'];
     $devo = isset($_POST['devolucionOn']) ? $_POST['devolucionOn'] : '';
     if (empty($motivo)) {
         $this->session->set_flashdata('msg', '<div class="msgFlash"><img src="http://www.apeplazas.com/obras/assets/graphics/alerta.png" alt="Alerta"><strong>Favor de ingresar motivo de cancelación.</strong></div><br class="clear">');
         redirect("tempciri/cancelarCi/" . $ciId);
     }
     if (isset($devo) && $devo && empty($_FILES['fichaDevolucion']['name'])) {
         $this->session->set_flashdata('msg', '<div class="msgFlash"><img src="http://www.apeplazas.com/obras/assets/graphics/alerta.png" alt="Alerta"><strong>Favor de ingresar la ficha de devolución.</strong></div><br class="clear">');
         redirect("tempciri/cancelarCi/" . $ciId);
     } elseif (isset($devo) && $devo) {
         $permitidos = array('gif', 'png', 'jpg', 'pdf', 'GIF', 'PNG', 'JPG', 'PDF');
         $archivoNombre = $_FILES['fichaDevolucion']['name'];
         $archivoTipo = $_FILES['fichaDevolucion']['type'];
         $tamanoH = $_FILES['fichaDevolucion']['size'];
         $ext = pathinfo($archivoNombre, PATHINFO_EXTENSION);
         if (in_array($ext, $permitidos)) {
             move_uploaded_file($_FILES['fichaDevolucion']['tmp_name'], DIRFICHASDEV . $archivoNombre);
             $data = array('ciId' => $ciId, 'fichaNombre' => $archivoNombre);
             $this->db->insert('TEMPORA_CI_FICHAS_DEVOLUCION', $data);
             $fichadevId = $this->db->insert_id();
         } else {
             $this->session->set_flashdata('msg', '<div class="msg mt20 mb20">Favor de Ingresar un Formato valido.</div>');
             redirect("tempciri/cancelarCi/" . $ciId);
         }
     }
     $CiData = $this->tempciri_model->traerDatosCi($ciId);
     $op['depositoLetra'] = num_to_letras($CiData[0]->deposito);
     $op['vendedorNombre'] = $CiData[0]->vendedorNombre;
     $op['rentanLocalLetra'] = num_to_letras($CiData[0]->renta);
     $op['rentaCant'] = $CiData[0]->renta;
     $op['rentaDeposito'] = $CiData[0]->renta * 1.16;
     $op['local'] = $CiData[0]->local;
     $op['clientrfc'] = $CiData[0]->rfc;
     $op['clientEmail'] = $CiData[0]->email;
     $op['clientetelefono'] = $CiData[0]->telefono;
     $op['clientNom'] = preg_replace('/\\s+/', ' ', $CiData[0]->pnombre . ' ' . $CiData[0]->snombre . ' ' . $CiData[0]->apellidopaterno . ' ' . $CiData[0]->apellidomaterno);
     $op['crednum'] = $CiData[0]->rfc;
     $op['rentmes'] = $CiData[0]->contraroInicioMes;
     $op['rentduracion'] = $CiData[0]->contratoDuracion;
     $op['rentant'] = $CiData[0]->deposito;
     $op['remnumcuenta'] = $CiData[0]->devolucionCuenta;
     $op['rembanco'] = $CiData[0]->devolucionBanco;
     $op['fecha'] = date('d/m/Y', strtotime($CiData[0]->fecha));
     $op['rentaDepositoLet'] = num_to_letras($op['rentaDeposito']);
     $op['plaza'] = $CiData[0]->plazaNombre;
     $op['dirplaza'] = $CiData[0]->dir;
     $op['diasGracia'] = $CiData[0]->diasGracia;
     $op['gerente'] = $CiData[0]->gerentePlaza;
     $op['folioCompro'] = $CiData[0]->folioComprobante;
     $op['folioDoc'] = $CiData[0]->folio;
     $op['cancelarDoc'] = true;
     $this->load->helper(array('dompdf', 'file'));
     // page info here, db calls, etc.
     $html = $this->layouts->loadpdf('carta-intencion', $op, 'pdf_print', true);
     $data = pdf_create($html, '', false);
     write_file(DIRPDF . 'CI_' . $ciId . '.pdf', $data);
     $this->db->where('id', $ciId);
     $this->db->update('TEMPORA_CI', array('estado' => 'cancelado', 'motivoCancelacion' => $motivo));
     redirect("tempciri/verCi");
 }
Exemplo n.º 2
0
 <td colspan="3" class="Estilo5"></td ><td colspan="2" class="Estilo5"></td> <?php 
    }
    ?>
  </tr>
  <tr>
    <td class="Estilo3">DIESEL:</td>
    <?php 
    if ($item->nombre_gasolina == "DIESEL") {
        ?>
    <td colspan="3" class="Estilo5"><?php 
        echo $item->cantidad_asignada;
        ?>
</td>
    <td colspan="2" class="Estilo5"><?php 
        $this->load->helper('numeros_helper');
        echo num_to_letras($item->cantidad_asignada);
        ?>
</td>
    <?php 
    } else {
        ?>
 <td colspan="3" class="Estilo5"></td ><td colspan="2" class="Estilo5"></td> <?php 
    }
    ?>
  </tr>

  <tr>
    <td height="108" width="151" align="center" class="Estilo3">----------------------<br>
      DIRECTOR<br>
      SOLICITANTE</td>
    <td  height="108" width="168" colspan="2" align="center" class="Estilo3">-----------------------<br>
Exemplo n.º 3
0
      	</td>
      </tr>
      <?php 
}
?>
    </table></td>
  </tr>
    <?php 
$igv = $valores->monto * 18 / 100;
?>
  	<?php 
$subtotal = $valores->monto - $igv;
?>
  <tr class="row-footer">
    <td class="numletras" colspan="3"><?php 
echo num_to_letras($valores->monto);
?>
</td>
    <td class="subtotal"><?php 
echo number_format($subtotal, 2);
?>
</td>
  </tr>
  <tr class="row-footer">
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
    <td class="igv"><?php 
echo number_format($igv, 2);
?>
</td>
  </tr>