<%@language=vbscript%>
<%
Response.Buffer=True
If Session("ID")=0 then
Response.Redirect("http://www.grupo-mim.com")
Response.End
Else
%>
<!--#include file="fpdf.asp"-->
<%
Session.LCID=2058
Session.timeout = 1000
Dim Rs11, Sql11, Rs12, Sql12, Rs13, Sql13
Dim Clave, Empresa,Digital
Dim Tipo,Digitalb, foliofiscal, Nodocumento
Dim Rs21, Sql21, Rs22, Sql22
Clave = Request("Clave")
Empresa = "MEXICO"
Set Cn1 = Server.CreateObject( "ADODB.Connection" )
Cn1.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID=ADMIMSIS;PWD=ST2108GP;Database=MEXICO"
Set Rs11 = server.CreateObject("ADODB.Recordset")
Sql11 = "Select Nombre, Direccion, Colonia, Poblacion, Telefono, Fax, Website From Empresa;"
Rs11.Open Sql11,Cn1,1,2
Negocio = Rs11("Nombre")
Direccion = Rs11("Direccion")
Colonia = Rs11("Colonia")
Poblacion = Rs11("Poblacion")
Telefono = Rs11("Telefono")
Fax = Rs11("Fax")
Website = Rs11("Website")
Set Rs12 = server.CreateObject("ADODB.Recordset")
Sql12 = "select * from EDOXPRV where cveprv = '"& Clave &"' " &_
"order by movcxpg, nrecxpg asc;"
Rs12.Open Sql12,Cn1,1,2
Set Rs13 = server.CreateObject("ADODB.Recordset")
Sql13 = "select Cveprv, Nomprv, Dirprv,Colprv, Pobprv, Edoprv, Cpprv, Rfcprv, Staprv " &_
"From Proveedores " &_
"where Cveprv = '"& Clave &"';"
Rs13.Open Sql13,Cn1,1,2
ClaveC = Rs13("Cveprv")
NombreC = Rs13("Nomprv")
CalleC = Rs13("Dirprv")
ColoniaC = Rs13("Colprv")
PoblacionC = Rs13("Pobprv")
EstadoC = Rs13("Edoprv")
CodigoPC = Rs13("Cpprv")
RFCC = Rs13("RFCprv")
StatusC = Rs13("Staprv")
If StatusC = "A" Then
StatusC = "ACTIVO"
Else If StatusC = "B" Then
StatusC = "BAJA"
Else If StatusC = "S" Then
StatusC = "SUSPENDIDO"
End If
End If
End If
Set pdf=CreateJsObject("FPDF")
pdf.CreatePDF "L", "mm", "Letter"
pdf.SetPath("fpdf/")
pdf.SetFillColor 13,16,121
pdf.Open()
pdf.LoadModels("CxpEdoprvPdf")
pdf.SetLeftMargin(8.0)
pdf.AddPage()
pdf.SetFont "Arial","",7
Do While Not Rs12.Eof
Tipo = Rs12("Descxpc")
Entrada = Rs12("Nrecxpg")
FechaE = Rs12("Frecxpg")
FechaP = Rs12("Fpacxpg")
ImporteO = Rs12("Impcxpg")
Pagado = Rs12("Pagcxpg")
Saldo = Rs12("Salcxpg")
Moneda = Rs12("Moncxpg")
Vencimiento = Rs12("Vencimiento")
If Cdbl(Moneda) = 1 Then
Pesos = Cdbl(Saldo)
PesosA = Cdbl(PesosA) + Cdbl(Saldo)
Dolares = 0
DolaresA = Cdbl( DolaresA)
ELse
Pesos = 0
PesosA = Cdbl(PesosA)
Dolares = Cdbl(Saldo)
DolaresA = Cdbl(DolaresA) + Cdbl(Saldo)
End If
pdf.Cell 25,4," ",0,0,"L",0
pdf.Cell 20,4,Mid(Tipo,1,10),0,0,"L",0
pdf.Cell 10,4,Cstr(Entrada),0,0,"R",0
pdf.Cell 15,4,Cstr(FechaE),0,0,"R",0
pdf.Cell 15,4,Cstr(FechaP),0,0,"R",0
pdf.Cell 20,4,Formatnumber(ImporteO),0,0,"R",0
pdf.Cell 20,4,Formatnumber(Pagado),0,0,"R",0
pdf.Cell 20,4,Formatnumber(Pesos),0,0,"R",0
pdf.Cell 20,4,Formatnumber(PesosA),0,0,"R",0
pdf.Cell 20,4,Formatnumber(Dolares),0,0,"R",0
pdf.Cell 20,4,Formatnumber(DolaresA),0,0,"R",0
pdf.Cell 20,4,Formatnumber(Vencimiento),0,0,"R",0
Pdf.Ln(4)
Rs12.Movenext
Loop
PesosAT = PesosAT + PesosA
DolaresAT = DolaresAT + DolaresA
Pdf.Ln(8)
pdf.Cell 145,4,"TOTAL: ",0,0,"R",0
pdf.Cell 20,4,"",0,0,"R",0
pdf.Cell 20,4,"TOTAL: ",0,0,"R",0
pdf.Cell 20,4,"",0,0,"R",0
Pdf.Ln(4)
pdf.Cell 145,4,"PESOS: ",0,0,"R",0
pdf.Cell 20,4,Formatnumber(PesosAT),0,0,"R",0
pdf.Cell 20,4,"DOLARES: ",0,0,"R",0
pdf.Cell 20,4,Formatnumber(DolaresAT),0,0,"R",0
Pdf.Ln(4)
pdf.Output()
End If
%>