
PK 
<!--#include file="includes/openconn.asp" -->
<!--#include file="includes/checkadmin.asp" -->
<!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(idarticulo,art_nombre) {
var answer = confirm("Quiere borrar el articulo " + art_nombre + " ?")
if (answer){
location.href="articulo_del.asp?idarticulo=" + idarticulo;
}
}
//-->
</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">
Control de stock</h1>
<ol class="breadcrumb">
Lista de Articulos faltantes o escasos
<li class="active"></li>
</ol>
</div>
</div>
<!-- Page Heading -->
<form role="form" action="reporte_controldestock.asp" method="POST" class="form" id="busca_articulo" name="busca_articulo">
<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-3">
<select name="idcategoria" id="idcategoria" class="form-control" onchange="document.busca_articulo.submit();">
<option value="">- Seleccionar -</option>
<%rs1.open "SELECT * FROM Q_categorias ORDER BY sec_nombre,cat_nombre",conn,3,1
if not rs1.eof then
rs1.movefirst%>
<%do until rs1.eof%>
<option value="<%=rs1("idcategoria")%>"
<%if cstr(rs1("idcategoria")) = request("idcategoria") then%> selected<%end if%>
><%=rs1("sec_nombre")%> - <%=rs1("cat_nombre")%></option>
<%rs1.movenext
loop
end if
rs1.close%>
</select>
</div>
<div class="col-lg-6">
<button type="button" class="btn btn-primary" onClick="location.href='reporte_controldestock.asp?Todos=SI'">Todos</button>
<button type="button" class="btn btn-primary" onClick="location.href='reporte_controldestock.asp?Sinstock=SI'">En falta</button>
<button type="button" class="btn btn-primary" onClick="location.href='reporte_controldestock.asp?art_publicado=SI'">Solo Publicados</button>
</div>
</div>
</form>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<%dim sqlstr
'sqlstr="SELECT Fups.*, Usuarios.nombre, Usuarios.idusuario, Usuarios.apellido FROM Fups LEFT JOIN Usuarios ON Fups.autor = Usuarios.idusuario ORDER BY idFups DESC"
sqlstr=""
if request("Todos") = "SI" then
sqlstr="SELECT * FROM Q_articulos WHERE art_stock < 0 OR Art_stock < art_stock_minimo ORDER BY sec_nombre,cat_nombre,art_nombre"
end if
if request("Sinstock") = "SI" then
sqlstr="SELECT * FROM Q_articulos WHERE art_stock < 0 ORDER BY sec_nombre,cat_nombre,art_nombre"
end if
if request("art_publicado") = "SI" then
sqlstr="SELECT * FROM Q_articulos WHERE (art_stock < 0 OR Art_stock < art_stock_minimo) AND art_publicado = true ORDER BY sec_nombre,cat_nombre,art_nombre"
end if
if request("idcategoria") <> "" then
sqlstr="SELECT * FROM Q_articulos WHERE (art_stock < 0 OR Art_stock < art_stock_minimo) AND idcategoria = " & request("idcategoria") & " ORDER BY sec_nombre,cat_nombre,art_nombre"
end if
' if request("clave") <> "" then
' sqlstr="SELECT * FROM Q_articulos WHERE art_nombre LIKE '%" & request("clave") & "%' OR art_codigo LIKE '%" & request("clave") & "%' OR art_copete LIKE '%" & request("clave") & "%' ORDER BY art_nombre"
' end if
'
' if request("idcategoria") <> "" then
' sqlstr="SELECT * FROM Q_articulos WHERE idcategoria = " & request("idcategoria") & " ORDER BY art_nombre"
' end if
'
' if request("art_publicado") = "NO" then
' sqlstr="SELECT * FROM Q_articulos WHERE art_publicado = false ORDER BY sec_nombre,cat_nombre,art_nombre"
' end if
'
' if request("art_oferta") = "SI" then
' sqlstr="SELECT * FROM Q_articulos WHERE art_oferta = true ORDER BY sec_nombre,cat_nombre,art_nombre"
' end if
'
' if request("art_apedido") = "SI" then
' sqlstr="SELECT * FROM Q_articulos WHERE art_apedido = true ORDER BY sec_nombre,cat_nombre,art_nombre"
' end if
'
' if request("art_novedad") = "SI" then
' sqlstr="SELECT * FROM Q_articulos WHERE art_novedad = true ORDER BY sec_nombre,cat_nombre,art_nombre"
' end if
'rs.CursorLocation = 3
if sqlstr <> "" then
rs.open sqlstr,conn,3,1
if rs.EOF then%>
<div class="alert alert-danger">
<strong>No se encontraron Articulos </strong>Intente nuevamente
</div>
<%else
dim xcant, cantstr, Compra_total
Compra_total =0
rs.movefirst%>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Nombre</th>
<th>Categoria</th>
<th>P.Compra</th>
<th>Stock</th>
<th>Minimo</th>
<th>Faltan</th>
<th>Subtotal</th>
<th width="70px"></th>
</tr>
</thead>
<tbody>
<%do until rs.EOF%>
<tr <%if rs("art_stock") < 0 then%>
style="background-color:#FFDDDD;"
<%else
if rs("art_stock") < rs("art_stock_minimo") then%>
style="background-color:#FFFFDD;"
<%end if
end if%> >
<td><a href="articulo_edit.asp?idarticulo=<%=rs("idarticulo")%>" title="Editar articulo"><%=rs("art_nombre")%> (<%=rs("art_presentacion")%>)</a></td>
<td><%=rs("sec_nombre")%>-<%=rs("cat_nombre")%></td>
<td align="right"><%if not isnull(rs("art_precio_compra")) then %>$ <%=formatnumber(rs("art_precio_compra"),2)%><%end if%></td>
<td align="right"><%=rs("art_stock")%>
<%if rs("art_stock") > 0 AND rs("art_unidadespc") > 0 then response.Write("(" & round(rs("art_stock")/rs("art_unidadespc"),0) & " Cajas)")%></td>
<td ><%=rs("art_stock_minimo")%>
<%if rs("art_stock_minimo") > 0 AND rs("art_unidadespc") > 0 then response.Write(" (" & round(rs("art_stock_minimo")/rs("art_unidadespc"),0) & " Cajas)")%></td>
<td align="right"><%if rs("art_stock_minimo") > 0 then%>
<%=rs("art_stock_minimo")-rs("art_stock")%>
<%else%>
<%=-rs("art_stock")%>
<%end if%>
</td>
<td align="right"><%if rs("art_stock_minimo") > 0 then
if not isnull(rs("art_precio_compra")) then
Compra_total = Compra_total + ((rs("art_stock_minimo")-rs("art_stock")) * rs("art_precio_compra"))%>
$ <%=formatnumber((rs("art_stock_minimo")-rs("art_stock")) * rs("art_precio_compra"),2)%>
<%end if
else
if not isnull(rs("art_precio_compra")) then
Compra_total = Compra_total + ((-rs("art_stock")) * rs("art_precio_compra"))%>
$ <%=formatnumber(-rs("art_stock") * rs("art_precio_compra"),2)%>
<%end if
end if%>
</td>
<td><a href="articulo_edit.asp?idarticulo=<%=rs("idarticulo")%>" title="Editar articulo"><i class="fa fa-pencil-square "></i></a> <a href="#" onclick="del_confirmation(<%=rs("idarticulo")%>,'<%=rs("art_nombre")%>');" title="Eliminar articulo"><i class="fa fa-times-circle"></i></a></td>
</tr>
<%rs.movenext
loop%>
</tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><h4>TOTAL</h4> </td>
<td align="right"><h4>$ <%=formatnumber(Compra_total,2)%></h4></td>
<td width="70px"></td>
</tr>
</table>
<%end if
rs.close
end if%>
</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