<%
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 CXcM where (usuario like'" & nombre & "')"
rs5.open sql5,cn1,1,2
%>
<%
do while not rs5.EOF
%>
<a href="<%=rs5.fields("cxcm")%>.asp"><img src="Image/<%=rs5.fields("cxcn")%>.gif" border=0 ALT="<%=rs5.fields("cxCn")%>"></a>
<%
rs5.MoveNext
loop
%>
</div>
<div style="position:absolute; top:105px; left:10">
<center>
<hr>
<B>CAPTURA NOTAS DE CREDITO POR ANTICIPO </B>
<%
Dim Rs11, Sql11, Rs12, Sql12, Rs13, Sql13, Rs14, Sql14, Rs15, Sql15
Dim Rs16, Sql16, Rs17, Sql17, Rs18, Sql18, Rs19, Sql19, Rs20, Sql20
Dim Faplica, Cliente, Factura, SaldoF, MonedaF, TCF, Importe, Moneda, TCP, Concepto
Dim Folio, tiva, Iva, Retencion, IvaT, ReteT, ImporteT, ImporteMX, Anticipo, Tanticipo
Dim Idcxcg, Tcafac, Tcapag, Pergan
Faplica = Request("Faplica")
Cliente = Request("Cliente")
Factura = Request("Factura")
SaldoF = Request("SaldoF")
MonedaF = Request("MonedaF")
TCF = Request("TCF")
Importe = Request("Importe")
Moneda = Request("Moneda")
TCP = Request("TCP")
Concepto = Request("Concepto")
Tiva = Request("Tiva")
Idcxcg = 1 & "-" & Factura
Tcafac = Cdbl(Importe) * cdbl(TCF)
Tcapag = Cdbl(Importe) * cdbl(TCP)
Pergan = Cdbl(TcaPag) - Cdbl(TcaFac)
Set Rs11 = server.CreateObject("ADODB.Recordset")
Sql11 = "Select Ncredito from consecutivos;"
Rs11.open Sql11,cn1,1,2
Folio = Rs11("Ncredito") + 1
Set Rs12 = server.CreateObject("ADODB.Recordset")
Sql12 = "Select * from EsquemaIva where regiva = regiva;"
Rs12.open Sql12,cn1,1,2
Iva = Rs12("Iva")
Retencion = Rs12("Retencion")
IvaT = (Cdbl(Importe) * Cdbl(Iva)) /100
ReteT = (Cdbl(Importe) * Cdbl(Retencion)) /100
ImporteT = Cdbl(Ivat) + Cdbl(Importe) - Cdbl(ReteT)
ImporteMX = Cdbl(ImporteT) * Cdbl(TCP)
Set Rs13 = server.CreateObject("ADODB.Recordset")
Sql13 = "Insert Into CXCNCR " &_
"(NumNcr, FecNcr, CliNcr, NotNCR, DocNcr, MonNcr, Esqncr, TcaNcr, IvaNcr, RetNcr, SubNcr, IvTncr, ImpNcr, ImxNcr, " &_
"AntNcr, RefNcr, TanNcr, Impreso, ucosto, Cpromedio, MotNcr, RecNcr, UsuNca, TipoD) " &_
"Values ("& Folio &", '"& Faplica &"', '"& Cliente &"', '"& Sanea(Concepto) &"', "& Factura &", "& Moneda &", "& TCP &", " &_
""& Tiva &", "& Iva &", "& Retencion &", "& Importe &", "& IvaT &", "& ImporteT &", "& ImporteMX &", 0, "& Factura &", " &_
"0, 0, 0, 0, 0, 1, '"& Nombre &"', 1);"
Cn1.Execute Sql13
Set Rs14 = server.CreateObject("ADODB.Recordset")
Sql14 = "Insert Into CXCDET " &_
"(Movcxcd, Clicxcd, nfacxcd, refcxcd, doccxcd, frecxcd, fpacxcd, Moncxcd, Tcacxcd, Impcxcd, imdcxcd, Tcdcxcd, idcxcg) " &_
"Values(16, '"& Cliente &"', "& Factura &", "& Folio &", "& Folio &", '"& Faplica &"', '"& Faplica &"', "& Moneda &", " &_
""& Tcp &", ("& ImporteMx &" * -1) , ("& ImporteT &" * -1), 0, '"& Idcxcg &"');"
Cn1.Execute Sql14
Set Rs15 = server.CreateObject("ADODB.Recordset")
Sql15 = "Update Cxcgen " &_
"Set Ncacxcg = "& ImporteT &", Salcxcg = (Salcxcg - "& ImporteT &"), Pagcxcg = (Pagcxcg + "& ImporteT &"), " &_
"ImtCxcg = (Imtcxcg - "& ImporteMX &") where Nfacxcg = "& Factura &";"
Cn1.Execute Sql15
Set Rs16 = server.CreateObject("ADODB.Recordset")
Sql16 = "Update Clientes " &_
"Set salcli = (Salcli - "& ImporteMx &") where Clacli = '"& Cliente &"';"
Cn1.Execute Sql16
If Cdbl(pergan) < 0 then
Set Rs17 = server.CreateObject("ADODB.Recordset")
Sql17 = "Update Cxcgen Set " &_
"ImtCxcg = (Imtcxcg + "& Pergan &") where Nfacxcg = "& Factura &";"
Cn1.Execute Sql17
Set Rs18 = server.CreateObject("ADODB.Recordset")
Sql18 = "Update Clientes " &_
"Set salcli = (Salcli + "& Pergan &") where Clacli = '"& Cliente &"';"
Cn1.Execute Sql18
Set Rs19 = server.CreateObject("ADODB.Recordset")
Sql19 = "Insert Into CXCDET " &_
"(Movcxcd, Clicxcd, nfacxcd, refcxcd, doccxcd, frecxcd, fpacxcd, Moncxcd, Tcacxcd, Impcxcd, imdcxcd, Tcdcxcd, idcxcg) " &_
"Values(23, '"& Cliente &"', "& Factura &", "& Folio &", "& Folio &", '"& Faplica &"', '"& Faplica &"', 1, " &_
"1, "& Pergan &" , 0, 0, '"& Idcxcg &"');"
Cn1.Execute Sql19
Else If Cdbl(Pergan) > 0 then
Set Rs17 = server.CreateObject("ADODB.Recordset")
Sql17 = "Update Cxcgen Set " &_
"ImtCxcg = (Imtcxcg + "& Pergan &") where Nfacxcg = "& Factura &";"
Cn1.Execute Sql17
Set Rs18 = server.CreateObject("ADODB.Recordset")
Sql18 = "Update Clientes " &_
"Set salcli = (Salcli + "& Pergan &") where Clacli = '"& Cliente &"';"
Cn1.Execute Sql18
Set Rs19 = server.CreateObject("ADODB.Recordset")
Sql19 = "Insert Into CXCDET " &_
"(Movcxcd, Clicxcd, nfacxcd, refcxcd, doccxcd, frecxcd, fpacxcd, Moncxcd, Tcacxcd, Impcxcd, imdcxcd, Tcdcxcd, idcxcg) " &_
"Values(24, '"& Cliente &"', "& Factura &", "& Folio &", "& Folio &", '"& Faplica &"', '"& Faplica &"', 1, " &_
"1, "& Pergan &" , 0, 0, '"& Idcxcg &"');"
Cn1.Execute Sql19
End If
End If
Set Rs20 = server.CreateObject("ADODB.Recordset")
Sql20 = "Update Consecutivos set Ncredito = "& Folio &";"
Cn1.Execute Sql20
Response.redirect("Facelectro.asp?FolioF="& Folio &"&Electro=2")
%>
<HR>
MOVIMIENTO REALIZADO.<BR>
<HR>
<a href="javascript:history.back(1)">Volver Atrás</a>
<BR><BR>
</div>
</body>
</html>
<%
End Sub
'Add the chosen course to the cart
Call AddUsuario()
'Display contents of electronic shopping cart
Call DisplayUsuario()
%>