autcxc.asp
Características
| En Menú: | Sí |
| Formularios: | Ninguno |
| Consultas SQL: | 3 consulta(s) |
| Complejidad: | high |
| Bases de Datos: | Session DB |
Tablas Utilizadas (2)
Empresa
FPEDENC
Consultas SQL (3)
SQL Original (ASP)
Select * from Empresa;
Tablas:
Empresa
SQL Original (ASP)
select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend
SQL Original (ASP)
select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend from FPEDENC, CLIENTES, Vendedores, Monedas Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' Order by Fecfpede asc
Tablas:
FPEDENC
Comentarios y Notas (0)
No hay comentarios aún
Enlaces Salientes (2)
Páginas a las que esta página enlaza
| Archivo ASP | Tipo | Módulo | Estado | Página Razor |
|---|---|---|---|---|
cxcm.asp |
include | CXC | Pendiente | - |
default.asp |
redirect | General | Pendiente | - |
Enlaces Entrantes (0)
Páginas que enlazan a esta página
No hay enlaces entrantes
Código ASP Original: autcxc.asp
<%
Option Explicit
Session.LCID = 2058
'***** SI NO HA INICIADO SESION ***
If Session("Mybussiness") = "" then
Response.redirect("default.asp")
Else
Session.Timeout = 1200
'******* EN CASO DE ERROR ****
Err.Clear
On Error Resume Next
'*** REMPLAZA
Function Sanea(Texto)
Sanea = Replace(Texto, "'", "''")
End Function
%>
<!DOCTYPE html>
<HTML>
<HEAD>
<meta charset="ISO-8859-1" />
<TITLE>SISTEMA MIM <%= Session("Mybussiness") %> USUARIO: <%= Session("MyName") %></TITLE>
<link href="css/Modulos.css" rel="stylesheet" />
<link href="css/Buscador.css" rel="stylesheet" />
<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>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Buffer = True
'la siguiente linea escribe el encabezado... produciendo el refresh.
Response.AddHeader "Refresh", "15"
'***** Variables a la base de datos ****
Dim Cn1
Dim Rs11, Rs12, Rs13, Rs14
Dim Sql11, Sql12, Sql13, Sql14
Dim ColorFila, Msga
'***** Conexion a la Base de Datos
Set Cn1 = Server.CreateObject( "ADODB.Connection" )
Cn1.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database="& Session("Mybussiness") &""
'***** Conexion A la Tabla Empresa ****
Set Rs11 = Server.CreateObject("ADODB.Recordset")
Sql11="Select * from Empresa;"
Rs11.Open Sql11,Cn1,1,2
%>
<SECTION Class="HeaderGes">
<div Id="DivHeadGes">
<%= Rs11("Nombre") %><br>
<%= Rs11("Direccion") %>, <%= Rs11("colonia") %><br>
<%= Rs11("Poblacion") %>
</div>
</SECTION>
<!--#include file="cxcm.asp"-->
<SECTION>
<center>
<br>
<b>****** AUTORIZACION DE PEDIDOS (CREDITO) *****</b>
<br><br>
<% If Session("MyName") = "AGOMEZ" OR Session("MyName") = "PGUERRERO" OR Session("MyName") = "ASANCHEZ" OR Session("MyName") = "RURBINA" OR Session("MyName") = "BHERRERA" OR Session("MyName") = "NCASTILLO" THEN %>
<%
'******* VARIABLES PARA EL GRUPO *****
Dim Cn20, Cn21, Cn22, Cn23, Cn24, Cn25, Cn26, Cn27, Cn28, Cn29
Dim Cn30, Cn31, Cn32, Cn33, Cn34, Cn35, Cn36, Cn37,Cn41
Dim Rs20, Rs21, Rs22, Rs23, Rs24, Rs25, Rs26, Rs27, Rs28, Rs29
Dim Rs30, Rs31, Rs32, Rs33, Rs34, Rs35, Rs36, Rs37,Rs41
Dim Sql20, Sql21, Sql22, Sql23, Sql24, Sql25, Sql26, Sql27, Sql28, Sql29
Dim Sql30, Sql31, Sql32, Sql33, Sql34, Sql35, Sql36, Sql37,Sql41
'***** Conexion a la Base de Datos
Set Cn20 = Server.CreateObject( "ADODB.Connection" )
Cn20.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=BAJIO"
Set Rs20 = server.CreateObject("ADODB.Recordset")
Sql20 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs20.Open Sql20,Cn20,1,2
%>
<br><br>
<b>****** BAJIO *****</b>
<br><br>
<%
If Rs20.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs20.Eof
If Rs20("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs20("Numfpede") %>&FILIAL=BAJIO""><%= Rs20("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs20("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs20("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs20("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs20("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs20("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs20("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs20("Nomvend") %></Td>
</Tr>
<%
Rs20.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos
Set Cn41 = Server.CreateObject( "ADODB.Connection" )
Cn41.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=SLP"
Set Rs41 = server.CreateObject("ADODB.Recordset")
Sql41 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs41.Open Sql41,Cn41,1,2
%>
<br><br>
<b>****** SAN LUIS *****</b>
<br><br>
<%
If Rs41.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs41.Eof
If Rs41("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs41("Numfpede") %>&FILIAL=SLP""><%= Rs41("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs41("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs41("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs41("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs41("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs41("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs41("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs41("Nomvend") %></Td>
</Tr>
<%
Rs41.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos COATZACOALCOS ***
Set Cn21 = Server.CreateObject( "ADODB.Connection" )
Cn21.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=COATZA"
Set Rs21 = server.CreateObject("ADODB.Recordset")
Sql21 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs21.Open Sql21,Cn21,1,2
%>
<br><br>
<b>****** COATZACOALCOS *****</b>
<br><br>
<%
If Rs21.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs21.Eof
If Rs21("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs21("Numfpede") %>&FILIAL=COATZA"><%= Rs21("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs21("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs21("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs21("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs21("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs21("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs21("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs21("Nomvend") %></Td>
</Tr>
<%
Rs21.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos VILLAHERMOSA ***
Set Cn22 = Server.CreateObject( "ADODB.Connection" )
Cn22.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=VILLAHERMOSA"
Set Rs22 = server.CreateObject("ADODB.Recordset")
Sql22 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs22.Open Sql22,Cn22,1,2
%>
<br><br>
<b>****** VILLAHERMOSA *****</b>
<br><br>
<%
If Rs22.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs22.Eof
If Rs22("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs22("Numfpede") %>&FILIAL=VILLAHERMOSA"><%= Rs22("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs22("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs22("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs22("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs22("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs22("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs22("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs22("Nomvend") %></Td>
</Tr>
<%
Rs22.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos PINTURAS ***
Set Cn23 = Server.CreateObject( "ADODB.Connection" )
Cn23.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=PINTURAS"
Set Rs23 = server.CreateObject("ADODB.Recordset")
Sql23 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs23.Open Sql23,Cn23,1,2
%>
<br><br>
<b>****** PINTURAS *****</b>
<br><br>
<%
If Rs23.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs23.Eof
If Rs23("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs23("Numfpede") %>&FILIAL=PINTURAS"><%= Rs23("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs23("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs23("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs23("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs23("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs23("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs23("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs23("Nomvend") %></Td>
</Tr>
<%
Rs23.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos GUADALAJARA ***
Set Cn24 = Server.CreateObject( "ADODB.Connection" )
Cn24.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=GUADALAJARA"
Set Rs24 = server.CreateObject("ADODB.Recordset")
Sql24 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs24.Open Sql24,Cn24,1,2
%>
<br><br>
<b>****** GUADALAJARA *****</b>
<br><br>
<%
If Rs24.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs24.Eof
If Rs24("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs24("Numfpede") %>&FILIAL=GUADALAJARA"><%= Rs24("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs24("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs24("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs24("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs24("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs24("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs24("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs24("Nomvend") %></Td>
</Tr>
<%
Rs24.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos MIGPINTURAS ***
Set Cn25 = Server.CreateObject( "ADODB.Connection" )
Cn25.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=MIGPINTURAS"
Set Rs25 = server.CreateObject("ADODB.Recordset")
Sql25 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs25.Open Sql25,Cn25,1,2
%>
<br><br>
<b>****** MIGPINTURAS *****</b>
<br><br>
<%
If Rs25.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs25.Eof
If Rs25("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs25("Numfpede") %>&FILIAL=MIGPINTURAS"><%= Rs25("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs25("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs25("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs25("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs25("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs25("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs25("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs25("Nomvend") %></Td>
</Tr>
<%
Rs25.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos MEXICO ***
Set Cn26 = Server.CreateObject( "ADODB.Connection" )
Cn26.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=MEXICO"
Set Rs26 = server.CreateObject("ADODB.Recordset")
Sql26 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs26.Open Sql26,Cn26,1,2
%>
<br><br>
<b>****** MEXICO *****</b>
<br><br>
<%
If Rs26.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs26.Eof
Dim RecogeC
RecogeC = Rs26("RECOGE")
If RecogeC = true Then
ColorFila = "#FF5733 "
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs26("Numfpede") %>&FILIAL=MEXICO"><%= Rs26("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs26("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs26("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Nomvend") %></Td>
</Tr>
<%
Rs26.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos TAMPICO ***
Set Cn28 = Server.CreateObject( "ADODB.Connection" )
Cn28.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=TAMPICO"
Set Rs28 = server.CreateObject("ADODB.Recordset")
Sql28 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs28.Open Sql28,Cn28,1,2
%>
<br><br>
<b>****** TAMPICO *****</b>
<br><br>
<%
If Rs28.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs28.Eof
If Rs28("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs28("Numfpede") %>&FILIAL=TAMPICO"><%= Rs28("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs28("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs28("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Nomvend") %></Td>
</Tr>
<%
Rs28.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos MEXPINTURAS ***
Set Cn29 = Server.CreateObject( "ADODB.Connection" )
Cn29.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=MEXPINTURAS"
Set Rs29 = server.CreateObject("ADODB.Recordset")
Sql29 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs29.Open Sql29,Cn29,1,2
%>
<br><br>
<b>****** MEXPINTURAS *****</b>
<br><br>
<%
If Rs29.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs29.Eof
If Rs29("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs29("Numfpede") %>&FILIAL=MEXPINTURAS"><%= Rs29("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs29("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs29("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Nomvend") %></Td>
</Tr>
<%
Rs29.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos MIMTY ***
Set Cn30 = Server.CreateObject( "ADODB.Connection" )
Cn30.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=MIMTY"
Set Rs30 = server.CreateObject("ADODB.Recordset")
Sql30 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs30.Open Sql30,Cn30,1,2
%>
<br><br>
<b>****** MIMTY *****</b>
<br><br>
<%
If Rs30.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs30.Eof
If Rs30("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs30("Numfpede") %>&FILIAL=MIMTY"><%= Rs30("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs30("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs30("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs30("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs30("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs30("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs30("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs30("Nomvend") %></Td>
</Tr>
<%
Rs30.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos CANCUN ***
Set Cn31 = Server.CreateObject( "ADODB.Connection" )
Cn31.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=CANCUN"
Set Rs31 = server.CreateObject("ADODB.Recordset")
Sql31 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs31.Open Sql31,Cn31,1,2
%>
<br><br>
<b>****** CANCUN *****</b>
<br><br>
<%
If Rs31.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs31.Eof
If Rs31("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs31("Numfpede") %>&FILIAL=CANCUN"><%= Rs31("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs31("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs31("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs31("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs31("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs31("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs31("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs31("Nomvend") %></Td>
</Tr>
<%
Rs31.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos MERIDA ***
Set Cn32 = Server.CreateObject( "ADODB.Connection" )
Cn32.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=MERIDA"
Set Rs32 = server.CreateObject("ADODB.Recordset")
Sql32 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs32.Open Sql32,Cn32,1,2
%>
<br><br>
<b>****** MERIDA *****</b>
<br><br>
<%
If Rs32.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs32.Eof
If Rs32("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs32("Numfpede") %>&FILIAL=MERIDA"><%= Rs32("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs32("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs32("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs32("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs32("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs32("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs32("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs32("Nomvend") %></Td>
</Tr>
<%
Rs32.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos ORIZABA ***
Set Cn34 = Server.CreateObject( "ADODB.Connection" )
Cn34.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=ORIZABA"
Set Rs34 = server.CreateObject("ADODB.Recordset")
Sql34 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs34.Open Sql34,Cn34,1,2
%>
<br><br>
<b>****** ORIZABA *****</b>
<br><br>
<%
If Rs34.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs34.Eof
If Rs34("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs34("Numfpede") %>&FILIAL=ORIZABA"><%= Rs34("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs34("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs34("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs34("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs34("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs34("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs34("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs34("Nomvend") %></Td>
</Tr>
<%
Rs34.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos PUEBLA ***
Set Cn35 = Server.CreateObject( "ADODB.Connection" )
Cn35.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=PUEBLA"
Set Rs35 = server.CreateObject("ADODB.Recordset")
Sql35 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs35.Open Sql35,Cn35,1,2
%>
<br><br>
<b>****** PUEBLA *****</b>
<br><br>
<%
If Rs35.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs35.Eof
If Rs35("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs35("Numfpede") %>&FILIAL=PUEBLA"><%= Rs35("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs35("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs35("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs35("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs35("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs35("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs35("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs35("Nomvend") %></Td>
</Tr>
<%
Rs35.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos Indmexmexico ***
Set Cn36 = Server.CreateObject( "ADODB.Connection" )
Cn36.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=Indmexmexico"
Set Rs36 = server.CreateObject("ADODB.Recordset")
Sql36 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs36.Open Sql36,Cn36,1,2
%>
<br><br>
<b>****** INDMEXMEXICO *****</b>
<br><br>
<%
If Rs36.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs36.Eof
If Rs36("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs36("Numfpede") %>&FILIAL=Indmexmexico"><%= Rs36("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs36("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs36("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Nomvend") %></Td>
</Tr>
<%
Rs36.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos
Set Cn37 = Server.CreateObject( "ADODB.Connection" )
Cn37.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=RIO"
Set Rs37 = server.CreateObject("ADODB.Recordset")
Sql37 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs37.Open Sql37,Cn37,1,2
%>
<br><br>
<b>****** RIO *****</b>
<br><br>
<%
If Rs37.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs37.Eof
If Rs37("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs37("Numfpede") %>&FILIAL=RIO"><%= Rs37("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs37("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs37("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs37("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs37("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs37("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs37("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs37("Nomvend") %></Td>
</Tr>
<%
Rs37.Movenext
Loop
%>
</Table>
<%
End If
%>
<% Else
%>
<%
'***** Conexion a la Base de Datos MEXICO ***
Set Cn26 = Server.CreateObject( "ADODB.Connection" )
Cn26.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=MEXICO"
Set Rs26 = server.CreateObject("ADODB.Recordset")
Sql26 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs26.Open Sql26,Cn26,1,2
%>
<br><br>
<b>****** MEXICO *****</b>
<br><br>
<%
If Rs26.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs26.Eof
RecogeC = Rs26("RECOGE")
If RecogeC = true Then
ColorFila = "#FF5733"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs26("Numfpede") %>&FILIAL=MEXICO"><%= Rs26("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs26("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs26("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs26("Nomvend") %></Td>
</Tr>
<%
Rs26.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos Indmexmexico ***
Set Cn36 = Server.CreateObject( "ADODB.Connection" )
Cn36.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=Indmexmexico"
Set Rs36 = server.CreateObject("ADODB.Recordset")
Sql36 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs36.Open Sql36,Cn36,1,2
%>
<br><br>
<b>****** INDMEXMEXICO *****</b>
<br><br>
<%
If Rs36.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs36.Eof
If Rs36("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs36("Numfpede") %>&FILIAL=Indmexmexico"><%= Rs36("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs36("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs36("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs36("Nomvend") %></Td>
</Tr>
<%
Rs36.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos TAMPICO ***
Set Cn28 = Server.CreateObject( "ADODB.Connection" )
Cn28.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=TAMPICO"
Set Rs28 = server.CreateObject("ADODB.Recordset")
Sql28 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs28.Open Sql28,Cn28,1,2
%>
<br><br>
<b>****** TAMPICO *****</b>
<br><br>
<%
If Rs28.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs28.Eof
If Rs28("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs28("Numfpede") %>&FILIAL=TAMPICO"><%= Rs28("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs28("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs28("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs28("Nomvend") %></Td>
</Tr>
<%
Rs28.Movenext
Loop
%>
</Table>
<%
End If
%>
<%
'***** Conexion a la Base de Datos MEXPINTURAS ***
Set Cn29 = Server.CreateObject( "ADODB.Connection" )
Cn29.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database=MEXPINTURAS"
Set Rs29 = server.CreateObject("ADODB.Recordset")
Sql29 = "select Numfpede, Fecfpede, Clifpede, nomcli, stafpede, totfpede, desdiv, Recoge, Nomvend " &_
"from FPEDENC, CLIENTES, Vendedores, Monedas " &_
"Where CLIFPEDE = CLACLI and Vencli = Cvevend and Monfpede = Cladiv and FDCFPEDE is null AND FDVFPEDE > '' AND Eautoriza = 9 AND STAFPEDE = 'A' " &_
"Order by Fecfpede asc"
Rs29.Open Sql29,Cn29,1,2
%>
<br><br>
<b>****** MEXPINTURAS *****</b>
<br><br>
<%
If Rs29.Eof Then
Else
%>
<Table Align="center">
<Tr Class="InvResultado">
<Td>Pedido</Td>
<Td>Fecha</Td>
<Td>Clave</Td>
<Td>Cliente</Td>
<Td>Status</Td>
<Td>Importe</Td>
<Td>Moneda</Td>
<Td>Recoge</Td>
<Td>Vendedor</Td>
</Tr>
<%
Do While Not Rs29.Eof
If Rs29("Recoge") = 1 Then
ColorFila = "#FFF447"
Msga = "SI"
Else
ColorFila = ""
Msga = "NO"
End IF
%>
<Tr Class="InvResultado">
<Td Bgcolor="<%= ColorFila %>"><a Href="Autpcxcd.asp?Pedido=<%= Rs29("Numfpede") %>&FILIAL=MEXPINTURAS"><%= Rs29("Numfpede") %> </a></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Fecfpede") %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Clifpede") %> </Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Nomcli") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Rs29("Stafpede") %></Td>
<Td Align="Right" Bgcolor="<%= ColorFila %>"><%= FormatNumber(Rs29("Totfpede")) %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Desdiv") %></Td>
<Td Align="Center" Bgcolor="<%= ColorFila %>"><%= Msga %></Td>
<Td Bgcolor="<%= ColorFila %>"><%= Rs29("Nomvend") %></Td>
</Tr>
<%
Rs29.Movenext
Loop
%>
</Table>
<%
End If
%>
</SECTION>
<%
End If
%>
<%
If Err.Number <> 0 Then
%>
<br><br>
Número de Error: <%= Err.Number %><BR>
Descripción: <%= Err.Description %><BR>
Origen: <%= Err.Source %><BR>
Linea: <%= Err.Line %><BR>
<br>
<%
Else
'****** FIN DE LOS ERRORES ***
End If
%>
</BODY>
</HTML>
<%
'FIN DE SESION
End If
%>
1602 líneas de código
Code Behind: Clientes/Autcxc.cshtml.cs
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using MimPortal.Data;
using MimPortal.Data.Entities;
namespace MimPortal.Pages.Clientes
{
public class AutcxcModel : PageModel
{
private readonly MimDbContext _context;
public AutcxcModel(MimDbContext context)
{
_context = context;
}
public Dictionary<string, List<PedidoPendiente>> PedidosPorFilial { get; set; } = new();
public int TotalPedidos { get; set; }
public async Task OnGetAsync()
{
var sucursal = HttpContext.Session.GetString("Sucursal") ?? "MERIDA";
// Get pending orders that need credit authorization
// EAUTORIZA = 9 means pending authorization, STAFPEDE = 'A' means active
var pedidos = await _context.FPEDENC
.Where(p => p.EAUTORIZA == 9 && p.STAFPEDE == "A" && p.FDCFPEDE == null && p.FDVFPEDE != null)
.Join(_context.CLIENTES, p => p.CLIFPEDE, c => c.CLACLI, (p, c) => new { Pedido = p, Cliente = c })
.Join(_context.VENDEDORES, pc => pc.Cliente.VENCLI, v => v.CVEVEND, (pc, v) => new { pc.Pedido, pc.Cliente, Vendedor = v })
.Select(pcv => new PedidoPendiente
{
NumPedido = pcv.Pedido.NUMFPEDE,
Fecha = pcv.Pedido.FECFPEDE,
ClaveCliente = pcv.Pedido.CLIFPEDE ?? "",
NombreCliente = pcv.Cliente.NOMCLI ?? "",
Status = pcv.Pedido.STAFPEDE ?? "",
Total = pcv.Pedido.TOTFPEDE ?? 0,
Moneda = pcv.Pedido.MONFPEDE == 1 ? "MXN" : "USD",
Recoge = pcv.Pedido.RECOGE == true,
Vendedor = pcv.Vendedor.NOMVEND ?? ""
})
.OrderBy(p => p.Fecha)
.ToListAsync();
// Group by filial (for now, just use "Principal" since we're querying single DB)
PedidosPorFilial["Principal"] = pedidos;
TotalPedidos = pedidos.Count;
}
public class PedidoPendiente
{
public int NumPedido { get; set; }
public DateTime? Fecha { get; set; }
public string ClaveCliente { get; set; } = "";
public string NombreCliente { get; set; } = "";
public string Status { get; set; } = "";
public decimal Total { get; set; }
public string Moneda { get; set; } = "";
public bool Recoge { get; set; }
public string Vendedor { get; set; } = "";
}
}
}
64 líneas de código
Razor Page: Clientes/Autcxc.cshtml
@page
@model MimPortal.Pages.Clientes.AutcxcModel
@{
ViewData["Title"] = "Autorización de Pedidos (Crédito)";
}
<div class="container-fluid">
<h4 class="mb-4"><i class="fas fa-check-circle"></i> Autorización de Pedidos (Crédito)</h4>
<div class="alert alert-info">
<i class="fas fa-sync-alt"></i> Esta página se actualiza automáticamente cada 15 segundos.
<span class="badge bg-primary ms-2">@Model.TotalPedidos pedidos pendientes</span>
</div>
@if (Model.PedidosPorFilial != null && Model.PedidosPorFilial.Any())
{
@foreach (var filial in Model.PedidosPorFilial)
{
<div class="card mb-4">
<div class="card-header bg-primary text-white">
<h5 class="mb-0"><i class="fas fa-building"></i> @filial.Key</h5>
</div>
<div class="card-body">
@if (filial.Value.Any())
{
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead class="table-dark">
<tr>
<th>Pedido</th>
<th>Fecha</th>
<th>Clave</th>
<th>Cliente</th>
<th>Status</th>
<th>Importe</th>
<th>Moneda</th>
<th>Recoge</th>
<th>Vendedor</th>
<th>Acción</th>
</tr>
</thead>
<tbody>
@foreach (var pedido in filial.Value)
{
var rowClass = pedido.Recoge ? "table-warning" : "";
<tr class="@rowClass">
<td>
<a href="/Clientes/Autpcxcd?Pedido=@pedido.NumPedido&Filial=@filial.Key" class="text-primary fw-bold">
@pedido.NumPedido
</a>
</td>
<td>@pedido.Fecha?.ToString("dd/MM/yyyy")</td>
<td>@pedido.ClaveCliente</td>
<td>@pedido.NombreCliente</td>
<td class="text-center">
<span class="badge bg-warning">@pedido.Status</span>
</td>
<td class="text-end">@pedido.Total.ToString("N2")</td>
<td>@pedido.Moneda</td>
<td class="text-center">
@if (pedido.Recoge)
{
<span class="badge bg-success">SI</span>
}
else
{
<span class="badge bg-secondary">NO</span>
}
</td>
<td>@pedido.Vendedor</td>
<td>
<a href="/Clientes/Autpcxcd?Pedido=@pedido.NumPedido&Filial=@filial.Key" class="btn btn-sm btn-primary">
<i class="fas fa-eye"></i> Ver
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
}
else
{
<div class="alert alert-success mb-0">
<i class="fas fa-check"></i> No hay pedidos pendientes de autorización.
</div>
}
</div>
</div>
}
}
else
{
<div class="alert alert-success">
<i class="fas fa-check-circle"></i> No hay pedidos pendientes de autorización en ninguna filial.
</div>
}
</div>
@section Scripts {
<script>
// Auto-refresh every 15 seconds
setTimeout(function() {
location.reload();
}, 15000);
</script>
}
108 líneas de código