function mostrarResumen() { if (isset($_COOKIE['listaArticulos'])) { $total = 0.0; $cookies = (array) json_decode($_COOKIE['listaArticulos'], true); $productos = array(); $articulo; for ($i = 0; $i < sizeof($cookies['articulos']); $i++) { $datos = obtenerDatos($cookies['articulos'][$i]['articulo']['asin']); $articulo = array("articulo" => array("name" => $datos['idproducts'], "asin" => $cookies['articulos'][$i]['articulo']['asin'], "name" => $datos['name'], "numArticulo" => $cookies['articulos'][$i]['articulo']['numArticulo'], "price" => $datos['price'])); $oferta = '<div class="row">'; $oferta .= '<div class="col s10 borde-fila left-align"><p>' . $articulo["articulo"]['name'] . '</p></div>'; $oferta .= '<div class="col s1 borde-fila center-align"><p>' . $articulo['articulo']['numArticulo'] . '</p></div>'; $oferta .= '<div class="col s1 borde-fila right-align"><p>' . $articulo["articulo"]['price'] . '</p></div></div>'; $precio = (double) $articulo["articulo"]['price']; $cantidad = (double) $articulo['articulo']['numArticulo']; $total = (double) ($precio * $cantidad) + $total; /* // Insertaríamos los productos en la base de datos $sentencia; $valores = array($articulo["articulo"]['idproducts'], $articulo["articulo"]['asin'], $articulo["articulo"]['numArticulos'], $articulo["articulo"]['asin'], ); insertarFacturaPreparada($sentencia, $valores); */ echo $oferta; } $resultado = '<div class="row">'; $resultado .= '<div class="col s10 right-align"><p>Total</p></div>'; $resultado .= '<div class="col s2 borde right-align"><p>' . $total . '</p></div></div>'; echo $resultado; } else { $resultado = '<div class="col s12 center-align"><p></p></div>'; $resultado .= '<div class="col s12 center-align"><p>No hay productos en la cesta</p></div>'; $resultado .= '<div class="col s12 center-align"><p></p></div>'; $resultado .= '<div class="col s12 center-align"><p></p></div>'; echo $resultado; } }
CONCAT_WS(' ', cc.nombre,cc.paterno,cc.materno) AS cliente, cs.prefijo AS destino, IFNULL(f.total + f.sobmontoafacturar + f.otrosmontofacturar,0) AS importe, f.idusuario, CONCAT_WS(' ',ce.nombre,ce.apellidopaterno,ce.apellidomaterno) AS empleado FROM facturacion f INNER JOIN catalogosucursal cs ON f.idsucursal = cs.id INNER JOIN catalogocliente cc ON f.cliente = cc.id LEFT JOIN catalogoempleado ce ON f.idusuario = ce.id WHERE f.fecha BETWEEN '".cambiaf_a_mysql($_GET[fechainicio])."' AND '".cambiaf_a_mysql(((!empty($_GET[fechafin]))?$_GET[fechafin]:$_GET[fechainicio]))."' AND f.facturaestado='CANCELADO' AND f.idsucursal = ".$_GET[sucursal].""; obtenerDatos($facturascanceladas,$pdf,"FACTURAS CANCELADAS DEL DIA","SI"); //RELACION DE GUIAS CON AUTORIZACION PARA CANCELAR $criterioguiasforaneapagadacreditoentregadas = " INNER JOIN catalogocliente cc ON gv.idremitente = cc.id WHERE gv.estado = 'AUTORIZACION PARA CANCELAR' AND gv.idsucursalorigen = ".$_GET[sucursal]." AND gv.fecha BETWEEN '".cambiaf_a_mysql($_GET[fechainicio])."' AND '".cambiaf_a_mysql(((!empty($_GET[fechafin]))?$_GET[fechafin]:$_GET[fechainicio]))."' ORDER BY gv.idusuario"; obtenerDatos($s.$criterioguiasforaneapagadacreditoentregadas,$pdf,"RELACION DE GUIAS CON AUTORIZACION PARA CANCELAR","SI"); function ponerEncabezados($pdf,$tituloreporte,$medidas,$titulos){ $pdf->addLeyenda2($tituloreporte,38,10); $pdf->AddPage(); $pdf->SetFont('Arial','B',7); $pdf->SetWidths($medidas); $pdf->Titulos($titulos,$medidas); $pdf->SetFont('Arial','',5); } function ponerOcurre($pdf,$titulo){ $pdf->SetFont('Arial','B',7); $arr = array('0'=> '','1'=>'','2'=>$titulo,'3'=>"",'4'=>'','6'=>'','7'=>'','8'=>''); $pdf->Row($arr); $pdf->SetFont('Arial','',5); }
IFNULL(f.total + f.sobmontoafacturar + f.otrosmontofacturar,0) AS importe, f.idusuario, CONCAT_WS(' ',ce.nombre,ce.apellidopaterno,ce.apellidomaterno) AS empleado FROM facturacion f INNER JOIN catalogosucursal cs ON f.idsucursal = cs.id INNER JOIN catalogocliente cc ON f.cliente = cc.id LEFT JOIN catalogoempleado ce ON f.idusuario = ce.id WHERE f.fechacancelacion BETWEEN '".cambiaf_a_mysql($_GET[fechainicio])."' AND '".cambiaf_a_mysql(((!empty($_GET[fechafin]))?$_GET[fechafin]:$_GET[fechainicio]))."' AND f.facturaestado='CANCELADO' AND f.idsucursal = ".$_GET[sucursal]." AND f.tipoguia <> 'ventanilla'"; obtenerDatos($facturascanceladas,"FACTURAS CANCELADAS DEL DIA","SI",$l,$sucursalNombre); //RELACION DE GUIAS CON AUTORIZACION PARA CANCELAR $criterioguiasforaneapagadacreditoentregadas = " INNER JOIN catalogocliente cc ON gv.idremitente = cc.id WHERE gv.estado = 'AUTORIZACION PARA CANCELAR' AND gv.idsucursalorigen = ".$_GET[sucursal]." AND gv.fecha BETWEEN '".cambiaf_a_mysql($_GET[fechainicio])."' AND '".cambiaf_a_mysql(((!empty($_GET[fechafin]))?$_GET[fechafin]:$_GET[fechainicio]))."' ORDER BY gv.idusuario"; obtenerDatos($s.$criterioguiasforaneapagadacreditoentregadas,"RELACION DE GUIAS CON AUTORIZACION PARA CANCELAR","SI",$l,$sucursalNombre); function obtenerDatos($criterio,$tituloreporte,$llevausuario,$l,$sucursalNombre,$entregadas=null){ $r = mysql_query($criterio,$l) or die($s); if(mysql_num_rows($r)>0){ echo '<table width="800" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">'; echo '<tr>'; echo '<td>'; echo '<table width="100%" border="0" cellpadding="1" cellspacing="0">'; echo '<tr>'; echo '<td colspan="5" align="center" style="font-weight:bold">PAQUETERIA Y MENSAJERIA EN MOVIMIENTO</td>'; echo '</tr>'; echo '<tr>'; echo '<td width="97" style="font-weight:bold">REPORTE:</td>'; echo '<td colspan="5" >CORTE DIARIO DETALLADO </td>'; echo '</tr>';
$criterioguiasforaneapagadacontadoentregadas = " WHERE gv.tipoflete = 0 AND gv.condicionpago = 0 AND gv.estado = 'ENTREGADA' AND gv.idsucursaldestino = ".$_GET[sucursal]." AND ".((!empty($_GET[fechainicio]))? "gv.fecha BETWEEN '".cambiaf_a_mysql($_GET[fechainicio])."' AND '".cambiaf_a_mysql($_GET[fechafin])."'" : "gv.fecha = '".cambiaf_a_mysql($_GET[fecha])."'")." AND gv.estado<>'CANCELADO'"; obtenerDatos($s.$criterioguiasforaneapagadacontadoentregadas,$pdf,"GUIAS FORANEAS PAGADAS-CONTADO ENTREGADAS",""); //17) GUIAS FORANEAS PAGADAS-CREDITO ENTREGADAS $criterioguiasforaneapagadacreditoentregadas = " WHERE gv.tipoflete = 0 AND gv.condicionpago = 1 AND gv.estado = 'ENTREGADA' AND gv.idsucursaldestino = ".$_GET[sucursal]." AND ".((!empty($_GET[fechainicio]))? "gv.fecha BETWEEN '".cambiaf_a_mysql($_GET[fechainicio])."' AND '".cambiaf_a_mysql($_GET[fechafin])."'" : "gv.fecha = '".cambiaf_a_mysql($_GET[fecha])."'")." AND gv.estado<>'CANCELADO'"; obtenerDatos($s.$criterioguiasforaneapagadacreditoentregadas,$pdf,"GUIAS FORANEAS PAGADAS-CREDITO ENTREGADAS",""); //18) RELACION DE GUIAS CANCELADAS $criterioguiasforaneapagadacreditoentregadas = " WHERE gv.estado = 'CANCELADO' AND gv.idsucursalorigen = ".$_GET[sucursal]." AND ".((!empty($_GET[fechainicio]))? "gv.fecha BETWEEN '".cambiaf_a_mysql($_GET[fechainicio])."' AND '".cambiaf_a_mysql($_GET[fechafin])."'" : "gv.fecha = '".cambiaf_a_mysql($_GET[fecha])."'")." AND gv.estado<>'CANCELADO' ORDER BY gv.idusuario"; obtenerDatos($s.$criterioguiasforaneapagadacreditoentregadas,$pdf,"RELACION DE GUIAS CANCELADAS","SI"); function obtenerDatos($criterio,$pdf,$tituloreporte,$llevausuario){ $l = Conectarse("webpmm"); $r = mysql_query($criterio,$l) or die($criterio); $tguias = 0; $tvalor = 0; $data = array(); $total = mysql_num_rows($r); if($total>0){ while($f = mysql_fetch_array($r)){ $f[0] = cambio_texto($f[0]); $f[2] = cambio_texto($f[2]); $f[3] = cambio_texto($f[3]); $f[6] = cambio_texto($f[6]); $tguias++; $tvalor = $tvalor + $f[4];
echo '<script type="text/javascript">'.$js.'</script>'; echo '<script type="text/javascript">hayRestriccion=1;</script>'; echo '<br><input type="checkbox" name="chkboxRes" onclick="showRestriccion(this)" >Mostrar Restricción</input>'; } else{ echo "<br>Este usuario no cuenta con restricción de área<br>"; echo '<script type="text/javascript">hayRestriccion=0;</script>'; } ?> <button type="button" align="center" onClick="abrirPag('v3tool_restricciones.html')">Establecer Restricción</button><br /> <input type="checkbox" name="chkboxRuta" onclick="loadKml(this)" >Mostrar Ruta </input><br> </div> <div class="formulario" id="formulario"> <!-- verificamos si existe restricción guardada--> <?php obtenerDatos(); ?> </div> </div> <div class="mapa" id="map_canvas">Mapa</div> <div class="pie"> </div> </div> <?php function obtenerDatos() { include 'conectar.php'; include 'makerutakml_1.php'; //adecuar ID usr //$nomInsti=$_SESSION['nomInsti'];