%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
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()%>
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%> |
|||||||||||||||||||||||||||||||||||