PK

ADDRLIN : /HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/
FLL :
Current File : //HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/reporte_compraapedido1.asp

<!--#include file="includes/openconn.asp" -->

<!--#include file="includes/checkadmin.asp" -->

<%rs.open "SELECT * FROM Pedidos WHERE NOT ISNULL(ped_verificado) AND ISNULL(ped_descargado)",conn,2,2
if not rs.EOF then
	rs.movefirst
	do until rs.EOF
		if request("ped_" & rs("idpedido")) = "SI" then
			rs("ped_grupo") = true
			rs.update
		end if 
		rs.movenext
	loop
end if
rs.close%>

<!DOCTYPE html>
<html lang="en">

<head>

	<!--#include file="includes/metatags.asp" -->

	<link rel="stylesheet" href="lightbox/css/bootstrap-lightbox.min.css">
	<link rel="stylesheet" href="lightbox/prettify/prettify.css">

<script type="text/javascript">
<!--
function del_confirmation(idPedido,art_nombre) {
    var answer = confirm("Quiere borrar el Pedido " + art_nombre + " ?")
     if (answer){
     	location.href="Pedido_del.asp?idPedido=" + idPedido;
     }
}
//-->
</script>

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
           
           	<!--#include file="includes/navup.asp" -->
            
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <%session("seccion") = "Reportes"%>
            <!--#include file="includes/navizq.asp" -->

            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                        A pedido</h1>
                        <ol class="breadcrumb">
                          Lista de Pedidos y articulos para los que se necesita mercaderia A PEDIDO
                          <li class="active"></li>
                        </ol>
                    </div>
                     
                </div>
                    <!-- Page Heading -->
<!--                    <form role="form" action="Pedidos.asp" method="POST" class="form" id="busca_Pedido" name="busca_Pedido">

                    <div class="row">
                        <div class="col-lg-3">
                            <div class="form-group input-group" >
                            <input type="text" class="form-control" name="clave" id="clave" value="<%=request("clave")%>" placeholder="Buscar ...">
                            <span class="input-group-btn"><button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button></span>
                        	</div>
                        </div>

                        <div class="col-lg-9">
                        	<button type="button" class="btn btn-primary" onClick="location.href='Pedidos.asp?dias=7'">Ultima semana</button> 
                        	<button type="button" class="btn btn-primary" onClick="location.href='Pedidos.asp?dias=30'">Ultimo MES</button> 
                            <button type="button" class="btn btn-primary" onClick="location.href='Pedidos.asp?ped_verificado=NO'">Sin verificar</button> 
                            <button type="button" class="btn btn-primary" onClick="location.href='Pedidos.asp?ped_pagado=NO'">Sin pagar</button> 
                            <button type="button" class="btn btn-primary" onClick="location.href='Pedidos.asp?ped_descargado=NO'">Sin descargar</button> 
                            <button type="button" class="btn btn-primary" onClick="location.href='Pedidos.asp?ped_enviado=NO'">Sin enviar</button> 
                        </div>
                    </div>   
                  </form>-->
                    
                <!-- /.row -->
                
                <div class="row">
                    <div class="col-lg-12">

                      

                    
                    <h2>Articulos a cubrir  <button type="button" class="btn btn-primary" onclick="location.href='reporte_compraapedido_xls.asp';" ><i class="fa fa-file-excel-o"></i> Exportar</button></h2>
                    
                    <div class="table-responsive">
                      
                      <%dim sqlstr
					  sqlstr="SELECT * FROM Q_rep_items_apedido WHERE art_apedido = true ORDER BY item_nombre"
					  
                    'sqlstr="SELECT DISTINCT idPedido* FROM Q_Pedido_items WHERE ped_verificado = true AND ped_descargado = false AND art_apedido = true ORDER BY ped_now"
                  
                  rs.open sqlstr,conn,3,1
				  if rs.EOF then%>
                   <div class="alert alert-danger">
                    <strong>No se encontraron Pedidos </strong>Intente nuevamente
                </div>
                <%else
						dim tot_compra, cantstr
						tot_compra=0
						rs.movefirst%>
                        
                      <table class="table table-bordered table-hover">
                        <thead>
                          <tr>
                            <th width="70px">Cajas</th>
                            <th width="70px">Unid</th>
                            <th>Articulo</th>
                            <th>Stock</th>
                            <th>Faltan</th>
                            <th>Monto</th>

                          </tr>
                        </thead>
                        <tbody>
                          <%do until rs.EOF%>
                          <tr <%if rs("sumadeitem_cantidad") > rs("art_stock")  then%> style="background-color:#FFDDDD;"<%end if%> >
  
                            <td><% if rs("art_unidadespc") > 0  then%>
        <%if Int (rs("sumadeitem_cantidad")/rs("art_unidadespc")) > 0 then%>
        <%=Int (rs("sumadeitem_cantidad")/rs("art_unidadespc"))%> (x<%=rs("art_unidadespc")%>)
        <%end if%>
        <%end if%>
							
							</td>
							<td><% if rs("art_unidadespc") > 0 then%>
        <%if rs("sumadeitem_cantidad")-(Int (rs("sumadeitem_cantidad")/rs("art_unidadespc"))*rs("art_unidadespc")) > 0 then%>
        <%=rs("sumadeitem_cantidad")-(Int (rs("sumadeitem_cantidad")/rs("art_unidadespc"))*rs("art_unidadespc"))%>
        <%end if%>
        <%else%>
        <%if rs("sumadeitem_cantidad") > 0 then%>
        <%=rs("sumadeitem_cantidad")%>
        <%end if%>
        <%end if%></td>
                            <td><a href="articulo_edit.asp?idarticulo=<%=rs("xidarticulo")%>"><%=rs("item_nombre")%></a></td>
                            <td ><%=rs("art_stock")%></td>
                            <td ><%if rs("sumadeitem_cantidad") > rs("art_stock")  then response.Write(rs("sumadeitem_cantidad") - rs("art_stock"))%></td>
                            <td align="right" ><%if not isnull(rs("art_precio_compra")) then%>
                            $ <%=formatnumber(rs("sumadeitem_cantidad") * rs("art_precio_compra"),2)%>
                            
                            <%tot_compra = tot_compra +(rs("sumadeitem_cantidad") * rs("art_precio_compra"))
							end if%></td>
                            
                          </tr>
                          <%rs.movenext
						loop%>
                        </tbody>
                        				  <tr  style="background-color:#EEEEEE;">

                    <td class="destacado"></td>
                                        <td class="destacado"></td>
                                        <td class="destacado"></td>
                    <td class="destacado"></td>

				    <td align="right" class="destacado">TOTAL  = </td>
				    <td align="right" class="destacado"><b>$ <%=formatnumber(tot_compra,2)%></b></td>

				  </tr>  
                      </table>
                      <%end if
					  rs.close%>
                    </div>
                    
                </div>
                </div>
                
            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>

    <!-- LightBox JavaScript -->
	<script src="lightbox/js/scale.fix.js"></script>
	<script src="lightbox/prettify/prettify.js"></script>
	<script src="lightbox/js/bootstrap-lightbox.min.js"></script>
	
</body>

</html>

<!--#include file="includes/closeconn.asp" -->


PK 99