<%
Option Explicit
%>
<%
Session.LCID = 2058
%>
<!--#include file="User.asp"-->
<!--#include file="general.asp"-->
<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"--><br>
<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="normal" style="position:absolute; top:60px; left:10">
<%
dim rs5, sql5
set rs5 = server.CreateObject("ADODB.Recordset")
sql5 = "select * from Ffacm where (usuario like'" & nombre & "') order by ffacs asc"
rs5.open sql5,cn1,1,2
%>
<%
do while not rs5.EOF
%>
<a href="<%=rs5.fields("Ffacm")%>.asp"><img src="Image/<%=rs5.fields("ffacn")%>.gif" border=0 alt="<%=rs5.fields("ffacn")%>"></a>
<%
rs5.MoveNext
loop
%>
</div>
<div class="normal" style="position:absolute; top:100px; left:1">
<center>
<HR>
<BR>
<%
Dim Rs11, Sql11, Rs12, Sql12, Rs13, Sql13, Rs14, Sql14, Rs15, Sql15, Rs16, Sql16, rs17, Sql17
Dim Factura, Anticipo, Almacen, Nota
Dim Partida, FechaR, Subtotal
Factura = Request("Factura")
Anticipo = Request("Anticipo")
Almacen = Request("Almacen")
Nota = Request("Nota")
FechaR = date()
If Isnull(Anticipo) or Anticipo = "" or Anticipo = 0 then
%>
El Valor del Anticipo debe ser Mayor a Cero
<br>
<a href = "javascript:history.back()"><<< Regresar</a><br><br>
<%
Else
Set Rs11 = server.CreateObject("ADODB.Recordset")
Sql11 = "select max(secffacd) as Partida from ffacdet where nfaffacd = "& Factura &";"
Rs11.Open Sql11,Cn1,1,2
Partida = Rs11("Partida")
Partida = Cdbl(Partida) + 1
Set Rs12 = server.CreateObject("ADODB.Recordset")
Sql12 = "Insert into Ffacdet " &_
"(Nfaffacd, cliffacd, secffacd, Almffacd, codffacd, canffacd, Cdeffacd, preffacd, desffacd, uniffacd, " &_
"Ucoffacd, cprffacd, monffacd, Tcaffacd, fpeffacd, ivaffacd, antffacd, rgrffacd, obsffacd, usuffacd) " &_
"Select " &_
"numfface, Clifface, "& Partida &", "& Almacen &", 'AMORTIZACION', 1, 0, ("& Anticipo &" * -1), 0, ("& Anticipo &" * -1), " &_
"0, 0, monfface, tcafface, '"& FechaR &"', ivafface, 0, 0, '"& Nota &"', '"& Nombre &"' " &_
"From Ffacenc where numfface = "& Factura &";"
Cn1.Execute Sql12
Set Rs13 = server.CreateObject("ADODB.Recordset")
Sql13 = "Select sum(canffacd * uniffacd) as Importe " &_
"from ffacdet where nfaffacd = "& Factura &";"
Rs13.Open Sql13,Cn1,1,2
Subtotal = Rs13("Importe")
Set Rs14 = server.CreateObject("ADODB.Recordset")
Sql14 = "Update ffacenc " &_
"set antifface = "& Anticipo &", Ivtfface = (("& Subtotal &" * Ivafface)/100), Totfface = "& Subtotal &" + (("& Subtotal &" * Ivafface)/100) " &_
"From Ffacenc where Numfface = "& Factura &";"
Cn1.Execute Sql14
Set Rs15 = server.CreateObject("ADODB.Recordset")
Sql15 = "Update Cxcdet " &_
"Set Imdcxcd = totfface, Impcxcd = (Totfface * Tcafface) " &_
"From ffacenc where numfface = "& Factura &" and numfface = nfacxcd and Movcxcd = 1;"
Cn1.Execute Sql15
Set Rs16 = server.CreateObject("ADODB.Recordset")
Sql16 = "Update Cxcgen " &_
"Set Impcxcg = totfface, salcxcg = totfface, Imtcxcg = (Totfface * Tcafface) " &_
"From ffacenc where numfface = "& Factura &" and numfface = nfacxcg and Movcxcg = 1;"
Cn1.Execute Sql16
Set Rs17 = server.CreateObject("ADODB.Recordset")
Sql17 = "Update Clientes " &_
"Set Salcli = salcli - ("& Anticipo &" * Tcafface) " &_
"From ffacenc where Numfface = "& Factura &" and Clifface = Clacli;"
Cn1.Execute Sql17
Response.Redirect("ffacant.asp?factura="& Factura &"")
%>
<%
End If
%>
<hr>
</div>
</body>
</html>
<%
End Sub
'Add the chosen course to the cart
Call AddUsuario()
'Display contents of electronic shopping cart
Call DisplayUsuario()
%>