<%
Option Explicit
Session.LCID = 2058
'***** SI NO HA INICIADO SESION ***
If Session("Mybussiness") = "" then
Response.redirect("default.asp")
Else
Session.Timeout = 1200
'******* EN CASO DE ERROR ****
Err.Clear
On Error Resume Next
'*** REMPLAZA
Function Sanea(Texto)
Sanea = Replace(Texto, "'", "''")
End Function
%>
<!DOCTYPE html>
<HTML>
<HEAD>
<meta charset="ISO-8859-1" />
<TITLE>SISTEMA MIM <%= Session("Mybussiness") %> USUARIO: <%= Session("MyName") %></TITLE>
<link href="css/Modulos.css" rel="stylesheet" />
<link href="css/Buscador.css" rel="stylesheet" />
<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>
<%
'***** Variables a la base de datos ****
Dim Cn1
Dim Rs11, Rs12, Rs13, Rs14, Rs15, Rs16, Rs17, Rs18, Rs19, Rs20, Rs21, Rs22, Rs23, Rs24, Rs25, Rs26, Rs27, Rs28, Rs29, Rs30
Dim Sql11, Sql12, Sql13, Sql14, Sql15, Sql16, Sql17, Sql18, Sql19, Sql20, Sql21, Sql22, Sql23, Sql24, Sql25, Sql26, Sql27, Sql28, Sql29, Sql30
Dim Diferencia
'***** Conexion a la Base de Datos
Set Cn1 = Server.CreateObject( "ADODB.Connection" )
Cn1.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database="& Session("Mybussiness") &""
'***** Conexion A la Tabla Empresa ****
Set Rs11 = Server.CreateObject("ADODB.Recordset")
Sql11="Select * from Empresa;"
Rs11.Open Sql11,Cn1,1,2
%>
<SECTION Class="HeaderGes">
<div Id="DivHeadGes">
<%= Rs11("Nombre") %><br>
<%= Rs11("Direccion") %>, <%= Rs11("colonia") %><br>
<%= Rs11("Poblacion") %>
</div>
</SECTION>
<SECTION>
<%
Dim Factura
Dim Saldocolor
Factura = Request("Factura")
%>
<center>
<br>
<B>***** NOTA DE CREDITO POR BONIFICACION O DESCUENTO *****
<br><br>
</B>
<b>
<a href="Help/Procedimiento Nota Credito Pago a Cuenta.pdf" onclick="NewWindow(this.href,'Recibir','800','600','yes');return false;">
Procedimiento Nota Credito Pago a Cuenta</a>
<br><br>
<Form action="cxcNotCr.asp" method="post">
<Table Id="CRMform">
<Tr>
<Td>Factura</Td>
<Td>
<input tabindex="1" type="text" placeholder="Factura" Title="Factura" name="Factura" id="Factura" value="<%= Factura %>" Size="5px" onChange="javascript:this.value=this.value.toUpperCase();">
</Td>
<Td>
<button tabindex="3" type="submit" name="Buscar" id="Buscar"/>Buscar</button>
</Td>
<Tr>
</Table>
</Form>
<%
'---- CONDICIONAL PARA SABER SI EXISTE LA FACTURA -----
If Factura = "" Or Isnull(Factura) Then
Else
Set Rs12 = server.CreateObject("ADODB.Recordset")
Sql12="Select regcxcg, nfacxcg, impcxcg, Tcacxcg, salcxcg, clacli, Nomcli, desdiv from Cxcgen, Clientes, Monedas " &_
"Where nfacxcg = "& Factura &" and clicxcg = clacli and moncxcg = cladiv and (movcxcg = 1 or movcxcg = 12) order by nfacxcg;"
Rs12.open Sql12,Cn1,1,2
'****** CONDICIONAL SI ES FIN DE ARCHIVO RECORDSET 12
If Rs12.Eof Then
'****** EN CASO QUE EXISTA ****
Else
%>
<br> <br>
<Form action="CxcNcrn.asp" name="NotaCr" method="POST">
<Table Id="Transfer">
<Tr>
<Td>Factura</Td>
<Td Colspan="2">Cliente</Td>
<Td>Fecha</Td>
</Tr>
<Tr>
<Td><input tabindex="1" type="text" placeholder="Factura" Title="Factura" name="Factura" id="Factura" value="<%= Rs12("Nfacxcg") %>" Size="5px" onChange="javascript:this.value=this.value.toUpperCase();" readonly /></td>
<Td Colspan="2">
<input tabindex="2" type="text" placeholder="Clave Cliente" Title="Clave Cliente" name="ClaveC" id="ClaveC" value="<%= Rs12("Clacli") %>" Size="5px" onChange="javascript:this.value=this.value.toUpperCase();" readonly />
<input tabindex="3" type="text" placeholder="Nombre Cliente" Title="Nombre Cliente" name="NombreC" id="NombreC" value="<%= Rs12("Nomcli") %>" Size="60px" onChange="javascript:this.value=this.value.toUpperCase();" readonly />
</td>
<Td><input tabindex="4" type="text" placeholder="Fecha" Title="Fecha" name="Fecha" id="Fecha" value="<%= Date() %>" Size="9px" onChange="javascript:this.value=this.value.toUpperCase();" readonly /></td>
</Tr>
<Tr>
<Td>Importe</Td>
<Td Colspan="2">Motivo</Td>
<Td>Pago a Cuenta</Td>
</Tr>
<Tr>
<Td><input tabindex="5" type="text" placeholder="Importe" Title="Importe" name="Importe" id="Importe" value="0.00" Size="5px" Style="Text-Align:Right" onChange="javascript:this.value=this.value.toUpperCase();"></td>
<Td Colspan="2">
<%
Set Rs13 = server.CreateObject("ADODB.Recordset")
Sql13 ="select * from Mrecla"
Rs13.Open Sql13,Cn1,1,2
%>
<Select tabindex="6" Name="Motivo">
<optgroup label="Seleccione un Motivo">
<%
Do while not Rs13.EOF
%>
<Option value="<%= Rs13("Idmrec") %>"><%= Rs13("Desmrec") %></Option>
<%
Rs13.MoveNext
Loop
%>
<Td align="Left" Class="normal">
<Input type="checkbox" Value="1" Name="Pagcta">
</Td>
<Td align="Left" Class="normal" >
</tr>
</Select>
</td>
<Td></Td>
</Tr>
<Tr>
<Td>Forma de Pago</Td>
<Td Colspan="2">Uso de CFDi</Td>
</Tr>
<Tr>
<Td>
<%
'***** Conexion A la Tabla Empresa ****
Set Rs14 = Server.CreateObject("ADODB.Recordset")
Sql14="Select * " &_
"From FormaPago;"
Rs14.Open Sql14,Cn1,1,2
%>
<Select tabindex="8" Name="FForma">
<option value="99" Selected>99</Option>
<optgroup label="Cambiar_Por:">
<%
Do While NOT Rs14.EOF
%>
<option value="<%= Rs14("ClaveFP") %>"><%= Rs14("ClaveFP") %> <%= Rs14("DescripcionFP") %></Option>
<%
Rs14.Movenext
Loop
%>
</Select>
</td>
<Td Colspan="2">
<%
'***** Conexion A la Tabla Empresa ****
Set Rs15 = Server.CreateObject("ADODB.Recordset")
Sql15="Select * " &_
"From UsoCFDI;"
Rs15.Open Sql15,Cn1,1,2
%>
<Select tabindex="9" Name="UsoCFDI">
<option value="G01" Selected>G01</Option>
<optgroup label="Cambiar_Por:">
<%
Do While NOT Rs15.EOF
%>
<option value="<%= Rs15("ClaveUC") %>"><%= Rs15("ClaveUC") %> <%= Rs15("DescripcionUC") %></Option>
<%
Rs15.Movenext
Loop
%>
</Select>
</Td>
</Tr>
<Tr>
<Td>Metodo de Pago</Td>
<Td Colspan="2">UUID ANTERIOR</Td>
</Tr>
<Tr>
<Td>
<%
'***** Conexion A la Tabla Empresa ****
Set Rs16 = Server.CreateObject("ADODB.Recordset")
Sql16="Select * " &_
"From MetodoPago;"
Rs16.Open Sql16,Cn1,1,2
%>
<Select tabindex="10" Name="MetodoPago">
<option value="PPD" Selected>PPD</Option>
<optgroup label="Cambiar_Por:">
<%
Do While NOT Rs16.EOF
%>
<option value="<%= Rs16("ClaveMP") %>"><%= Rs16("ClaveMP") %> <%= Rs16("DescripcionMP") %></Option>
<%
Rs16.Movenext
Loop
%>
</Select>
</Td>
<Td Colspan="2"><input tabindex="11" type="text" placeholder="UUID ANTERIOR" Title="UUID ANTERIOR" name="UUIDANT" id="UUIDANT" value="" Size="40px" Style="Text-Align:LEFT" onChange="javascript:this.value=this.value.toUpperCase();"></Td>
</Tr>
<Tr>
<Td></td>
<Td>Tipo de Relacion </Td>
</Tr>
<Tr>
<td></td>
<Td Colspan="2">
<%
'***** Conexion A la Tabla Empresa ****
Set Rs17 = Server.CreateObject("ADODB.Recordset")
Sql17="Select * " &_
"From TipoRelacion;"
Rs17.Open Sql17,Cn1,1,2
%>
<Select tabindex="12" Name="TipoRel">
<option value="01" Selected>01</Option>
<optgroup label="Cambiar_Por:">
<%
Do While NOT Rs17.EOF
%>
<option value="<%= Rs17("TipoRel") %>"><%= Rs17("TipoRel") %> <%= Rs17("DescRel") %></Option>
<%
Rs17.Movenext
Loop
%>
</Select>
</Td>
</Tr>
<Tr>
<Td Colspan="4">Concepto de la nota</td>
</Tr>
<Tr>
<Td Colspan="2" Align="Center">
<textarea name="Notas" cols="90" rows="5" onChange="javascript:this.value=this.value.toUpperCase();"></Textarea>
</Td>
<Td Colspan="2" Align="Left" Valign="Top">
<%
'***** Conexion A la Tabla cxcgen ****
Set Rs18 = Server.CreateObject("ADODB.Recordset")
Sql18="Select Impcxcg, Salcxcg " &_
"From Cxcgen " &_
"Where Nfacxcg = "& Factura &" ;"
Rs18.Open Sql18,Cn1,1,2
If Cdbl(Rs18("Salcxcg")) < 0 Then
SaldoColor = "#FA1D1D"
Else
SaldoColor = "#000000"
End If
Diferencia = Cdbl(Rs18("Impcxcg")) + Cdbl(Rs18("Salcxcg"))
%>
Saldo de la Factura
<Table Id="Transfer">
<Tr>
<Td>Historico</Td>
</Tr>
<Tr>
<Td Align="Right">
<a href="CxcHistdet.asp?Documento=<%= Factura %>&Cliente=<%= Rs12("Clacli") %>" onclick="NewWindow(this.href,'Historico','800','600','yes');return false;">
<img src="Image/pdf.gif" border="0" height="25px" alt="Factura <%= Factura %>"> </a>
</Td>
<Td Align="Right">
<a href="CxcHistdetxls.asp?Documento=<%= Factura %>&Cliente=<%= Rs12("Clacli") %>" onclick="NewWindow(this.href,'Historico','800','600','yes');return false;">
<img src="Image/excel.gif" border="0" height="25px" alt="Factura <%= Factura %>"> </a>
</Td>
</Tr>
</Table>
</Td>
</Tr>
<Tr>
<Td></td>
<Td Colspan="3" Align="Center"><input type="submit" value="Aceptar"> </Td>
</Tr>
</Table>
</FORM>
<%
'******* FIN DE ARCHIVO RECORDSET 12
End If
'---- SE CIERRA LA CONDICIONAL PARA SABER SI EXISTE LA FACTURA ----
End If
%>
</SECTION>
<%
If Err.Number <> 0 Then
%>
<br><br>
Número de Error: <%= Err.Number %><BR>
Descripción: <%= Err.Description %><BR>
Origen: <%= Err.Source %><BR>
Linea: <%= Err.Line %><BR>
<br>
<%
Else
'****** FIN DE LOS ERRORES ***
End If
%>
</BODY>
</HTML>
<%
'FIN DE SESION
End If
%>