Exemplo n.º 1
0
if ($_REQUEST["txtBusqueda"] != "") {
    $query .= " AND (c.nombre LIKE '%" . $_REQUEST["txtBusqueda"] . "%'\r\n\t\t\t\t\t\t\t\t\t\t  OR p.nombre LIKE '%" . $_REQUEST["txtBusqueda"] . "%' \r\n\t\t\t\t\t\t\t\t\t\t  OR d.nombre LIKE '%" . $_REQUEST["txtBusqueda"] . "%' \r\n\t\t\t\t\t\t\t\t\t\t  OR e.remesa LIKE '%" . $_REQUEST["txtBusqueda"] . "%' \r\n\t\t\t\t\t\t\t\t\t\t  OR e.factura LIKE '%" . $_REQUEST["txtBusqueda"] . "%'  \t\t\t\r\n\t\t\t\t\t\t\t\t\t\t) ";
}
if ($_REQUEST["cmbEstatusEnvio"] != "") {
    $query .= " AND e.ind_envio=" . $_REQUEST["cmbEstatusEnvio"];
}
$fechaI = $_REQUEST["cmbAnoI"] . "-" . $_REQUEST["cmbMesI"] . "-" . $_REQUEST["cmbDiaI"];
if ($fechaI != "--") {
    $query .= " AND e.fecha_creacion='" . $fechaI . "' ";
}
$query .= " ORDER BY e.fecha_creacion DESC, e.ind_envio, e.id DESC, e.remesa, e.factura ";
$result = obtenerResultset($link, $query);
$lastPage = ceil(numeroRegistros($result) / $rowsPerPage);
$query .= "LIMIT {$offset}, {$rowsPerPage}";
$result = obtenerResultset($link, $query);
while ($row = obtenerRegistro($result)) {
    $inactiva = false;
    if ($row->ind_activo == 0) {
        $inactiva = true;
    }
    ?>
               
          				<tr style="color: #000">
                			<td <?php 
    if ($inactiva) {
        ?>
 style="color:#999;" <?php 
    }
    ?>
>
								<?php 
Exemplo n.º 2
0
                		
                    	<td width="120" align="right"><strong><?php 
echo $valor;
?>
</strong></td>	

                	</tr>
            		<tr>
                    	<td class="text" colspan="11"><hr></td>
                	</tr>                  		
                	<?php 
$total_bultos = 0;
$total_mercancia = 0;
$total_peso = 0;
$total_viaje = 0;
while ($envio = obtenerRegistro($result2)) {
    ?>
           
          			<tr style="color:#999">
                		<td <?php 
    if ($inactiva) {
        ?>
 style="color:#999;" <?php 
    }
    ?>
>
							<?php 
    echo obtenerProveedorStr($link, $envio->id_proveedor);
    ?>
                    	</td>
                		<td <?php 
Exemplo n.º 3
0
function eliminarGuia($link, $id)
{
    $envios = obtenerEnviosGuia($link, $id);
    while ($row = obtenerRegistro($envios)) {
        $query = "UPDATE ts_envio SET id_guia=NULL WHERE id=" . $row->id;
        mysql_query($query, $link);
    }
    $query = "DELETE FROM ts_guia WHERE id=" . $id;
    mysql_query($query, $link);
    return "exitoEliminarGuia";
}
Exemplo n.º 4
0
    ?>
            			</tr>		
						<?php 
}
?>
                        
                        <tr>
                        	<td colspan="6">&nbsp;</td>
                        </tr>
            			<tr>
                    		<td class="text" colspan="11"><hr></td>
                		</tr>            
                		<?php 
$query = "SELECT id_guia,\r\n\t\t\t\t\t\t\t                 COUNT(1) facturas, \r\n\t\t\t\t\t\t\t                 SUM(bultos) bultos,\r\n\t\t\t\t\t\t\t                 SUM(mercancia) mercancia,\r\n\t\t\t\t\t\t\t                 SUM((flete/100)*mercancia) flete,\r\n\t\t\t\t\t\t\t                 SUM(viaje) viaje,\r\n\t\t\t\t\t\t\t                 SUM(peso*bskg) peso\r\n\t\t\t\t\t\t\t            FROM ts_envio\r\n\t\t\t\t\t\t\t           WHERE id_guia=" . $guia->id . " \r\n\t\t\t\t\t\t\t         GROUP BY id_guia";
$result2 = obtenerResultset($link, $query);
$totales = obtenerRegistro($result2);
?>
            
                        <tr>
                        	<td align="left">
                        		<strong>BULTOS</strong>
                            </td>
                        	<td align="center">
                        		<strong><?php 
echo $totales->bultos;
?>
</strong>
                            </td>
                        	<td align="center">
                        		<strong>FACTURAS</strong>
                            </td>
Exemplo n.º 5
0
            			<tr>
                    		<td class="text" colspan="11"><hr></td>
                		</tr> 
                        <tr>
                        	<td colspan="6">&nbsp;</td>
                        </tr> 
                        <tr>
                        	<td colspan="6"></td>
                        </tr>                                                                                               
          			</table>
                    <strong style="padding-left:15px">CHOFER</strong>&nbsp;
                     <select name="cmbChofer">
                     	<option value=""></option>
                     	<?php 
$choferes = obtenerChoferes($link);
while ($row = obtenerRegistro($choferes)) {
    ?>
                     	<option value="<?php 
    echo $row->id;
    ?>
">
                     	<?php 
    echo $row->nombre;
    ?>
                     	</option>
                     	<?php 
}
?>
                     </select> 
						&nbsp;                  		 	
                     <input name="action" type="hidden" value="Generar" />
}
if (isset($_GET["id"])) {
    $remesa = $_GET["remesa"];
    $id_cliente = $_GET["id"];
    $cliente = obtenerCliente($link, $id_cliente);
    $envios = obtenerEnviosClienteRemesa($link, $cliente->id, $remesa);
    $factura->proveedor = "";
    $factura->factura = "";
    $factura->total_bultos;
    $factura->total_mercancia = 0;
    $factura->total_peso = 0;
    $factura->flete = 0;
    $factura->bskg = 0;
    $factura->total_viaje = 0;
    $factura->seguro = obtenerSeguro($link);
    while ($row = obtenerRegistro($envios)) {
        $factura->proveedor .= obtenerProveedorStr($link, $row->id_proveedor) . ", ";
        $factura->factura .= $row->factura . ", ";
        $factura->total_bultos += $row->bultos;
        $factura->total_mercancia += $row->mercancia;
        $factura->total_peso += $row->peso;
        $factura->total_flete_mercancia += $row->mercancia * ($row->flete / 100);
        $factura->total_flete_peso += $row->peso * $row->bskg;
        $factura->total_viaje += $row->viaje;
        if ($factura->flete == 0) {
            $factura->flete = $row->flete;
        }
        if ($factura->bskg == 0) {
            $factura->bskg = $row->bskg;
        }
        if ($factura->tipo_cobro == "") {