<%
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>
<script language="javascript">
stat=1
function frm_submit(frm,rec)
{
var msgDel,check
check = 0
msgDel = "Desea continuar ?"
if (rec == 1)
{
if(frm.chk.checked == false){
check = 0
}
else{
check= 1
}
}
else if(rec > 1 )
{
for(i=0;i<frm.chk.length;i++)
{
if(frm.chk[i].checked == true)
{
check = 1;
break;
}
}
}
if (check == 0)
{
alert("Debe Seleccionar por lo menos una partida")
return;
}
else if(check == 1)
{
ok = confirm(msgDel)
if (ok == false)
{
return;
}
else
{
frm.submit()
}
}
}
function en_dis(frm,RecCount,val){
var chkLength
// tg= document.getElementById(tag_id1).className
//if (tg =='slected'){
//for (i=1;i<5;i++){
//eval("document.getElementById(tag_id"+i+").className=''")
//}}
//else{
//for (i=1;i<5;i++){
//eval("document.getElementById(tag_id"+i+").className='slected'")
//}
//}
//tg_id.className='slected'
if (RecCount>1){
chkLength=frm.chk.length
}
else
{
chkLength=1
frm.chkMain.checked=frm.chk.checked
if (stat==1){
eval("document.frm."+val+".disabled=false")
stat=0
}
else{
eval("document.frm."+val+".disabled=true")
stat=1
}
return;
}
for(i=0;i<=chkLength-1;i++){
if(frm.chk[i].checked==false){
frm.chkMain.checked=false
break;
}
else{
frm.chkMain.checked=true
}
}
tt= eval("document.frm."+val+".disabled")
if (tt== true){
eval("document.frm."+val+".disabled=false")
}
else
eval("document.frm."+val+".disabled=true")
}
function chk_all(frm,RecCount){
var chkLength
if (RecCount>1)
{
chkLength=frm.chk.length
}
else if (RecCount==1)
{
chkLength=1
frm.chk.checked=frm.chkMain.checked
if (stat==1){
document.frm.txt_0.disabled=false
stat=0
}
else{
document.frm.txt_0.disabled=true
stat=1
}
return;
}
if(frm.chkMain.checked==true){
for (i=0;i<=chkLength-1;i++){
frm.chk[i].checked=true
//frm.txt[i].disabled= false
eval("frm.txt_"+i+".disabled= false")
}
}
else
{
for (i=0;i<=chkLength-1;i++){
frm.chk[i].checked=false
//frm.txt[i].disabled= true
eval("frm.txt_"+i+".disabled= true")
}
}
return;
}
</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 Rs11, Sql11, Rs12, Sql12, Rs13, Sql13
Dim Cliente, Nomcli, Pedido, Limite, Saldo, disponible
Dim Anticipo, Impoanti, Tcanticipo, Numanti
Cliente = Request("Cliente")
Pedido = Request("pedido")
Anticipo = Request("Anticipo")
If Cliente = "" then
Cliente = "00000000"
Nomcli = "Sin Seleccionar"
Else
Cliente = Cliente
Set Rs11 = server.CreateObject("ADODB.Recordset")
SQL11="Select Clacli, Nomcli, Limcli, Salcli From Clientes where Clacli = '"& Cliente &"';"
Rs11.open Sql11,Cn1,1,2
Nomcli = Rs11("Nomcli")
Limite = Rs11("Limcli")
Saldo = Rs11("Salcli")
Disponible = Cdbl(Limite) - Cdbl(Saldo)
End If
If Pedido = "" then
Pedido = "000000"
Else
Pedido = Pedido
Set Rs13 = server.CreateObject("ADODB.Recordset")
SQL13="Select regfremd, nrefremd, secfremd, desalm, codfremd, nominv, Cpefremd, Desdiv " &_
"from fremdet, inventarios, Almacenes, Monedas " &_
"where codfremd = cveinv and almfremd = claalm and antfremd = "& Pedido &" " &_
"and Monfremd = Cladiv and Cpefremd > 0 order by secfremd;"
Rs13.open Sql13,Cn1,1,2
End If
If Anticipo = "" or Anticipo = 0 then
Anticipo = 0
Numanti = 0
Impoanti = 0
Tcanticipo = 0
else
Anticipo = Anticipo
Set Rs12 = server.CreateObject("ADODB.Recordset")
SQL12="select regcxcg, nfacxcg, frecxcg, salcxcg, desdiv, tcacxcg from cxcgen, monedas " &_
"where movcxcg = 2 and moncxcg = cladiv and salcxcg < -1 and regcxcg = "& Anticipo &";"
Rs12.open Sql12,Cn1,1,2
NumAnti = rs12("nfacxcg")
Impoanti = rs12("salcxcg")
Tcanticipo = rs12("Tcacxcg")
End If
%>
<center>
<b>Emision de Facturas</b>
<hr>
<Table border=0 cellspacing=0 cellpadding=1>
<TR>
<TD width="80" align="left" class="normalw" bgcolor="#006699"><b>Cliente</b></td>
<TD width="400" align="left" class="normalw" bgcolor="#006699" Colspan="2"><b>Nombre</b></td>
<TD width="80" align="left" class="normalw" bgcolor="#006699"><b>Pedido</b></td>
</TR>
<TR>
<TD width="80" align="Right" class="normalb">
<a Href="BClienteF.asp?Cliente=<%= Cliente %>&Pedido=<%= Pedido %>" onclick="NewWindow(this.href,'BCliente','640','480','yes');return false;">
<%= Cliente %><a/>
</td>
<TD width="400" align="Left" class="normalb" Colspan="2">
<%= Nomcli %>
</td>
<TD width="80" align="Right" class="normalb">
<a Href="BPedidoF.asp?Cliente=<%= Cliente %>&Pedido=<%= Pedido %>&Anticipo=<%= Anticipo %>" onclick="NewWindow(this.href,'BCliente','640','480','yes');return false;">
<%= Pedido %><a/>
</td>
</tr>
<TR>
<TD width="280" align="center" class="normalw" bgcolor="#006699" Colspan="2"><b>Credito del Cliente</b></td>
<TD width="280" align="center" class="normalw" bgcolor="#006699" Colspan="2"><b>Anticipo</b></td>
</TR>
<TR>
<TD width="280" align="Center" class="normalb" Colspan="2">
<Table border=1 cellspacing=0 cellpadding=0 width="280px" bordercolor="#000000">
<tr>
<TD width="90" align="left" class="normaln" bgcolor="#c0c0c0"><b>Limite Credito</b></td>
<TD width="90" align="left" class="normaln" bgcolor="#c0c0c0"><b>Pagos Pendientes</b></td>
<TD width="100" align="left" class="normaln" bgcolor="#c0c0c0"><b>Credito Disponible</b></td>
</tr>
<tr>
<TD width="90" align="Right" class="normalb"><b><%= Formatnumber(Limite) %></b></td>
<TD width="90" align="Right" class="normalb"><b><%= Formatnumber(saldo) %></b></td>
<TD width="90" align="Right" class="normalb"><b><%= Formatnumber(Disponible) %></b></td>
</tr>
</table>
</td>
<TD width="280" align="Center" class="normalb" Colspan="2">
<Table border=1 cellspacing=0 cellpadding=0 width="280px" bordercolor="#000000">
<tr>
<TD width="90" align="left" class="normaln" bgcolor="#c0c0c0"><b>No. Anticipo</b></td>
<TD width="90" align="left" class="normaln" bgcolor="#c0c0c0"><b>Importe Ant</b></td>
<TD width="100" align="left" class="normaln" bgcolor="#c0c0c0"><b>Tipo Cambio Ant</b></td>
</tr>
<tr>
<TD width="90" align="Right" class="normalb"><b>
<a Href="BAnticipoF.asp?Cliente=<%= Cliente %>&Pedido=<%= Pedido %>&Anticipo=<%= Anticipo %>" onclick="NewWindow(this.href,'BCliente','640','480','yes');return false;">
<%= Numanti %><a/>
</td>
<TD width="90" align="Right" class="normalb"><b><%= Formatnumber(Impoanti) %></b></td>
<TD width="90" align="Right" class="normalb"><b><%= Formatnumber(Tcanticipo) %></b></td>
</tr>
</table>
</td>
</tr>
</Table>
<hr>
<%
If Pedido = 0 or Pedido = "" Then
%>
---------
<br>
<%
Else
If Rs13.EOF then
%>
No hay partidas a Facturar de este pedido<br>
<%
Else
%>
<!--------- EN ESTA PARTE ES PARA LAS PARTIDAS ------------->
<FORM action="FacNormal.asp" name="frm" method='post'>
<table border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#336699">
<td align="center"><input type="checkbox" name="chkMain" onClick="JavaScript:chk_all(document.frm,<%=rs13.recordcount%>)"></td>
<td class="n_verdana">Remision </td>
<td class="n_verdana">Partida </td>
<td class="n_verdana">Almacen </td>
<td class="n_verdana">Producto </td>
<td class="n_verdana">Descripcion </td>
<td class="n_verdana">Cantidad </td>
<td class="n_verdana">Pesos </td>
</tr>
<%
dim count,bg_color
count = 0
For i = 0 to rs13.RecordCount - 1
if (count Mod 2= 0) then bg_color="#ffffff" else bg_color="#EFF5F3" end if
%>
<tr bgcolor="<%=bg_color%>" >
<td align="center" >
<input type="checkbox" name="chk" value="<%=i%>" onClick="JavaScript:en_dis(document.frm,<%=rs13.recordcount%>,'txt_<%=i%>')">
</td>
<td class="n_verdana_simple" Align="Right"><%= rs13("nrefremd") %> </td>
<td class="n_verdana_simple" Align="Right"><%= rs13("secfremd") %> </td>
<td class="n_verdana_simple" Align="Left"><%= rs13("desalm") %> </td>
<td class="n_verdana_simple" Align="Left"><%= rs13("codfremd") %> </td>
<td class="n_verdana_simple" Align="Left"><%= rs13("nominv") %> </td>
<td>
<input type="Text" name="txt_<%=i%>" size="7" value="<%= Cdbl(rs13("cpefremd")) %>" disabled style="border:1px solid:#000000;Text-align=Right;background:<%=bg_color%>" class="n_verdana_simple">
</td>
<td class="n_verdana_simple" Align="Right"><%= rs13("desdiv") %> </td>
</tr>
<%
Rs13.Movenext
count=count+1
Next
%>
<tr>
<td colspan=8 align=center><input value="Aceptar" type="button" Class="Normalb" onclick="frm_submit(document.frm,<%=rs13.recordcount%>)" id=bt name=bt></td>
</tr>
</table>
<%
End If
End If
%>
</div>
</body>
</html>
<%
End Sub
'Add the chosen course to the cart
Call AddUsuario()
'Display contents of electronic shopping cart
Call DisplayUsuario()
%>