<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Consulta rápida de pedimentos - SEPCE Agentes Aduanales
 
Patente:
Número de Pedimento:
   
<% dim Patente dim Pedimento dim Referencia dim rstPedimento dim rstStatusPedimento dim strConnStr dim objDBConn dim strSQL dim FacturaActual dim ContadorFactura ContadorFactura = 0 Patente = "" & request.Form("cboPatente") Pedimento = "" & request.Form("txtPedimento") if Pedimento <> "" and Patente <> "" then strConnStr = "Provider=SQLOLEDB.1;Password=ENy%rN4d52rY;Persist Security Info=True;User ID=spcsqluser;Initial Catalog=Pedimentos;Data Source=SPCJRZSVR" Set objDBConn = Server.CreateObject("ADODB.Connection") objDBConn.Open strConnStr Set rstPedimento = Server.CreateObject("ADODB.Recordset") rstPedimento.ActiveConnection = objDBConn rstPedimento.Source = "SELECT PEDI_nID, PEDI_tTipo FROM Pedimento WHERE PATE_tID = '" & Patente & "' AND PEDI_tNumeroPedimento = '" & Pedimento & "'" rstPedimento.CursorType = 0 rstPedimento.CursorLocation = 2 rstPedimento.LockType = 1 rstPedimento.Open() ' if rstPedimento.BOF = false and rstPedimento.EOF = false then%> <% Referencia = rstpedimento.Fields("PEDI_nID") Set rstExisteStatus = Server.CreateObject("ADODB.Recordset") rstExisteStatus.ActiveConnection = objDBConn rstExisteStatus.Source = "SELECT PePEDI_nID FROM PeStatusPedimento WHERE PePEDI_nID = " & Referencia rstExisteStatus.CursorType = 0 rstExisteStatus.CursorLocation = 2 rstExisteStatus.LockType = 1 rstExisteStatus.Open() if rstExisteStatus.BOF = false and rstPedimento.EOF = false then %>

<%=Patente%> - <%=Pedimento%>

<%rstPedimento.movefirst() rstPedimento.Close() strSQL = "SELECT dbo.Pedimento.PATE_tID AS Patente, dbo.Pedimento.PEDI_tTipo AS Tipo, dbo.Pedimento.PEDI_tNumeroPedimento AS Pedimento, dbo.PeStatusPedimento.PePEDI_nID AS Referencia, " strSQL = strSQL & " Catalogos.dbo.AtributosClavesPedimentos.ClavePed AS [Clave Pedimento], " strSQL = strSQL & " CASE dbo.Pedimento.PEDI_bTipoOperacion WHEN '0' THEN 'Exportacion' WHEN '-1' THEN 'Importacion' END AS Tipo_Operacion, " strSQL = strSQL & " Catalogos.dbo.CaSubestadoPedimento.CaSUPE_tDescripcion AS [Estatus del Pedimento], " strSQL = strSQL & " Catalogos.dbo.CaSubestadoPedimento.CaSUPE_nID, " strSQL = strSQL & " dbo.PeStatusPedimento.PeSTPE_dFechaRegistro AS [Fecha de Registro], " strSQL = strSQL & " dbo.PeStatusPedimento.PeSTPE_tHoraRegistro AS [Hora de Registro], " strSQL = strSQL & " dbo.PeStatusPedimento.PeSTPE_nConsecutivoFacturaAduana AS [Cvo. Factura Aduana], " strSQL = strSQL & " dbo.PeStatusPedimento.PeSTPE_nConsecutivoFactura AS [Cvo. Factura]" strSQL = strSQL & " FROM dbo.PeStatusPedimento INNER JOIN" strSQL = strSQL & " dbo.Pedimento ON dbo.PeStatusPedimento.PePEDI_nID = dbo.Pedimento.PEDI_nID INNER JOIN" strSQL = strSQL & " Catalogos.dbo.CaSubestadoPedimento ON dbo.PeStatusPedimento.CaSUPE_nID = Catalogos.dbo.CaSubestadoPedimento.CaSUPE_nID INNER JOIN" strSQL = strSQL & " Catalogos.dbo.AtributosClavesPedimentos ON dbo.Pedimento.IDClaveAtr = Catalogos.dbo.AtributosClavesPedimentos.IDClaveAtr" strSQL = strSQL & " WHERE dbo.PeStatusPedimento.PePEDI_nID = " & Referencia & " ORDER BY dbo.PeStatusPedimento.PeSTPE_nConsecutivoFacturaAduana, Catalogos.dbo.CaSubestadoPedimento.CaSUPE_nID" rstPedimento.Source = strSQL rstPedimento.Open()%> <%FacturaActual = "" FacturaAnterior = "" rstPedimento.movefirst() While (NOT rstPedimento.EOF) FacturaActual = "" & rstPedimento.Fields("Cvo. Factura Aduana")%> <%'if FacturaActual <> rstPedimento.Fields("Cvo. Factura Aduana") then if FacturaActual <> FacturaAnterior then%> <%end if%> <% if ContadorFactura = rstPedimento.fields("Cvo. Factura") then rstPedimento.MoveNext () else %> <% If FacturaActual = "" then %> <%FacturaAnterior = FacturaActual%> <% ContadorFactura = rstPedimento.fields("Cvo. Factura") rstPedimento.MoveNext() else %> <%FacturaAnterior = FacturaActual%> <% ContadorFactura = rstPedimento.fields("Cvo. Factura") rstPedimento.MoveNext() end if end if Wend%>
Pedimento Clave Tipo Operación Estatus del pedimento Fecha y hora de registro Consecutivo Aduana Consecutivo Pedimento














<%=rstPedimento.Fields("Patente")%> - <%=rstPedimento.Fields("Pedimento")%>
<%=rstPedimento.Fields("Clave Pedimento")%>
<%=rstPedimento.Fields("Tipo_Operacion")%>
<%=rstPedimento.Fields("Estatus del Pedimento")%>
<%=rstPedimento.Fields("Fecha de Registro")%> - <%=rstPedimento.Fields("Hora de Registro")%>
<%=rstPedimento.Fields("Cvo. Factura Aduana")%>
<%=rstPedimento.Fields("Cvo. Factura")%>
<%=rstPedimento.Fields("Patente")%> - <%=rstPedimento.Fields("Pedimento")%>
<%=rstPedimento.Fields("Clave Pedimento")%>
<%=rstPedimento.Fields("Tipo_Operacion")%>
<%%>
<%=rstPedimento.Fields("Fecha de Registro")%> - <%=rstPedimento.Fields("Hora de Registro")%>
"><%=rstPedimento.Fields("Cvo. Factura Aduana")%>
<%=rstPedimento.Fields("Cvo. Factura")%>
<%rstPedimento.Close() Set rstPedimento = Nothing else%>

El número de pedimento <%=Patente%>-<%=Pedimento%> aun no tiene historial de estatus.

<% end if else %>

El número de pedimento <%=Patente%>-<%=Pedimento%> no existe.

Verifíquelo por favor!

<%rstPedimento.Close() Set rstPedimento = Nothing end if objDBConn.Close() Set objDBConn = Nothing end if%>