<%@ Language=VBScript %>
<%
Option Explicit
%>
<%
Session.LCID = 2058
%>
<!--#include file="User.asp"-->
<!--#include file="general.asp"-->
<%
Dim Rs11, Sql11, Rs12, Sql12, Rs13, Sql13, Rs14, Sql14, Rs15, Sql15, Rs16, Sql16, Rs17, Sql17
Dim Pago, Cveprv, Nomprv, Moneda, DMoneda, Tpago, Dtpago, Aplicar, DocuP, Documento, SaldoD, SaldoM
Dim Fmoneda, Fpago, FCap, TipoC, DifeC, TipoA, Importe, FmonedaA, ImporteDls, DesMonA, DesMonF
Dim DocuApli, DocumentoA, SaldoDls, SaldoMxp, Destino, IdDestino, DesDestino, TcambioE
Dim ColorL, Vpago, VpagoA, LecturaC, Paloma1, Paloma2
Cveprv = Request("Cveprv")
Moneda = Request("Moneda")
Pago = Request("Pago")
Aplicar = Request("Aplicar")
Tpago = Request("Tpago")
DocuP = Request("DocuP")
DocuApli = Request("DocuApli")
TcambioE = Request("TcambioE")
Fcap = Request("Fcap")
DifeC = Request("DifeC")
Destino = Request("destino")
IF Pago = "" then
Pago = 0
Else
Pago = Pago
End IF
IF Cveprv = "" or Cveprv = "00000000" then
Cveprv = "00000000"
Nomprv = "El Proveedor No Existe"
Else
Set Rs11 = server.CreateObject("ADODB.Recordset")
SQL11="Select Cveprv, Nomprv From Proveedores where Cveprv = '"& Cveprv &"';"
Rs11.open Sql11,Cn1,1,2
Nomprv = Rs11("Nomprv")
End If
If Moneda = "" then
Moneda = 1
Else
Moneda = Moneda
End If
If Aplicar = "" then
Aplicar = Pago
Else
Aplicar = Aplicar
End If
Set Rs12 = server.CreateObject("ADODB.Recordset")
SQL12="Select CLadiv, Desdiv, Tcadiv from monedas where Cladiv = "& Moneda &";"
Rs12.open Sql12,Cn1,1,2
Moneda = Rs12("Cladiv")
DMoneda = Rs12("Desdiv")
If Tpago = "" then
Tpago = 7
Else
Tpago = Tpago
End If
If DocuP = "" or DocuP = 0 then
Docup = 0
Documento = "000000"
SaldoD = 0
SaldoM = 0
Fmoneda = 1
Else
DocuP = DocuP
Set Rs14 = server.CreateObject("ADODB.Recordset")
SQL14="Select Regcxpg as Registro, Nrecxpg as Documento, Salcxpg as Saldo, (salcxpg * Tcacxpg) as pesos, " &_
"Desdiv as Fmoneda, Moncxpg, Tcacxpg As TipoC From cxpgen, Monedas where Regcxpg = "& DocuP &" and Cladiv = Moncxpg;"
Rs14.open Sql14,Cn1,1,2
Documento = Rs14("Documento")
SaldoD = Rs14("Saldo")
SaldoM = Rs14("Pesos")
Fmoneda = Rs14("Moncxpg")
DesMonF = Rs14("Fmoneda")
TipoC = Rs14("TipoC")
If Cdbl(SaldoM) < (Cdbl(Pago) * Cdbl(TipoC)) Then
Vpago = SaldoD
Else
Vpago = Aplicar
End IF
END IF
If DocuApli = "" or DocuApli = 0 then
DocuApli = 0
DocumentoA = "000000"
SaldoDls = 0
SaldoMxp = 0
FmonedaA = 1
Else
DocuApli = DocuApli
Set Rs17 = server.CreateObject("ADODB.Recordset")
SQL17="Select Regcxpg as Registro, Nrecxpg as Documento, Salcxpg as Saldo, (Salcxpg * Tcacxpg) as pesos, " &_
"Desdiv as FmonedaA, Moncxpg, Tcacxpg As TipoA From cxpgen, Monedas where Regcxpg = "& DocuApli &" and Cladiv = Moncxpg;"
Rs17.open Sql17,Cn1,1,2
DocumentoA = Rs17("Documento")
SaldoDls = Rs17("Saldo")
SaldoMxp = Rs17("Pesos")
FmonedaA = Rs17("Moncxpg")
DesMonA = Rs17("FmonedaA")
TipoA = Rs17("TipoA")
If Cdbl(SaldoMxp) < (Cdbl(Pago) * Cdbl(TipoA)) Then
VpagoA = SaldoDls
Else
VpagoA = Aplicar
End IF
END IF
If cdbl(Fmoneda) = cdbl(FmonedaA) then
If cdbl(SaldoD) =(1- cdbl(SaldoDls)) then
ImporteDls = cdbl(SaldoD)
Importe = cdbl(SaldoD) * cdbl(TipoC)
else If cdbl(SaldoD) < (1- cdbl(SaldoDls)) then
ImporteDls = cdbl(SaldoD)
Importe = cdbl(SaldoD) * cdbl(TipoC)
else If cdbl(SaldoD) > (1- cdbl(SaldoDls)) then
ImporteDls = (-1* cdbl(SaldoDls))
Importe = (-1 * cdbl(SaldoDls)) * cdbl(TipoA)
end if
end if
end if
else If cdbl(Fmoneda) > cdbl(FmonedaA) then
If (cdbl(SaldoD)*cdbl(TipoC)) =(-1 *cdbl(SaldoDls)) then
ImporteDls = cdbl(SaldoD)
Importe = cdbl(SaldoD) * cdbl(TipoC)
else If (cdbl(SaldoD)*cdbl(TipoC)) < (-1*cdbl(SaldoDls)) then
ImporteDls = cdbl(SaldoD)
Importe = cdbl(SaldoD) * cdbl(TipoC)
else If(cdbl(SaldoD)*cdbl(TipoC)) > (-1*cdbl(SaldoDls)) then
ImporteDls = (-1*(cdbl(SaldoDls)/cdbl(TcambioE)))
Importe = (-1*(cdbl(SaldoDls) * cdbl(TipoA)))
end if
end if
end if
else If cdbl(Fmoneda) < cdbl(FmonedaA) then
If cdbl(SaldoM) =(1- (cdbl(SaldoDls) * cdbl(TipoA))) then
ImporteDls = (cdbl(SaldoD)/cdbl(TcambioE))
Importe = cdbl(SaldoD)
else If cdbl(SaldoM) < (1- (cdbl(SaldoDls) * cdbl(TipoA))) then
ImporteDls = cdbl(SaldoD)/cdbl(TcambioE)
Importe = cdbl(SaldoD)
else If cdbl(SaldoM) > (1- (cdbl(SaldoDls) * cdbl(TipoA))) then
ImporteDls = (-1 * cdbl(saldodls))
Importe = (-1 * cdbl(SaldoDls)) * cdbl(TipoA)
end if
end if
end if
End If
End If
End If
If Fcap = "" then
Fpago = Date()
Else
Fpago = Fcap
End If
If DifeC = "" then
DifeC = 0
Paloma1 = "checked"
Paloma2 = ""
Else
DifeC = DifeC
Paloma1 = ""
Paloma2 = "checked"
End If
If TcambioE = "" then
TcambioE = 1
Else
TcambioE=TcambioE
End If
If DifeC < 0 then
ColorL = "#FC1A03"
Else
ColorL = "#000000"
End If
%>
<html>
<head>
<title>Grupo 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>
</head>
<BODY>
<!--#INCLUDE FILE="BARRA.asp"-->
<div class="normalw" style="position:absolute; top:1px">
<center>
<!--#include file="empresa.asp"-->
<hr>
</center>
</div>
<div class="normalw" style="position:absolute; top:1px;">
Bienvenido: <%= nombre %>. <br>
Hora Actual: <%= time %>
</div>
<div class="normalw" style="position:absolute; top:34px; left:1">
<!--#include file="mpro.asp"-->
</div>
<div class="normalw" style="position:absolute; top:1px;">
Bienvenido: <%= nombre %>. <br>
Hora Actual: <%= time %>
</div>
<div class="normalw" style="position:absolute; top:34px; left:1">
<!--#include file="mpro.asp"-->
</div>
<div class="normal" style="position:absolute; top:60px; left:10">
<%
dim rs5, sql5
set rs5 = server.CreateObject("ADODB.Recordset")
sql5 = "select * from CXPM where (usuario like'" & nombre & "')"
rs5.open sql5,cn1,1,2
%>
<%
do while not rs5.EOF
%>
<a href="<%=rs5.fields("cxPm")%>.asp"><img src="Image/<%=rs5.fields("cxPn")%>.gif" border=0 ALT="<%=rs5.fields("cxPn")%>"></a>
<%
rs5.MoveNext
loop
%>
</div>
<div style="position:absolute; top:95px; left:10">
<hr>
<center>
<b>Cuentas por Pagar
</center>
Aplicación de Saldos a Favor/Anticipos:
<hr>
<b>
<CENTER>
<!----------- FORMULARIO PARA GRABAR EL DOCUMENTO ----------->
<Form action="ApliCxpSal.asp" name="ApliCxpSal" method='post'>
<Table border=1 cellspacing=1 cellpadding=1 bordercolor="#006699">
<TR>
<TD width="80" align="left" class="normalw" bgcolor="#006699"><b>Fecha Pago</b></td>
<TD width="80" align="left" class="normalw" bgcolor="#006699"><b>Proveedor</b></td>
<TD width="200" align="left" class="normalw" bgcolor="#006699"><b>Nombre del Proveedor</b></td>
<TD width="120" align="left" class="normalw" bgcolor="#006699"><b>Doc a Pagar</b></td>
<TD width="100" align="left" class="normalw" bgcolor="#006699"><b>Saldo Doc.</b></td>
</tr>
<TR>
<TD width="80" align="Right" class="normalb" Valign=top>
<a href="AcalenP.asp?Cveprv=<%= Cveprv %>&Moneda=<%= Moneda %>&Pago=<%= Pago %>&Aplicar=<%= Aplicar %>
&Fcap=<%= Fpago %>&DocuP=<%= DocuP %>&DocuApli=<%= DocuApli %>"
onclick="NewWindow(this.href,'SClienteF','640','480','yes');return false;"">
<%= Fpago %>
</td>
<TD width="80" align="Center" class="normalb">
<a href="SProveF.asp?Cveprv=<%= Cveprv %>&Moneda=<%= Moneda %>&Pago=<%= Pago %>&Aplicar=<%= Aplicar %>
&Fcap=<%= Fpago %>&DocuP=<%= DocuP %>&DocuApli=<%= DocuApli %>&TcambioE=<%=TcambioE%>"
onclick="NewWindow(this.href,'BCliente','640','480','yes');return false;"">
<%= Cveprv %> </a>
</td>
<TD width="400" align="left" class="normalb"><%= Nomprv %></td>
<TD width="100" align="center" class="normalb">
<a href="ADocuP.asp?Cveprv=<%= Cveprv %>&Moneda=<%= Moneda %>&Pago=<%= Pago %>&Aplicar=<%= Aplicar %>
&Fcap=<%= Fpago %>&DocuP=<%= DocuP %>&DocuApli=<%= DocuApli %>&TcambioE=<%=TcambioE%>"
onclick="NewWindow(this.href,'SClienteF','640','480','yes');return false;"">
<%= Documento %> </a>
</td>
<TD width="400" align="Center" class="normalb">
<%= FormatNumber(SaldoD) %> - <%= DesMonF %> | <%= FormatNumber(SaldoM) %>
</td>
</tr>
<TR>
<TD width="100" align="left" class="normalw" bgcolor="#006699"><b>T.Cambio</b></td>
<TD width="80" align="left" class="normalw" bgcolor="#006699"><b>Documento</b></td>
<TD width="400" align="Center" class="normalw" bgcolor="#006699"><b>Saldo Moneda | Saldo Pesos</b></td>
<TD width="80" align="left" class="normalw" bgcolor="#006699"><b>Dif. Cam</b></td>
<TD width="120" align="left" class="normalw" bgcolor="#006699"><b>Descripcion</b></td>
</tr>
<TR>
<TD width="80" align="Center" class="normalb">
<a href="AdestinoP.asp?Pago=<%= Pago %>&Cveprv=<%= Cveprv %>&Moneda=<%= Moneda %>&Aplicar=<%= Aplicar %>
&DocuP=<%= DocuP %>&DocuApli=<%= DocuApli %>&Fcap=<%= Fpago %>&TcambioE=<%=TcambioE%>"
onclick="NewWindow(this.href,'BPago','800','600','yes');return false;"">
<%= TcambioE %> </a>
</td>
<TD width="100" align="center" class="normalb">
<a href="DocuSaP.asp?Pago=<%= Pago %>&Cveprv=<%= Cveprv %>&Moneda=<%= Moneda %>&Aplicar=<%= Aplicar %>
&DocuP=<%= DocuP %>&DocuApli=<%= DocuApli %>&Fcap=<%= Fpago %>&TcambioE=<%=TcambioE%>"
onclick="NewWindow(this.href,'BPago','800','600','yes');return false;"">
<%= DocumentoA %> </a>
</td>
<TD width="400" align="Center" class="normalb">
<%= FormatNumber(SaldoDls) %> - <%= DesMonA %> | <%= FormatNumber(SaldoMxp) %>
</td>
<TD width="120" align="Right" class="normalb">
<input type="text" class="normalb" Value="<%= Cdbl(ImporteDls) %>" name="ImporteDls" size=10 Style="text-align:right">
<input type="Text" class="normalb" Value="<%= cdbl(Importe) %>" name="ImporteC" size=20>
</td>
<TD width="100" align="Right" class="normalb">
<b Style="color:<%= ColorL %>"><%= Formatnumber(DifeC) %></b>
</td>
</tr>
<tr>
<TD width="400" align="Center" class="normalw" bgcolor="#006699" colspan=6><b>Observaciones</b></td>
</tr>
<tr>
<TD width="400" align="Left" class="normalb" colspan="6">
<input type="text" class="normalb" Value="" name="Observa" size=60>
</td>
</tr>
<TR>
<TD align="Center" class="normalb" Colspan="5">
Aplicar Pago: <input type="Radio" name="Proceso" value="1" <%= Paloma1 %>> |
Perdida O Ganancia Cambiaria: <input type="Radio" name="Proceso" value="2" <%= Paloma2 %>>
</td>
</tr>
<TR>
<TD align="Center" class="normalb" Colspan="5">
<input type="Hidden" class="normalb" Value="<%= Pago %>" name="Pago" size=30>
<input type="Hidden" class="normalb" Value="<%= TcambioE %>" name="TcambioE" size=30>
<input type="Hidden" class="normalb" Value="<%= Cveprv %>" name="Cveprv" size=30>
<input type="Hidden" class="normalb" Value="<%= Moneda %>" name="Moneda" size=30>
<input type="Hidden" class="normalb" Value="<%= Aplicar %>" name="Aplicar" size=30>
<input type="Hidden" class="normalb" Value="<%= Docup %>" name="DocuP" size=30>
<input type="Hidden" class="normalb" Value="<%= DocuApli %>" name="DocuApli" size=30>
<input type="Hidden" class="normalb" Value="<%= Fpago %>" name="Fcap" size=30>
<input type="hidden" class="normalb" Value="<%= Difec %>" name="Difec" size=30>
<input type="submit" value="Guardar" class=normalb onclick="javascript:this.form.submit();this.disabled= true;"></td>
</tr>
<TD align="Center" class="normalb" Colspan="5">
</td>
</tr>
</Table>
</form>
<br>
</body>
</html>
<%
End Sub
'Add the chosen course to the cart
Call AddUsuario()
'Display contents of electronic shopping cart
Call DisplayUsuario()
%>