<%
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>
<center>
<HR>
<br>
<b> ***** Consulta De Pedidos Filiales ***** </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, PedidoC
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="SegFilial.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 LABFPEDE = '"& Pedido &"' and Clifpede = Clacli and Vencli = Cvevend and Monfpede = Cladiv and (tipocli='f' or tipocli='s');"
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>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("Desdiv") %> </td>
<TD align="Left" class="normaln"><%= Dpedido %> </td>
<TD align="Left" class="normaln"><%= StatusP %> </td>
</Tr>
</Table>
<%
'***** RECORDSET PARA LAS PARTIDAS *****
Set Rs13 = Server.CreateObject("ADODB.Recordset")
Sql13 = "Select Numfpede, 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, fpedenc, Inventarios " &_
"Where numfpede = npefpedd and labfpede = '"& Pedido &"' and Codfpedd = Cveinv and fecfpede> '01/01/2023'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">Pedido</td>
<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>
</Tr>
<%
registros_mostrados = 0
While (Not Rs13.eof And registros_mostrados < num_registros)
registros_mostrados = registros_mostrados + 1
PedidoC = Rs13("Numfpede")
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("Numfpede") %></td>
<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 = "& PedidoC &" 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>
</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()
%>