<%
Option Explicit
%>
<%
Session.LCID = 2058
Dim ClaveC, ClienteC
ClaveC = Request("ClaveC")
ClienteC = Request("ClienteC")
%>
<!--#include file="User.asp"-->
<!--#include file="general.asp"-->
<html>
<head>
<title>::: Sistema MIM :::</title>
<link rel=stylesheet href="vista.css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// End -->
</script>
<script type="text/javascript" src="validacion.js"></script>
<script type="text/javascript">
<!--
function check(formname, submitbutton) {
var errors = '';
;
errors += checkNum(formname, 'Numped', 'Numero Pedido');
checkThisForm(formname, submitbutton, errors);
}
//-->
</script>
</head>
<BODY>
<!--#INCLUDE FILE="BARRA.asp"-->
<center>
<!--#include file="empresa.asp"--><br>
<hr>
<%
Dim Rs5
Dim Sql5
Set Rs5 = Server.CreateObject("ADODB.Recordset")
Sql5 = "select * from Fpedm where usuario = '" & nombre & "' order by npedm;"
Rs5.Open Sql5,cn1,1,2
%>
<%
do while not rs5.EOF
%>
<a href="<%=rs5.fields("Fpedm")%>.asp"><img src="image\<%=rs5.fields("fpedn")%>.gif" border=0 alt="<%=rs5.fields("fpedn")%>"></a>
<%
rs5.MoveNext
loop
%>
<center>
<HR>
<br>
<b> ***** Consulta De Pedidos ***** </B>
<br>
<br>
<%
Dim Rs11, Rs12, Rs13, Rs14, Rs15, Rs16, Rs17, Rs18
Dim Sql11, Sql12, Sql13, Sql14, Sql15, Sql16, Sql17, Sql18
Dim Cmd14, Cmd15, Cmd16, Cmd17, Cmd18
Dim Pedido, RegistroP
Dim Tpedido, Dpedido, EstatusP, StatusP
Dim Color, Colorfila
Dim registros_mostrados, num_registros, num_campos, Campo
Dim RemisionR, PartidaR, AlmacenR, CodigoR
Pedido = Request("Pedido")
'Numero de Paginas
If Request("pag")<>"" Then
Session("pagina") = Request("pag")
Else
Session("pagina") = 1
End If
%>
<Form action="Fpedcon.asp" name="Fpedido" method='post'>
<TABLE border=0 cellspacing=0 cellpadding=0 class="normal">
<Tr>
<TD align="Left" class="normal">Pedido: </td>
<Td align="center" class="normal">
<input type="text" class="normalc" Value="<%= Pedido %>" name="Pedido" size="7" style="text-align:right;" onChange="javascript:this.value=this.value.toUpperCase();">
</Td>
<td Align="Center"> <input type="submit" value="Buscar" class="normalc"> </td>
</tr>
</Table>
</form>
<%
If Pedido = "" Or Isnull(Pedido) Then
Else
Set Rs11 = server.CreateObject("ADODB.Recordset")
Sql11="Select Numfpede, Clifpede, Nomcli, Fecfpede, Labfpede, Usufpede, Nomvend, Confpede, Desdiv, Tpedido, Stafpede " &_
"From Fpedenc, Clientes, Vendedores, Monedas " &_
"Where Numfpede = "& Pedido &" and Clifpede = Clacli and Vencli = Cvevend and Monfpede = Cladiv;"
Rs11.Open Sql11,Cn1,1,2
'***** CUANDO ES FIN DE ARCHIVO *****
If Rs11.EOF Then
Else
'****** CONDICIONAL PARA SABER EL TIPO DE PEDIDO *******
Tpedido = Rs11("Tpedido")
If Tpedido = 0 Then
Dpedido = "COMPLETO"
Else If Tpedido = 1 then
Dpedido = "PARCIAL"
Else If Tpedido = 2 then
Dpedido = "PAR. COMPLETAS"
End IF
End IF
End IF
'****** CONDICIONAL PARA SABER EL STATUS DEL PEDIDO
EstatusP = Rs11("Stafpede")
If EstatusP = "A" then
StatusP = "Activo"
Else If EstatusP = "R" then
StatusP = "Apartado"
Else If EstatusP = "T" then
StatusP = "Surtido Completo"
Else If EstatusP = "P" then
StatusP = "Surtido Parcial"
Else If EstatusP = "C" then
StatusP = "Cancelado"
End If
End If
End If
End If
End If
%>
<Table>
<Tr>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Pedido </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Cliente </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Fecha </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Referencia </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Elaboro </b></td>
</Tr>
<Tr>
<TD align="Left" class="normaln"><%= Rs11("Numfpede") %> </td>
<TD align="Left" class="normaln">( <%= Rs11("Clifpede") %> ) <%= Rs11("Nomcli") %> </td>
<TD align="Left" class="normaln"><%= Rs11("Fecfpede") %> </td>
<TD align="Left" class="normaln"><%= Rs11("Labfpede") %> </td>
<TD align="Left" class="normaln"><%= Rs11("Usufpede") %> </td>
</Tr>
<Tr>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Agente </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Plazo </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Moneda </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Tipo </b></td>
<TD align="Left" class="normalw" bgcolor="#006699"><b>Status </b></td>
</Tr>
<Tr>
<TD align="Left" class="normaln"><%= Rs11("Nomvend") %> </td>
<TD align="Left" class="normaln"><%= Rs11("Confpede") %> </td>
<TD align="Left" class="normaln"><%= Rs11("Desdiv") %> </td>
<TD align="Left" class="normaln"><%= Dpedido %> </td>
<TD align="Left" class="normaln"><%= StatusP %> </td>
</Tr>
<Tr>
<TD align="Left" class="normalw" bgcolor="#006699"><b>O.C. </b></td>
</Tr>
<Tr>
<TD align="Left" class="normaln">
<%
Set Rs12 = Server.CreateObject("ADODB.Recordset")
Sql12 = "Select PedidoP, AnexoP " &_
"From ocpedidos " &_
"Where PedidoP = "& Pedido &";"
Rs12.Open Sql12,Cn1,1,2
If Rs12.Eof Then
Else
%>
<a href="Ocpedido/<%= Rs12("AnexoP") %>" onclick="NewWindow(this.href,'Pedido','790','470','yes');return false;"><%= Rs12("AnexoP") %></a>
<%
End If
%>
</td>
</Tr>
</Table>
<%
'***** RECORDSET PARA LAS PARTIDAS *****
Set Rs13 = Server.CreateObject("ADODB.Recordset")
Sql13 = "Select Regfpedd as Registro, Secfpedd As Partida, Codfpedd As Codigo, NomInv as Descripcion, Canfpedd as Cantidad, Csufpedd as Surtido, " &_
"Cpefpedd as Pendiente, Unifpedd as Unitario, Fpefpedd as F_Entrega " &_
"From Fpeddet, Inventarios " &_
"Where Npefpedd = "& Pedido &" and Codfpedd = Cveinv Order By secFpedd;"
Rs13.Open Sql13,Cn1,1,2
If Rs13.EOF Then
Else
num_registros = 10
RS13.PageSize=num_registros
RS13.AbsolutePage=Session("pagina")
%>
Pagina <b><%=Session("pagina")%></b> De <b><%=RS13.PageCount%></b>
<br>
Registros Encontrados: <b><%=RS13.RecordCount%></b>
<Hr>
<TABLE border="0" Cellspacing="1" Cellpadding="2" bordercolor="#c0c0c0">
<Tr>
<%
'Contamos el numero de campos
num_campos=Rs13.Fields.Count
%>
<td align="center" Class="normal" bgcolor="#d8d8d8">Partida</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Codigo</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Descripcion</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Cantidad</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Surtido</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Pendiente</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Unitario</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">F_Entrega</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Remision</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Factura</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Requisicion</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Orden_Compra</td>
<td align="center" Class="normal" bgcolor="#d8d8d8">Recepcion</td>
</Tr>
<%
registros_mostrados = 0
While (Not Rs13.eof And registros_mostrados < num_registros)
registros_mostrados = registros_mostrados + 1
RegistroP = Rs13("Registro")
If colorfila = 0 Then
Color= "#E8E8EC"
Colorfila = 1
else
Color= "#ffffff"
Colorfila = 0
end if
%>
<Tr>
<td class="normal" align="Right" bgcolor="<%=Color%>"><%= Rs13("Partida") %></td>
<td class="normal" align="Left" bgcolor="<%=Color%>"><%= Rs13("Codigo") %></td>
<td class="normal" align="Left" bgcolor="<%=Color%>"><%= Rs13("Descripcion") %></td>
<td class="normal" align="Right" bgcolor="<%=Color%>"><%= Formatnumber(Rs13("Cantidad")) %></td>
<td class="normal" align="Right" bgcolor="<%=Color%>"><%= Formatnumber(Rs13("Surtido")) %></td>
<td class="normal" align="Right" bgcolor="<%=Color%>"><%= Formatnumber(Rs13("Pendiente")) %></td>
<td class="normal" align="Right" bgcolor="<%=Color%>"><%= Formatnumber(Rs13("Unitario")) %></td>
<td class="normal" align="Left" bgcolor="<%=Color%>"><%= Rs13("F_entrega") %></td>
<td class="normal" align="Left" bgcolor="<%=Color%>" Valign="Top">
<%
Set Cmd14 = server.CreateObject("ADODB.Command")
Set Cmd14.ActiveConnection = Cn1
Cmd14.CommandText = "Select Regfremd, Nrefremd, Secfremd, Almfremd, Codfremd, Canfremd, Stafreme " &_
"From Fremdet, Fremenc " &_
"Where Rgpfremd = "& RegistroP &" And Numfreme = Nrefremd;"
Set Rs14 = Server.CreateObject("ADODB.Recordset")
Set Rs14 = Cmd14.Execute()
If Rs14.Eof Then
RemisionR = 0
PartidaR = 0
AlmacenR = 0
CodigoR = "0"
Else
%>
<TABLE Border="0" Cellspacing=0 Cellpadding="0" Class="Normal">
<Tr>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Rem. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Cant. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Sta. </td>
</TR>
<%
Response.Flush
%>
<%
Do While Not Rs14.Eof
RemisionR = Rs14("Nrefremd")
PartidaR = Rs14("Secfremd")
AlmacenR = Rs14("Almfremd")
CodigoR = Rs14("Codfremd")
%>
<Tr>
<TD align="Right" class="normaln"><%= Rs14("Nrefremd") %> </td>
<TD align="Right" class="normaln"><%= Formatnumber(Rs14("canfremd")) %> </td>
<TD align="Center" class="normaln"><%= Rs14("Stafreme") %> </td>
</tr>
<%
Rs14.Movenext
Loop
%>
</Table>
<%
End If
%>
</td>
<td class="normal" align="Left" bgcolor="<%=Color%>" Valign="Top">
<%
Set Rs15 = Server.CreateObject("ADODB.Recordset")
Sql15 = "select Nfaffacd, Canffacd, Stafface " &_
"From Fremdet, Ffacdet, Ffacenc " &_
"Where Antfremd = "& Pedido &" And Rgpfremd = "& RegistroP &" " &_
"And Rgrffacd = Regfremd " &_
"And Numfface = Nfaffacd " &_
"Order by Regfremd, numfface;"
Rs15.Open Sql15,Cn1,1,2
If Rs15.Eof Then
Else
%>
<TABLE Border="0" Cellspacing=0 Cellpadding="0" Class="Normal">
<Tr>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Fac. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Cant. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Sta. </td>
</TR>
<%
Response.Flush
%>
<%
Do While Not Rs15.Eof
%>
<Tr>
<TD align="Right" class="normaln"><%= Rs15("Nfaffacd") %> </td>
<TD align="Right" class="normaln"><%= Formatnumber(Rs15("canffacd")) %> </td>
<TD align="Center" class="normaln"><%= Rs15("Stafface") %> </td>
</tr>
<%
Rs15.Movenext
Loop
%>
</Table>
<%
End If
%>
</td>
<td class="normal" align="Left" bgcolor="<%=Color%>" Valign="Top">
<%
Set Cmd16 = server.CreateObject("ADODB.Command")
Set Cmd16.ActiveConnection = Cn1
Cmd16.CommandText = "select numreqd, casreqd " &_
"from fpeddet, creqdet " &_
"where npefpedd = "& Pedido &" and regfpedd = "& RegistroP &" " &_
"and almfpedd = almreqd and codfpedd = codreqd " &_
"and npefpedd = pedreqd and secfpedd = parreqd;"
Set Rs16 = Server.CreateObject("ADODB.Recordset")
Set Rs16 = Cmd16.Execute()
If Rs16.Eof Then
Else
%>
<TABLE Border="0" Cellspacing=0 Cellpadding="0" Class="Normal">
<Tr>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Req. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Cant. </td>
</TR>
<%
Response.Flush
%>
<%
Do While Not Rs16.Eof
%>
<Tr>
<TD align="Right" class="normaln"><%= Rs16("Numreqd") %> </td>
<TD align="Right" class="normaln"><%= Formatnumber(Rs16("casreqd")) %> </td>
<TD align="Center" class="normaln"></td>
</tr>
<%
Rs16.Movenext
Loop
%>
</Table>
<%
End If
%>
</td>
<td class="normal" align="Left" bgcolor="<%=Color%>" Valign="Top">
<%
Set Cmd17 = server.CreateObject("ADODB.Command")
Set Cmd17.ActiveConnection = Cn1
Cmd17.CommandText = "select numord, csoord, staore " &_
"from corddet, cordenc, fpeddet " &_
"where numord = numore " &_
"and npefpedd = "& Pedido &" and regfpedd = "& RegistroP &" " &_
"and pinord = npefpedd and secfpedd = ppiord;"
Set Rs17 = Server.CreateObject("ADODB.Recordset")
Set Rs17 = Cmd17.Execute()
If Rs17.Eof Then
Else
%>
<TABLE Border="0" Cellspacing=0 Cellpadding="0" Class="Normal">
<Tr>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Ord. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Cant. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Sta. </td>
</TR>
<%
Do While Not Rs17.Eof
%>
<Tr>
<TD align="Right" class="normaln"><%= Rs17("Numord") %> </td>
<TD align="Right" class="normaln"><%= Formatnumber(Rs17("csoord")) %> </td>
<TD align="Right" class="normaln"><%= Rs17("Staore") %> </td>
</tr>
<%
Rs17.Movenext
Loop
%>
</Table>
<%
End If
%>
</td>
<td class="normal" align="Left" bgcolor="<%=Color%>" Valign="Top">
<%
Set Cmd18 = server.CreateObject("ADODB.Command")
Set Cmd18.ActiveConnection = Cn1
Cmd18.CommandText = "select numrdet, crerdet, starenc " &_
"from crecdet, crecenc, fpeddet " &_
"where numrdet = numrenc " &_
"and npefpedd = "& Pedido &" and regfpedd = "& RegistroP &" " &_
"and pinrdet = npefpedd and secfpedd = ppirdet;"
Set Rs18 = Server.CreateObject("ADODB.Recordset")
Set Rs18 = Cmd18.Execute()
If Rs18.Eof Then
Else
%>
<TABLE Border="0" Cellspacing=0 Cellpadding="0" Class="Normal">
<Tr>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Rec. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Cant. </td>
<TD align="Left" class="normaln" bgcolor="#C0C0C0">Sta. </td>
</TR>
<%
Do While Not Rs18.Eof
%>
<Tr>
<TD align="Right" class="normaln"><%= Rs18("Numrdet") %> </td>
<TD align="Right" class="normaln"><%= Formatnumber(Rs18("crerdet")) %> </td>
<TD align="Right" class="normaln"><%= Rs18("Starenc") %> </td>
</tr>
<%
Rs18.Movenext
Loop
%>
</Table>
<%
End If
%>
</td>
</tr>
<%
Rs13.MoveNext
Wend
%>
<Tr>
<Td colspan="<%=num_campos + 5 %>" align="center">
<%
i=0
While i<Rs13.PageCount
i = i + 1
%>
<b><a href="Fpedcon.asp?pag=<%=i%>&Pedido=<%= Pedido %>"><%=i%></a></b>
<%
Wend
%>
</td>
</tr>
</Table>
<%
'*** FIN DE CONDICIONAL PARTIDAS ***
End If
%>
<%
'**** FIN CUANDO SI HAY DATOS ****
End If
End If
%>
</body>
</html>
<%
End Sub
'Add the chosen course to the cart
Call AddUsuario()
'Display contents of electronic shopping cart
Call DisplayUsuario()
%>